Setting Sprite Texture From SpriteCache

What are some ways to set the texture of a Sprite from SpriteCache?

  1. I load a spritesheet in -> now these are in the SpriteCache.

  2. I create a Sprite and now later on I want to to a setTexture() but that wants a filename and it goes and looks to lead it from the file system ( I see: file not found errors to prove this…)

  3. I’d like to just look at my SpriteFrame Cache for the setTexture() so I dont have to ship the individual .png’s in my Resources directory.

Thoughts anyone?

2.x or 3.x?

In 2.x just use initWithSpriteFrameName();
mySprite->initWithSpriteFrameName(“spriteNameInSpriteCache”);

In 3.x just use setSpriteFrame();
mySprite->setSpriteFrame(“spriteNameInSpriteCache”);

Thanks. I was making a stupid mistake with setDisplayFrame()