MCPcopy
hub / github.com/4ian/GDevelop / addMultiTween

Method addMultiTween

Extensions/TweenBehavior/TweenManager.ts:279–312  ·  view source on GitHub ↗

* 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
        )

Source from the content-addressed store, hash-verified

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.

Callers 8

_addObjectScaleTweenMethod · 0.80
_addObjectColorTweenMethod · 0.80
_tweenCameraFunction · 0.80

Calls 3

removeTweenMethod · 0.95
_addActiveTweenMethod · 0.95
setMethod · 0.65

Tested by

no test coverage detected