I am making an application using Box2D in which i am getting images from Asset Library and displaying them as sprites.
here is the code which i have done :
Getting Images from asset library :
CGImageRef imgRef = [[mutArrAssetPhotos objectAtIndex:i] thumbnail];
Creating Texture2D :
CCTexture2D *spriteTexture = [[CCTexture2D alloc]initWithCGImage:imgRef resolutionType:kCCResolutionUnknown];
Creating sprites from textures :
CCSprite *paddle = [CCSprite spriteWithTexture:spriteTexture];
This gives me warning in console like :
"cocos2d: CCTexture2D: Using RGB565 texture since image has no alpha"
Still in simulator it works fine though warning but in device images are not being displayed.
But instead if i used :
CCSprite *paddle = [CCSprite spriteWithFile:@"img.png"];
it is working fine and is not giving any warning also.
Can anyone help please ?? Thanks in Advance.