Records and holds trigger data for an animation.

Triggers are used to fire events when the animation gets to that point.

Hierarchy

  • TriggerRecorder

Constructors

Properties

Methods

Constructors

Properties

triggers: TriggerInfo[]

Methods

  • Adds a new trigger.

    Parameters

    • name: string

      The identifier of this trigger. Multiple of the same identifier can be used to fire the same trigger multiple times in an animation.

    • position: number

      The time position in seconds of this trigger. Trigger will be fired when the animation reaches this time position.

    Returns void

  • Adds the triggers from the given TriggerRecorder to this

    Named "combine" as order does not matter

    Parameters

    Returns void

  • Removes the trigger with the given name from this recorder.

    This isn't implemented well for multiple triggers of the same name

    Parameters

    • name: string

    Returns boolean

  • Shifts the time position of all the triggers in this recorder by the given interval

    Useful if you are appending the keyframes from one KeyframeRecorder to another to keep the trigger's positions relative.

    Example:

    local keyframeRecorder
    local triggerRecorder

    local otherKeyframeRecorder
    local otherTriggerRecorder

    -- make sure to shift position before you append the other keyframeRecorder
    -- getLength will change (unless you want to subtract from the new one)
    otherTriggerRecorder:shift(keyframeRecorder:getLength())

    keyframeRecorder:append(otherKeyframeRecorder)
    triggerRecorder:combine(otherTriggerRecorder)

    Note: Could also add this to combine in the future

    Parameters

    • interval: number

    Returns void

Generated using TypeDoc