Skip to content

AnimatorControllerAPI

Defined in: animation/Animator.ts:500

Owns one App’s animator-controller registry and per-entity parameter/trigger values, evaluates each Animator’s state machine, and drives the entity’s SpriteAnimator clip on state changes. Published as the AnimatorController resource; read it as app.getResource(AnimatorController).

new AnimatorControllerAPI(): AnimatorControllerAPI

Defined in: animation/Animator.ts:508

AnimatorControllerAPI

clearControllers(): void

Defined in: animation/Animator.ts:578

void


getBool(entity, name): boolean

Defined in: animation/Animator.ts:604

number

string

boolean


getController(name): AnimatorControllerDef | undefined

Defined in: animation/Animator.ts:570

string

AnimatorControllerDef | undefined


getFloat(entity, name): number

Defined in: animation/Animator.ts:600

number

string

number


hasMotionDriver(kind): boolean

Defined in: animation/Animator.ts:529

Whether some driver can play kind here.

string

boolean


registerController(name, def): void

Defined in: animation/Animator.ts:554

string

AnimatorControllerDef

void


registerMotionDriver<M>(kind, driver): void

Defined in: animation/Animator.ts:522

Teach this animator a kind of motion. Called by the plugin that owns the kind (TimelinePlugin, SpinePlugin); a state naming an unregistered kind is inert rather than an error, since a scene may be authored against a module this build does not load.

M extends AnimatorMotion

M["kind"]

MotionDriver<M>

void


removeEntity(entity): void

Defined in: animation/Animator.ts:609

Drop an entity’s parameter/trigger/playback state (wire to world.onDespawn).

number

void


resetTrigger(entity, name): void

Defined in: animation/Animator.ts:596

number

string

void


setBool(entity, name, value): void

Defined in: animation/Animator.ts:588

number

string

boolean

void


setFloat(entity, name, value): void

Defined in: animation/Animator.ts:584

number

string

number

void


setSpineDriver(driver): void

Defined in: animation/Animator.ts:535

Inject the Spine driver (SpinePlugin wires SpineManager here). Optional — without it, spine-targeting states are inert.

SpineAnimationDriver | null

void


setTrigger(entity, name): void

Defined in: animation/Animator.ts:592

number

string

void


unregisterController(name): void

Defined in: animation/Animator.ts:558

string

void


update(world, dt?, events?): void

Defined in: animation/Animator.ts:635

dt seconds advance the animator’s own clock, which is what a sampled motion is evaluated against and what a crossfade progresses on. events is where what the clips declared is posted; without one the animator still runs and simply says nothing, which is what a bare App is.

World

number = 0

AnimatorEventSink

void