|
SpriteBatch Methods |
The SpriteBatch type exposes the following members.
Methods | Name | Description |
---|
| Begin(BlendState, SamplerState, DepthStencilState, RasterizerState, SpriteEffect) |
Begin method must be called before any Draw(ShaderResourceView, RectangleF, Boolean, Color4) or Draw(ShaderResourceView, RectangleF, RectangleF, Boolean, Color4) calls.
The method sets common properties of all sprites that will be defined by Draw call.
After all draw calls are done, the End method must be called.
|
| Begin(Matrix, BlendState, SamplerState, DepthStencilState, RasterizerState, SpriteEffect) |
Begin method must be called before any Draw(ShaderResourceView, RectangleF, Boolean, Color4) or Draw(ShaderResourceView, RectangleF, RectangleF, Boolean, Color4) calls.
The method sets common properties of all sprites that will be defined by Draw call.
After all draw calls are done, the End method must be called.
|
| Draw(ShaderResourceView, RectangleF, Boolean) |
Draw method adds the specified texture to the destinationRectangle and with specified mask defined by the color parameter.
Draw method must be called after Begin and End methods are called.
|
| Draw(ShaderResourceView, RectangleF, Boolean, Color4) |
Draw method adds the specified texture to the destinationRectangle and with specified mask defined by the color parameter.
Draw method must be called after Begin and End methods are called.
|
| Draw(ShaderResourceView, RectangleF, RectangleF, Boolean, Color4) |
Draw method adds the specified texture to the destinationRectangle and with specified mask defined by the color parameter.
The method takes sourceRectangle as parameter. This can be used to have one texture with many images.
Draw method must be called after Begin and End methods are called.
|
| End |
End method ends adding sprites.
|
| SetBlendState |
Sets the BlendState that will be drawn after this method is called
|
| SetDepthStencilState |
Sets the DepthStencilState that will be drawn after this method is called
|
| SetRasterizerState |
Sets the RasterizerState that will be drawn after this method is called
|
| SetSamplerState |
Sets the SamplerState that will be drawn after this method is called
|
| SetTransform(Matrix) |
Sets the transformation of the sprites that will be drawn after this method is called.
Note that the coordinate system goes from (0, 0) at top-left corner to (1, 1) at bottom right corner.
To rotate the sprite, set the destinationRectangle in the Draw command so that the center of the sprite will be at (0, 0).
|
| SetTransform(Matrix) |
Sets the transformation of the sprites that will be drawn after this method is called
|
TopSee Also