API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classAnimatedSprite

@codexo/exojs / rendering / stable

A Sprite that advances through a sequence of texture-frame Rectangles over time to produce frame-based animation. Multiple named clips can be registered via defineClip or the constructor. Call play to start a clip; call update each frame with the elapsed delta (seconds or a `Time` object) to advance playback. The `onFrame` signal fires on every frame advance and `onComplete` fires when a clip completes its final AnimatedSpriteClipDefinition.repeat cycle. Use AnimatedSprite.fromSpritesheet to create an instance directly from a Spritesheet's named animations.

43
props
47
methods
15
events
Import
import { AnimatedSprite } from '@codexo/exojs'

A Sprite that advances through a sequence of texture-frame Rectangles over time to produce frame-based animation.

Multiple named clips can be registered via defineClip or the constructor. Call play to start a clip; call update each frame with the elapsed delta (seconds or a `Time` object) to advance playback. The `onFrame` signal fires on every frame advance and `onComplete` fires when a clip completes its final AnimatedSpriteClipDefinition.repeat cycle.

Use AnimatedSprite.fromSpritesheet to create an instance directly from a Spritesheet's named animations.

Constructors 1
new(texture: Texture | RenderTexture | null, clips?: Readonly<Record<string, AnimatedSpriteClipDefinition>>): AnimatedSprite
Methods 47
_invalidateChildrenTransform(): void
_updateOrigin(): void
addFilter(filter: Filter): this
blur(): this
clearFilters(): this
collidesWith(target: Collidable): CollisionResponse | null
contains(x: number, y: number): boolean
defineClip(name: string, clip: AnimatedSpriteClipDefinition): this
destroy(): void
focus(): this
getBounds(): Rectangle
getGlobalTransform(): Matrix
getLocalBounds(): Rectangle
getNormals(): Vector[]
getTransform(): Matrix
intersectsWith(target: Collidable): boolean
invalidateCache(): this
inView(view: View): boolean
move(x: number, y: number): this
pause(): this
play(name: string, options: AnimatedSpritePlayOptions): this
project(axis: Vector, result: Interval): Interval
removeClip(name: string): this
removeFilter(filter: Filter): this
render(backend: RenderBackend): this
resetTextureFrame(): this
resume(): this
rotate(degrees: number): this
setAnchor(x: number, y: number): this
setBlendMode(blendMode: BlendModes): this
setClips(clips: Readonly<Record<string, AnimatedSpriteClipDefinition>>): this
setOrigin(x: number, y: number): this
setPosition(x: number, y: number): this
setRotation(degrees: number): this
setScale(x: number, y: number): this
setSkew(x: number, y: number): this
setTexture(texture: Texture | RenderTexture | null): this
setTextureFrame(frame: Rectangle, resetSize: boolean): this
setTint(color: Color): this
stop(): this
update(delta: number | Time): this
updateBounds(): this
updateParentTransform(): this
updateTexture(): this
updateTransform(): this
fromSpritesheet(spritesheet: Spritesheet): AnimatedSprite
setInternalSpriteFactory(factory: object | null): void
Properties 43
clip: boolean
clipShape: Rectangle | Geometry | null
collisionType: CollisionType
cursor: string | null
draggable: boolean
flags: Flags<SceneNodeTransformFlags>
focusable: boolean
name: string | null
preserveDrawOrder: boolean
tabIndex: number
anchor: ObservableVector
blendMode: BlendModes
cacheAsBitmap: boolean
cullable: boolean
cullArea: Rectangle | null
currentClip: string | null
currentFrame: number
filters: readonly Filter[]
height: number
interactive: boolean
isAlignedBox: boolean
mask: MaskSource
material: SpriteMaterial | null
origin: ObservableVector
parent: Container | null
pixelSnapMode: PixelSnapMode
playing: boolean
position: ObservableVector
repeat: number
rotation: number
scale: ObservableVector
skewX: number
skewY: number
texCoords: Uint32Array
texture: Texture | RenderTexture | null
textureFrame: Rectangle
tint: Color
vertices: Float32Array
visible: boolean
width: number
x: number
y: number
zIndex: number
Events 15
onComplete: Signal<[clip]>
onFrame: Signal<[clip, frame]>
onBlur: Signal<[RenderNode]>
onDrag: Signal<[InteractionEvent]>
onDragEnd: Signal<[InteractionEvent]>
onDragStart: Signal<[InteractionEvent]>
onFocus: Signal<[RenderNode]>
onKeyDown: Signal<[KeyEvent]>
onKeyUp: Signal<[KeyEvent]>
onPointerDown: Signal<[InteractionEvent]>
onPointerMove: Signal<[InteractionEvent]>
onPointerOut: Signal<[InteractionEvent]>
onPointerOver: Signal<[InteractionEvent]>
onPointerTap: Signal<[InteractionEvent]>
onPointerUp: Signal<[InteractionEvent]>
Source