Sprites and sprite sheets
As far as XNA
and the SpriteBatch
classes are concerned, a Sprite is a 2D bitmapped image that can be drawn either with or without transparency information to the screen.
Tip
Sprites versus. textures
XNA defines a sprite as a 2D bitmap that is drawn directly to the screen. While these bitmaps are stored in Texture2D
objects, the term texture is used when a 2D image is mapped onto a 3D object, providing a visual representation of the surface of the object. In practice, all XNA graphics are actually performed in 3D, with 2D sprites being rendered through special configurations of the XNA rendering engine.
The simple form of the SpriteBatch.Draw()
call that you used in Chapter 1, Introducing XNA Game Studio, when drawing squares only needed two parameters: a Texture2D
to draw a rectangle indicating where to draw it, and a Color
to specify the tint to overlay onto the sprite.
Other overloads of the Draw()
method, however, also allow you to specify a rectangle representing...