官术网_书友最值得收藏!

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 integrated 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 sequence, 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.

Example Sprite Sheet

Credits: Reemax & artisticdude

Sprites can range from representing the player or enemies with animations, to static objects that fill the entire background. Sprites may be rotated, scaled, moved, or even layered with other sprites, allowing for on the fly positioning and customization.

主站蜘蛛池模板: 蕉岭县| 嵩明县| 兴宁市| 呼和浩特市| 资中县| 勐海县| 澎湖县| 高陵县| 正安县| 峨眉山市| 巴南区| 郁南县| 辽阳市| 会东县| 乐陵市| 新巴尔虎右旗| 西平县| 正定县| 勐海县| 来凤县| 安徽省| 涿州市| 铜梁县| 邢台市| 江油市| 张家川| 惠来县| 墨脱县| 沙洋县| 西青区| 衡东县| 安泽县| 广元市| 蒲江县| 庆城县| 淮安市| 新邵县| 噶尔县| 龙游县| 登封市| 宁明县|