Class Group

A group is a class that allows you to manage many tweens from one place.

A tween will ALWAYS belong to a group. If no group is assigned it will default to the static shared group: Group.shared.

Hierarchy

  • Group

Constructors

Properties

Accessors

Methods

Constructors

Properties

now: (() => number) = NOW

Type declaration

    • (): number
    • Function used by the group to know what time is it. Used to calculate the deltaTime in case you call update without the parameter.

      Returns number

Accessors

  • get shared(): Group
  • A tween without an explicit group will default to this shared static one.

    Returns Group

Methods

  • Adds a tween to this group.

    note: this will not modify the group reference inside the tween object

    Parameters

    • tween: Tween<any>

      Tween to add.

    Returns void

  • Returns all the tweens in this group.

    note: only running tweens are in a group.

    Returns

    all the running tweens.

    Returns Tween<any>[]

  • A paused group will skip updating all the asociated tweens. To control all tweens, use getAll to get an array with all tweens.

    Returns

    returns true if this group is paused.

    Returns boolean

  • Pauses this group. If a group was already paused, this has no effect. A paused group will skip updating all the asociated tweens. To control all tweens, use getAll to get an array with all tweens.

    Returns void

  • Removes a tween from this group.

    note: this will not modify the group reference inside the tween object

    Parameters

    Returns void

  • Removes all the tweens in this group.

    note: this will not modify the group reference inside the tween object

    Returns void

  • Resumes this group. If a group was not paused, this has no effect. A paused group will skip updating all the asociated tweens. To control all tweens, use getAll to get an array with all tweens.

    Returns void

  • Updates all the tweens in this group.

    If a tween is stopped, paused, finished or non started it will be removed from the group.

    Tweens are updated in "batches". If you add a new tween during an update, then the new tween will be updated in the next batch. If you remove a tween during an update, it may or may not be updated. However, if the removed tween was added during the current batch, then it will not be updated.

    Returns

    returns true if the group is not empty and it is not paused.

    Parameters

    • Optional deltaTime: number

      Amount of miliseconds that have passed since last excecution. If not provided it will be calculated using the now function

    • preserve: boolean = false

      Prevent the removal of stopped, paused, finished or non started tweens.

    Returns boolean

Generated using TypeDoc