* Add a tween on several values.
(
identifier: string,
timeSource: TimeSource,
totalDuration: number,
easingIdentifier: string,
interpolate: Interpolation,
initialValue: Array<float>,
targetedValue: Array<float>,
setValue: (value: Array<float>) => void,
tweenInformation: TweenInformation,
onFinish?: (() => void) | null
)
| 277 | * Add a tween on several values. |
| 278 | */ |
| 279 | addMultiTween( |
| 280 | identifier: string, |
| 281 | timeSource: TimeSource, |
| 282 | totalDuration: number, |
| 283 | easingIdentifier: string, |
| 284 | interpolate: Interpolation, |
| 285 | initialValue: Array<float>, |
| 286 | targetedValue: Array<float>, |
| 287 | setValue: (value: Array<float>) => void, |
| 288 | tweenInformation: TweenInformation, |
| 289 | onFinish?: (() => void) | null |
| 290 | ): void { |
| 291 | const easing = easingFunctions[easingIdentifier]; |
| 292 | if (!easing) return; |
| 293 | |
| 294 | // Remove any prior tween |
| 295 | this.removeTween(identifier); |
| 296 | |
| 297 | // Initialize the tween instance |
| 298 | const tween = new MultiTweenInstance( |
| 299 | timeSource, |
| 300 | totalDuration, |
| 301 | easing, |
| 302 | easingIdentifier, |
| 303 | interpolate, |
| 304 | initialValue, |
| 305 | targetedValue, |
| 306 | setValue, |
| 307 | tweenInformation, |
| 308 | onFinish |
| 309 | ); |
| 310 | this._tweens.set(identifier, tween); |
| 311 | this._addActiveTween(tween); |
| 312 | } |
| 313 | |
| 314 | /** |
| 315 | * Tween exists. |
no test coverage detected