CCFadeOutDownTiles doesn't work as I'd expect?

Forums Programming cocos2d support (graphics engine) CCFadeOutDownTiles doesn't work as I'd expect?

This topic contains 6 replies, has 2 voices, and was last updated by  araker 2 years ago.

Viewing 7 posts - 1 through 7 (of 7 total)
Author Posts
Author Posts
March 24, 2012 at 8:29 pm #240160

slycrel
Participant
@slycrel

I’m having a little trouble with CCFadeOutDownTiles. if I create an action like this

id action = [CCFadeOutDownTiles actionWithSize:ccg(16,16) duration:1];

to fade out a CCSprite, it seems to face anything with a lower z order out as well, not just the sprite. I’ve confirmed that if I change the z order so the sprite is behind other things it works as I’d expect — the other sprites are not affected. I’ve moved this sprite to be attached to the scene not it’s regular parent node with the same effects. Am I missing something?

March 25, 2012 at 7:26 am #369899

slycrel
Participant
@slycrel

This seems to be an issue with the CCGrid stuff in general. Not everything has this problem, but sliding by row/col and fade out up/down definitely both exhibit this. I’ve tested this with both the 1.0 and latest 1.1 beta with the same effect.

March 25, 2012 at 7:40 pm #369900

slycrel
Participant
@slycrel

A little more on this for those who are (probably not) following along from home… It looks like the problem is that I’ve got a full-screen effect, but it’s not putting the lower Z order effects within the effect itself. So I get my sprite with a non-transparent black background instead of a transparent background. So the entire screen is affected by the black background. This doesn’t seem to happen in the cocos2d test project, so I’m puzzled as to what is happening here. :/ I’ve got a scene with a layer with a few child sprites that are all having this problem, should be a straightforward setup…

March 27, 2012 at 2:36 am #369901

slycrel
Participant
@slycrel

OK, I’ve made a sample project with this problem that you can download here. This is the basic cocos2d template from the 1.1 beta 2 build that was recently released. As you will see, the grid effect is using a black background instead of a transparent background when modeling it’s effect. I’ve looked at the code some but have been unable to determine why this is.

as long as the z order is >= to the background, regardless of the CCNode hierarchy, it seems to have this problem.

Thanks in advance for any comments or help.

Edit: I should also note that this problem exists in v2.0 as well.

March 27, 2012 at 11:08 pm #369902

araker
Moderator
@araker

You need to initialize the EAGLView with kEAGLColorFormatRGBA8. The grabber that the grid effect uses internally doesn’t work with RGB565 (a bug). You’re the second one that stumbles upon this in a few weeks, I’ll add a assert to the code to give a appropriate error message when needed.

Edit, done.. https://github.com/cocos2d/cocos2d-iphone/commit/71bce5a3ff976f5f9ab2b0d881eda13d5cf152c4

March 28, 2012 at 1:21 am #369903

slycrel
Participant
@slycrel

Ahh, thanks a ton araker! I was thinking about filing a bug report, sounds like it’s a known issue. I just tried this change and it worked great. I’ll do a little research on why I should care about RGB565 vs RGBA8, I expect it won’t matter much for the relatively simple things we are doing. Again, much appreciated!

March 28, 2012 at 9:03 am #369904

araker
Moderator
@araker

The difference is that it takes twice as much memory, 32 bit per pixel instead of 16 bit, and the fill-rate is a bit lower (more data to write). I doubt that you’ll notice the difference though.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.