Skip to content
TweenGroup

Utils / TweenGroup

TweenGroup Class ​

Gap group, used to simultaneously control multiple gap objects

Table of contents ​

Methods ​

add(tween: Tween<TweenUnknownProps>): void other
Add the specified gap object to the current gap group
getAll(): Tween<TweenUnknownProps>[] other
Retrieve all interpolation objects in the current interpolation group
remove(tween: Tween<TweenUnknownProps>): void other
Remove the specified interval object from the current interval group and delete it
removeAll(): void other
Remove all gap objects from the current gap group
update(time?: number, preserve?: boolean): boolean other
Update Compensation Group

Methods ​

add ​

• add(tween): void other

Add the specified gap object to the current gap group

Parameters ​

tween Tween<TweenUnknownProps>The supplementary object to be added

getAll ​

• getAll(): Tween<TweenUnknownProps>[] other

Retrieve all interpolation objects in the current interpolation group

Returns ​

Tween<TweenUnknownProps>[]Interval object array

remove ​

• remove(tween): void other

Remove the specified interval object from the current interval group and delete it

Parameters ​

tween Tween<TweenUnknownProps>Supplementary objects to be removed and deleted

removeAll ​

• removeAll(): void other

Remove all gap objects from the current gap group

Precautions

According to the achieve of the current function, only the mending objects are removed from the mending group, not deleted


update ​

• update(time?, preserve?): boolean other

Update Compensation Group

Parameters ​

time? numberThe time to be set for all gap objects in the current gap group is not deltaTime. Default: current time
range: [0,+∞] type: floating-point number
preserve? booleanShould the completed gap object be retained in the gap group? Default: false

Returns ​

booleanIs there still an unfinished supplementary object. True - There are unfinished interstitial objects; Fall - all have ended

Usage example: Generally speaking, using default parameters when calling can make it run normally.

ts
// Update custom gap group
const group = new mw.TweenUtil.Group()
group.update()

// Update Global Compensation Group
mw.TweenUtil.TWEEN.update()
// Update custom gap group
const group = new mw.TweenUtil.Group()
group.update()

// Update Global Compensation Group
mw.TweenUtil.TWEEN.update()