Search code examples
ios5cocos2d-iphoneccsprite

PNG Transparency in cocos2d iphone issue


I've just begun cocos2d development on the iphone. An issue I'm having is that when I add a CCSprite to my scene, instead of it being transparent around the edges of the .png file, its showing up as white.

So for example, I define the CCSprite in my header file -

 CCSprite *foo;

Then when I initialise my scene -

  foo = [CCSprite spriteWithFile:@"foo.png"];

  [self addChild:player z:0 tag:1];

Is there anything wrong with this code?

Thanks for any help.

P.S. I have double checked my .png file in Photoshop and its correctly showing up as transparent where it should be.


Solution

  • Check the bottom portion of this page:

    http://www.cocos2d-iphone.org/wiki/doku.php/faq#my_png_doesn_t_look_like_in_photoshop