melonJS
    Preparing search index...

    Type Alias AnimationOptionsInput

    AnimationOptionsInput:
        | string
        | (() => unknown)
        | {
            loop?: boolean;
            next?: string;
            onComplete?: () => unknown;
            speed?: number;
        }

    What a caller may PASS as the second argument of setCurrentAnimation.

    The loose counterpart of AnimationOptions, which is what those choices normalize TO. Every field here is optional, because the defaults are the point: { loop: true } has to be a complete thing to say. Typing an argument as the normalized shape instead makes loop and speed mandatory and turns the shortest useful call into a type error.

    Type Declaration

    • string
    • () => unknown
    • { loop?: boolean; next?: string; onComplete?: () => unknown; speed?: number }
      • Optionalloop?: boolean

        loop forever (default) or play once and hold the last frame

      • Optionalnext?: string

        name of an animation to switch to when this one finishes

      • OptionalonComplete?: () => unknown

        called when the animation completes a cycle

      • Optionalspeed?: number

        playback rate multiplier (1 = authored speed)