dacha
    Preparing search index...

    Class Animatable

    Animatable component for managing animations.

    It provides a state machine for an actor to manage its animations. Each state can have a set of transitions to other states, and each transition describes a set of conditions to check before the transition is triggered.

    State consists of a timeline of frames where each frame represents a snapshot of the actor's state. Frames allow to update any actor's component values. It can be used for example to update the sprite's current frame.

    In addition to individual states, it supports group states. Group states allow to avoid repeating the states with the same set of transitions, but slightly different frames. For instance, it can be used to describe a character state like "idle", "run" or "jump" from different angles.

    It is better to use an editor to create the animatable component since it has a quite complex structure.

    Hierarchy (View Summary)

    Index
    actor?: Actor
    currentState?: IndividualState | GroupState

    Current state of the animatable component

    duration: number

    Duration of the current state relative to the total duration of the timeline

    initialState: string

    Initial state of the animatable component

    states: (IndividualState | GroupState)[]

    States of the animatable component

    componentName: string
    • Parameters

      • currentState: string

      Returns void