Functions, messages and properties used to manipulate sprite components.

See SpriteProperties for related properties. See SpriteMessages for related messages.

Static methods

staticplay_flipbook<T>(url:HashOrStringOrUrl, id:Hash, ?complete_function:(self:T, message_id:Message<SpriteMessageAnimationDone>, message:SpriteMessageAnimationDone, sender:Url) ‑> Void, ?play_properties:SpritePlayFlipbookProperties):Void

Play an animation on a sprite component from its tile set

An optional completion callback function can be provided that will be called when the animation has completed playing. If no function is provided, a animation_done message is sent to the script that started the animation.

Parameters:

url

the sprite that should play the animation

id

name hash of the animation to play

complete_function

function to call when the animation has completed.

play_properties

optional table with properties

staticreset_constant(url:UrlOrString, name:HashOrString):Void

Reset a shader constant for a sprite.

The constant must be defined in the material assigned to the sprite. Resetting a constant through this function implies that the value defined in the material will be used. Which sprite to reset a constant for is identified by the URL.

Parameters:

url

the sprite that should have a constant reset

name

of the constant

staticset_constant(url:UrlOrString, name:HashOrString, value:Vector4):Void

Set a shader constant for a sprite.

The constant must be defined in the material assigned to the sprite. Setting a constant through this function will override the value set for that constant in the material. The value will be overridden until Sprite.reset_constant is called. Which sprite to set a constant for is identified by the URL.

Parameters:

url

the sprite that should have a constant set

name

of the constant

value

of the constant

staticset_hflip(url:UrlOrString, flip:Bool):Void

Sets horizontal flipping of the provided sprite's animations.

Which sprite to flip is identified by the URL. If the currently playing animation is flipped by default, flipping it again will make it appear like the original texture.

Parameters:

url

the sprite that should flip its animations

flip

if the sprite should flip its animations or not

staticset_vflip(url:UrlOrString, flip:Bool):Void

Sets vertical flipping of the provided sprite's animations.

Which sprite to flip is identified by the URL. If the currently playing animation is flipped by default, flipping it again will make it appear like the original texture.

Parameters:

url

the sprite that should flip its animations

flip

if the sprite should flip its animations or not