Timer

The Timer class is designed to create a timer in seconds that can be displayed on a Bar or with a digital TextLabel.

Type Parameters

Constructors

  • Private

    Type Parameters

    Parameters

    • _type: T

      The type of Timer to create

    • Optional start: number

      What time the Timer should start at

    Returns Timer<T>

Properties

ParentBorderSize: number = 0

The BorderSize of the element that will be the _timeUI Parent.

_activeTween?: T extends Bar
    ? Tween
    : undefined = undefined

This is the active tween on the bar if the Timer._type is TimerType.Bar.

_lastStartTime: number

The last time that was started on this Timer. It's mainly for Timer.Reset.

_time: number

Default Value

0 if no start is passed to the constructor. The current time in seconds of this timer.

_timeUI: T extends Digit
    ? TimerDigit
    : TimerBar

This is the Instance that will represent the time for a TimerType.Digit it would be a TextLabel; TimerType.Bar.

_type: TimerType

The TimerType of this Timer.

Methods

  • Decrements the time by 'n' second('s).

    Parameters

    • Optional n: number

      The number to decrement on the Timer. Default(1)

    Returns void

  • Removes references internally when use of the Timer is no longer needed.

    Returns void

  • Increments the time by 'n' second('s).

    Parameters

    • Optional n: number

      The number to increment on the Timer. Default(1)

    Returns void

  • This resets the Timer to the last start time.

    Returns void

  • Sets the Timer to the given time.

    Parameters

    • _time: number

      The amount of time to set in seconds

    Returns void

  • Sets the ZIndex of the Timer depending on the TimerType.

    Parameters

    • zIndex: number

    Returns void

Generated using TypeDoc