Skip to main content

FromSpriteSheetOptions

Index

Properties

optionaldurationPerFrameMs

durationPerFrameMs?: number

Optionally specify a default duration for frames in milliseconds

frameCoordinates

frameCoordinates: { duration?: number; options?: GetSpriteOptions; x: number; y: number }[]

The list of (x, y) positions of sprites in the [[SpriteSheet]] of each frame, for example (0, 0) is the the top left sprite, (0, 1) is the sprite directly below that, and so on.

You may optionally specify a duration for the frame in milliseconds as well, this will override the default duration.

optionalreverse

reverse?: boolean

Optionally specify the animation should be reversed

optionalspeed

speed?: number

Optionally set a positive speed multiplier on the animation.

By default 1, meaning 1x speed. If set to 2, it will play the animation twice as fast.

spriteSheet

spriteSheet: SpriteSheet

[[SpriteSheet]] to source the animation frames from

optionalstrategy

Optionally specify the animation strategy for this animation, by default animations loop [[AnimationStrategy.Loop]]