Sprite::create("filename.png"); returns NULL

Sprite::create("filename.png"); returns NULL
0.0 0


Hi, I’m trying to replace a png file for another one that has some minor modifications (the designer told me that he changed the type of transparency or something like that).

Now I’m having a problem when trying to create a Sprite using that file.
The console doesn’t show any message but after using Sprite:create(“filename.png”); the pointer returns as NULL… that makes my game crash.

Do you have any ideas of what makes this behavior?

Also I have to tell you that before using the file name to create the sprite I checked if it exists using :
bool fileExists = cocos2d::FileUtils::getInstance()->isFileExist("filename.png");

fileExists is true so I assume that the file is in the application bundle.


Can you post your code and show the NULL, please


Filenames are case sensitive. Maybe you changed something or you move it into another folder?


A good point…