Can someone explain Sprites vs. SpriteFrames?

I imagine SpriteFrames are more useful for managing sprite sheets and animating…and Sprites are the instance of the current frame to be placed and rendered on the screen? What is the relationship between the two?

Also…what is binding a texture? Is that essentially establishing a reference pointer and descriptive data for a texture in GPU?

From my understanding Atlases and spritesheets are one in the same. Sorry if this is a hodgepodge of concepts, any that can be explained would be very appreciated, or if someone know of good references explaining these. Whenever I get into realms of Atlases and binding especially I get greatly confused

Apologies for the noobier questions. I hope this diminishes with time. Here’s what I found:

SpriteFrames can be thought of as a unit image in a SpriteFrameCache, the collection of sprite images loaded into GPU memory from a Sprite sheet (or texture atlas, which amounts to the same thing), essentially a saved file. Sprites amount to the immediate image to place on the screen, and has the color tinting, skewing, scaling.

Binding a texture, from my understanding, is indeed associating metadata and a pointer to a loaded texture. I’m not quite sure how this is different from a sprite, and what its unique utility is.

The sprite frame is an image (on a sprite sheet).
A Sprite is a game object that you use to display the sprite frame.
Yes: Texture Atlas = Sprite sheet.

Don’t worry about the binding… cocos2d-x does that for you.

Here’s a tutorial that might get you started faster:

1 Like