Atlantis.SpriteBatch Class
Define a SpriteBatch that is responsible to draw multiple elements on screen on one pass.
Constructor
Atlantis.SpriteBatch
-
The
Parameters:
-
TheAtlantis.Graphics.GraphicsDevicegraphics device.
Item Index
Methods
- begin
- draw
- drawString
- drawTexture static
- end
Methods
begin
-
The -
A
Begin the batch operation.
Parameters:
-
TheAtlantis.SpriteSortModetype of sorting to use (option, default is Immediate).
-
AArraytransform matrix to apply for all items (optional). The matrix is a 3x3 matrix in a single array.
- [ScaleX, SkewX, SkewY, ScaleY, TranslationX, TranslationY]
draw
-
The -
The -
A -
A -
Rotation -
Origin -
Scale -
An -
The
Draw a texture on the screen
Parameters:
-
TheImageimage or canvas to draw.
-
TheAtlantis.Rectangle | Atlantis.Vector2position or the rectangle of the image.
-
AAtlantis.Rectanglesource rectangle.
-
AStringcolor to apply on the image in hex format.
-
RotationNumberof the image.
-
OriginAtlantis.Vector2of the image (defaut is 0, 0 on top/left).
-
ScaleAtlantis.Vector2of the image (default is 1/1);
-
AnAtlantis.SpriteEffecteffect to apply (default is none).
-
TheNumberlayer depth (Important when SpriteSortMode is set to BackToFront or FrontToBack).
drawString
-
The -
The -
The -
The -
Rotation -
Origin -
Scale -
An -
The
Draw a string on the screen
Parameters:
-
TheAtlantis.SpriteFontSpriteFont to use.
-
TheStringstring to draw.
-
TheAtlantis.Vector2position of the string.
-
TheStringcolor of the string in hex format.
-
RotationNumberof the image.
-
OriginAtlantis.Vector2of the image (defaut is 0, 0 on top/left).
-
ScaleAtlantis.Vector2of the image (default is 1/1);
-
AnAtlantis.SpriteEffecteffect to apply (default is none).
-
TheNumberlayer depth (Important when SpriteSortMode is set to BackToFront or FrontToBack).
drawTexture
-
The -
The -
x -
y -
width -
height -
A
Draw a texture on the screen
Parameters:
-
TheCanvasContextcanvas context.
-
TheImageimage or canvas to draw.
-
xNumbercoordinate.
-
yNumbercoordinate.
-
widthNumberof the image.
-
heightNumberof the image.
-
AAtlantis.Rectanglesource rectangle.
end
()
Execute the batch process and draw the result in the screen.
