Click or drag to resize
AB4D logo

SpriteBatch Methods

The SpriteBatch type exposes the following members.

Methods
 NameDescription
Public methodBegin(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.
Public methodBegin(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.
Public methodDraw(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.
Public methodDraw(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.
Public methodDraw(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.
Public methodEnd End method ends adding sprites.
Public methodSetBlendState Sets the BlendState that will be drawn after this method is called
Public methodSetDepthStencilState Sets the DepthStencilState that will be drawn after this method is called
Public methodSetRasterizerState Sets the RasterizerState that will be drawn after this method is called
Public methodSetSamplerState Sets the SamplerState that will be drawn after this method is called
Public methodSetTransform(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).
Public methodSetTransform(Matrix) Sets the transformation of the sprites that will be drawn after this method is called
Top
See Also