getSpriteFrameByName is only used if you’ve loaded a spritesheet that contains that specific frame in it, as @slackmoehrle shows in point 2 of the post above.
From your description and screenshot, it seems that you’re just trying to load an image from a file, so you need to use
Sprite::create("filename.png"). For your specific case, it would be
If you want to add the
character/idle to the search paths, then do this:
auto* fileUtils = FileUtils::getInstance();
fileUtils->addSearchPath("character"); // if you want to use Sprite::create("idle/0001.png"); etc.
fileUtils->addSearchPath("character/idle"); // only if you want to use Sprite::create("0001.png"); etc.
I don’t recommend you add those paths to the search list, because if you have multiple characters, and each has graphics that use the same file names, such as
0001.png, then it’ll always pick the first one it finds, which may not be the one you want.