A base class for SpriteBatch
elements which can be extended with custom logic.
See BasicElement
as an example of custom element logic.
Constructor
Variables
rotation:Float = 0
Element rotation in radians.
This variable is used only if SpriteBatch.hasRotationScale
is set to true
.
write onlyscale:Float
Shortcut to set both BatchElement.scaleX
and BatchElement.scaleY
at the same time.
Equivalent to el.scaleX = el.scaleY = scale
.
scaleX:Float = 1
X-axis scaling factor of the element.
This variable is used only if SpriteBatch.hasRotationScale
is set to true
.
scaleY:Float = 1
Y-axis scaling factor of the element.
This variable is used only if SpriteBatch.hasRotationScale
is set to true
.
t:Tile
The Tile this element renders.
Due to implementation specifics, this Tile instance is used only to provide rendering area, not the Texture itself,
as SpriteBatch.tile
used as a source of rendered texture.
Methods
privateupdate(et:Float):Bool
Override this method to perform custom logic per batch element.
Update method called only if SpriteBatch.hasUpdate
is set to true
.
Parameters:
dt | The elapsed time in seconds since last update from |
---|
Returns:
If method returns false
, element will be removed from the SpriteBatch.