Game Development Reference
In-Depth Information
What a sprite is
Sprites and textures are pretty similar, but their differences appear when you look at
what they do when the game is running. A texture is quite simply a 2D image that we
can generate or load from the disk. In many cases, sprites are the same as textures,
and you won't need to worry about them. Technically though, a sprite is a runtime
representation of the image within the context of the game scene. This is because
we can use parts of the texture (or multiple textures) as a sprite, giving the illusion of
a complete image coming from a single texture. The difference really appears when
you have sprite sheet-based animations (animations with each frame arrayed on the
same texture).
Note
Sprites were originally images that sat on top of the frame buffer, seemingly in-
tegrated into the bitmap even though they were just layered on top. These days
sprites just refer to individual images displayed to the player.
When you look at an animation, you will see a series of frames displayed in rapid se-
quence, giving the illusion of movement. Often these frames are packed together on
a single texture, also known as a sprite sheet. The texture is always the full image
with all frames; however, when displayed within the context of the game, only single
frames are drawn, and this display of frames as a single object is called the sprite.
Search WWH ::




Custom Search