Options
All
  • Public
  • Public/Protected
  • All
Menu

An active tween. The addTween functions on TweenService create an entity with the TweenComponent on it. Once the tween is created, you can use callbacks in the Watcher module to watch for the current state of the tweening operation.

Most of this component's fields are copied from TweenDesc when you use TweenService::addTween to add a new tween.

You can dynamically change values inside the TweenComponent at any time.

Hierarchy

Index

Constructors

constructor

  • Parameters

    • Optional target: Entity
    • Optional cid: ComponentTypeId
    • Optional offset: number
    • Optional duration: number
    • Optional func: TweenFunc
    • Optional loop: LoopMode
    • Optional destroyWhenDone: boolean
    • Optional t: number
    • Optional started: boolean
    • Optional ended: boolean
    • Optional loopCount: number

    Returns TweenComponent

Properties

cid

Target: target component.

destroyWhenDone

destroyWhenDone: boolean

If true, destroys the tweening entity (not the target entity) when the tweening operation ends.

duration

duration: number

Duration of tween, in seconds.

ended

ended: boolean

True if the tween has stopped playing (t>duration). Never true if looping is continuous. You can use the Watcher module to watch this, and trigger a calback when the tween is finished playing.

func

func: TweenFunc

The tweening function to use, as defined in the TweenFunc enum.

loop

loop: LoopMode

The looping behavior to use.

loopCount

loopCount: number

Number of times the tween has looped. You can use the Watcher module to watch this, and trigger a calback every loop.

offset

offset: number

Target: offset in the component. This is the field offset into the component memory, in bytes. This offset is set automatically when using JS or TS generic addTween functions. Internally, it is retrieved from the ComponentType.FieldName.$o prototype value. For example TransformLocalPosition.position.y.$o has an offset of 4: The second float value inside the TransformLocalPosition component.

started

started: boolean

True if the tween has started playing (t>0) This can be watched using the Watcher module.

t

t: number

Current time of tween, in seconds. Negative if the tween has not started.

target

target: Entity

Target: target entity.

Static _isSharedComp

_isSharedComp: boolean

Static _size

_size: number

Static _view

_view: any

Static cid

cid: number

Static destroyWhenDone

destroyWhenDone: ComponentFieldDesc

Static duration

Static ended

Static loopCount

Static started

Static t

Static target

target: EntityComponentFieldDesc

Methods

Static _dtorFn

  • Parameters

    Returns void

Static _fromPtr

Static _tempHeapPtr

  • Parameters

    Returns number

Static _toPtr

  • Parameters

    Returns void

Generated using TypeDoc