Animation
INFO
Inherits: Graphic
Represent a moving image.
Examples:
ts
const anim = new Animation({
path: 'anim.png',
layer: 'Background',
origin: 'Centre',
position: [320, 240],
frameCount: 10,
frameDelay: 0,
repeat: false,
})Constructor details
ts
new Animation({
path,
layer,
origin,
position,
frameCount,
frameDelay,
command,
})- Parameters:
path(string): The path to the image's file relative to the beatmap folder.layer(Layer) (Layer): The layer on which the animation resides.origin(Origin) (Origin): The origin point of the animation.position(IVector2 | Vector2Tuple | Vector2) (Vector2): The position of the animation.frameCount(number): Indicates how many frames the animation has.frameDelay(number): Indicates how many milliseconds should be in between each frame.repeat(boolean): Indicates if the animation should loop or not.commands(Command[] | undefined) (Command): The commands of this animation. Defaults toundefined.
Properties
Properties inherited from Graphic:
layer, origin, path, position, commands
frameCount
Indicates how many frames the animation has.
- Type:
number
frameDelay
Indicates how many milliseconds should be in between each frame.
- Type:
number
repeat
Indicates if the animation should loop or not.
- Type:
boolean
Methods
Methods inherited from Graphic:
fade, move, moveX, moveY, scale, scaleVec, rotate, color, flipH, flipV, additive, startLoopGroup, startTriggerGroup, endGroup
toString()
Return a string representation of this animation.
- Returns:
string