I'm trying to make my sprite have a shake effect. However, while the sprite does shake, the entire background turns black. Can anybody help me with this?
Here's the code that I've written to add the sprite to my layer along with the action that I run right after.
CCSprite * picture = [CCSprite spriteWithFile:@"picture.png"];
picture.position = ccp(winsize.width/4,
picture.contentSize.height * 0.8);
CCShaky3D * shake = [CCShaky3D actionWithRange:4
Can anybody help me?
Have you enabled depth buffering of the EAGLView? Most 3D actions require depth buffering (
GL_DEPTH_COMPONENT24_OES) to avoid visual artifacts. You may also have to use a 32-Bit frame buffer with alpha channels by using the
kEAGLColorFormatRGBA8 instead of
EAGLView is initialized in the app delegate class:
EAGLView* glView = [EAGLView viewWithFrame:[window bounds] pixelFormat:kEAGLColorFormatRGBA8 depthFormat:GL_DEPTH_COMPONENT24_OES preserveBackbuffer:NO sharegroup:nil multiSampling:0 numberOfSamples:0];