Click or drag to resize
Ab4d.SharpEngine logo

SpriteBatch Methods

The SpriteBatch type exposes the following members.

Methods
 NameDescription
Public methodBegin Begin method must be called before any Draw or Set 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 methodCollectRenderingItems CollectRenderingItems adds the RenderingItem objects to the OverlayRenderingLayer or any custom RenderingLayer that is set in the Begin(Boolean, Int32) method.
Public methodDispose Disposes the resources that are created by this SpriteBatch (does not dispose the used GpuImages).
Public methodDrawBitmapText(String, Vector2, Single, Color4, Single, Single, Single, Single, Boolean, BitmapTextCreator) DrawBitmapText method draws the specified text to the specified position that defines the top-left corner of the text. See remarks for more info.
Public methodDrawBitmapText(String, Vector2, Single, Color4, Color4, Single, Single, Single, Single, Single, Single, Single, Single, Boolean, BitmapTextCreator) DrawBitmapText method draws the specified text to the specified position that defines the top-left corner of the text. This method also rendered the background with the specified color and applies the specified margin to the text. See remarks for more info.
Public methodDrawRectangle DrawRectangle method draws a rectangle at the specified position and size. The rectangle is filled by the specified color. When rotationAngleDegrees is specified (0 by default), then the rectangle is rotated around the center position.
Public methodDrawSprite(Vector2, Vector2, Single) DrawSprite method draws the current texture to the specified position, size and and rotation (0 by default). When size is set to (0, 0), then the actual size of the texture is used. See remarks for more info.
Public methodDrawSprite(Vector2, Single, Single, Single) DrawSprite method draws the current texture to the specified position and using the specified scale (1 by default) and rotation (0 by default). See remarks for more info.
Public methodDrawSprite(Vector2, Vector2, Color4, Single, Boolean) DrawSprite method draws the current texture to the specified position, size and and rotation (0 by default). When size is set to (0, 0), then the actual size of the texture is used. The colors in the texture are multiplied by the specified colorMask. See remarks for more info.
Public methodDrawSprite(Vector2, Color4, Single, Single, Single, Boolean) DrawSprite method draws the current texture to the specified position and using the specified scale (1 by default) and rotation (0 by default). The colors in the texture are multiplied by the specified colorMask. See remarks for more info.
Public methodEnd End method ends adding sprites.
Protected methodFinalize Destrictor
(Overrides ObjectFinalize)
Public methodGetBitmapTextSize Returns the size of the specified text.
Public methodGetCoordinateCenter Gets the current position of a coordinate center. See remarks for SetCoordinateCenter(PositionTypes) for more info.
Public methodSetCoordinateCenter SetCoordinateCenter can set a custom position of a coordinate center. By default the center position is set to TopLeft, but with this method you can set it to any corner or center of the screen. See remarks for more info.
Public methodSetSpriteTexture Sets the specified GpuImage as the current sprite texture
Public methodSetTransform(Matrix3x2) 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(Matrix3x2) Sets the transformation of the sprites that will be drawn after this method is called
Public methodUpdate Update method is automatically called from Scene or SceneView. It sets the Scene or SceneViews dirty flags when any absolute coordinates are used and the SceneView's size is changed.
Top
See Also