Atlantis.SpriteBatch Class
Define a SpriteBatch that is responsible to draw multiple elements on screen on one pass.
Constructor
Atlantis.SpriteBatch
-
The
Parameters:
-
The
Atlantis.Graphics.GraphicsDevicegraphics device.
Item Index
Methods
- begin
- draw
- drawString
- drawTexture static
- end
Methods
begin
-
The
-
A
Begin the batch operation.
Parameters:
-
The
Atlantis.SpriteSortModetype of sorting to use (option, default is Immediate).
-
A
Arraytransform 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:
-
The
Imageimage or canvas to draw.
-
The
Atlantis.Rectangle | Atlantis.Vector2position or the rectangle of the image.
-
A
Atlantis.Rectanglesource rectangle.
-
A
Stringcolor to apply on the image in hex format.
-
Rotation
Numberof the image.
-
Origin
Atlantis.Vector2of the image (defaut is 0, 0 on top/left).
-
Scale
Atlantis.Vector2of the image (default is 1/1);
-
An
Atlantis.SpriteEffecteffect to apply (default is none).
-
The
Numberlayer 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:
-
The
Atlantis.SpriteFontSpriteFont to use.
-
The
Stringstring to draw.
-
The
Atlantis.Vector2position of the string.
-
The
Stringcolor of the string in hex format.
-
Rotation
Numberof the image.
-
Origin
Atlantis.Vector2of the image (defaut is 0, 0 on top/left).
-
Scale
Atlantis.Vector2of the image (default is 1/1);
-
An
Atlantis.SpriteEffecteffect to apply (default is none).
-
The
Numberlayer 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:
-
The
CanvasContextcanvas context.
-
The
Imageimage or canvas to draw.
-
x
Numbercoordinate.
-
y
Numbercoordinate.
-
width
Numberof the image.
-
height
Numberof the image.
-
A
Atlantis.Rectanglesource rectangle.
end
()
Execute the batch process and draw the result in the screen.