The sprite component.
groupComponents
subgroupComponent Types
draw: Comp["draw"]
Name of the sprite.
Width for sprite.
Height for sprite.
Current frame in the entire spritesheet.
Current frame in relative to the animation that is currently playing.
The rectangular area of the texture to render.
play(anim: string, options?: SpriteAnimPlayOpt): void
Play a piece of anim.
Stop current anim.
Get total number of frames.
getCurAnim(): SpriteCurAnim | null
Get the current animation data.
sincev3001.0
curAnim(): string | undefined
Get current anim name.
deprecatedUse `getCurAnim().name` instead.
hasAnim(name: string): boolean
Check if object's sprite has an animation.
getAnim(name: string): SpriteAnim | null
Get an animation.
Speed multiplier for all animations (for the actual fps for an anim use .play("anim", { speed: 10 })).
Flip texture horizontally.
Flip texture vertically.
onAnimStart(action: (anim: string)=>void): KEventController
Register an event that runs when an animation is played.
onAnimEnd(action: (anim: string)=>void): KEventController
Register an event that runs when an animation is ended.
sincev3000.0
serialize(): SerializedSpriteComp