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

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.

主站蜘蛛池模板: 高唐县| 阿瓦提县| 乌拉特前旗| 龙陵县| 金沙县| 光泽县| 门源| 阳泉市| 炎陵县| 屏南县| 天全县| 宕昌县| 固安县| 广德县| 永济市| 巴中市| 开平市| 营口市| 宁武县| 秀山| 吉水县| 杨浦区| 宝应县| 南通市| 锡林郭勒盟| 长治市| 海南省| 库车县| 华容县| 东平县| 兴宁市| 台北市| 锡林浩特市| 正安县| 日照市| 陆良县| 客服| 敦化市| 扶绥县| 溧水县| 芜湖市|