@kayelaa/canvas API - v0.2.15
    Preparing search index...

    Class DeltaTweenII

    Delta-based tween for a single numeric change

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • __namedParameters: { delta: number; ms: number; easing?: (t: number) => number }

      Returns DeltaTweenII

    Properties

    listenerMap: Map<"finish" | "delta", Listener<any[]>[]> = ...
    delta: number
    duration: number
    elapsed: number
    lastValue: number
    finished: boolean
    easing: (t: number) => number

    Methods

    • Registers a listener for the specified event.

      Type Parameters

      • K extends "finish" | "delta"

        Event name

      Parameters

      • event: K

        The name of the event

      • listener: (...args: { delta: number[]; finish: void[] }[K]) => void

        The callback to invoke when the event is emitted

      Returns this

      This emitter for chaining

    • Registers a one-time listener for the specified event.

      The listener is automatically removed after the first invocation.

      Type Parameters

      • K extends "finish" | "delta"

        Event name

      Parameters

      • event: K

        The name of the event

      • listener: (...args: { delta: number[]; finish: void[] }[K]) => void

        The callback to invoke once

      Returns this

      This emitter for chaining

    • Removes a listener for the specified event.

      Type Parameters

      • K extends "finish" | "delta"

        Event name

      Parameters

      • event: K

        The name of the event

      • listener: (...args: { delta: number[]; finish: void[] }[K]) => void

        The callback to remove

      Returns this

      This emitter for chaining

    • Emits an event, invoking all registered listeners with the provided arguments.

      If the event is "error" and no listeners are registered, the first argument (the error) will be thrown.

      Type Parameters

      • K extends "finish" | "delta"

        Event name

      Parameters

      • event: K

        The name of the event to emit

      • ...args: { delta: number[]; finish: void[] }[K]

        Arguments to pass to listeners

      Returns boolean

      true if any listeners were invoked, false otherwise

    • Removes all listeners for the specified event, or all listeners if no event is provided.

      Type Parameters

      • K extends "finish" | "delta"

        Event name

      Parameters

      • Optionalevent: K

        Optional event name to clear listeners for

      Returns DeltaTweenII

      This emitter for chaining

    • Returns the number of listeners registered for the specified event.

      Type Parameters

      • K extends "finish" | "delta"

        Event name

      Parameters

      • event: K

        The event to count listeners for

      Returns number

      The number of registered listeners

    • Advance tween by delta time

      Parameters

      • delta: number

      Returns void