@kayahr/wastelib
    Preparing search index...

    Class BaseAnimationPlayer<A, T>Abstract

    Abstract base class for animation player implementations.

    Type Parameters

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Creates a new animation player for the given animation and calling the given draw callback for each animation frame.

      Type Parameters

      Parameters

      • animation: A

        The animation to play.

      • onDraw: (frame: T) => void

        Callback to call on each frame update. This callback is responsible for actually showing the animation frame to the user.

      Returns BaseAnimationPlayer<A, T>

    Methods

    • Returns the number of time units to wait before rendering the next frame.

      Parameters

      • animation: A

        The animation to play.

      Returns number

      The next delay in time units.

    • Initializes the player. Called for initialization when player is created and each time it is reset.

      Parameters

      • animation: A

        The animation to play.

      Returns T

      The base frame to start the animation with.

    • Creates and returns the next frame in the animation.

      TODO Do we need a return value here?

      Parameters

      • animation: A

        The animation to play.

      • currentFrame: T

        The current frame.

      Returns T

      The next frame.