Skip to content

Class: Tween<T> ​

Default generic is any so a plain Tween field is assignable from any concrete target without forcing the caller to spell out the target type.

Type Parameters ​

Type ParameterDefault type
T extends TweenTargetany

Constructors ​

Constructor ​

ts
new Tween<T>(target): Tween<T>;

Parameters ​

ParameterType
targetT

Returns ​

Tween<T>

Methods ​

GetTarget() ​

ts
GetTarget(): T;

Returns ​

T


IsCompleted() ​

ts
IsCompleted(): boolean;

Returns ​

boolean


IsRunning() ​

ts
IsRunning(): boolean;

Returns ​

boolean


Loop() ​

ts
Loop(loop?, yoyo?): this;

Parameters ​

ParameterTypeDefault value
loopbooleantrue
yoyobooleanfalse

Returns ​

this


OnComplete() ​

ts
OnComplete(cb): this;

Parameters ​

ParameterType
cb() => void

Returns ​

this


OnUpdate() ​

ts
OnUpdate(cb): this;

Parameters ​

ParameterType
cb(target, t) => void

Returns ​

this


Pause() ​

ts
Pause(pause?): this;

Stays registered; Tick is just skipped. Resume with Pause(false).

Parameters ​

ParameterTypeDefault value
pausebooleantrue

Returns ​

this


Reset() ​

ts
Reset(): this;

Returns ​

this


Start() ​

ts
Start(): this;

Returns ​

this


Stop() ​

ts
Stop(): this;

Returns ​

this


Then() ​

ts
Then(next): Tween<object>;

Chains the next tween onto completion. Returns the new tween; Start() the head.

Parameters ​

ParameterType
nextTween<object>

Returns ​

Tween<object>


Tick() ​

ts
Tick(dt): void;

Parameters ​

ParameterType
dtnumber

Returns ​

void


To() ​

ts
To(values, durationSeconds): this;

Snapshots the target's CURRENT values for each listed key — call after setting initial state, before Start.

Parameters ​

ParameterType
valuesPartial<Record<keyof T, number>>
durationSecondsnumber

Returns ​

this


WithEasing() ​

ts
WithEasing(fn): this;

Parameters ​

ParameterType
fnEasingFn

Returns ​

this

© 2026 PlayAdGentic