gdcore-tools 2.0.0-gd-v5.5.242-autobuild → 2.0.0-gd-v5.5.243-autobuild
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Runtime/AsyncTasksManager.js +2 -2
- package/dist/Runtime/AsyncTasksManager.js.map +2 -2
- package/dist/Runtime/CustomRuntimeObject.js +1 -1
- package/dist/Runtime/CustomRuntimeObject.js.map +2 -2
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3D.js +1 -1
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3D.js.map +2 -2
- package/dist/Runtime/Extensions/3D/Cube3DRuntimeObject.js +1 -1
- package/dist/Runtime/Extensions/3D/Cube3DRuntimeObject.js.map +2 -2
- package/dist/Runtime/Extensions/3D/CustomRuntimeObject3D.js +1 -1
- package/dist/Runtime/Extensions/3D/CustomRuntimeObject3D.js.map +2 -2
- package/dist/Runtime/Extensions/3D/JsExtension.js +5 -0
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js +1 -1
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js.map +2 -2
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject3DRenderer.js +1 -1
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject3DRenderer.js.map +2 -2
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/DebuggerTools/JsExtension.js +3 -1
- package/dist/Runtime/Extensions/DestroyOutsideBehavior/destroyoutsideruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/DestroyOutsideBehavior/destroyoutsideruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/Multiplayer/messageManager.js +1 -1
- package/dist/Runtime/Extensions/Multiplayer/messageManager.js.map +2 -2
- package/dist/Runtime/Extensions/Multiplayer/multiplayerobjectruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/Multiplayer/multiplayerobjectruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js +1 -1
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js.map +2 -2
- package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js +1 -1
- package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/Physics3DBehavior/Physics3DRuntimeBehavior.js +1 -1
- package/dist/Runtime/Extensions/Physics3DBehavior/Physics3DRuntimeBehavior.js.map +2 -2
- package/dist/Runtime/Extensions/Physics3DBehavior/PhysicsCar3DRuntimeBehavior.js +1 -1
- package/dist/Runtime/Extensions/Physics3DBehavior/PhysicsCar3DRuntimeBehavior.js.map +2 -2
- package/dist/Runtime/Extensions/Physics3DBehavior/PhysicsCharacter3DRuntimeBehavior.js +1 -1
- package/dist/Runtime/Extensions/Physics3DBehavior/PhysicsCharacter3DRuntimeBehavior.js.map +2 -2
- package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/PlatformBehavior/platformruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/PlatformBehavior/platformruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/SaveState/JsExtension.js +488 -0
- package/dist/Runtime/Extensions/SaveState/SaveConfigurationRuntimeBehavior.js +2 -0
- package/dist/Runtime/Extensions/SaveState/SaveConfigurationRuntimeBehavior.js.map +7 -0
- package/dist/Runtime/Extensions/SaveState/SaveStateTools.js +2 -0
- package/dist/Runtime/Extensions/SaveState/SaveStateTools.js.map +7 -0
- package/dist/Runtime/Extensions/Spine/spineruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/Spine/spineruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TextObject/textruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TextObject/textruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/TileMapModel.d.ts +4 -4
- package/dist/Runtime/Extensions/TileMap/simpletilemapruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TileMap/simpletilemapruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/tilemapcollisionmaskruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TileMap/tilemapcollisionmaskruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject-pixi-renderer.js +1 -1
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject-pixi-renderer.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TopDownMovementBehavior/topdownmovementruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/TopDownMovementBehavior/topdownmovementruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/TweenBehavior/TweenManager.js +2 -2
- package/dist/Runtime/Extensions/TweenBehavior/TweenManager.js.map +2 -2
- package/dist/Runtime/Extensions/TweenBehavior/tweenruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/TweenBehavior/tweenruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/TweenBehavior/tweentools.js +1 -1
- package/dist/Runtime/Extensions/TweenBehavior/tweentools.js.map +2 -2
- package/dist/Runtime/Extensions/Video/videoruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/Video/videoruntimeobject.js.map +2 -2
- package/dist/Runtime/RuntimeInstanceContainer.js +1 -1
- package/dist/Runtime/RuntimeInstanceContainer.js.map +2 -2
- package/dist/Runtime/RuntimeLayer.js +1 -1
- package/dist/Runtime/RuntimeLayer.js.map +2 -2
- package/dist/Runtime/debugger-client/hot-reloader.js +1 -1
- package/dist/Runtime/debugger-client/hot-reloader.js.map +2 -2
- package/dist/Runtime/events-tools/objecttools.js +1 -1
- package/dist/Runtime/events-tools/objecttools.js.map +2 -2
- package/dist/Runtime/events-tools/runtimescenetools.js +1 -1
- package/dist/Runtime/events-tools/runtimescenetools.js.map +2 -2
- package/dist/Runtime/gd.js +1 -1
- package/dist/Runtime/gd.js.map +2 -2
- package/dist/Runtime/howler-sound-manager/howler-sound-manager.js +1 -1
- package/dist/Runtime/howler-sound-manager/howler-sound-manager.js.map +2 -2
- package/dist/Runtime/indexeddb.js +2 -0
- package/dist/Runtime/indexeddb.js.map +7 -0
- package/dist/Runtime/oncetriggers.js +1 -1
- package/dist/Runtime/oncetriggers.js.map +2 -2
- package/dist/Runtime/runtimebehavior.js +1 -1
- package/dist/Runtime/runtimebehavior.js.map +2 -2
- package/dist/Runtime/runtimegame.js +1 -1
- package/dist/Runtime/runtimegame.js.map +2 -2
- package/dist/Runtime/runtimeobject.js +1 -1
- package/dist/Runtime/runtimeobject.js.map +2 -2
- package/dist/Runtime/runtimescene.js +1 -1
- package/dist/Runtime/runtimescene.js.map +2 -2
- package/dist/Runtime/scenestack.js +1 -1
- package/dist/Runtime/scenestack.js.map +2 -2
- package/dist/Runtime/spriteruntimeobject.js +1 -1
- package/dist/Runtime/spriteruntimeobject.js.map +2 -2
- package/dist/Runtime/timemanager.js +1 -1
- package/dist/Runtime/timemanager.js.map +2 -2
- package/dist/Runtime/timer.js +1 -1
- package/dist/Runtime/timer.js.map +2 -2
- package/dist/Runtime/types/global-types.d.ts +29 -0
- package/dist/Runtime/types/project-data.d.ts +144 -3
- package/dist/Runtime/types/save-state.d.ts +9 -0
- package/dist/Runtime/variable.js +1 -1
- package/dist/Runtime/variable.js.map +2 -2
- package/dist/Runtime/variablescontainer.js +1 -1
- package/dist/Runtime/variablescontainer.js.map +2 -2
- package/dist/lib/libGD.cjs +1 -1
- package/dist/lib/libGD.wasm +0 -0
- package/dist/loaders.cjs +1 -1
- package/gd.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var gdjs;(function(w){const p=new w.Logger("Tween");function O(h){return h.setScaleX&&h.setScaleY&&h.getScaleX&&h.getScaleY}function R(h){return h.setOpacity&&h.getOpacity}function S(h){return h.getZ&&h.setZ}function C(h){return h.setColor&&h.getColor}function F(h){return h.setCharacterSize&&h.getCharacterSize}const g=w.evtTools.common.lerp,f=w.evtTools.common.exponentialInterpolation;class X extends w.RuntimeBehavior{constructor(e,t,n){super(e,t,n);this._tweens=new w.evtTools.tween.TweenManager;this._isActive=!0}updateFromBehaviorData(e,t){return!0}doStepPreEvents(e){this._tweens.step()}_deleteFromScene(){this.owner.deleteFromScene()}addVariableTween(e,t,n,o,i,s,r){this._tweens.addSimpleTween(e,this.owner.getRuntimeScene(),s/1e3,i,g,n,o,a=>t.setNumber(a),r?()=>this._deleteFromScene():null)}addVariableTween2(e,t,n,o,i,s){this._addVariableTween(e,t,n,o,i/1e3,s,this.owner.getRuntimeScene())}addVariableTween3(e,t,n,o,i,s){this._addVariableTween(e,t,n,o,i,s,this.owner)}_addVariableTween(e,t,n,o,i,s,r){t.getType()==="number"&&this._tweens.addSimpleTween(e,r,i,o,g,t.getValue(),n,a=>t.setNumber(a),s?()=>this._deleteFromScene():null)}addValueTween(e,t,n,o,i,s,r){this._tweens.addSimpleTween(e,this.owner,i,o,s?f:g,t,n,a=>{},r?()=>this._deleteFromScene():null)}addObjectPositionTween(e,t,n,o,i,s){this._addObjectPositionTween(e,t,n,o,i/1e3,s,this.owner.getRuntimeScene())}addObjectPositionTween2(e,t,n,o,i,s){this._addObjectPositionTween(e,t,n,o,i,s,this.owner)}_addObjectPositionTween(e,t,n,o,i,s,r){this._tweens.addMultiTween(e,r,i,o,g,[this.owner.getX(),this.owner.getY()],[t,n],([a,l])=>this.owner.setPosition(a,l),s?()=>this._deleteFromScene():null)}addObjectPositionXTween(e,t,n,o,i){this._addObjectPositionXTween(e,t,n,o/1e3,i,this.owner.getRuntimeScene())}addObjectPositionXTween2(e,t,n,o,i){this._addObjectPositionXTween(e,t,n,o,i,this.owner)}_addObjectPositionXTween(e,t,n,o,i,s){this._tweens.addSimpleTween(e,s,o,n,g,this.owner.getX(),t,r=>this.owner.setX(r),i?()=>this._deleteFromScene():null)}addObjectPositionYTween(e,t,n,o,i){this._addObjectPositionYTween(e,t,n,o/1e3,i,this.owner.getRuntimeScene())}addObjectPositionYTween2(e,t,n,o,i){this._addObjectPositionYTween(e,t,n,o,i,this.owner)}_addObjectPositionYTween(e,t,n,o,i,s){this._tweens.addSimpleTween(e,s,o,n,g,this.owner.getY(),t,r=>this.owner.setY(r),i?()=>this._deleteFromScene():null)}addObjectPositionZTween(e,t,n,o,i){this._addObjectPositionZTween(e,t,n,o/1e3,i,this.owner.getRuntimeScene())}addObjectPositionZTween2(e,t,n,o,i,s){this._addObjectPositionZTween(t,n,o,i,s,this.owner)}_addObjectPositionZTween(e,t,n,o,i,s){const{owner:r}=this;!S(r)||this._tweens.addSimpleTween(e,s,o,n,g,r.getZ(),t,a=>r.setZ(a),i?()=>this._deleteFromScene():null)}addObjectAngleTween(e,t,n,o,i){this._addObjectAngleTween(e,t,n,o/1e3,i,this.owner.getRuntimeScene())}addObjectAngleTween2(e,t,n,o,i){this._addObjectAngleTween(e,t,n,o,i,this.owner)}_addObjectAngleTween(e,t,n,o,i,s){this._tweens.addSimpleTween(e,s,o,n,g,this.owner.getAngle(),t,r=>this.owner.setAngle(r),i?()=>this._deleteFromScene():null)}addObjectRotationXTween(e,t,n,o,i,s){const{owner:r}=this;!S(r)||this._tweens.addSimpleTween(t,this.owner,i,o,g,r.getRotationX(),n,a=>r.setRotationX(a),s?()=>this._deleteFromScene():null)}addObjectRotationYTween(e,t,n,o,i,s){const{owner:r}=this;!S(r)||this._tweens.addSimpleTween(t,this.owner,i,o,g,r.getRotationY(),n,a=>r.setRotationY(a),s?()=>this._deleteFromScene():null)}addObjectScaleTween(e,t,n,o,i,s,r){this._addObjectScaleTween(e,t,n,o,i/1e3,s,r,this.owner.getRuntimeScene(),g)}addObjectScaleTween2(e,t,n,o,i,s,r){this._addObjectScaleTween(e,t,n,o,i,s,r,this.owner,f)}_addObjectScaleTween(e,t,n,o,i,s,r,a,l){const d=this.owner;if(!O(d))return;t<0&&(t=0),n<0&&(n=0);const c=r?([b,T])=>{const m=d.getCenterXInScene(),u=d.getCenterYInScene();d.setScaleX(b),d.setScaleY(T),d.setCenterPositionInScene(m,u)}:([b,T])=>{d.setScaleX(b),d.setScaleY(T)};this._tweens.addMultiTween(e,a,i,o,l,[d.getScaleX(),d.getScaleY()],[t,n],c,s?()=>this._deleteFromScene():null)}addObjectScaleTween3(e,t,n,o,i,s){this._addObjectScaleXTween(e,t,n,o,i,s,this.owner,f);const r=this.owner;if(!O(r))return;const a=S(r)?r:null,l=s?d=>{const c=r.getCenterXInScene(),b=r.getCenterYInScene(),T=a?a.getCenterZInScene():0;r.setScale(d),r.setCenterXInScene(c),r.setCenterYInScene(b),a&&a.setCenterZInScene(T)}:d=>r.setScale(d);this._tweens.addSimpleTween(e,this.owner,o,n,f,r.getScale(),t,l,i?()=>this._deleteFromScene():null)}addObjectScaleXTween(e,t,n,o,i,s){this._addObjectScaleXTween(e,t,n,o/1e3,i,s,this.owner.getRuntimeScene(),g)}addObjectScaleXTween2(e,t,n,o,i,s){this._addObjectScaleXTween(e,t,n,o,i,s,this.owner,f)}_addObjectScaleXTween(e,t,n,o,i,s,r,a){const l=this.owner;if(!O(l))return;const d=s?c=>{const b=l.getCenterXInScene();l.setScaleX(c),l.setCenterXInScene(b)}:c=>l.setScaleX(c);this._tweens.addSimpleTween(e,r,o,n,a,l.getScaleX(),t,d,i?()=>this._deleteFromScene():null)}addObjectScaleYTween(e,t,n,o,i,s){this._addObjectScaleYTween(e,t,n,o/1e3,i,s,this.owner.getRuntimeScene(),g)}addObjectScaleYTween2(e,t,n,o,i,s){this._addObjectScaleYTween(e,t,n,o,i,s,this.owner,f)}_addObjectScaleYTween(e,t,n,o,i,s,r,a){const l=this.owner;if(!O(l))return;const d=s?c=>{const b=l.getCenterYInScene();l.setScaleY(c),l.setCenterYInScene(b)}:c=>l.setScaleY(c);this._tweens.addSimpleTween(e,r,o,n,a,l.getScaleY(),t,d,i?()=>this._deleteFromScene():null)}addObjectOpacityTween(e,t,n,o,i){this._addObjectOpacityTween(e,t,n,o/1e3,i,this.owner.getRuntimeScene())}addObjectOpacityTween2(e,t,n,o,i){this._addObjectOpacityTween(e,t,n,o,i,this.owner)}_addObjectOpacityTween(e,t,n,o,i,s){const r=this.owner;!R(r)||this._tweens.addSimpleTween(e,s,o,n,g,r.getOpacity(),t,a=>r.setOpacity(a),i?()=>this._deleteFromScene():null)}addNumberEffectPropertyTween(e,t,n,o,i,s,r,a){const l=this.owner.getRendererEffects()[o];l||p.error(`The object "${this.owner.name}" doesn't have any effect called "${o}"`),this._tweens.addSimpleTween(t,this.owner,r,s,g,l?l.getDoubleParameter(i):0,n,d=>{l&&l.updateDoubleParameter(i,d)},a?()=>this._deleteFromScene():null)}addColorEffectPropertyTween(e,t,n,o,i,s,r,a){const l=this.owner.getRendererEffects()[o];l||p.error(`The object "${this.owner.name}" doesn't have any effect called "${o}"`);const d=w.hexNumberToRGB(l?l.getColorParameter(i):0),c=w.rgbOrHexToRGBColor(n);this._tweens.addMultiTween(t,this.owner,r,s,g,w.evtTools.tween.rgbToHsl(d.r,d.g,d.b),w.evtTools.tween.rgbToHsl(c[0],c[1],c[2]),([b,T,m])=>{if(l){const u=w.evtTools.tween.hslToRgb(b,T,m);l.updateColorParameter(i,w.rgbToHexNumber(u[0],u[1],u[2]))}},a?()=>this._deleteFromScene():null)}addObjectColorTween(e,t,n,o,i,s){this._addObjectColorTween(e,t,n,o/1e3,i,s,this.owner.getRuntimeScene())}addObjectColorTween2(e,t,n,o,i,s=!0){this._addObjectColorTween(e,t,n,o,i,s,this.owner)}_addObjectColorTween(e,t,n,o,i,s,r){const a=this.owner;if(!C(a))return;const l=w.rgbOrHexToRGBColor(a.getColor()),d=w.rgbOrHexToRGBColor(t);let c,b,T;s?(c=w.evtTools.tween.rgbToHsl(l[0],l[1],l[2]),b=w.evtTools.tween.rgbToHsl(d[0],d[1],d[2]),T=([m,u,j])=>{const _=w.evtTools.tween.hslToRgb(m,u,j);a.setColor(Math.round(_[0])+";"+Math.round(_[1])+";"+Math.round(_[2]))}):(c=l,b=d,T=([m,u,j])=>{a.setColor(Math.floor(m)+";"+Math.floor(u)+";"+Math.floor(j))}),this._tweens.addMultiTween(e,r,o,n,g,c,b,T,i?()=>this._deleteFromScene():null)}addObjectColorHSLTween(e,t,n,o,i,s,r,a){this._addObjectColorHSLTween(e,t,n,o,i,s,r/1e3,a,this.owner.getRuntimeScene())}addObjectColorHSLTween2(e,t,n,o,i,s,r,a){this._addObjectColorHSLTween(e,t,n,o,i,s,r,a,this.owner)}_addObjectColorHSLTween(e,t,n,o,i,s,r,a,l){if(!C(this.owner))return;const d=this.owner,c=w.rgbOrHexToRGBColor(d.getColor()),b=w.evtTools.tween.rgbToHsl(c[0],c[1],c[2]),T=n?t:b[0],m=o===-1?b[1]:Math.min(Math.max(o,0),100),u=i===-1?b[2]:Math.min(Math.max(i,0),100);this._tweens.addMultiTween(e,l,r,s,g,b,[T,m,u],([j,_,P])=>{const v=w.evtTools.tween.hslToRgb(j,_,P);d.setColor(Math.round(v[0])+";"+Math.round(v[1])+";"+Math.round(v[2]))},a?()=>this._deleteFromScene():null)}addTextObjectCharacterSizeTween(e,t,n,o,i){this._addTextObjectCharacterSizeTween(e,t,n,o/1e3,i,this.owner.getRuntimeScene(),g)}addTextObjectCharacterSizeTween2(e,t,n,o,i){this._addTextObjectCharacterSizeTween(e,t,n,o,i,this.owner,f)}_addTextObjectCharacterSizeTween(e,t,n,o,i,s,r){const a=this.owner;!F(a)||this._tweens.addSimpleTween(e,s,o,n,r,a.getCharacterSize(),t,l=>a.setCharacterSize(l),i?()=>this._deleteFromScene():null)}addObjectWidthTween(e,t,n,o,i){this._addObjectWidthTween(e,t,n,o/1e3,i,this.owner.getRuntimeScene())}addObjectWidthTween2(e,t,n,o,i){this._addObjectWidthTween(e,t,n,o,i,this.owner)}_addObjectWidthTween(e,t,n,o,i,s){this._tweens.addSimpleTween(e,s,o,n,g,this.owner.getWidth(),t,r=>this.owner.setWidth(r),i?()=>this._deleteFromScene():null)}addObjectHeightTween(e,t,n,o,i){this._addObjectHeightTween(e,t,n,o/1e3,i,this.owner.getRuntimeScene())}addObjectHeightTween2(e,t,n,o,i){this._addObjectHeightTween(e,t,n,o,i,this.owner)}_addObjectHeightTween(e,t,n,o,i,s){this._tweens.addSimpleTween(e,s,o,n,g,this.owner.getHeight(),t,r=>this.owner.setHeight(r),i?()=>this._deleteFromScene():null)}addObjectDepthTween(e,t,n,o,i){this._addObjectDepthTween(e,t,n,o/1e3,i,this.owner.getRuntimeScene())}addObjectDepthTween2(e,t,n,o,i,s){this._addObjectDepthTween(t,n,o,i,s,this.owner)}_addObjectDepthTween(e,t,n,o,i,s){const{owner:r}=this;!S(r)||this._tweens.addSimpleTween(e,s,o,n,g,r.getDepth(),t,a=>r.setDepth(a),i?()=>this._deleteFromScene():null)}isPlaying(e){return this._tweens.isPlaying(e)}exists(e){return this._tweens.exists(e)}hasFinished(e){return this._tweens.hasFinished(e)}pauseTween(e){this._isActive&&this._tweens.pauseTween(e)}stopTween(e,t){this._isActive&&this._tweens.stopTween(e,t)}resumeTween(e){this._isActive&&this._tweens.resumeTween(e)}removeTween(e){this._tweens.removeTween(e)}getProgress(e){return this._tweens.getProgress(e)}getValue(e){return this._tweens.getValue(e)}onDeActivate(){this._isActive=!1}onActivate(){this._isActive=!0}}w.TweenRuntimeBehavior=X,w.registerBehavior("Tween::TweenBehavior",w.TweenRuntimeBehavior)})(gdjs||(gdjs={}));
|
|
1
|
+
var gdjs;(function(d){const S=new d.Logger("Tween");function h(a){return a.setScaleX&&a.setScaleY&&a.getScaleX&&a.getScaleY}function j(a){return a.setOpacity&&a.getOpacity}function u(a){return a.getZ&&a.setZ}function m(a){return a.setColor&&a.getColor}function O(a){return a.setCharacterSize&&a.getCharacterSize}const g=d.evtTools.common.lerp,T=d.evtTools.common.exponentialInterpolation,_=()=>{},p=a=>e=>a.setNumber(e),v=a=>e=>a.setX(e),C=a=>e=>a.setY(e),R=a=>u(a)?e=>a.setZ(e):()=>{},y=a=>([e,t])=>a.setPosition(e,t),P=a=>e=>a.setAngle(e),X=a=>e=>a.setWidth(e),D=a=>e=>a.setHeight(e),Y=a=>e=>a.setRotationX(e),H=a=>e=>a.setRotationY(e),B=a=>e=>a.setDepth(e),I=(a,e)=>e?([t,o])=>{const r=a.getCenterXInScene(),n=a.getCenterYInScene();a.setScaleX(t),a.setScaleY(o),a.setCenterPositionInScene(r,n)}:([t,o])=>{a.setScaleX(t),a.setScaleY(o)},x=(a,e,t)=>t?o=>{const r=a.getCenterXInScene(),n=a.getCenterYInScene(),i=e?e.getCenterZInScene():0;a.setScale(o),a.setCenterXInScene(r),a.setCenterYInScene(n),e&&e.setCenterZInScene(i)}:o=>a.setScale(o),M=(a,e)=>e?t=>{const o=a.getCenterXInScene();a.setScaleX(t),a.setCenterXInScene(o)}:t=>a.setScaleX(t),V=(a,e)=>e?t=>{const o=a.getCenterYInScene();a.setScaleY(t),a.setCenterYInScene(o)}:t=>a.setScaleY(t),F=a=>e=>a.setOpacity(e),N=a=>e=>a.setCharacterSize(e),A=(a,e)=>t=>{a.updateDoubleParameter(e,t)},k=(a,e)=>([t,o,r])=>{const n=d.evtTools.tween.hslToRgb(t,o,r);a.updateColorParameter(e,d.rgbToHexNumber(n[0],n[1],n[2]))},z=(a,e)=>e?([t,o,r])=>{const n=d.evtTools.tween.hslToRgb(t,o,r);a.setColor(Math.floor(n[0])+";"+Math.floor(n[1])+";"+Math.floor(n[2]))}:([t,o,r])=>{a.setColor(Math.floor(t)+";"+Math.floor(o)+";"+Math.floor(r))},Z=a=>([e,t,o])=>{const r=d.evtTools.tween.hslToRgb(e,t,o);a.setColor(Math.floor(r[0])+";"+Math.floor(r[1])+";"+Math.floor(r[2]))},E=a=>e=>{const t=e.type,o=e.variablePath,r=e.effectName,n=e.propertyName,i=!!e.scaleFromCenterOfObject,s=!!e.useHSLColorTransition;if(t==="objectValue")return _;if(t==="variable"&&o){const l=a.getVariables().getVariableFromPath(o);return l?p(l):()=>{}}if(t==="positionX")return v(a);if(t==="positionY")return C(a);if(t==="position")return y(a);if(t==="positionZ")return R(a);if(t==="width")return X(a);if(t==="height")return D(a);if(t==="depth")return u(a)?B(a):()=>{};if(t==="angle")return P(a);if(t==="rotationX")return u(a)?Y(a):()=>{};if(t==="rotationY")return u(a)?H(a):()=>{};if(t==="scale"){if(!h(a))return()=>{};const l=u(a)?a:null;return x(a,l,i)}if(t==="scaleXY")return h(a)?I(a,i):()=>{};if(t==="scaleX")return h(a)?M(a,i):()=>{};if(t==="scaleY")return h(a)?V(a,i):()=>{};if(t==="opacity")return j(a)?F(a):()=>{};if(t==="characterSize")return O(a)?N(a):()=>{};if(t==="numberEffectProperty"&&r&&n){const l=a.getRendererEffects()[r];return l||S.error(`The object "${a.name}" doesn't have any effect called "${r}"`),A(l,n)}if(t==="colorEffectProperty"&&r&&n){const l=a.getRendererEffects()[r];return l||S.error(`The object "${a.name}" doesn't have any effect called "${r}"`),k(l,n)}return t==="objectColor"?m(a)?z(a,s):()=>{}:t==="objectColorHSL"?m(a)?Z(a):()=>{}:()=>{}};class q extends d.RuntimeBehavior{constructor(e,t,o){super(e,t,o);this._tweens=new d.evtTools.tween.TweenManager;this._isActive=!0}updateFromBehaviorData(e,t){return!0}getNetworkSyncData(e){return{...super.getNetworkSyncData(e),props:{tweenManager:this._tweens.getNetworkSyncData()}}}updateFromNetworkSyncData(e,t){super.updateFromNetworkSyncData(e,t),e.props.tweenManager&&this._tweens.updateFromNetworkSyncData(e.props.tweenManager,o=>this.owner,o=>E(this.owner)(o),o=>o.destroyObjectWhenFinished?()=>this._deleteFromScene():null)}doStepPreEvents(e){this._tweens.step()}_deleteFromScene(){this.owner.deleteFromScene()}addVariableTween(e,t,o,r,n,i,s){this._tweens.addSimpleTween(e,this.owner.getRuntimeScene(),i/1e3,n,g,o,r,p(t),{type:"variable",variable:t,destroyObjectWhenFinished:s},s?()=>this._deleteFromScene():null)}addVariableTween2(e,t,o,r,n,i){this._addVariableTween(e,t,o,r,n/1e3,i,this.owner.getRuntimeScene())}addVariableTween3(e,t,o,r,n,i){this._addVariableTween(e,t,o,r,n,i,this.owner)}_addVariableTween(e,t,o,r,n,i,s){t.getType()==="number"&&this._tweens.addSimpleTween(e,s,n,r,g,t.getValue(),o,p(t),{type:"variable",variable:t,destroyObjectWhenFinished:i},i?()=>this._deleteFromScene():null)}addValueTween(e,t,o,r,n,i,s){this._tweens.addSimpleTween(e,this.owner,n,r,i?T:g,t,o,_,{type:"objectValue",destroyObjectWhenFinished:s},s?()=>this._deleteFromScene():null)}addObjectPositionTween(e,t,o,r,n,i){this._addObjectPositionTween(e,t,o,r,n/1e3,i,this.owner.getRuntimeScene())}addObjectPositionTween2(e,t,o,r,n,i){this._addObjectPositionTween(e,t,o,r,n,i,this.owner)}_addObjectPositionTween(e,t,o,r,n,i,s){this._tweens.addMultiTween(e,s,n,r,g,[this.owner.getX(),this.owner.getY()],[t,o],y(this.owner),{type:"position",destroyObjectWhenFinished:i},i?()=>this._deleteFromScene():null)}addObjectPositionXTween(e,t,o,r,n){this._addObjectPositionXTween(e,t,o,r/1e3,n,this.owner.getRuntimeScene())}addObjectPositionXTween2(e,t,o,r,n){this._addObjectPositionXTween(e,t,o,r,n,this.owner)}_addObjectPositionXTween(e,t,o,r,n,i){this._tweens.addSimpleTween(e,i,r,o,g,this.owner.getX(),t,v(this.owner),{type:"positionX",destroyObjectWhenFinished:n},n?()=>this._deleteFromScene():null)}addObjectPositionYTween(e,t,o,r,n){this._addObjectPositionYTween(e,t,o,r/1e3,n,this.owner.getRuntimeScene())}addObjectPositionYTween2(e,t,o,r,n){this._addObjectPositionYTween(e,t,o,r,n,this.owner)}_addObjectPositionYTween(e,t,o,r,n,i){this._tweens.addSimpleTween(e,i,r,o,g,this.owner.getY(),t,C(this.owner),{type:"positionY",destroyObjectWhenFinished:n},n?()=>this._deleteFromScene():null)}addObjectPositionZTween(e,t,o,r,n){this._addObjectPositionZTween(e,t,o,r/1e3,n,this.owner.getRuntimeScene())}addObjectPositionZTween2(e,t,o,r,n,i){this._addObjectPositionZTween(t,o,r,n,i,this.owner)}_addObjectPositionZTween(e,t,o,r,n,i){const{owner:s}=this;!u(s)||this._tweens.addSimpleTween(e,i,r,o,g,s.getZ(),t,R(s),{type:"positionZ",destroyObjectWhenFinished:n},n?()=>this._deleteFromScene():null)}addObjectAngleTween(e,t,o,r,n){this._addObjectAngleTween(e,t,o,r/1e3,n,this.owner.getRuntimeScene())}addObjectAngleTween2(e,t,o,r,n){this._addObjectAngleTween(e,t,o,r,n,this.owner)}_addObjectAngleTween(e,t,o,r,n,i){this._tweens.addSimpleTween(e,i,r,o,g,this.owner.getAngle(),t,P(this.owner),{type:"angle",destroyObjectWhenFinished:n},n?()=>this._deleteFromScene():null)}addObjectRotationXTween(e,t,o,r,n,i){const{owner:s}=this;!u(s)||this._tweens.addSimpleTween(t,this.owner,n,r,g,s.getRotationX(),o,Y(s),{type:"rotationX",destroyObjectWhenFinished:i},i?()=>this._deleteFromScene():null)}addObjectRotationYTween(e,t,o,r,n,i){const{owner:s}=this;!u(s)||this._tweens.addSimpleTween(t,this.owner,n,r,g,s.getRotationY(),o,H(s),{type:"rotationY",destroyObjectWhenFinished:i},i?()=>this._deleteFromScene():null)}addObjectScaleTween(e,t,o,r,n,i,s){this._addObjectScaleTween(e,t,o,r,n/1e3,i,s,this.owner.getRuntimeScene(),g)}addObjectScaleTween2(e,t,o,r,n,i,s){this._addObjectScaleTween(e,t,o,r,n,i,s,this.owner,T)}_addObjectScaleTween(e,t,o,r,n,i,s,l,c){const w=this.owner;!h(w)||(t<0&&(t=0),o<0&&(o=0),this._tweens.addMultiTween(e,l,n,r,c,[w.getScaleX(),w.getScaleY()],[t,o],I(w,s),{type:"scaleXY",destroyObjectWhenFinished:i},i?()=>this._deleteFromScene():null))}addObjectScaleTween3(e,t,o,r,n,i){this._addObjectScaleXTween(e,t,o,r,n,i,this.owner,T);const s=this.owner;if(!h(s))return;const l=u(s)?s:null;this._tweens.addSimpleTween(e,this.owner,r,o,T,s.getScale(),t,x(s,l,i),{type:"scale",scaleFromCenterOfObject:i,destroyObjectWhenFinished:n},n?()=>this._deleteFromScene():null)}addObjectScaleXTween(e,t,o,r,n,i){this._addObjectScaleXTween(e,t,o,r/1e3,n,i,this.owner.getRuntimeScene(),g)}addObjectScaleXTween2(e,t,o,r,n,i){this._addObjectScaleXTween(e,t,o,r,n,i,this.owner,T)}_addObjectScaleXTween(e,t,o,r,n,i,s,l){const c=this.owner;!h(c)||this._tweens.addSimpleTween(e,s,r,o,l,c.getScaleX(),t,M(c,i),{type:"scaleX",scaleFromCenterOfObject:i,destroyObjectWhenFinished:n},n?()=>this._deleteFromScene():null)}addObjectScaleYTween(e,t,o,r,n,i){this._addObjectScaleYTween(e,t,o,r/1e3,n,i,this.owner.getRuntimeScene(),g)}addObjectScaleYTween2(e,t,o,r,n,i){this._addObjectScaleYTween(e,t,o,r,n,i,this.owner,T)}_addObjectScaleYTween(e,t,o,r,n,i,s,l){const c=this.owner;!h(c)||this._tweens.addSimpleTween(e,s,r,o,l,c.getScaleY(),t,V(c,i),{type:"scaleY",scaleFromCenterOfObject:i,destroyObjectWhenFinished:n},n?()=>this._deleteFromScene():null)}addObjectOpacityTween(e,t,o,r,n){this._addObjectOpacityTween(e,t,o,r/1e3,n,this.owner.getRuntimeScene())}addObjectOpacityTween2(e,t,o,r,n){this._addObjectOpacityTween(e,t,o,r,n,this.owner)}_addObjectOpacityTween(e,t,o,r,n,i){const s=this.owner;!j(s)||this._tweens.addSimpleTween(e,i,r,o,g,s.getOpacity(),t,F(s),{type:"opacity",destroyObjectWhenFinished:n},n?()=>this._deleteFromScene():null)}addNumberEffectPropertyTween(e,t,o,r,n,i,s,l){const c=this.owner.getRendererEffects()[r];c||S.error(`The object "${this.owner.name}" doesn't have any effect called "${r}"`),this._tweens.addSimpleTween(t,this.owner,s,i,g,c?c.getDoubleParameter(n):0,o,A(c,n),{type:"numberEffectProperty",effectName:r,propertyName:n,destroyObjectWhenFinished:l},l?()=>this._deleteFromScene():null)}addColorEffectPropertyTween(e,t,o,r,n,i,s,l){const c=this.owner.getRendererEffects()[r];c||S.error(`The object "${this.owner.name}" doesn't have any effect called "${r}"`);const w=d.hexNumberToRGB(c?c.getColorParameter(n):0),b=d.rgbOrHexToRGBColor(o);this._tweens.addMultiTween(t,this.owner,s,i,g,d.evtTools.tween.rgbToHsl(w.r,w.g,w.b),d.evtTools.tween.rgbToHsl(b[0],b[1],b[2]),k(c,n),{type:"colorEffectProperty",effectName:r,propertyName:n,destroyObjectWhenFinished:l},l?()=>this._deleteFromScene():null)}addObjectColorTween(e,t,o,r,n,i){this._addObjectColorTween(e,t,o,r/1e3,n,i,this.owner.getRuntimeScene())}addObjectColorTween2(e,t,o,r,n,i=!0){this._addObjectColorTween(e,t,o,r,n,i,this.owner)}_addObjectColorTween(e,t,o,r,n,i,s){const l=this.owner;if(!m(l))return;const c=d.rgbOrHexToRGBColor(l.getColor()),w=d.rgbOrHexToRGBColor(t),b=i?d.evtTools.tween.rgbToHsl(c[0],c[1],c[2]):c,f=i?d.evtTools.tween.rgbToHsl(w[0],w[1],w[2]):w;this._tweens.addMultiTween(e,s,r,o,g,b,f,z(l,i),{type:"objectColor",useHSLColorTransition:i,destroyObjectWhenFinished:n},n?()=>this._deleteFromScene():null)}addObjectColorHSLTween(e,t,o,r,n,i,s,l){this._addObjectColorHSLTween(e,t,o,r,n,i,s/1e3,l,this.owner.getRuntimeScene())}addObjectColorHSLTween2(e,t,o,r,n,i,s,l){this._addObjectColorHSLTween(e,t,o,r,n,i,s,l,this.owner)}_addObjectColorHSLTween(e,t,o,r,n,i,s,l,c){if(!m(this.owner))return;const w=this.owner,b=d.rgbOrHexToRGBColor(w.getColor()),f=d.evtTools.tween.rgbToHsl(b[0],b[1],b[2]),L=o?t:f[0],$=r===-1?f[1]:Math.min(Math.max(r,0),100),G=n===-1?f[2]:Math.min(Math.max(n,0),100);this._tweens.addMultiTween(e,c,s,i,g,f,[L,$,G],Z(w),{type:"objectColorHSL",destroyObjectWhenFinished:l},l?()=>this._deleteFromScene():null)}addTextObjectCharacterSizeTween(e,t,o,r,n){this._addTextObjectCharacterSizeTween(e,t,o,r/1e3,n,this.owner.getRuntimeScene(),g)}addTextObjectCharacterSizeTween2(e,t,o,r,n){this._addTextObjectCharacterSizeTween(e,t,o,r,n,this.owner,T)}_addTextObjectCharacterSizeTween(e,t,o,r,n,i,s){const l=this.owner;!O(l)||this._tweens.addSimpleTween(e,i,r,o,s,l.getCharacterSize(),t,N(l),{type:"characterSize",destroyObjectWhenFinished:n},n?()=>this._deleteFromScene():null)}addObjectWidthTween(e,t,o,r,n){this._addObjectWidthTween(e,t,o,r/1e3,n,this.owner.getRuntimeScene())}addObjectWidthTween2(e,t,o,r,n){this._addObjectWidthTween(e,t,o,r,n,this.owner)}_addObjectWidthTween(e,t,o,r,n,i){this._tweens.addSimpleTween(e,i,r,o,g,this.owner.getWidth(),t,X(this.owner),{type:"width",destroyObjectWhenFinished:n},n?()=>this._deleteFromScene():null)}addObjectHeightTween(e,t,o,r,n){this._addObjectHeightTween(e,t,o,r/1e3,n,this.owner.getRuntimeScene())}addObjectHeightTween2(e,t,o,r,n){this._addObjectHeightTween(e,t,o,r,n,this.owner)}_addObjectHeightTween(e,t,o,r,n,i){this._tweens.addSimpleTween(e,i,r,o,g,this.owner.getHeight(),t,D(this.owner),{type:"height",destroyObjectWhenFinished:n},n?()=>this._deleteFromScene():null)}addObjectDepthTween(e,t,o,r,n){this._addObjectDepthTween(e,t,o,r/1e3,n,this.owner.getRuntimeScene())}addObjectDepthTween2(e,t,o,r,n,i){this._addObjectDepthTween(t,o,r,n,i,this.owner)}_addObjectDepthTween(e,t,o,r,n,i){const{owner:s}=this;!u(s)||this._tweens.addSimpleTween(e,i,r,o,g,s.getDepth(),t,B(s),{type:"depth",destroyObjectWhenFinished:n},n?()=>this._deleteFromScene():null)}isPlaying(e){return this._tweens.isPlaying(e)}exists(e){return this._tweens.exists(e)}hasFinished(e){return this._tweens.hasFinished(e)}pauseTween(e){this._isActive&&this._tweens.pauseTween(e)}stopTween(e,t){this._isActive&&this._tweens.stopTween(e,t)}resumeTween(e){this._isActive&&this._tweens.resumeTween(e)}removeTween(e){this._tweens.removeTween(e)}getProgress(e){return this._tweens.getProgress(e)}getValue(e){return this._tweens.getValue(e)}onDeActivate(){this._isActive=!1}onActivate(){this._isActive=!0}}d.TweenRuntimeBehavior=q,d.registerBehavior("Tween::TweenBehavior",d.TweenRuntimeBehavior)})(gdjs||(gdjs={}));
|
|
2
2
|
//# sourceMappingURL=tweenruntimebehavior.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../GDevelop/Extensions/TweenBehavior/tweenruntimebehavior.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nGDevelop - Tween Behavior Extension\nCopyright (c) 2010-2023 Florian Rival (Florian.Rival@gmail.com)\n */\nnamespace gdjs {\n const logger = new gdjs.Logger('Tween');\n interface IColorable extends gdjs.RuntimeObject {\n setColor(color: string): void;\n getColor(): string;\n }\n\n interface ICharacterScalable extends gdjs.RuntimeObject {\n setCharacterSize(characterSize: number): void;\n getCharacterSize(): number;\n }\n\n function isScalable(\n object: gdjs.RuntimeObject\n ): object is gdjs.RuntimeObject & gdjs.Scalable {\n return (\n //@ts-ignore We are checking if the methods are present.\n object.setScaleX &&\n //@ts-ignore\n object.setScaleY &&\n //@ts-ignore\n object.getScaleX &&\n //@ts-ignore\n object.getScaleY\n );\n }\n\n function isOpaque(\n object: gdjs.RuntimeObject\n ): object is gdjs.RuntimeObject & gdjs.OpacityHandler {\n //@ts-ignore We are checking if the methods are present.\n return object.setOpacity && object.getOpacity;\n }\n\n function is3D(\n object: gdjs.RuntimeObject\n ): object is gdjs.RuntimeObject & gdjs.Base3DHandler {\n //@ts-ignore We are checking if the methods are present.\n return object.getZ && object.setZ;\n }\n\n function isColorable(object: gdjs.RuntimeObject): object is IColorable {\n //@ts-ignore We are checking if the methods are present.\n return object.setColor && object.getColor;\n }\n\n function isCharacterScalable(\n object: gdjs.RuntimeObject\n ): object is ICharacterScalable {\n //@ts-ignore We are checking if the methods are present.\n return object.setCharacterSize && object.getCharacterSize;\n }\n\n const linearInterpolation = gdjs.evtTools.common.lerp;\n const exponentialInterpolation =\n gdjs.evtTools.common.exponentialInterpolation;\n\n export class TweenRuntimeBehavior extends gdjs.RuntimeBehavior {\n private _tweens = new gdjs.evtTools.tween.TweenManager();\n private _isActive: boolean = true;\n\n /**\n * @param instanceContainer The instance container the behavior belongs to.\n * @param behaviorData The data to initialize the behavior\n * @param owner The runtime object the behavior belongs to.\n */\n constructor(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n behaviorData: BehaviorData,\n owner: gdjs.RuntimeObject\n ) {\n super(instanceContainer, behaviorData, owner);\n }\n\n updateFromBehaviorData(\n oldBehaviorData: BehaviorData,\n newBehaviorData: BehaviorData\n ): boolean {\n // Nothing to update.\n return true;\n }\n\n doStepPreEvents(instanceContainer: gdjs.RuntimeInstanceContainer): void {\n this._tweens.step();\n }\n\n private _deleteFromScene() {\n this.owner.deleteFromScene();\n }\n\n /**\n * Add an object variable tween.\n * @deprecated Use addVariableTween3 instead.\n * This function is misleading since one could think that the tween starts\n * right at the moment this function is called whereas the value of the variable\n * will change at the next frame only. Moreover, the variable will not start from\n * the start value exactly since time will have passed at the moment the next\n * frame is rendered.\n * See https://github.com/4ian/GDevelop/issues/4270\n * @param identifier Unique id to identify the tween\n * @param variable The object variable to store the tweened value\n * @param fromValue Start value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addVariableTween(\n identifier: string,\n variable: gdjs.Variable,\n fromValue: float,\n toValue: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._tweens.addSimpleTween(\n identifier,\n this.owner.getRuntimeScene(),\n duration / 1000,\n easing,\n linearInterpolation,\n fromValue,\n toValue,\n (value: float) => variable.setNumber(value),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object variable.\n * @deprecated Use addVariableTween3 instead.\n * @param identifier Unique id to identify the tween\n * @param variable The object variable to store the tweened value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addVariableTween2(\n identifier: string,\n variable: gdjs.Variable,\n toValue: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addVariableTween(\n identifier,\n variable,\n toValue,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object variable.\n * @param identifier Unique id to identify the tween\n * @param variable The object variable to store the tweened value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addVariableTween3(\n identifier: string,\n variable: gdjs.Variable,\n toValue: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addVariableTween(\n identifier,\n variable,\n toValue,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addVariableTween(\n identifier: string,\n variable: gdjs.Variable,\n toValue: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n if (variable.getType() !== 'number') {\n return;\n }\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n variable.getValue() as number,\n toValue,\n (value: float) => variable.setNumber(value),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Add an object value tween.\n * @param identifier Unique id to identify the tween\n * @param fromValue Start value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param useExponentialInterpolation Set it to true to use a exponential\n * It's useful for values that are factors like a scale or a zoom.\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addValueTween(\n identifier: string,\n fromValue: float,\n toValue: float,\n easing: string,\n duration: float,\n useExponentialInterpolation: boolean,\n destroyObjectWhenFinished: boolean\n ) {\n this._tweens.addSimpleTween(\n identifier,\n this.owner,\n duration,\n easing,\n useExponentialInterpolation\n ? exponentialInterpolation\n : linearInterpolation,\n fromValue,\n toValue,\n (value: float) => {},\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object position.\n * @deprecated Use addObjectPositionTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toX The target X position\n * @param toY The target Y position\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionTween(\n identifier: string,\n toX: number,\n toY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionTween(\n identifier,\n toX,\n toY,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object position.\n * @param identifier Unique id to identify the tween\n * @param toX The target X position\n * @param toY The target Y position\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionTween2(\n identifier: string,\n toX: number,\n toY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionTween(\n identifier,\n toX,\n toY,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectPositionTween(\n identifier: string,\n toX: number,\n toY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n this._tweens.addMultiTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n [this.owner.getX(), this.owner.getY()],\n [toX, toY],\n ([x, y]) => this.owner.setPosition(x, y),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object X position.\n * @deprecated Use addObjectPositionXTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toX The target X position\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionXTween(\n identifier: string,\n toX: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionXTween(\n identifier,\n toX,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object X position.\n * @param identifier Unique id to identify the tween\n * @param toX The target X position\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionXTween2(\n identifier: string,\n toX: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionXTween(\n identifier,\n toX,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectPositionXTween(\n identifier: string,\n toX: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n this.owner.getX(),\n toX,\n (value: float) => this.owner.setX(value),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object Y position.\n * @deprecated Use addObjectPositionYTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toY The target Y position\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionYTween(\n identifier: string,\n toY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionYTween(\n identifier,\n toY,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object Y position.\n * @param identifier Unique id to identify the tween\n * @param toY The target Y position\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionYTween2(\n identifier: string,\n toY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionYTween(\n identifier,\n toY,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectPositionYTween(\n identifier: string,\n toY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n this.owner.getY(),\n toY,\n (value: float) => this.owner.setY(value),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object Z position.\n * @deprecated Use addObjectPositionZTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toZ The target Z position\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionZTween(\n identifier: string,\n toZ: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionZTween(\n identifier,\n toZ,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object Z position.\n * @param object3DBehavior Only used by events can be set to null\n * @param identifier Unique id to identify the tween\n * @param toZ The target Z position\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionZTween2(\n object3DBehavior: any,\n identifier: string,\n toZ: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionZTween(\n identifier,\n toZ,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectPositionZTween(\n identifier: string,\n toZ: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n const { owner } = this;\n if (!is3D(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n owner.getZ(),\n toZ,\n (value: float) => owner.setZ(value),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object angle.\n * @deprecated Use addObjectAngleTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toAngle The target angle\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectAngleTween(\n identifier: string,\n toAngle: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectAngleTween(\n identifier,\n toAngle,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object angle.\n * @param identifier Unique id to identify the tween\n * @param toAngle The target angle\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectAngleTween2(\n identifier: string,\n toAngle: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectAngleTween(\n identifier,\n toAngle,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectAngleTween(\n identifier: string,\n toAngle: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n this.owner.getAngle(),\n toAngle,\n (value: float) => this.owner.setAngle(value),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween a 3D object rotation X.\n * @param object3DBehavior Only used by events can be set to null\n * @param identifier Unique id to identify the tween\n * @param toAngle The target angle\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectRotationXTween(\n object3DBehavior: any,\n identifier: string,\n toAngle: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n const { owner } = this;\n if (!is3D(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n this.owner,\n duration,\n easing,\n linearInterpolation,\n owner.getRotationX(),\n toAngle,\n (value: float) => owner.setRotationX(value),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween a 3D object rotation Y.\n * @param object3DBehavior Only used by events can be set to null\n * @param identifier Unique id to identify the tween\n * @param toAngle The target angle\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectRotationYTween(\n object3DBehavior: any,\n identifier: string,\n toAngle: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n const { owner } = this;\n if (!is3D(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n this.owner,\n duration,\n easing,\n linearInterpolation,\n owner.getRotationY(),\n toAngle,\n (value: float) => owner.setRotationY(value),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object scale.\n * @deprecated Use addObjectScaleTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toScaleX The target X-scale\n * @param toScaleY The target Y-scale\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleTween(\n identifier: string,\n toScaleX: number,\n toScaleY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleTween(\n identifier,\n toScaleX,\n toScaleY,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner.getRuntimeScene(),\n linearInterpolation\n );\n }\n\n /**\n * Tween an object scale.\n * @deprecated Use addObjectScaleXTween2 and addObjectScaleYTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toScaleX The target X-scale\n * @param toScaleY The target Y-scale\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleTween2(\n identifier: string,\n toScaleX: number,\n toScaleY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleTween(\n identifier,\n toScaleX,\n toScaleY,\n easing,\n duration,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner,\n exponentialInterpolation\n );\n }\n\n private _addObjectScaleTween(\n identifier: string,\n toScaleX: number,\n toScaleY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource,\n interpolation: gdjs.evtTools.tween.Interpolation\n ) {\n const owner = this.owner;\n if (!isScalable(owner)) return;\n\n if (toScaleX < 0) toScaleX = 0;\n if (toScaleY < 0) toScaleY = 0;\n\n const setValue = scaleFromCenterOfObject\n ? ([scaleX, scaleY]: float[]) => {\n const oldX = owner.getCenterXInScene();\n const oldY = owner.getCenterYInScene();\n owner.setScaleX(scaleX);\n owner.setScaleY(scaleY);\n owner.setCenterPositionInScene(oldX, oldY);\n }\n : ([scaleX, scaleY]: float[]) => {\n owner.setScaleX(scaleX);\n owner.setScaleY(scaleY);\n };\n\n this._tweens.addMultiTween(\n identifier,\n timeSource,\n duration,\n easing,\n interpolation,\n [owner.getScaleX(), owner.getScaleY()],\n [toScaleX, toScaleY],\n setValue,\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object scale.\n * @param identifier Unique id to identify the tween\n * @param toScale The target scale\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleTween3(\n identifier: string,\n toScale: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleXTween(\n identifier,\n toScale,\n easing,\n duration,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner,\n exponentialInterpolation\n );\n const owner = this.owner;\n if (!isScalable(owner)) return;\n\n // This action doesn't require 3D capabilities.\n // So, gdjs.RuntimeObject3D may not exist\n // when the 3D extension is not used.\n const owner3d = is3D(owner) ? owner : null;\n\n const setValue = scaleFromCenterOfObject\n ? (scale: float) => {\n const oldX = owner.getCenterXInScene();\n const oldY = owner.getCenterYInScene();\n const oldZ = owner3d ? owner3d.getCenterZInScene() : 0;\n owner.setScale(scale);\n owner.setCenterXInScene(oldX);\n owner.setCenterYInScene(oldY);\n if (owner3d) {\n owner3d.setCenterZInScene(oldZ);\n }\n }\n : (scale: float) => owner.setScale(scale);\n\n this._tweens.addSimpleTween(\n identifier,\n this.owner,\n duration,\n easing,\n exponentialInterpolation,\n owner.getScale(),\n toScale,\n setValue,\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object X-scale.\n * @deprecated Use addObjectScaleXTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toScaleX The target X-scale\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleXTween(\n identifier: string,\n toScaleX: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleXTween(\n identifier,\n toScaleX,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner.getRuntimeScene(),\n linearInterpolation\n );\n }\n\n /**\n * Tween an object X-scale.\n * @param identifier Unique id to identify the tween\n * @param toScaleX The target X-scale\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleXTween2(\n identifier: string,\n toScaleX: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleXTween(\n identifier,\n toScaleX,\n easing,\n duration,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner,\n exponentialInterpolation\n );\n }\n\n private _addObjectScaleXTween(\n identifier: string,\n toScaleX: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource,\n interpolation: gdjs.evtTools.tween.Interpolation\n ) {\n const owner = this.owner;\n if (!isScalable(owner)) return;\n\n const setValue = scaleFromCenterOfObject\n ? (scaleX: float) => {\n const oldX = owner.getCenterXInScene();\n owner.setScaleX(scaleX);\n owner.setCenterXInScene(oldX);\n }\n : (scaleX: float) => owner.setScaleX(scaleX);\n\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n interpolation,\n owner.getScaleX(),\n toScaleX,\n setValue,\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object Y-scale.\n * @deprecated Use addObjectScaleYTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toScaleY The target Y-scale\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleYTween(\n identifier: string,\n toScaleY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleYTween(\n identifier,\n toScaleY,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner.getRuntimeScene(),\n linearInterpolation\n );\n }\n\n /**\n * Tween an object Y-scale.\n * @param identifier Unique id to identify the tween\n * @param toScaleY The target Y-scale\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleYTween2(\n identifier: string,\n toScaleY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleYTween(\n identifier,\n toScaleY,\n easing,\n duration,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner,\n exponentialInterpolation\n );\n }\n\n private _addObjectScaleYTween(\n identifier: string,\n toScaleY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource,\n interpolation: gdjs.evtTools.tween.Interpolation\n ) {\n const owner = this.owner;\n if (!isScalable(owner)) return;\n\n const setValue = scaleFromCenterOfObject\n ? (scaleY: float) => {\n const oldY = owner.getCenterYInScene();\n owner.setScaleY(scaleY);\n owner.setCenterYInScene(oldY);\n }\n : (scaleY: float) => owner.setScaleY(scaleY);\n\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n interpolation,\n owner.getScaleY(),\n toScaleY,\n setValue,\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object opacity.\n * @deprecated Use addObjectOpacityTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toOpacity The target opacity\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectOpacityTween(\n identifier: string,\n toOpacity: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectOpacityTween(\n identifier,\n toOpacity,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object opacity.\n * @param identifier Unique id to identify the tween\n * @param toOpacity The target opacity\n * @param easing Easing function identifier\n * @param duration Duration in second\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectOpacityTween2(\n identifier: string,\n toOpacity: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectOpacityTween(\n identifier,\n toOpacity,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectOpacityTween(\n identifier: string,\n toOpacity: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n const owner = this.owner;\n if (!isOpaque(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n owner.getOpacity(),\n toOpacity,\n (value: float) => owner.setOpacity(value),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween a numeric object effect property.\n * @param effectBehavior Only used by events can be set to null\n * @param identifier Unique id to identify the tween\n * @param toValue The targeted value\n * @param effectName Effect name\n * @param propertyName Property name\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addNumberEffectPropertyTween(\n effectBehavior: any,\n identifier: string,\n toValue: float,\n effectName: string,\n propertyName: string,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n const effect = this.owner.getRendererEffects()[effectName];\n if (!effect) {\n logger.error(\n `The object \"${this.owner.name}\" doesn't have any effect called \"${effectName}\"`\n );\n }\n this._tweens.addSimpleTween(\n identifier,\n this.owner,\n duration,\n easing,\n linearInterpolation,\n effect ? effect.getDoubleParameter(propertyName) : 0,\n toValue,\n (value: float) => {\n if (effect) {\n effect.updateDoubleParameter(propertyName, value);\n }\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween a color object effect property.\n * @param effectBehavior Only used by events can be set to null\n * @param identifier Unique id to identify the tween\n * @param toColorStr The target RGB color (format \"128;200;255\" with values between 0 and 255 for red, green and blue)\n * @param effectName Effect name\n * @param propertyName Property name\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addColorEffectPropertyTween(\n effectBehavior: any,\n identifier: string,\n toColorStr: string,\n effectName: string,\n propertyName: string,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n const effect = this.owner.getRendererEffects()[effectName];\n if (!effect) {\n logger.error(\n `The object \"${this.owner.name}\" doesn't have any effect called \"${effectName}\"`\n );\n }\n const rgbFromColor = gdjs.hexNumberToRGB(\n effect ? effect.getColorParameter(propertyName) : 0\n );\n const rgbToColor: float[] = gdjs.rgbOrHexToRGBColor(toColorStr);\n\n this._tweens.addMultiTween(\n identifier,\n this.owner,\n duration,\n easing,\n linearInterpolation,\n gdjs.evtTools.tween.rgbToHsl(\n rgbFromColor.r,\n rgbFromColor.g,\n rgbFromColor.b\n ),\n gdjs.evtTools.tween.rgbToHsl(\n rgbToColor[0],\n rgbToColor[1],\n rgbToColor[2]\n ),\n ([hue, saturation, lightness]) => {\n if (effect) {\n const rgbFromHslColor = gdjs.evtTools.tween.hslToRgb(\n hue,\n saturation,\n lightness\n );\n effect.updateColorParameter(\n propertyName,\n gdjs.rgbToHexNumber(\n rgbFromHslColor[0],\n rgbFromHslColor[1],\n rgbFromHslColor[2]\n )\n );\n }\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object color.\n * @deprecated Use addObjectColorTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toColorStr The target RGB color (format \"128;200;255\" with values between 0 and 255 for red, green and blue)\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param useHSLColorTransition Tween using HSL color mappings, rather than direct RGB line\n */\n addObjectColorTween(\n identifier: string,\n toColorStr: string,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n useHSLColorTransition: boolean\n ) {\n this._addObjectColorTween(\n identifier,\n toColorStr,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n useHSLColorTransition,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object color.\n * @param identifier Unique id to identify the tween\n * @param toColorStr The target RGB color (format \"128;200;255\" with values between 0 and 255 for red, green and blue)\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param useHSLColorTransition Tween using HSL color mappings, rather than direct RGB line\n */\n addObjectColorTween2(\n identifier: string,\n toColorStr: string,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n useHSLColorTransition: boolean = true\n ) {\n this._addObjectColorTween(\n identifier,\n toColorStr,\n easing,\n duration,\n destroyObjectWhenFinished,\n useHSLColorTransition,\n this.owner\n );\n }\n\n private _addObjectColorTween(\n identifier: string,\n toColorStr: string,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n useHSLColorTransition: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n const owner = this.owner;\n if (!isColorable(owner)) {\n return;\n }\n\n const rgbFromColor: float[] = gdjs.rgbOrHexToRGBColor(owner.getColor());\n const rgbToColor: float[] = gdjs.rgbOrHexToRGBColor(toColorStr);\n\n let initialValue;\n let targetedValue;\n let setValue;\n if (useHSLColorTransition) {\n initialValue = gdjs.evtTools.tween.rgbToHsl(\n rgbFromColor[0],\n rgbFromColor[1],\n rgbFromColor[2]\n );\n targetedValue = gdjs.evtTools.tween.rgbToHsl(\n rgbToColor[0],\n rgbToColor[1],\n rgbToColor[2]\n );\n setValue = ([hue, saturation, lightness]) => {\n const rgbFromHslColor = gdjs.evtTools.tween.hslToRgb(\n hue,\n saturation,\n lightness\n );\n owner.setColor(\n Math.round(rgbFromHslColor[0]) +\n ';' +\n Math.round(rgbFromHslColor[1]) +\n ';' +\n Math.round(rgbFromHslColor[2])\n );\n };\n } else {\n initialValue = rgbFromColor;\n targetedValue = rgbToColor;\n setValue = ([red, green, blue]) => {\n owner.setColor(\n Math.floor(red) + ';' + Math.floor(green) + ';' + Math.floor(blue)\n );\n };\n }\n\n this._tweens.addMultiTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n initialValue,\n targetedValue,\n setValue,\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object HSL color, with the \"to\" color given using HSL (H: any number, S and L: 0-100).\n * @deprecated Use addObjectColorHSLTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toHue The target hue, or the same as the from color's hue if blank\n * @param animateHue include hue in calculations, as can't set this to -1 as default to ignore\n * @param toSaturation The target saturation, or the same as the from color's saturation if blank\n * @param toLightness The target lightness, or the same as the from color's lightness if blank\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectColorHSLTween(\n identifier: string,\n toHue: number,\n animateHue: boolean,\n toSaturation: number,\n toLightness: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectColorHSLTween(\n identifier,\n toHue,\n animateHue,\n toSaturation,\n toLightness,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object HSL color, with the \"to\" color given using HSL (H: any number, S and L: 0-100).\n * @param identifier Unique id to identify the tween\n * @param toHue The target hue, or the same as the from color's hue if blank\n * @param animateHue include hue in calculations, as can't set this to -1 as default to ignore\n * @param toSaturation The target saturation, or the same as the from color's saturation if blank\n * @param toLightness The target lightness, or the same as the from color's lightness if blank\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectColorHSLTween2(\n identifier: string,\n toHue: number,\n animateHue: boolean,\n toSaturation: number,\n toLightness: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectColorHSLTween(\n identifier,\n toHue,\n animateHue,\n toSaturation,\n toLightness,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectColorHSLTween(\n identifier: string,\n toHue: number,\n animateHue: boolean,\n toSaturation: number,\n toLightness: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n if (!isColorable(this.owner)) return;\n const owner = this.owner;\n\n const rgbFromColor = gdjs.rgbOrHexToRGBColor(owner.getColor());\n const hslFromColor = gdjs.evtTools.tween.rgbToHsl(\n rgbFromColor[0],\n rgbFromColor[1],\n rgbFromColor[2]\n );\n\n const toH = animateHue ? toHue : hslFromColor[0];\n const toS =\n -1 === toSaturation\n ? hslFromColor[1]\n : Math.min(Math.max(toSaturation, 0), 100);\n const toL =\n -1 === toLightness\n ? hslFromColor[2]\n : Math.min(Math.max(toLightness, 0), 100);\n\n this._tweens.addMultiTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n\n hslFromColor,\n [toH, toS, toL],\n ([hue, saturation, lightness]) => {\n const rgbFromHslColor = gdjs.evtTools.tween.hslToRgb(\n hue,\n saturation,\n lightness\n );\n\n owner.setColor(\n Math.round(rgbFromHslColor[0]) +\n ';' +\n Math.round(rgbFromHslColor[1]) +\n ';' +\n Math.round(rgbFromHslColor[2])\n );\n },\n\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween a text object character size.\n * @deprecated Use addTextObjectCharacterSizeTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toSize The target character size\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addTextObjectCharacterSizeTween(\n identifier: string,\n toSize: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addTextObjectCharacterSizeTween(\n identifier,\n toSize,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene(),\n linearInterpolation\n );\n }\n\n /**\n * Tween a text object character size.\n * @param identifier Unique id to identify the tween\n * @param toSize The target character size\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addTextObjectCharacterSizeTween2(\n identifier: string,\n toSize: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addTextObjectCharacterSizeTween(\n identifier,\n toSize,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner,\n exponentialInterpolation\n );\n }\n\n private _addTextObjectCharacterSizeTween(\n identifier: string,\n toSize: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource,\n interpolation: gdjs.evtTools.tween.Interpolation\n ) {\n const owner = this.owner;\n if (!isCharacterScalable(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n interpolation,\n owner.getCharacterSize(),\n toSize,\n (value: float) => owner.setCharacterSize(value),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object width.\n * @deprecated Use addObjectWidthTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toWidth The target width\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectWidthTween(\n identifier: string,\n toWidth: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectWidthTween(\n identifier,\n toWidth,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object width.\n * @param identifier Unique id to identify the tween\n * @param toWidth The target width\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectWidthTween2(\n identifier: string,\n toWidth: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectWidthTween(\n identifier,\n toWidth,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectWidthTween(\n identifier: string,\n toWidth: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n this.owner.getWidth(),\n toWidth,\n (value: float) => this.owner.setWidth(value),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object height.\n * @deprecated Use addObjectHeightTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toHeight The target height\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectHeightTween(\n identifier: string,\n toHeight: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectHeightTween(\n identifier,\n toHeight,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object height.\n * @param identifier Unique id to identify the tween\n * @param toHeight The target height\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectHeightTween2(\n identifier: string,\n toHeight: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectHeightTween(\n identifier,\n toHeight,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectHeightTween(\n identifier: string,\n toHeight: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n this.owner.getHeight(),\n toHeight,\n (value: float) => this.owner.setHeight(value),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object depth.\n * @deprecated Use addObjectDepthTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toDepth The target depth\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectDepthTween(\n identifier: string,\n toDepth: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectDepthTween(\n identifier,\n toDepth,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object depth.\n * @param object3DBehavior Only used by events can be set to null\n * @param identifier Unique id to identify the tween\n * @param toDepth The target depth\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectDepthTween2(\n object3DBehavior: any,\n identifier: string,\n toDepth: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectDepthTween(\n identifier,\n toDepth,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectDepthTween(\n identifier: string,\n toDepth: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n const { owner } = this;\n if (!is3D(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n owner.getDepth(),\n toDepth,\n (value: float) => owner.setDepth(value),\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween is playing.\n * @param identifier Unique id to identify the tween\n */\n isPlaying(identifier: string): boolean {\n return this._tweens.isPlaying(identifier);\n }\n\n /**\n * Tween exists.\n * @param identifier Unique id to identify the tween\n * @returns The tween exists\n */\n exists(identifier: string): boolean {\n return this._tweens.exists(identifier);\n }\n\n /**\n * Tween has finished.\n * @param identifier Unique id to identify the tween\n */\n hasFinished(identifier: string): boolean {\n return this._tweens.hasFinished(identifier);\n }\n\n /**\n * Pause a tween.\n * @param identifier Unique id to identify the tween\n */\n pauseTween(identifier: string) {\n if (this._isActive) {\n this._tweens.pauseTween(identifier);\n }\n }\n\n /**\n * Stop a tween.\n * @param identifier Unique id to identify the tween\n * @param jumpToDest Move to destination\n */\n stopTween(identifier: string, jumpToDest: boolean) {\n if (this._isActive) {\n this._tweens.stopTween(identifier, jumpToDest);\n }\n }\n\n /**\n * Resume a tween.\n * @param identifier Unique id to identify the tween\n */\n resumeTween(identifier: string) {\n if (this._isActive) {\n this._tweens.resumeTween(identifier);\n }\n }\n\n /**\n * Remove a tween.\n * @param identifier Unique id to identify the tween\n */\n removeTween(identifier: string) {\n this._tweens.removeTween(identifier);\n }\n\n /**\n * Get tween progress.\n * @param identifier Unique id to identify the tween\n * @returns Progress of playing tween animation (between 0.0 and 1.0)\n */\n getProgress(identifier: string): float {\n return this._tweens.getProgress(identifier);\n }\n\n /**\n * Get tween value.\n *\n * It returns 0 for tweens with several values.\n *\n * @param identifier Unique id to identify the tween\n * @returns Value of playing tween animation\n */\n getValue(identifier: string): float {\n return this._tweens.getValue(identifier);\n }\n\n onDeActivate() {\n this._isActive = false;\n }\n\n onActivate() {\n this._isActive = true;\n }\n }\n gdjs.registerBehavior('Tween::TweenBehavior', gdjs.TweenRuntimeBehavior);\n}\n"],
|
|
5
|
-
"mappings": "AAIA,GAAU,MAAV,UAAU,EAAV,CACE,KAAM,GAAS,GAAI,GAAK,OAAO,SAW/B,WACE,EAC8C,CAC9C,MAEE,GAAO,WAEP,EAAO,WAEP,EAAO,WAEP,EAAO,UAIX,WACE,EACoD,CAEpD,MAAO,GAAO,YAAc,EAAO,WAGrC,WACE,EACmD,CAEnD,MAAO,GAAO,MAAQ,EAAO,KAG/B,WAAqB,EAAkD,CAErE,MAAO,GAAO,UAAY,EAAO,SAGnC,WACE,EAC8B,CAE9B,MAAO,GAAO,kBAAoB,EAAO,iBAG3C,KAAM,GAAsB,EAAK,SAAS,OAAO,KAC3C,EACJ,EAAK,SAAS,OAAO,yBAEhB,eAAmC,GAAK,eAAgB,CAS7D,YACE,EACA,EACA,EACA,CACA,MAAM,EAAmB,EAAc,GAbjC,aAAU,GAAI,GAAK,SAAS,MAAM,aAClC,eAAqB,GAe7B,uBACE,EACA,EACS,CAET,MAAO,GAGT,gBAAgB,EAAwD,CACtE,KAAK,QAAQ,OAGP,kBAAmB,CACzB,KAAK,MAAM,kBAoBb,iBACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,KAAK,MAAM,kBACX,EAAW,IACX,EACA,EACA,EACA,EACA,AAAC,GAAiB,EAAS,UAAU,GACrC,EAA4B,IAAM,KAAK,mBAAqB,MAchE,kBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,kBACH,EACA,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAaf,kBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,kBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,kBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,AAAI,EAAS,YAAc,UAG3B,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAS,WACT,EACA,AAAC,GAAiB,EAAS,UAAU,GACrC,EAA4B,IAAM,KAAK,mBAAqB,MAehE,cACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,KAAK,MACL,EACA,EACA,EACI,EACA,EACJ,EACA,EACA,AAAC,GAAiB,GAClB,EAA4B,IAAM,KAAK,mBAAqB,MAchE,uBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,wBACH,EACA,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAaf,wBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,wBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,wBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,cACX,EACA,EACA,EACA,EACA,EACA,CAAC,KAAK,MAAM,OAAQ,KAAK,MAAM,QAC/B,CAAC,EAAK,GACN,CAAC,CAAC,EAAG,KAAO,KAAK,MAAM,YAAY,EAAG,GACtC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,wBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,yBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,yBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,yBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,yBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,OACX,EACA,AAAC,GAAiB,KAAK,MAAM,KAAK,GAClC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,wBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,yBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,yBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,yBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,yBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,OACX,EACA,AAAC,GAAiB,KAAK,MAAM,KAAK,GAClC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,wBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,yBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAaf,yBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,yBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,yBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,CAAE,SAAU,KAClB,AAAI,CAAC,EAAK,IAEV,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,OACN,EACA,AAAC,GAAiB,EAAM,KAAK,GAC7B,EAA4B,IAAM,KAAK,mBAAqB,MAahE,oBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,qBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,WACX,EACA,AAAC,GAAiB,KAAK,MAAM,SAAS,GACtC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,wBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,CAAE,SAAU,KAClB,AAAI,CAAC,EAAK,IAEV,KAAK,QAAQ,eACX,EACA,KAAK,MACL,EACA,EACA,EACA,EAAM,eACN,EACA,AAAC,GAAiB,EAAM,aAAa,GACrC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,wBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,CAAE,SAAU,KAClB,AAAI,CAAC,EAAK,IAEV,KAAK,QAAQ,eACX,EACA,KAAK,MACL,EACA,EACA,EACA,EAAM,eACN,EACA,AAAC,GAAiB,EAAM,aAAa,GACrC,EAA4B,IAAM,KAAK,mBAAqB,MAehE,oBACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EAAW,IACX,EACA,EACA,KAAK,MAAM,kBACX,GAeJ,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,GAAI,CAAC,EAAW,GAAQ,OAExB,AAAI,EAAW,GAAG,GAAW,GACzB,EAAW,GAAG,GAAW,GAE7B,KAAM,GAAW,EACb,CAAC,CAAC,EAAQ,KAAqB,CAC7B,KAAM,GAAO,EAAM,oBACb,EAAO,EAAM,oBACnB,EAAM,UAAU,GAChB,EAAM,UAAU,GAChB,EAAM,yBAAyB,EAAM,IAEvC,CAAC,CAAC,EAAQ,KAAqB,CAC7B,EAAM,UAAU,GAChB,EAAM,UAAU,IAGtB,KAAK,QAAQ,cACX,EACA,EACA,EACA,EACA,EACA,CAAC,EAAM,YAAa,EAAM,aAC1B,CAAC,EAAU,GACX,EACA,EAA4B,IAAM,KAAK,mBAAqB,MAahE,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAEF,KAAM,GAAQ,KAAK,MACnB,GAAI,CAAC,EAAW,GAAQ,OAKxB,KAAM,GAAU,EAAK,GAAS,EAAQ,KAEhC,EAAW,EACb,AAAC,GAAiB,CAChB,KAAM,GAAO,EAAM,oBACb,EAAO,EAAM,oBACb,EAAO,EAAU,EAAQ,oBAAsB,EACrD,EAAM,SAAS,GACf,EAAM,kBAAkB,GACxB,EAAM,kBAAkB,GACpB,GACF,EAAQ,kBAAkB,IAG9B,AAAC,GAAiB,EAAM,SAAS,GAErC,KAAK,QAAQ,eACX,EACA,KAAK,MACL,EACA,EACA,EACA,EAAM,WACN,EACA,EACA,EAA4B,IAAM,KAAK,mBAAqB,MAchE,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EAAW,IACX,EACA,EACA,KAAK,MAAM,kBACX,GAaJ,sBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,sBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,GAAI,CAAC,EAAW,GAAQ,OAExB,KAAM,GAAW,EACb,AAAC,GAAkB,CACjB,KAAM,GAAO,EAAM,oBACnB,EAAM,UAAU,GAChB,EAAM,kBAAkB,IAE1B,AAAC,GAAkB,EAAM,UAAU,GAEvC,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,YACN,EACA,EACA,EAA4B,IAAM,KAAK,mBAAqB,MAchE,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EAAW,IACX,EACA,EACA,KAAK,MAAM,kBACX,GAaJ,sBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,sBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,GAAI,CAAC,EAAW,GAAQ,OAExB,KAAM,GAAW,EACb,AAAC,GAAkB,CACjB,KAAM,GAAO,EAAM,oBACnB,EAAM,UAAU,GAChB,EAAM,kBAAkB,IAE1B,AAAC,GAAkB,EAAM,UAAU,GAEvC,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,YACN,EACA,EACA,EAA4B,IAAM,KAAK,mBAAqB,MAahE,sBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,uBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,uBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,uBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,uBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,AAAI,CAAC,EAAS,IAEd,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,aACN,EACA,AAAC,GAAiB,EAAM,WAAW,GACnC,EAA4B,IAAM,KAAK,mBAAqB,MAehE,6BACE,EACA,EACA,EACA,E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GAGF,EAAM,SACJ,KAAK,MAAM,EAAgB,IACzB,IACA,KAAK,MAAM,EAAgB,IAC3B,IACA,KAAK,MAAM,EAAgB,MAIjC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,gCACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,iCACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,kBACX,GAYJ,iCACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,iCACH,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,iCACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,AAAI,CAAC,EAAoB,IAEzB,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,mBACN,EACA,AAAC,GAAiB,EAAM,iBAAiB,GACzC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,oBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,qBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,WACX,EACA,AAAC,GAAiB,KAAK,MAAM,SAAS,GACtC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,qBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,sBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,sBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,YACX,EACA,AAAC,GAAiB,KAAK,MAAM,UAAU,GACvC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,oBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAaf,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,CAAE,SAAU,KAClB,AAAI,CAAC,EAAK,IAEV,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,WACN,EACA,AAAC,GAAiB,EAAM,SAAS,GACjC,EAA4B,IAAM,KAAK,mBAAqB,MAQhE,UAAU,EAA6B,CACrC,MAAO,MAAK,QAAQ,UAAU,GAQhC,OAAO,EAA6B,CAClC,MAAO,MAAK,QAAQ,OAAO,GAO7B,YAAY,EAA6B,CACvC,MAAO,MAAK,QAAQ,YAAY,GAOlC,WAAW,EAAoB,CAC7B,AAAI,KAAK,WACP,KAAK,QAAQ,WAAW,GAS5B,UAAU,EAAoB,EAAqB,CACjD,AAAI,KAAK,WACP,KAAK,QAAQ,UAAU,EAAY,GAQvC,YAAY,EAAoB,CAC9B,AAAI,KAAK,WACP,KAAK,QAAQ,YAAY,GAQ7B,YAAY,EAAoB,CAC9B,KAAK,QAAQ,YAAY,GAQ3B,YAAY,EAA2B,CACrC,MAAO,MAAK,QAAQ,YAAY,GAWlC,SAAS,EAA2B,CAClC,MAAO,MAAK,QAAQ,SAAS,GAG/B,cAAe,CACb,KAAK,UAAY,GAGnB,YAAa,CACX,KAAK,UAAY,IAvxDd,EAAM,uBA0xDb,EAAK,iBAAiB,uBAAwB,EAAK,wBAn1D3C",
|
|
4
|
+
"sourcesContent": ["/*\nGDevelop - Tween Behavior Extension\nCopyright (c) 2010-2023 Florian Rival (Florian.Rival@gmail.com)\n */\nnamespace gdjs {\n const logger = new gdjs.Logger('Tween');\n\n interface TweenBehaviorNetworkSyncDataType {\n tweenManager: TweenManagerNetworkSyncData;\n }\n export interface TweenBehaviorNetworkSyncData\n extends BehaviorNetworkSyncData {\n props: TweenBehaviorNetworkSyncDataType;\n }\n\n interface IColorable extends gdjs.RuntimeObject {\n setColor(color: string): void;\n getColor(): string;\n }\n\n interface ICharacterScalable extends gdjs.RuntimeObject {\n setCharacterSize(characterSize: number): void;\n getCharacterSize(): number;\n }\n\n function isScalable(\n object: gdjs.RuntimeObject\n ): object is gdjs.RuntimeObject & gdjs.Scalable {\n return (\n //@ts-ignore We are checking if the methods are present.\n object.setScaleX &&\n //@ts-ignore\n object.setScaleY &&\n //@ts-ignore\n object.getScaleX &&\n //@ts-ignore\n object.getScaleY\n );\n }\n\n function isOpaque(\n object: gdjs.RuntimeObject\n ): object is gdjs.RuntimeObject & gdjs.OpacityHandler {\n //@ts-ignore We are checking if the methods are present.\n return object.setOpacity && object.getOpacity;\n }\n\n function is3D(\n object: gdjs.RuntimeObject\n ): object is gdjs.RuntimeObject & gdjs.Base3DHandler {\n //@ts-ignore We are checking if the methods are present.\n return object.getZ && object.setZ;\n }\n\n function isColorable(object: gdjs.RuntimeObject): object is IColorable {\n //@ts-ignore We are checking if the methods are present.\n return object.setColor && object.getColor;\n }\n\n function isCharacterScalable(\n object: gdjs.RuntimeObject\n ): object is ICharacterScalable {\n //@ts-ignore We are checking if the methods are present.\n return object.setCharacterSize && object.getCharacterSize;\n }\n\n const linearInterpolation = gdjs.evtTools.common.lerp;\n const exponentialInterpolation =\n gdjs.evtTools.common.exponentialInterpolation;\n\n const tweenObjectValueSetter = () => {};\n const getTweenVariableSetter = (variable: gdjs.Variable) => {\n return (value: float) => variable.setNumber(value);\n };\n const getTweenObjectPositionXSetter = (object: gdjs.RuntimeObject) => {\n return (value: float) => object.setX(value);\n };\n const getTweenObjectPositionYSetter = (object: gdjs.RuntimeObject) => {\n return (value: float) => object.setY(value);\n };\n const getTweenObjectPositionZSetter = (object: gdjs.RuntimeObject) => {\n if (!is3D(object)) return () => {};\n return (value: float) => object.setZ(value);\n };\n const getTweenObjectPositionSetter = (object: gdjs.RuntimeObject) => {\n return ([x, y]: float[]) => object.setPosition(x, y);\n };\n const getTweenObjectAngleSetter = (object: gdjs.RuntimeObject) => {\n return (value: float) => object.setAngle(value);\n };\n const getTweenObjectWidthSetter = (object: gdjs.RuntimeObject) => {\n return (value: float) => object.setWidth(value);\n };\n const getTweenObjectHeightSetter = (object: gdjs.RuntimeObject) => {\n return (value: float) => object.setHeight(value);\n };\n const getTweenObjectRotationXSetter = (\n object: gdjs.RuntimeObject & gdjs.Base3DHandler\n ) => {\n return (value: float) => object.setRotationX(value);\n };\n const getTweenObjectRotationYSetter = (\n object: gdjs.RuntimeObject & gdjs.Base3DHandler\n ) => {\n return (value: float) => object.setRotationY(value);\n };\n const getTweenObjectDepthSetter = (\n object: gdjs.RuntimeObject & gdjs.Base3DHandler\n ) => {\n return (value: float) => object.setDepth(value);\n };\n const getTweenObjectScaleXYSetter = (\n object: gdjs.RuntimeObject & gdjs.Scalable,\n scaleFromCenterOfObject: boolean\n ) => {\n return scaleFromCenterOfObject\n ? ([scaleX, scaleY]: float[]) => {\n const oldX = object.getCenterXInScene();\n const oldY = object.getCenterYInScene();\n object.setScaleX(scaleX);\n object.setScaleY(scaleY);\n object.setCenterPositionInScene(oldX, oldY);\n }\n : ([scaleX, scaleY]: float[]) => {\n object.setScaleX(scaleX);\n object.setScaleY(scaleY);\n };\n };\n const getTweenObjectScaleSetter = (\n object: gdjs.RuntimeObject & gdjs.Scalable,\n object3d: (gdjs.RuntimeObject & gdjs.Base3DHandler) | null,\n scaleFromCenterOfObject: boolean\n ) => {\n return scaleFromCenterOfObject\n ? (scale: float) => {\n const oldX = object.getCenterXInScene();\n const oldY = object.getCenterYInScene();\n const oldZ = object3d ? object3d.getCenterZInScene() : 0;\n object.setScale(scale);\n object.setCenterXInScene(oldX);\n object.setCenterYInScene(oldY);\n if (object3d) {\n object3d.setCenterZInScene(oldZ);\n }\n }\n : (scale: float) => object.setScale(scale);\n };\n const getTweenObjectScaleXSetter = (\n object: gdjs.RuntimeObject & gdjs.Scalable,\n scaleFromCenterOfObject: boolean\n ) => {\n return scaleFromCenterOfObject\n ? (scaleX: float) => {\n const oldX = object.getCenterXInScene();\n object.setScaleX(scaleX);\n object.setCenterXInScene(oldX);\n }\n : (scaleX: float) => object.setScaleX(scaleX);\n };\n const getTweenObjectScaleYSetter = (\n object: gdjs.RuntimeObject & gdjs.Scalable,\n scaleFromCenterOfObject: boolean\n ) => {\n return scaleFromCenterOfObject\n ? (scaleY: float) => {\n const oldY = object.getCenterYInScene();\n object.setScaleY(scaleY);\n object.setCenterYInScene(oldY);\n }\n : (scaleY: float) => object.setScaleY(scaleY);\n };\n const getTweenObjectOpacitySetter = (\n object: gdjs.RuntimeObject & gdjs.OpacityHandler\n ) => {\n return (value: float) => object.setOpacity(value);\n };\n const getTweenObjectCharacterSizeSetter = (object: ICharacterScalable) => {\n return (value: float) => object.setCharacterSize(value);\n };\n const getTweenObjectNumberEffectPropertySetter = (\n effect: PixiFiltersTools.Filter,\n propertyName: string\n ) => {\n return (value: float) => {\n effect.updateDoubleParameter(propertyName, value);\n };\n };\n const getTweenObjectColorEffectPropertySetter = (\n effect: PixiFiltersTools.Filter,\n propertyName: string\n ) => {\n return ([hue, saturation, lightness]: number[]) => {\n const rgbFromHslColor = gdjs.evtTools.tween.hslToRgb(\n hue,\n saturation,\n lightness\n );\n effect.updateColorParameter(\n propertyName,\n gdjs.rgbToHexNumber(\n rgbFromHslColor[0],\n rgbFromHslColor[1],\n rgbFromHslColor[2]\n )\n );\n };\n };\n const getTweenObjectColorSetter = (\n object: IColorable,\n useHSLColorTransition: boolean\n ) => {\n if (useHSLColorTransition) {\n return ([hue, saturation, lightness]: number[]) => {\n const rgbFromHslColor = gdjs.evtTools.tween.hslToRgb(\n hue,\n saturation,\n lightness\n );\n object.setColor(\n Math.floor(rgbFromHslColor[0]) +\n ';' +\n Math.floor(rgbFromHslColor[1]) +\n ';' +\n Math.floor(rgbFromHslColor[2])\n );\n };\n } else {\n return ([red, green, blue]: number[]) => {\n object.setColor(\n Math.floor(red) + ';' + Math.floor(green) + ';' + Math.floor(blue)\n );\n };\n }\n };\n const getTweenObjectColorHSLSetter = (object: IColorable) => {\n return ([hue, saturation, lightness]: number[]) => {\n const rgbFromHslColor = gdjs.evtTools.tween.hslToRgb(\n hue,\n saturation,\n lightness\n );\n\n object.setColor(\n Math.floor(rgbFromHslColor[0]) +\n ';' +\n Math.floor(rgbFromHslColor[1]) +\n ';' +\n Math.floor(rgbFromHslColor[2])\n );\n };\n };\n\n const tweenSetterFactory =\n (object: RuntimeObject) =>\n (tweenInformation: TweenInformationNetworkSyncData) => {\n const type = tweenInformation.type;\n const variablePath = tweenInformation.variablePath;\n const effectName = tweenInformation.effectName;\n const propertyName = tweenInformation.propertyName;\n const scaleFromCenterOfObject =\n !!tweenInformation.scaleFromCenterOfObject;\n const useHSLColorTransition = !!tweenInformation.useHSLColorTransition;\n if (type === 'objectValue') {\n return tweenObjectValueSetter;\n }\n if (type === 'variable' && variablePath) {\n const variable = object\n .getVariables()\n .getVariableFromPath(variablePath);\n if (!variable) return () => {};\n return getTweenVariableSetter(variable);\n }\n if (type === 'positionX') {\n return getTweenObjectPositionXSetter(object);\n }\n if (type === 'positionY') {\n return getTweenObjectPositionYSetter(object);\n }\n if (type === 'position') {\n return getTweenObjectPositionSetter(object);\n }\n if (type === 'positionZ') {\n return getTweenObjectPositionZSetter(object);\n }\n if (type === 'width') {\n return getTweenObjectWidthSetter(object);\n }\n if (type === 'height') {\n return getTweenObjectHeightSetter(object);\n }\n if (type === 'depth') {\n if (!is3D(object)) return () => {};\n return getTweenObjectDepthSetter(object);\n }\n if (type === 'angle') {\n return getTweenObjectAngleSetter(object);\n }\n if (type === 'rotationX') {\n if (!is3D(object)) return () => {};\n return getTweenObjectRotationXSetter(object);\n }\n if (type === 'rotationY') {\n if (!is3D(object)) return () => {};\n return getTweenObjectRotationYSetter(object);\n }\n if (type === 'scale') {\n if (!isScalable(object)) return () => {};\n\n const object3d = is3D(object) ? object : null;\n return getTweenObjectScaleSetter(\n object,\n object3d,\n scaleFromCenterOfObject\n );\n }\n if (type === 'scaleXY') {\n if (!isScalable(object)) return () => {};\n return getTweenObjectScaleXYSetter(object, scaleFromCenterOfObject);\n }\n if (type === 'scaleX') {\n if (!isScalable(object)) return () => {};\n return getTweenObjectScaleXSetter(object, scaleFromCenterOfObject);\n }\n if (type === 'scaleY') {\n if (!isScalable(object)) return () => {};\n return getTweenObjectScaleYSetter(object, scaleFromCenterOfObject);\n }\n if (type === 'opacity') {\n if (!isOpaque(object)) return () => {};\n return getTweenObjectOpacitySetter(object);\n }\n if (type === 'characterSize') {\n if (!isCharacterScalable(object)) return () => {};\n return getTweenObjectCharacterSizeSetter(object);\n }\n if (type === 'numberEffectProperty' && effectName && propertyName) {\n const effect = object.getRendererEffects()[effectName];\n if (!effect) {\n logger.error(\n `The object \"${object.name}\" doesn't have any effect called \"${effectName}\"`\n );\n }\n return getTweenObjectNumberEffectPropertySetter(effect, propertyName);\n }\n if (type === 'colorEffectProperty' && effectName && propertyName) {\n const effect = object.getRendererEffects()[effectName];\n if (!effect) {\n logger.error(\n `The object \"${object.name}\" doesn't have any effect called \"${effectName}\"`\n );\n }\n\n return getTweenObjectColorEffectPropertySetter(effect, propertyName);\n }\n\n if (type === 'objectColor') {\n if (!isColorable(object)) return () => {};\n\n return getTweenObjectColorSetter(object, useHSLColorTransition);\n }\n if (type === 'objectColorHSL') {\n if (!isColorable(object)) return () => {};\n\n return getTweenObjectColorHSLSetter(object);\n }\n\n return () => {};\n };\n\n export class TweenRuntimeBehavior extends gdjs.RuntimeBehavior {\n private _tweens = new gdjs.evtTools.tween.TweenManager();\n private _isActive: boolean = true;\n\n /**\n * @param instanceContainer The instance container the behavior belongs to.\n * @param behaviorData The data to initialize the behavior\n * @param owner The runtime object the behavior belongs to.\n */\n constructor(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n behaviorData: BehaviorData,\n owner: gdjs.RuntimeObject\n ) {\n super(instanceContainer, behaviorData, owner);\n }\n\n updateFromBehaviorData(\n oldBehaviorData: BehaviorData,\n newBehaviorData: BehaviorData\n ): boolean {\n // Nothing to update.\n return true;\n }\n\n getNetworkSyncData(\n syncOptions: GetNetworkSyncDataOptions\n ): TweenBehaviorNetworkSyncData {\n return {\n ...super.getNetworkSyncData(syncOptions),\n props: {\n tweenManager: this._tweens.getNetworkSyncData(),\n },\n };\n }\n\n updateFromNetworkSyncData(\n networkSyncData: TweenBehaviorNetworkSyncData,\n options: UpdateFromNetworkSyncDataOptions\n ): void {\n super.updateFromNetworkSyncData(networkSyncData, options);\n\n if (networkSyncData.props.tweenManager) {\n this._tweens.updateFromNetworkSyncData(\n networkSyncData.props.tweenManager,\n (tweenInformationNetworkSyncData) => {\n return this.owner;\n },\n (tweenInformationNetworkSyncData) => {\n return tweenSetterFactory(this.owner)(\n tweenInformationNetworkSyncData\n );\n },\n (tweenInformationNetworkSyncData) => {\n return tweenInformationNetworkSyncData.destroyObjectWhenFinished\n ? () => this._deleteFromScene()\n : null;\n }\n );\n }\n }\n\n doStepPreEvents(instanceContainer: gdjs.RuntimeInstanceContainer): void {\n this._tweens.step();\n }\n\n private _deleteFromScene() {\n this.owner.deleteFromScene();\n }\n\n /**\n * Add an object variable tween.\n * @deprecated Use addVariableTween3 instead.\n * This function is misleading since one could think that the tween starts\n * right at the moment this function is called whereas the value of the variable\n * will change at the next frame only. Moreover, the variable will not start from\n * the start value exactly since time will have passed at the moment the next\n * frame is rendered.\n * See https://github.com/4ian/GDevelop/issues/4270\n * @param identifier Unique id to identify the tween\n * @param variable The object variable to store the tweened value\n * @param fromValue Start value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addVariableTween(\n identifier: string,\n variable: gdjs.Variable,\n fromValue: float,\n toValue: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._tweens.addSimpleTween(\n identifier,\n this.owner.getRuntimeScene(),\n duration / 1000,\n easing,\n linearInterpolation,\n fromValue,\n toValue,\n getTweenVariableSetter(variable),\n {\n type: 'variable',\n variable,\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object variable.\n * @deprecated Use addVariableTween3 instead.\n * @param identifier Unique id to identify the tween\n * @param variable The object variable to store the tweened value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addVariableTween2(\n identifier: string,\n variable: gdjs.Variable,\n toValue: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addVariableTween(\n identifier,\n variable,\n toValue,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object variable.\n * @param identifier Unique id to identify the tween\n * @param variable The object variable to store the tweened value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addVariableTween3(\n identifier: string,\n variable: gdjs.Variable,\n toValue: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addVariableTween(\n identifier,\n variable,\n toValue,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addVariableTween(\n identifier: string,\n variable: gdjs.Variable,\n toValue: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n if (variable.getType() !== 'number') {\n return;\n }\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n variable.getValue() as number,\n toValue,\n getTweenVariableSetter(variable),\n {\n type: 'variable',\n variable,\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Add an object value tween.\n * @param identifier Unique id to identify the tween\n * @param fromValue Start value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param useExponentialInterpolation Set it to true to use a exponential\n * It's useful for values that are factors like a scale or a zoom.\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addValueTween(\n identifier: string,\n fromValue: float,\n toValue: float,\n easing: string,\n duration: float,\n useExponentialInterpolation: boolean,\n destroyObjectWhenFinished: boolean\n ) {\n this._tweens.addSimpleTween(\n identifier,\n this.owner,\n duration,\n easing,\n useExponentialInterpolation\n ? exponentialInterpolation\n : linearInterpolation,\n fromValue,\n toValue,\n tweenObjectValueSetter,\n {\n type: 'objectValue',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object position.\n * @deprecated Use addObjectPositionTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toX The target X position\n * @param toY The target Y position\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionTween(\n identifier: string,\n toX: number,\n toY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionTween(\n identifier,\n toX,\n toY,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object position.\n * @param identifier Unique id to identify the tween\n * @param toX The target X position\n * @param toY The target Y position\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionTween2(\n identifier: string,\n toX: number,\n toY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionTween(\n identifier,\n toX,\n toY,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectPositionTween(\n identifier: string,\n toX: number,\n toY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n this._tweens.addMultiTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n [this.owner.getX(), this.owner.getY()],\n [toX, toY],\n getTweenObjectPositionSetter(this.owner),\n {\n type: 'position',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object X position.\n * @deprecated Use addObjectPositionXTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toX The target X position\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionXTween(\n identifier: string,\n toX: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionXTween(\n identifier,\n toX,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object X position.\n * @param identifier Unique id to identify the tween\n * @param toX The target X position\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionXTween2(\n identifier: string,\n toX: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionXTween(\n identifier,\n toX,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectPositionXTween(\n identifier: string,\n toX: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n this.owner.getX(),\n toX,\n getTweenObjectPositionXSetter(this.owner),\n {\n type: 'positionX',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object Y position.\n * @deprecated Use addObjectPositionYTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toY The target Y position\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionYTween(\n identifier: string,\n toY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionYTween(\n identifier,\n toY,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object Y position.\n * @param identifier Unique id to identify the tween\n * @param toY The target Y position\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionYTween2(\n identifier: string,\n toY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionYTween(\n identifier,\n toY,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectPositionYTween(\n identifier: string,\n toY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n this.owner.getY(),\n toY,\n getTweenObjectPositionYSetter(this.owner),\n {\n type: 'positionY',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object Z position.\n * @deprecated Use addObjectPositionZTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toZ The target Z position\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionZTween(\n identifier: string,\n toZ: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionZTween(\n identifier,\n toZ,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object Z position.\n * @param object3DBehavior Only used by events can be set to null\n * @param identifier Unique id to identify the tween\n * @param toZ The target Z position\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectPositionZTween2(\n object3DBehavior: any,\n identifier: string,\n toZ: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectPositionZTween(\n identifier,\n toZ,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectPositionZTween(\n identifier: string,\n toZ: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n const { owner } = this;\n if (!is3D(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n owner.getZ(),\n toZ,\n getTweenObjectPositionZSetter(owner),\n {\n type: 'positionZ',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object angle.\n * @deprecated Use addObjectAngleTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toAngle The target angle\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectAngleTween(\n identifier: string,\n toAngle: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectAngleTween(\n identifier,\n toAngle,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object angle.\n * @param identifier Unique id to identify the tween\n * @param toAngle The target angle\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectAngleTween2(\n identifier: string,\n toAngle: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectAngleTween(\n identifier,\n toAngle,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectAngleTween(\n identifier: string,\n toAngle: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n this.owner.getAngle(),\n toAngle,\n getTweenObjectAngleSetter(this.owner),\n {\n type: 'angle',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween a 3D object rotation X.\n * @param object3DBehavior Only used by events can be set to null\n * @param identifier Unique id to identify the tween\n * @param toAngle The target angle\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectRotationXTween(\n object3DBehavior: any,\n identifier: string,\n toAngle: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n const { owner } = this;\n if (!is3D(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n this.owner,\n duration,\n easing,\n linearInterpolation,\n owner.getRotationX(),\n toAngle,\n getTweenObjectRotationXSetter(owner),\n {\n type: 'rotationX',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween a 3D object rotation Y.\n * @param object3DBehavior Only used by events can be set to null\n * @param identifier Unique id to identify the tween\n * @param toAngle The target angle\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectRotationYTween(\n object3DBehavior: any,\n identifier: string,\n toAngle: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n const { owner } = this;\n if (!is3D(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n this.owner,\n duration,\n easing,\n linearInterpolation,\n owner.getRotationY(),\n toAngle,\n getTweenObjectRotationYSetter(owner),\n {\n type: 'rotationY',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object scale.\n * @deprecated Use addObjectScaleTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toScaleX The target X-scale\n * @param toScaleY The target Y-scale\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleTween(\n identifier: string,\n toScaleX: number,\n toScaleY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleTween(\n identifier,\n toScaleX,\n toScaleY,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner.getRuntimeScene(),\n linearInterpolation\n );\n }\n\n /**\n * Tween an object scale.\n * @deprecated Use addObjectScaleXTween2 and addObjectScaleYTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toScaleX The target X-scale\n * @param toScaleY The target Y-scale\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleTween2(\n identifier: string,\n toScaleX: number,\n toScaleY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleTween(\n identifier,\n toScaleX,\n toScaleY,\n easing,\n duration,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner,\n exponentialInterpolation\n );\n }\n\n private _addObjectScaleTween(\n identifier: string,\n toScaleX: number,\n toScaleY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource,\n interpolation: gdjs.evtTools.tween.Interpolation\n ) {\n const owner = this.owner;\n if (!isScalable(owner)) return;\n\n if (toScaleX < 0) toScaleX = 0;\n if (toScaleY < 0) toScaleY = 0;\n\n this._tweens.addMultiTween(\n identifier,\n timeSource,\n duration,\n easing,\n interpolation,\n [owner.getScaleX(), owner.getScaleY()],\n [toScaleX, toScaleY],\n getTweenObjectScaleXYSetter(owner, scaleFromCenterOfObject),\n {\n type: 'scaleXY',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object scale.\n * @param identifier Unique id to identify the tween\n * @param toScale The target scale\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleTween3(\n identifier: string,\n toScale: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleXTween(\n identifier,\n toScale,\n easing,\n duration,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner,\n exponentialInterpolation\n );\n const owner = this.owner;\n if (!isScalable(owner)) return;\n\n // This action doesn't require 3D capabilities.\n // So, gdjs.RuntimeObject3D may not exist\n // when the 3D extension is not used.\n const owner3d = is3D(owner) ? owner : null;\n\n this._tweens.addSimpleTween(\n identifier,\n this.owner,\n duration,\n easing,\n exponentialInterpolation,\n owner.getScale(),\n toScale,\n getTweenObjectScaleSetter(owner, owner3d, scaleFromCenterOfObject),\n {\n type: 'scale',\n scaleFromCenterOfObject,\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object X-scale.\n * @deprecated Use addObjectScaleXTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toScaleX The target X-scale\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleXTween(\n identifier: string,\n toScaleX: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleXTween(\n identifier,\n toScaleX,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner.getRuntimeScene(),\n linearInterpolation\n );\n }\n\n /**\n * Tween an object X-scale.\n * @param identifier Unique id to identify the tween\n * @param toScaleX The target X-scale\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleXTween2(\n identifier: string,\n toScaleX: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleXTween(\n identifier,\n toScaleX,\n easing,\n duration,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner,\n exponentialInterpolation\n );\n }\n\n private _addObjectScaleXTween(\n identifier: string,\n toScaleX: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource,\n interpolation: gdjs.evtTools.tween.Interpolation\n ) {\n const owner = this.owner;\n if (!isScalable(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n interpolation,\n owner.getScaleX(),\n toScaleX,\n getTweenObjectScaleXSetter(owner, scaleFromCenterOfObject),\n {\n type: 'scaleX',\n scaleFromCenterOfObject,\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object Y-scale.\n * @deprecated Use addObjectScaleYTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toScaleY The target Y-scale\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleYTween(\n identifier: string,\n toScaleY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleYTween(\n identifier,\n toScaleY,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner.getRuntimeScene(),\n linearInterpolation\n );\n }\n\n /**\n * Tween an object Y-scale.\n * @param identifier Unique id to identify the tween\n * @param toScaleY The target Y-scale\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param scaleFromCenterOfObject Scale the transform from the center of the object (or point that is called center), not the top-left origin\n */\n addObjectScaleYTween2(\n identifier: string,\n toScaleY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean\n ) {\n this._addObjectScaleYTween(\n identifier,\n toScaleY,\n easing,\n duration,\n destroyObjectWhenFinished,\n scaleFromCenterOfObject,\n this.owner,\n exponentialInterpolation\n );\n }\n\n private _addObjectScaleYTween(\n identifier: string,\n toScaleY: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n scaleFromCenterOfObject: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource,\n interpolation: gdjs.evtTools.tween.Interpolation\n ) {\n const owner = this.owner;\n if (!isScalable(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n interpolation,\n owner.getScaleY(),\n toScaleY,\n getTweenObjectScaleYSetter(owner, scaleFromCenterOfObject),\n {\n type: 'scaleY',\n scaleFromCenterOfObject,\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object opacity.\n * @deprecated Use addObjectOpacityTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toOpacity The target opacity\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectOpacityTween(\n identifier: string,\n toOpacity: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectOpacityTween(\n identifier,\n toOpacity,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object opacity.\n * @param identifier Unique id to identify the tween\n * @param toOpacity The target opacity\n * @param easing Easing function identifier\n * @param duration Duration in second\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectOpacityTween2(\n identifier: string,\n toOpacity: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectOpacityTween(\n identifier,\n toOpacity,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectOpacityTween(\n identifier: string,\n toOpacity: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n const owner = this.owner;\n if (!isOpaque(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n owner.getOpacity(),\n toOpacity,\n getTweenObjectOpacitySetter(owner),\n {\n type: 'opacity',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween a numeric object effect property.\n * @param effectBehavior Only used by events can be set to null\n * @param identifier Unique id to identify the tween\n * @param toValue The targeted value\n * @param effectName Effect name\n * @param propertyName Property name\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addNumberEffectPropertyTween(\n effectBehavior: any,\n identifier: string,\n toValue: float,\n effectName: string,\n propertyName: string,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n const effect = this.owner.getRendererEffects()[effectName];\n if (!effect) {\n logger.error(\n `The object \"${this.owner.name}\" doesn't have any effect called \"${effectName}\"`\n );\n }\n this._tweens.addSimpleTween(\n identifier,\n this.owner,\n duration,\n easing,\n linearInterpolation,\n effect ? effect.getDoubleParameter(propertyName) : 0,\n toValue,\n getTweenObjectNumberEffectPropertySetter(effect, propertyName),\n {\n type: 'numberEffectProperty',\n effectName,\n propertyName,\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween a color object effect property.\n * @param effectBehavior Only used by events can be set to null\n * @param identifier Unique id to identify the tween\n * @param toColorStr The target RGB color (format \"128;200;255\" with values between 0 and 255 for red, green and blue)\n * @param effectName Effect name\n * @param propertyName Property name\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addColorEffectPropertyTween(\n effectBehavior: any,\n identifier: string,\n toColorStr: string,\n effectName: string,\n propertyName: string,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n const effect = this.owner.getRendererEffects()[effectName];\n if (!effect) {\n logger.error(\n `The object \"${this.owner.name}\" doesn't have any effect called \"${effectName}\"`\n );\n }\n const rgbFromColor = gdjs.hexNumberToRGB(\n effect ? effect.getColorParameter(propertyName) : 0\n );\n const rgbToColor: float[] = gdjs.rgbOrHexToRGBColor(toColorStr);\n\n this._tweens.addMultiTween(\n identifier,\n this.owner,\n duration,\n easing,\n linearInterpolation,\n gdjs.evtTools.tween.rgbToHsl(\n rgbFromColor.r,\n rgbFromColor.g,\n rgbFromColor.b\n ),\n gdjs.evtTools.tween.rgbToHsl(\n rgbToColor[0],\n rgbToColor[1],\n rgbToColor[2]\n ),\n getTweenObjectColorEffectPropertySetter(effect, propertyName),\n {\n type: 'colorEffectProperty',\n effectName,\n propertyName,\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object color.\n * @deprecated Use addObjectColorTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toColorStr The target RGB color (format \"128;200;255\" with values between 0 and 255 for red, green and blue)\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param useHSLColorTransition Tween using HSL color mappings, rather than direct RGB line\n */\n addObjectColorTween(\n identifier: string,\n toColorStr: string,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n useHSLColorTransition: boolean\n ) {\n this._addObjectColorTween(\n identifier,\n toColorStr,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n useHSLColorTransition,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object color.\n * @param identifier Unique id to identify the tween\n * @param toColorStr The target RGB color (format \"128;200;255\" with values between 0 and 255 for red, green and blue)\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n * @param useHSLColorTransition Tween using HSL color mappings, rather than direct RGB line\n */\n addObjectColorTween2(\n identifier: string,\n toColorStr: string,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n useHSLColorTransition: boolean = true\n ) {\n this._addObjectColorTween(\n identifier,\n toColorStr,\n easing,\n duration,\n destroyObjectWhenFinished,\n useHSLColorTransition,\n this.owner\n );\n }\n\n private _addObjectColorTween(\n identifier: string,\n toColorStr: string,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n useHSLColorTransition: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n const owner = this.owner;\n if (!isColorable(owner)) {\n return;\n }\n\n const rgbFromColor: float[] = gdjs.rgbOrHexToRGBColor(owner.getColor());\n const rgbToColor: float[] = gdjs.rgbOrHexToRGBColor(toColorStr);\n\n const initialValue = useHSLColorTransition\n ? gdjs.evtTools.tween.rgbToHsl(\n rgbFromColor[0],\n rgbFromColor[1],\n rgbFromColor[2]\n )\n : rgbFromColor;\n const targetedValue = useHSLColorTransition\n ? gdjs.evtTools.tween.rgbToHsl(\n rgbToColor[0],\n rgbToColor[1],\n rgbToColor[2]\n )\n : rgbToColor;\n\n this._tweens.addMultiTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n initialValue,\n targetedValue,\n getTweenObjectColorSetter(owner, useHSLColorTransition),\n {\n type: 'objectColor',\n useHSLColorTransition,\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object HSL color, with the \"to\" color given using HSL (H: any number, S and L: 0-100).\n * @deprecated Use addObjectColorHSLTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toHue The target hue, or the same as the from color's hue if blank\n * @param animateHue include hue in calculations, as can't set this to -1 as default to ignore\n * @param toSaturation The target saturation, or the same as the from color's saturation if blank\n * @param toLightness The target lightness, or the same as the from color's lightness if blank\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectColorHSLTween(\n identifier: string,\n toHue: number,\n animateHue: boolean,\n toSaturation: number,\n toLightness: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectColorHSLTween(\n identifier,\n toHue,\n animateHue,\n toSaturation,\n toLightness,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object HSL color, with the \"to\" color given using HSL (H: any number, S and L: 0-100).\n * @param identifier Unique id to identify the tween\n * @param toHue The target hue, or the same as the from color's hue if blank\n * @param animateHue include hue in calculations, as can't set this to -1 as default to ignore\n * @param toSaturation The target saturation, or the same as the from color's saturation if blank\n * @param toLightness The target lightness, or the same as the from color's lightness if blank\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectColorHSLTween2(\n identifier: string,\n toHue: number,\n animateHue: boolean,\n toSaturation: number,\n toLightness: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectColorHSLTween(\n identifier,\n toHue,\n animateHue,\n toSaturation,\n toLightness,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectColorHSLTween(\n identifier: string,\n toHue: number,\n animateHue: boolean,\n toSaturation: number,\n toLightness: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n if (!isColorable(this.owner)) return;\n const owner = this.owner;\n\n const rgbFromColor = gdjs.rgbOrHexToRGBColor(owner.getColor());\n const hslFromColor = gdjs.evtTools.tween.rgbToHsl(\n rgbFromColor[0],\n rgbFromColor[1],\n rgbFromColor[2]\n );\n\n const toH = animateHue ? toHue : hslFromColor[0];\n const toS =\n -1 === toSaturation\n ? hslFromColor[1]\n : Math.min(Math.max(toSaturation, 0), 100);\n const toL =\n -1 === toLightness\n ? hslFromColor[2]\n : Math.min(Math.max(toLightness, 0), 100);\n\n this._tweens.addMultiTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n hslFromColor,\n [toH, toS, toL],\n getTweenObjectColorHSLSetter(owner),\n {\n type: 'objectColorHSL',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween a text object character size.\n * @deprecated Use addTextObjectCharacterSizeTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toSize The target character size\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addTextObjectCharacterSizeTween(\n identifier: string,\n toSize: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addTextObjectCharacterSizeTween(\n identifier,\n toSize,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene(),\n linearInterpolation\n );\n }\n\n /**\n * Tween a text object character size.\n * @param identifier Unique id to identify the tween\n * @param toSize The target character size\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addTextObjectCharacterSizeTween2(\n identifier: string,\n toSize: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addTextObjectCharacterSizeTween(\n identifier,\n toSize,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner,\n exponentialInterpolation\n );\n }\n\n private _addTextObjectCharacterSizeTween(\n identifier: string,\n toSize: number,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource,\n interpolation: gdjs.evtTools.tween.Interpolation\n ) {\n const owner = this.owner;\n if (!isCharacterScalable(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n interpolation,\n owner.getCharacterSize(),\n toSize,\n getTweenObjectCharacterSizeSetter(owner),\n {\n type: 'characterSize',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object width.\n * @deprecated Use addObjectWidthTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toWidth The target width\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectWidthTween(\n identifier: string,\n toWidth: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectWidthTween(\n identifier,\n toWidth,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object width.\n * @param identifier Unique id to identify the tween\n * @param toWidth The target width\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectWidthTween2(\n identifier: string,\n toWidth: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectWidthTween(\n identifier,\n toWidth,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectWidthTween(\n identifier: string,\n toWidth: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n this.owner.getWidth(),\n toWidth,\n getTweenObjectWidthSetter(this.owner),\n {\n type: 'width',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object height.\n * @deprecated Use addObjectHeightTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toHeight The target height\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectHeightTween(\n identifier: string,\n toHeight: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectHeightTween(\n identifier,\n toHeight,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object height.\n * @param identifier Unique id to identify the tween\n * @param toHeight The target height\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectHeightTween2(\n identifier: string,\n toHeight: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectHeightTween(\n identifier,\n toHeight,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectHeightTween(\n identifier: string,\n toHeight: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n this.owner.getHeight(),\n toHeight,\n getTweenObjectHeightSetter(this.owner),\n {\n type: 'height',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween an object depth.\n * @deprecated Use addObjectDepthTween2 instead.\n * @param identifier Unique id to identify the tween\n * @param toDepth The target depth\n * @param easing Easing function identifier\n * @param duration Duration in milliseconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectDepthTween(\n identifier: string,\n toDepth: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectDepthTween(\n identifier,\n toDepth,\n easing,\n duration / 1000,\n destroyObjectWhenFinished,\n this.owner.getRuntimeScene()\n );\n }\n\n /**\n * Tween an object depth.\n * @param object3DBehavior Only used by events can be set to null\n * @param identifier Unique id to identify the tween\n * @param toDepth The target depth\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param destroyObjectWhenFinished Destroy this object when the tween ends\n */\n addObjectDepthTween2(\n object3DBehavior: any,\n identifier: string,\n toDepth: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean\n ) {\n this._addObjectDepthTween(\n identifier,\n toDepth,\n easing,\n duration,\n destroyObjectWhenFinished,\n this.owner\n );\n }\n\n private _addObjectDepthTween(\n identifier: string,\n toDepth: float,\n easing: string,\n duration: float,\n destroyObjectWhenFinished: boolean,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) {\n const { owner } = this;\n if (!is3D(owner)) return;\n\n this._tweens.addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n owner.getDepth(),\n toDepth,\n getTweenObjectDepthSetter(owner),\n {\n type: 'depth',\n destroyObjectWhenFinished,\n },\n destroyObjectWhenFinished ? () => this._deleteFromScene() : null\n );\n }\n\n /**\n * Tween is playing.\n * @param identifier Unique id to identify the tween\n */\n isPlaying(identifier: string): boolean {\n return this._tweens.isPlaying(identifier);\n }\n\n /**\n * Tween exists.\n * @param identifier Unique id to identify the tween\n * @returns The tween exists\n */\n exists(identifier: string): boolean {\n return this._tweens.exists(identifier);\n }\n\n /**\n * Tween has finished.\n * @param identifier Unique id to identify the tween\n */\n hasFinished(identifier: string): boolean {\n return this._tweens.hasFinished(identifier);\n }\n\n /**\n * Pause a tween.\n * @param identifier Unique id to identify the tween\n */\n pauseTween(identifier: string) {\n if (this._isActive) {\n this._tweens.pauseTween(identifier);\n }\n }\n\n /**\n * Stop a tween.\n * @param identifier Unique id to identify the tween\n * @param jumpToDest Move to destination\n */\n stopTween(identifier: string, jumpToDest: boolean) {\n if (this._isActive) {\n this._tweens.stopTween(identifier, jumpToDest);\n }\n }\n\n /**\n * Resume a tween.\n * @param identifier Unique id to identify the tween\n */\n resumeTween(identifier: string) {\n if (this._isActive) {\n this._tweens.resumeTween(identifier);\n }\n }\n\n /**\n * Remove a tween.\n * @param identifier Unique id to identify the tween\n */\n removeTween(identifier: string) {\n this._tweens.removeTween(identifier);\n }\n\n /**\n * Get tween progress.\n * @param identifier Unique id to identify the tween\n * @returns Progress of playing tween animation (between 0.0 and 1.0)\n */\n getProgress(identifier: string): float {\n return this._tweens.getProgress(identifier);\n }\n\n /**\n * Get tween value.\n *\n * It returns 0 for tweens with several values.\n *\n * @param identifier Unique id to identify the tween\n * @returns Value of playing tween animation\n */\n getValue(identifier: string): float {\n return this._tweens.getValue(identifier);\n }\n\n onDeActivate() {\n this._isActive = false;\n }\n\n onActivate() {\n this._isActive = true;\n }\n }\n gdjs.registerBehavior('Tween::TweenBehavior', gdjs.TweenRuntimeBehavior);\n}\n"],
|
|
5
|
+
"mappings": "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CA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,KAAK,MACL,EACA,EACA,EACI,EACA,EACJ,EACA,EACA,EACA,CACE,KAAM,cACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAchE,uBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,wBACH,EACA,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAaf,wBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,wBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,wBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,cACX,EACA,EACA,EACA,EACA,EACA,CAAC,KAAK,MAAM,OAAQ,KAAK,MAAM,QAC/B,CAAC,EAAK,GACN,EAA6B,KAAK,OAClC,CACE,KAAM,WACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAahE,wBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,yBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,yBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,yBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,yBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,OACX,EACA,EAA8B,KAAK,OACnC,CACE,KAAM,YACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAahE,wBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,yBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,yBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,yBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,yBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,OACX,EACA,EAA8B,KAAK,OACnC,CACE,KAAM,YACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAahE,wBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,yBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAaf,yBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,yBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,yBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,CAAE,SAAU,KAClB,AAAI,CAAC,EAAK,IAEV,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,OACN,EACA,EAA8B,GAC9B,CACE,KAAM,YACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAahE,oBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,qBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,WACX,EACA,EAA0B,KAAK,OAC/B,CACE,KAAM,QACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAahE,wBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,CAAE,SAAU,KAClB,AAAI,CAAC,EAAK,IAEV,KAAK,QAAQ,eACX,EACA,KAAK,MACL,EACA,EACA,EACA,EAAM,eACN,EACA,EAA8B,GAC9B,CACE,KAAM,YACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAahE,wBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,CAAE,SAAU,KAClB,AAAI,CAAC,EAAK,IAEV,KAAK,QAAQ,eACX,EACA,KAAK,MACL,EACA,EACA,EACA,EAAM,eACN,EACA,EAA8B,GAC9B,CACE,KAAM,YACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAehE,oBACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EAAW,IACX,EACA,EACA,KAAK,MAAM,kBACX,GAeJ,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,AAAI,CAAC,EAAW,IAEZ,GAAW,GAAG,GAAW,GACzB,EAAW,GAAG,GAAW,GAE7B,KAAK,QAAQ,cACX,EACA,EACA,EACA,EACA,EACA,CAAC,EAAM,YAAa,EAAM,aAC1B,CAAC,EAAU,GACX,EAA4B,EAAO,GACnC,CACE,KAAM,UACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,OAahE,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAEF,KAAM,GAAQ,KAAK,MACnB,GAAI,CAAC,EAAW,GAAQ,OAKxB,KAAM,GAAU,EAAK,GAAS,EAAQ,KAEtC,KAAK,QAAQ,eACX,EACA,KAAK,MACL,EACA,EACA,EACA,EAAM,WACN,EACA,EAA0B,EAAO,EAAS,GAC1C,CACE,KAAM,QACN,0BACA,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAchE,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EAAW,IACX,EACA,EACA,KAAK,MAAM,kBACX,GAaJ,sBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,sBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,AAAI,CAAC,EAAW,IAEhB,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,YACN,EACA,EAA2B,EAAO,GAClC,CACE,KAAM,SACN,0BACA,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAchE,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EAAW,IACX,EACA,EACA,KAAK,MAAM,kBACX,GAaJ,sBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,sBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,AAAI,CAAC,EAAW,IAEhB,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,YACN,EACA,EAA2B,EAAO,GAClC,CACE,KAAM,SACN,0BACA,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAahE,sBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,uBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,uBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,uBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,uBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,AAAI,CAAC,EAAS,IAEd,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,aACN,EACA,EAA4B,GAC5B,CACE,KAAM,UACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAehE,6BACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAS,KAAK,MAAM,qBAAqB,GAC/C,AAAK,GACH,EAAO,MACL,eAAe,KAAK,MAAM,yCAAyC,MAGvE,KAAK,QAAQ,eACX,EACA,KAAK,MACL,EACA,EACA,EACA,EAAS,EAAO,mBAAmB,GAAgB,EACnD,EACA,EAAyC,EAAQ,GACjD,CACE,KAAM,uBACN,aACA,eACA,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAehE,4BACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAS,KAAK,MAAM,qBAAqB,GAC/C,AAAK,GACH,EAAO,MACL,eAAe,KAAK,MAAM,yCAAyC,MAGvE,KAAM,GAAe,EAAK,eACxB,EAAS,EAAO,kBAAkB,GAAgB,GAE9C,EAAsB,EAAK,mBAAmB,GAEpD,KAAK,QAAQ,cACX,EACA,KAAK,MACL,EACA,EACA,EACA,EAAK,SAAS,MAAM,SAClB,EAAa,EACb,EAAa,EACb,EAAa,GAEf,EAAK,SAAS,MAAM,SAClB,EAAW,GACX,EAAW,GACX,EAAW,IAEb,EAAwC,EAAQ,GAChD,CACE,KAAM,sBACN,aACA,eACA,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAchE,oBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EAAW,IACX,EACA,EACA,KAAK,MAAM,mBAaf,qBACE,EACA,EACA,EACA,EACA,EACA,EAAiC,GACjC,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,GAAI,CAAC,EAAY,GACf,OAGF,KAAM,GAAwB,EAAK,mBAAmB,EAAM,YACtD,EAAsB,EAAK,mBAAmB,GAE9C,EAAe,EACjB,EAAK,SAAS,MAAM,SAClB,EAAa,GACb,EAAa,GACb,EAAa,IAEf,EACE,EAAgB,EAClB,EAAK,SAAS,MAAM,SAClB,EAAW,GACX,EAAW,GACX,EAAW,IAEb,EAEJ,KAAK,QAAQ,cACX,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EAA0B,EAAO,GACjC,CACE,KAAM,cACN,wBACA,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAgBhE,uBACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,wBACH,EACA,EACA,EACA,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAef,wBACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,wBACH,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,wBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,GAAI,CAAC,EAAY,KAAK,OAAQ,OAC9B,KAAM,GAAQ,KAAK,MAEb,EAAe,EAAK,mBAAmB,EAAM,YAC7C,EAAe,EAAK,SAAS,MAAM,SACvC,EAAa,GACb,EAAa,GACb,EAAa,IAGT,EAAM,EAAa,EAAQ,EAAa,GACxC,EACJ,AAAO,IAAP,GACI,EAAa,GACb,KAAK,IAAI,KAAK,IAAI,EAAc,GAAI,KACpC,EACJ,AAAO,IAAP,GACI,EAAa,GACb,KAAK,IAAI,KAAK,IAAI,EAAa,GAAI,KAEzC,KAAK,QAAQ,cACX,EACA,EACA,EACA,EACA,EACA,EACA,CAAC,EAAK,EAAK,GACX,EAA6B,GAC7B,CACE,KAAM,iBACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAahE,gCACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,iCACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,kBACX,GAYJ,iCACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,iCACH,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,iCACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,AAAI,CAAC,EAAoB,IAEzB,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,mBACN,EACA,EAAkC,GAClC,CACE,KAAM,gBACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAahE,oBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,qBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,WACX,EACA,EAA0B,KAAK,OAC/B,CACE,KAAM,QACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAahE,qBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,sBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,sBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,YACX,EACA,EAA2B,KAAK,OAChC,CACE,KAAM,SACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAahE,oBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAaf,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,CAAE,SAAU,KAClB,AAAI,CAAC,EAAK,IAEV,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,WACN,EACA,EAA0B,GAC1B,CACE,KAAM,QACN,6BAEF,EAA4B,IAAM,KAAK,mBAAqB,MAQhE,UAAU,EAA6B,CACrC,MAAO,MAAK,QAAQ,UAAU,GAQhC,OAAO,EAA6B,CAClC,MAAO,MAAK,QAAQ,OAAO,GAO7B,YAAY,EAA6B,CACvC,MAAO,MAAK,QAAQ,YAAY,GAOlC,WAAW,EAAoB,CAC7B,AAAI,KAAK,WACP,KAAK,QAAQ,WAAW,GAS5B,UAAU,EAAoB,EAAqB,CACjD,AAAI,KAAK,WACP,KAAK,QAAQ,UAAU,EAAY,GAQvC,YAAY,EAAoB,CAC9B,AAAI,KAAK,WACP,KAAK,QAAQ,YAAY,GAQ7B,YAAY,EAAoB,CAC9B,KAAK,QAAQ,YAAY,GAQ3B,YAAY,EAA2B,CACrC,MAAO,MAAK,QAAQ,YAAY,GAWlC,SAAS,EAA2B,CAClC,MAAO,MAAK,QAAQ,SAAS,GAG/B,cAAe,CACb,KAAK,UAAY,GAGnB,YAAa,CACX,KAAK,UAAY,IA5zDd,EAAM,uBA+zDb,EAAK,iBAAiB,uBAAwB,EAAK,wBA5qE3C",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var gdjs;(function(
|
|
1
|
+
var gdjs;(function(c){let F;(function(R){let M;(function(a){const y=new c.Logger("Tween"),p=e=>t=>e.setNumber(t),x=e=>{},S=e=>{},w=e=>([t,n])=>{e.setCameraX(t),e.setCameraY(n)},C=e=>t=>e.setCameraRotation(t),L=e=>t=>e.setCameraZoom(t),v=(e,t)=>n=>{e&&e.updateDoubleParameter(t,n)},P=(e,t)=>([n,r,s])=>{if(e){const o=c.evtTools.tween.hslToRgb(n,r,s);e.updateColorParameter(t,c.rgbToHexNumber(o[0],o[1],o[2]))}};a.tweenSetterFactory=e=>t=>{const n=t.type,r=t.layerName,s=t.variablePath,o=t.effectName,i=t.propertyName;if(n==="variable"&&s){const l=e.getVariables().getVariableFromPath(s);return l?p(l):()=>{}}if(n==="cameraZoom"&&r!==void 0){const l=e.getLayer(r);return L(l)}if(n==="cameraRotation"&&r!==void 0){const l=e.getLayer(r);return C(l)}if(n==="cameraPosition"&&r!==void 0){const l=e.getLayer(r);return w(l)}if(n==="colorEffectProperty"&&r!==void 0&&o&&i){const g=e.getLayer(r).getRendererEffects()[o];return g||y.error(`The layer "${r}" doesn't have any effect called "${o}"`),P(g,i)}if(n==="numberEffectProperty"&&r!==void 0&&o&&i){const g=e.getLayer(r).getRendererEffects()[o];return g||y.error(`The layer "${r}" doesn't have any effect called "${o}"`),v(g,i)}return n==="layoutValue"?x:n==="layerValue"?S:()=>{}},a.getTweensMap=e=>e._tweens||(e._tweens=new c.evtTools.tween.TweenManager),c.registerRuntimeScenePreEventsCallback(function(e){c.evtTools.tween.getTweensMap(e).step()}),c.registerRuntimeSceneGetSyncDataCallback(function(e,t,n){if(!n.syncTweens)return;const r=c.evtTools.tween.getTweensMap(e).getNetworkSyncData();t.tween=r}),c.registerRuntimeSceneUpdateFromSyncDataCallback(function(e,t,n){!t.tween||c.evtTools.tween.getTweensMap(e).updateFromNetworkSyncData(t.tween,r=>r.layerName!==void 0?e.getLayer(r.layerName):e,r=>c.evtTools.tween.tweenSetterFactory(e)(r),()=>null)}),a.sceneTweenExists=(e,t)=>a.getTweensMap(e).exists(t),a.sceneTweenIsPlaying=(e,t)=>a.getTweensMap(e).isPlaying(t),a.sceneTweenHasFinished=(e,t)=>a.getTweensMap(e).hasFinished(t),a.resumeSceneTween=(e,t)=>{a.getTweensMap(e).resumeTween(t)},a.pauseSceneTween=(e,t)=>{a.getTweensMap(e).pauseTween(t)},a.stopSceneTween=(e,t,n)=>{a.getTweensMap(e).stopTween(t,n)},a.removeSceneTween=(e,t)=>{a.getTweensMap(e).removeTween(t)},a.getProgress=(e,t)=>a.getTweensMap(e).getProgress(t),a.getValue=(e,t)=>a.getTweensMap(e).getValue(t);const m=c.evtTools.common.lerp,b=c.evtTools.common.exponentialInterpolation;a.addLayoutValueTween=(e,t,n,r,s,o,i)=>{a.getTweensMap(e).addSimpleTween(t,e,o,s,i?b:m,n,r,x,{type:"layoutValue"})},a.addLayerValueTween=(e,t,n,r,s,o,i,l)=>{const g=e.getLayer(l);a.getTweensMap(e).addSimpleTween(t,g,o,s,i?b:m,n,r,S,{type:"layerValue",layerName:l})},a.tweenVariableNumber=(e,t,n,r,s,o,i)=>{a.getTweensMap(e).addSimpleTween(t,e,o/1e3,i,m,r,s,p(n),{type:"variable",variable:n})},a.tweenVariableNumber2=(e,t,n,r,s,o)=>{a.tweenVariableNumber3(e,t,n,r,o,s/1e3)},a.tweenVariableNumber3=(e,t,n,r,s,o)=>{n.getType()==="number"&&a.getTweensMap(e).addSimpleTween(t,e,o,s,m,n.getValue(),r,p(n),{type:"variable",variable:n})},a.tweenCamera=(e,t,n,r,s,o,i)=>{V(e,t,n,r,s,o/1e3,i,e)},a.tweenCamera2=(e,t,n,r,s,o,i)=>{const l=e.getLayer(s);V(e,t,n,r,s,i,o,l)};const V=(e,t,n,r,s,o,i,l)=>{const g=e.getLayer(s);a.getTweensMap(e).addMultiTween(t,l,o,i,m,[g.getCameraX(),g.getCameraY()],[n,r],w(g),{type:"cameraPosition",layerName:s})};a.tweenCameraZoom=(e,t,n,r,s,o)=>{h(e,t,n,r,s/1e3,o,e,m)},a.tweenCameraZoom2=(e,t,n,r,s,o)=>{const i=e.getLayer(r);h(e,t,n,r,o,s,i,b)};const h=(e,t,n,r,s,o,i,l)=>{const g=e.getLayer(r);a.getTweensMap(e).addSimpleTween(t,i,s,o,l,g.getCameraZoom(),n,L(g),{type:"cameraZoom",layerName:r})};a.tweenCameraRotation=(e,t,n,r,s,o)=>{E(e,t,n,r,s/1e3,o,e)},a.tweenCameraRotation2=(e,t,n,r,s,o)=>{const i=e.getLayer(r);E(e,t,n,r,o,s,i)};const E=(e,t,n,r,s,o,i)=>{const l=e.getLayer(r);a.getTweensMap(e).addSimpleTween(t,i,s,o,m,l.getCameraRotation(),n,C(l),{type:"cameraRotation",layerName:r})};a.tweenNumberEffectPropertyTween=(e,t,n,r,s,o,i,l)=>{const g=e.getLayer(r),f=g.getRendererEffects()[s];f||y.error(`The layer "${g.getName()}" doesn't have any effect called "${s}"`),a.getTweensMap(e).addSimpleTween(t,g,l,i,m,f?f.getDoubleParameter(o):0,n,v(f,o),{type:"numberEffectProperty",layerName:r,effectName:s,propertyName:o})},a.tweenColorEffectPropertyTween=(e,t,n,r,s,o,i,l)=>{const g=e.getLayer(r),f=g.getRendererEffects()[s];f||y.error(`The layer "${g.getName()}" doesn't have any effect called "${s}"`);const T=c.hexNumberToRGB(f?f.getColorParameter(o):0),d=c.rgbOrHexToRGBColor(n);a.getTweensMap(e).addMultiTween(t,g,l,i,m,c.evtTools.tween.rgbToHsl(T.r,T.g,T.b),c.evtTools.tween.rgbToHsl(d[0],d[1],d[2]),P(f,o),{type:"colorEffectProperty",layerName:r,effectName:s,propertyName:o})}})(M=R.tween||(R.tween={}))})(F=c.evtTools||(c.evtTools={}))})(gdjs||(gdjs={}));
|
|
2
2
|
//# sourceMappingURL=tweentools.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../GDevelop/Extensions/TweenBehavior/tweentools.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nGDevelop - Tween Behavior Extension\nCopyright (c) 2010-2023 Florian Rival (Florian.Rival@gmail.com)\n */\nnamespace gdjs {\n export interface RuntimeScene {\n _tweens: gdjs.evtTools.tween.TweenManager;\n }\n export namespace evtTools {\n export namespace tween {\n const logger = new gdjs.Logger('Tween');\n\n export const getTweensMap = (runtimeScene: RuntimeScene) =>\n runtimeScene._tweens ||\n (runtimeScene._tweens = new gdjs.evtTools.tween.TweenManager());\n\n // Layout tweens from event-based objects won't step, but it's fine\n // because they don't have cameras anyway.\n gdjs.registerRuntimeScenePreEventsCallback(function (runtimeScene) {\n gdjs.evtTools.tween.getTweensMap(runtimeScene).step();\n });\n\n export const sceneTweenExists = (\n runtimeScene: RuntimeScene,\n id: string\n ) => getTweensMap(runtimeScene).exists(id);\n\n export const sceneTweenIsPlaying = (\n runtimeScene: RuntimeScene,\n id: string\n ) => {\n return getTweensMap(runtimeScene).isPlaying(id);\n };\n\n export const sceneTweenHasFinished = (\n runtimeScene: RuntimeScene,\n id: string\n ) => {\n return getTweensMap(runtimeScene).hasFinished(id);\n };\n\n export const resumeSceneTween = (\n runtimeScene: RuntimeScene,\n id: string\n ) => {\n getTweensMap(runtimeScene).resumeTween(id);\n };\n\n export const pauseSceneTween = (\n runtimeScene: RuntimeScene,\n id: string\n ) => {\n getTweensMap(runtimeScene).pauseTween(id);\n };\n\n export const stopSceneTween = (\n runtimeScene: RuntimeScene,\n id: string,\n shouldGoToEnd: boolean\n ) => {\n getTweensMap(runtimeScene).stopTween(id, shouldGoToEnd);\n };\n\n export const removeSceneTween = (\n runtimeScene: RuntimeScene,\n id: string\n ) => {\n getTweensMap(runtimeScene).removeTween(id);\n };\n\n /**\n * Get tween progress.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @returns Progress of playing tween animation (between 0.0 and 1.0)\n */\n export const getProgress = (\n runtimeScene: RuntimeScene,\n identifier: string\n ): float => {\n return getTweensMap(runtimeScene).getProgress(identifier);\n };\n\n /**\n * Get tween value.\n *\n * It returns 0 for tweens with several values.\n *\n * @param identifier Unique id to identify the tween\n * @returns Value of playing tween animation\n */\n export const getValue = (\n runtimeScene: RuntimeScene,\n identifier: string\n ): float => {\n return getTweensMap(runtimeScene).getValue(identifier);\n };\n\n const linearInterpolation = gdjs.evtTools.common.lerp;\n const exponentialInterpolation =\n gdjs.evtTools.common.exponentialInterpolation;\n\n /**\n * Add a layout value tween.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param fromValue Start value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param useExponentialInterpolation Set it to true to use a exponential\n * It's useful for values that are factors like a scale or a zoom.\n */\n export const addLayoutValueTween = (\n runtimeScene: RuntimeScene,\n identifier: string,\n fromValue: float,\n toValue: float,\n easing: string,\n duration: float,\n useExponentialInterpolation: boolean\n ): void => {\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n runtimeScene,\n duration,\n easing,\n useExponentialInterpolation\n ? exponentialInterpolation\n : linearInterpolation,\n fromValue,\n toValue,\n (value: float) => {}\n );\n };\n\n /**\n * Add a layer value tween. The layer time scale is taken into account.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param fromValue Start value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param useExponentialInterpolation Set it to true to use a exponential\n * It's useful for values that are factors like a scale or a zoom.\n * @param layerName The name of layer\n */\n export const addLayerValueTween = (\n runtimeScene: RuntimeScene,\n identifier: string,\n fromValue: float,\n toValue: float,\n easing: string,\n duration: float,\n useExponentialInterpolation: boolean,\n layerName: string\n ): void => {\n const layer = runtimeScene.getLayer(layerName);\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n layer,\n duration,\n easing,\n useExponentialInterpolation\n ? exponentialInterpolation\n : linearInterpolation,\n fromValue,\n toValue,\n (value: float) => {}\n );\n };\n\n /**\n * @deprecated Use tweenVariableNumber3 instead.\n * This function is misleading since one could think that the tween starts\n * right at the moment this function is called whereas the value of the variable\n * will change at the next frame only. Moreover, the variable will not start from\n * the start value exactly since time will have passed at the moment the next\n * frame is rendered.\n * See https://github.com/4ian/GDevelop/issues/4270\n */\n export const tweenVariableNumber = (\n runtimeScene: RuntimeScene,\n identifier: string,\n variable: Variable,\n from: number,\n to: number,\n duration: number,\n easing: string\n ) => {\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n runtimeScene,\n duration / 1000,\n easing,\n linearInterpolation,\n from,\n to,\n (value: float) => variable.setNumber(value)\n );\n };\n\n /**\n * @deprecated Use tweenVariableNumber3 instead.\n */\n export const tweenVariableNumber2 = (\n runtimeScene: RuntimeScene,\n identifier: string,\n variable: Variable,\n toValue: number,\n duration: number,\n easing: string\n ) => {\n tweenVariableNumber3(\n runtimeScene,\n identifier,\n variable,\n toValue,\n easing,\n duration / 1000\n );\n };\n\n /**\n * Tween a scene variable.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param variable The scene variable which is set to the tweened value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n */\n export const tweenVariableNumber3 = (\n runtimeScene: RuntimeScene,\n identifier: string,\n variable: Variable,\n toValue: number,\n easing: string,\n duration: number\n ) => {\n if (variable.getType() !== 'number') {\n return;\n }\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n runtimeScene,\n duration,\n easing,\n linearInterpolation,\n variable.getValue() as number,\n toValue,\n (value: float) => variable.setNumber(value)\n );\n };\n\n /**\n * @deprecated Use tweenCamera2 instead.\n */\n export const tweenCamera = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toX: number,\n toY: number,\n layerName: string,\n duration: number,\n easing: string\n ) => {\n _tweenCamera(\n runtimeScene,\n identifier,\n toX,\n toY,\n layerName,\n duration / 1000,\n easing,\n runtimeScene\n );\n };\n\n /**\n * Tween a layer camera position.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param toX The targeted position on X axis\n * @param toY The targeted position on Y axis\n * @param layerName The name of the layer to move\n * @param duration Duration in seconds\n * @param easing Easing function identifier\n */\n export const tweenCamera2 = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toX: number,\n toY: number,\n layerName: string,\n easing: string,\n duration: number\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n _tweenCamera(\n runtimeScene,\n identifier,\n toX,\n toY,\n layerName,\n duration,\n easing,\n layer\n );\n };\n\n const _tweenCamera = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toX: number,\n toY: number,\n layerName: string,\n duration: number,\n easing: string,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n getTweensMap(runtimeScene).addMultiTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n [layer.getCameraX(), layer.getCameraY()],\n [toX, toY],\n ([x, y]) => {\n layer.setCameraX(x);\n layer.setCameraY(y);\n }\n );\n };\n\n /**\n * @deprecated Use tweenCameraZoom2 instead.\n */\n export const tweenCameraZoom = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toZoom: number,\n layerName: string,\n duration: number,\n easing: string\n ) => {\n _tweenCameraZoom(\n runtimeScene,\n identifier,\n toZoom,\n layerName,\n duration / 1000,\n easing,\n runtimeScene,\n linearInterpolation\n );\n };\n\n /**\n * Tween a layer camera zoom factor.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param toZoom The targeted zoom factor\n * @param layerName The name of the layer to zoom\n * @param duration Duration in seconds\n * @param easing Easing function identifier\n */\n export const tweenCameraZoom2 = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toZoom: number,\n layerName: string,\n easing: string,\n duration: number\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n _tweenCameraZoom(\n runtimeScene,\n identifier,\n toZoom,\n layerName,\n duration,\n easing,\n layer,\n exponentialInterpolation\n );\n };\n\n const _tweenCameraZoom = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toZoom: number,\n layerName: string,\n duration: number,\n easing: string,\n timeSource: gdjs.evtTools.tween.TimeSource,\n interpolation: gdjs.evtTools.tween.Interpolation\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n interpolation,\n layer.getCameraZoom(),\n toZoom,\n (value: float) => layer.setCameraZoom(value)\n );\n };\n\n export const tweenCameraRotation = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toRotation: number,\n layerName: string,\n duration: number,\n easing: string\n ) => {\n _tweenCameraRotation(\n runtimeScene,\n identifier,\n toRotation,\n layerName,\n duration / 1000,\n easing,\n runtimeScene\n );\n };\n\n /**\n * Tween a layer camera rotation angle.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param toRotation The targeted angle in degrees\n * @param layerName The name of the layer to rotate\n * @param duration Duration in seconds\n * @param easing Easing function identifier\n */\n export const tweenCameraRotation2 = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toRotation: number,\n layerName: string,\n easing: string,\n duration: number\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n _tweenCameraRotation(\n runtimeScene,\n identifier,\n toRotation,\n layerName,\n duration,\n easing,\n layer\n );\n };\n\n const _tweenCameraRotation = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toRotation: number,\n layerName: string,\n duration: number,\n easing: string,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n layer.getCameraRotation(),\n toRotation,\n (value: float) => layer.setCameraRotation(value)\n );\n };\n\n /**\n * Tween a numeric object effect property.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param toValue The targeted value\n * @param layerName Layer name\n * @param effectName Effect name\n * @param propertyName Property name\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n */\n export const tweenNumberEffectPropertyTween = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toValue: float,\n layerName: string,\n effectName: string,\n propertyName: string,\n easing: string,\n duration: float\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n const effect = layer.getRendererEffects()[effectName];\n if (!effect) {\n logger.error(\n `The layer \"${layer.getName()}\" doesn't have any effect called \"${effectName}\"`\n );\n }\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n layer,\n duration,\n easing,\n linearInterpolation,\n effect ? effect.getDoubleParameter(propertyName) : 0,\n toValue,\n (value: float) => {\n if (effect) {\n effect.updateDoubleParameter(propertyName, value);\n }\n }\n );\n };\n\n /**\n * Tween a color object effect property.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param toColorStr The target RGB color (format \"128;200;255\" with values between 0 and 255 for red, green and blue)\n * @param layerName Layer name\n * @param effectName Effect name\n * @param propertyName Property name\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n */\n export const tweenColorEffectPropertyTween = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toColorStr: string,\n layerName: string,\n effectName: string,\n propertyName: string,\n easing: string,\n duration: float\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n const effect = layer.getRendererEffects()[effectName];\n if (!effect) {\n logger.error(\n `The layer \"${layer.getName()}\" doesn't have any effect called \"${effectName}\"`\n );\n }\n const rgbFromColor = gdjs.hexNumberToRGB(\n effect ? effect.getColorParameter(propertyName) : 0\n );\n const rgbToColor: float[] = gdjs.rgbOrHexToRGBColor(toColorStr);\n\n getTweensMap(runtimeScene).addMultiTween(\n identifier,\n layer,\n duration,\n easing,\n linearInterpolation,\n gdjs.evtTools.tween.rgbToHsl(\n rgbFromColor.r,\n rgbFromColor.g,\n rgbFromColor.b\n ),\n gdjs.evtTools.tween.rgbToHsl(\n rgbToColor[0],\n rgbToColor[1],\n rgbToColor[2]\n ),\n ([hue, saturation, lightness]) => {\n if (effect) {\n const rgbFromHslColor = gdjs.evtTools.tween.hslToRgb(\n hue,\n saturation,\n lightness\n );\n effect.updateColorParameter(\n propertyName,\n gdjs.rgbToHexNumber(\n rgbFromHslColor[0],\n rgbFromHslColor[1],\n rgbFromHslColor[2]\n )\n );\n }\n }\n );\n };\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "AAIA,GAAU,MAAV,UAAU,EAAV,CAIS,GAAU,GAAV,UAAU,EAAV,CACE,GAAU,GAAV,UAAU,EAAV,CACL,KAAM,GAAS,GAAI,GAAK,OAAO,
|
|
4
|
+
"sourcesContent": ["/*\nGDevelop - Tween Behavior Extension\nCopyright (c) 2010-2023 Florian Rival (Florian.Rival@gmail.com)\n */\nnamespace gdjs {\n export interface RuntimeScene {\n _tweens: gdjs.evtTools.tween.TweenManager;\n }\n export namespace evtTools {\n export namespace tween {\n const logger = new gdjs.Logger('Tween');\n\n const getTweenVariableSetter = (variable: gdjs.Variable) => {\n return (value: float) => variable.setNumber(value);\n };\n const tweenLayoutValueSetter = (value: float) => {};\n const tweenLayerValueSetter = (value: float) => {};\n const getTweenLayerCameraPositionSetter = (layer: gdjs.RuntimeLayer) => {\n return ([x, y]: Array<float>) => {\n layer.setCameraX(x);\n layer.setCameraY(y);\n };\n };\n const getTweenLayerCameraRotationSetter = (layer: gdjs.RuntimeLayer) => {\n return (value: float) => layer.setCameraRotation(value);\n };\n const getTweenLayerCameraZoomSetter = (layer: gdjs.RuntimeLayer) => {\n return (value: float) => layer.setCameraZoom(value);\n };\n const getTweenNumberEffectPropertySetter = (\n effect: PixiFiltersTools.Filter,\n propertyName: string\n ) => {\n return (value: float) => {\n if (effect) {\n effect.updateDoubleParameter(propertyName, value);\n }\n };\n };\n const getTweenColorEffectPropertySetter = (\n effect: PixiFiltersTools.Filter,\n propertyName: string\n ) => {\n return ([hue, saturation, lightness]: Array<float>) => {\n if (effect) {\n const rgbFromHslColor = gdjs.evtTools.tween.hslToRgb(\n hue,\n saturation,\n lightness\n );\n effect.updateColorParameter(\n propertyName,\n gdjs.rgbToHexNumber(\n rgbFromHslColor[0],\n rgbFromHslColor[1],\n rgbFromHslColor[2]\n )\n );\n }\n };\n };\n\n // Factory to get the tween setter based on type and options\n export const tweenSetterFactory =\n (runtimeScene: RuntimeScene) =>\n (tweenInformation: TweenInformationNetworkSyncData) => {\n const type = tweenInformation.type;\n const layerName = tweenInformation.layerName;\n const variablePath = tweenInformation.variablePath;\n const effectName = tweenInformation.effectName;\n const propertyName = tweenInformation.propertyName;\n\n if (type === 'variable' && variablePath) {\n const variable = runtimeScene\n .getVariables()\n .getVariableFromPath(variablePath);\n if (!variable) {\n return () => {};\n }\n return getTweenVariableSetter(variable);\n }\n if (type === 'cameraZoom' && layerName !== undefined) {\n const layer = runtimeScene.getLayer(layerName);\n return getTweenLayerCameraZoomSetter(layer);\n }\n if (type === 'cameraRotation' && layerName !== undefined) {\n const layer = runtimeScene.getLayer(layerName);\n return getTweenLayerCameraRotationSetter(layer);\n }\n if (type === 'cameraPosition' && layerName !== undefined) {\n const layer = runtimeScene.getLayer(layerName);\n return getTweenLayerCameraPositionSetter(layer);\n }\n if (\n type === 'colorEffectProperty' &&\n layerName !== undefined &&\n effectName &&\n propertyName\n ) {\n const layer = runtimeScene.getLayer(layerName);\n const effect = layer.getRendererEffects()[effectName];\n if (!effect) {\n logger.error(\n `The layer \"${layerName}\" doesn't have any effect called \"${effectName}\"`\n );\n }\n\n return getTweenColorEffectPropertySetter(effect, propertyName);\n }\n if (\n type === 'numberEffectProperty' &&\n layerName !== undefined &&\n effectName &&\n propertyName\n ) {\n const layer = runtimeScene.getLayer(layerName);\n const effect = layer.getRendererEffects()[effectName];\n if (!effect) {\n logger.error(\n `The layer \"${layerName}\" doesn't have any effect called \"${effectName}\"`\n );\n }\n return getTweenNumberEffectPropertySetter(effect, propertyName);\n }\n if (type === 'layoutValue') {\n return tweenLayoutValueSetter;\n }\n if (type === 'layerValue') {\n return tweenLayerValueSetter;\n }\n return () => {};\n };\n\n export const getTweensMap = (runtimeScene: RuntimeScene) =>\n runtimeScene._tweens ||\n (runtimeScene._tweens = new gdjs.evtTools.tween.TweenManager());\n\n // Layout tweens from event-based objects won't step, but it's fine\n // because they don't have cameras anyway.\n gdjs.registerRuntimeScenePreEventsCallback(function (runtimeScene) {\n gdjs.evtTools.tween.getTweensMap(runtimeScene).step();\n });\n\n gdjs.registerRuntimeSceneGetSyncDataCallback(\n function (runtimeScene, currentLayoutSyncData, syncOptions) {\n if (!syncOptions.syncTweens) return;\n const tweensNetworkSyncData = gdjs.evtTools.tween\n .getTweensMap(runtimeScene)\n .getNetworkSyncData();\n\n currentLayoutSyncData.tween = tweensNetworkSyncData;\n }\n );\n\n gdjs.registerRuntimeSceneUpdateFromSyncDataCallback(\n function (runtimeScene, receivedSyncData, syncOptions) {\n if (!receivedSyncData.tween) return;\n\n gdjs.evtTools.tween\n .getTweensMap(runtimeScene)\n .updateFromNetworkSyncData(\n receivedSyncData.tween,\n (tweenInformationNetworkSyncData) => {\n if (tweenInformationNetworkSyncData.layerName !== undefined) {\n return runtimeScene.getLayer(\n tweenInformationNetworkSyncData.layerName\n );\n }\n return runtimeScene;\n },\n (tweenInformationNetworkSyncData) => {\n return gdjs.evtTools.tween.tweenSetterFactory(runtimeScene)(\n tweenInformationNetworkSyncData\n );\n },\n // No onFinish for scene tweens.\n () => null\n );\n }\n );\n\n export const sceneTweenExists = (\n runtimeScene: RuntimeScene,\n id: string\n ) => getTweensMap(runtimeScene).exists(id);\n\n export const sceneTweenIsPlaying = (\n runtimeScene: RuntimeScene,\n id: string\n ) => {\n return getTweensMap(runtimeScene).isPlaying(id);\n };\n\n export const sceneTweenHasFinished = (\n runtimeScene: RuntimeScene,\n id: string\n ) => {\n return getTweensMap(runtimeScene).hasFinished(id);\n };\n\n export const resumeSceneTween = (\n runtimeScene: RuntimeScene,\n id: string\n ) => {\n getTweensMap(runtimeScene).resumeTween(id);\n };\n\n export const pauseSceneTween = (\n runtimeScene: RuntimeScene,\n id: string\n ) => {\n getTweensMap(runtimeScene).pauseTween(id);\n };\n\n export const stopSceneTween = (\n runtimeScene: RuntimeScene,\n id: string,\n shouldGoToEnd: boolean\n ) => {\n getTweensMap(runtimeScene).stopTween(id, shouldGoToEnd);\n };\n\n export const removeSceneTween = (\n runtimeScene: RuntimeScene,\n id: string\n ) => {\n getTweensMap(runtimeScene).removeTween(id);\n };\n\n /**\n * Get tween progress.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @returns Progress of playing tween animation (between 0.0 and 1.0)\n */\n export const getProgress = (\n runtimeScene: RuntimeScene,\n identifier: string\n ): float => {\n return getTweensMap(runtimeScene).getProgress(identifier);\n };\n\n /**\n * Get tween value.\n *\n * It returns 0 for tweens with several values.\n *\n * @param identifier Unique id to identify the tween\n * @returns Value of playing tween animation\n */\n export const getValue = (\n runtimeScene: RuntimeScene,\n identifier: string\n ): float => {\n return getTweensMap(runtimeScene).getValue(identifier);\n };\n\n const linearInterpolation = gdjs.evtTools.common.lerp;\n const exponentialInterpolation =\n gdjs.evtTools.common.exponentialInterpolation;\n\n /**\n * Add a layout value tween.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param fromValue Start value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param useExponentialInterpolation Set it to true to use a exponential\n * It's useful for values that are factors like a scale or a zoom.\n */\n export const addLayoutValueTween = (\n runtimeScene: RuntimeScene,\n identifier: string,\n fromValue: float,\n toValue: float,\n easing: string,\n duration: float,\n useExponentialInterpolation: boolean\n ): void => {\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n runtimeScene,\n duration,\n easing,\n useExponentialInterpolation\n ? exponentialInterpolation\n : linearInterpolation,\n fromValue,\n toValue,\n tweenLayoutValueSetter,\n {\n type: 'layoutValue',\n }\n );\n };\n\n /**\n * Add a layer value tween. The layer time scale is taken into account.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param fromValue Start value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n * @param useExponentialInterpolation Set it to true to use a exponential\n * It's useful for values that are factors like a scale or a zoom.\n * @param layerName The name of layer\n */\n export const addLayerValueTween = (\n runtimeScene: RuntimeScene,\n identifier: string,\n fromValue: float,\n toValue: float,\n easing: string,\n duration: float,\n useExponentialInterpolation: boolean,\n layerName: string\n ): void => {\n const layer = runtimeScene.getLayer(layerName);\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n layer,\n duration,\n easing,\n useExponentialInterpolation\n ? exponentialInterpolation\n : linearInterpolation,\n fromValue,\n toValue,\n tweenLayerValueSetter,\n {\n type: 'layerValue',\n layerName,\n }\n );\n };\n\n /**\n * @deprecated Use tweenVariableNumber3 instead.\n * This function is misleading since one could think that the tween starts\n * right at the moment this function is called whereas the value of the variable\n * will change at the next frame only. Moreover, the variable will not start from\n * the start value exactly since time will have passed at the moment the next\n * frame is rendered.\n * See https://github.com/4ian/GDevelop/issues/4270\n */\n export const tweenVariableNumber = (\n runtimeScene: RuntimeScene,\n identifier: string,\n variable: Variable,\n from: number,\n to: number,\n duration: number,\n easing: string\n ) => {\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n runtimeScene,\n duration / 1000,\n easing,\n linearInterpolation,\n from,\n to,\n getTweenVariableSetter(variable),\n {\n type: 'variable',\n variable,\n }\n );\n };\n\n /**\n * @deprecated Use tweenVariableNumber3 instead.\n */\n export const tweenVariableNumber2 = (\n runtimeScene: RuntimeScene,\n identifier: string,\n variable: Variable,\n toValue: number,\n duration: number,\n easing: string\n ) => {\n tweenVariableNumber3(\n runtimeScene,\n identifier,\n variable,\n toValue,\n easing,\n duration / 1000\n );\n };\n\n /**\n * Tween a scene variable.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param variable The scene variable which is set to the tweened value\n * @param toValue End value\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n */\n export const tweenVariableNumber3 = (\n runtimeScene: RuntimeScene,\n identifier: string,\n variable: Variable,\n toValue: number,\n easing: string,\n duration: number\n ) => {\n if (variable.getType() !== 'number') {\n return;\n }\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n runtimeScene,\n duration,\n easing,\n linearInterpolation,\n variable.getValue() as number,\n toValue,\n getTweenVariableSetter(variable),\n {\n type: 'variable',\n variable,\n }\n );\n };\n\n /**\n * @deprecated Use tweenCamera2 instead.\n */\n export const tweenCamera = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toX: number,\n toY: number,\n layerName: string,\n duration: number,\n easing: string\n ) => {\n _tweenCamera(\n runtimeScene,\n identifier,\n toX,\n toY,\n layerName,\n duration / 1000,\n easing,\n runtimeScene\n );\n };\n\n /**\n * Tween a layer camera position.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param toX The targeted position on X axis\n * @param toY The targeted position on Y axis\n * @param layerName The name of the layer to move\n * @param duration Duration in seconds\n * @param easing Easing function identifier\n */\n export const tweenCamera2 = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toX: number,\n toY: number,\n layerName: string,\n easing: string,\n duration: number\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n _tweenCamera(\n runtimeScene,\n identifier,\n toX,\n toY,\n layerName,\n duration,\n easing,\n layer\n );\n };\n\n const _tweenCamera = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toX: number,\n toY: number,\n layerName: string,\n duration: number,\n easing: string,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n getTweensMap(runtimeScene).addMultiTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n [layer.getCameraX(), layer.getCameraY()],\n [toX, toY],\n getTweenLayerCameraPositionSetter(layer),\n {\n type: 'cameraPosition',\n layerName,\n }\n );\n };\n\n /**\n * @deprecated Use tweenCameraZoom2 instead.\n */\n export const tweenCameraZoom = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toZoom: number,\n layerName: string,\n duration: number,\n easing: string\n ) => {\n _tweenCameraZoom(\n runtimeScene,\n identifier,\n toZoom,\n layerName,\n duration / 1000,\n easing,\n runtimeScene,\n linearInterpolation\n );\n };\n\n /**\n * Tween a layer camera zoom factor.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param toZoom The targeted zoom factor\n * @param layerName The name of the layer to zoom\n * @param duration Duration in seconds\n * @param easing Easing function identifier\n */\n export const tweenCameraZoom2 = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toZoom: number,\n layerName: string,\n easing: string,\n duration: number\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n _tweenCameraZoom(\n runtimeScene,\n identifier,\n toZoom,\n layerName,\n duration,\n easing,\n layer,\n exponentialInterpolation\n );\n };\n\n const _tweenCameraZoom = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toZoom: number,\n layerName: string,\n duration: number,\n easing: string,\n timeSource: gdjs.evtTools.tween.TimeSource,\n interpolation: gdjs.evtTools.tween.Interpolation\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n interpolation,\n layer.getCameraZoom(),\n toZoom,\n getTweenLayerCameraZoomSetter(layer),\n {\n type: 'cameraZoom',\n layerName,\n }\n );\n };\n\n export const tweenCameraRotation = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toRotation: number,\n layerName: string,\n duration: number,\n easing: string\n ) => {\n _tweenCameraRotation(\n runtimeScene,\n identifier,\n toRotation,\n layerName,\n duration / 1000,\n easing,\n runtimeScene\n );\n };\n\n /**\n * Tween a layer camera rotation angle.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param toRotation The targeted angle in degrees\n * @param layerName The name of the layer to rotate\n * @param duration Duration in seconds\n * @param easing Easing function identifier\n */\n export const tweenCameraRotation2 = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toRotation: number,\n layerName: string,\n easing: string,\n duration: number\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n _tweenCameraRotation(\n runtimeScene,\n identifier,\n toRotation,\n layerName,\n duration,\n easing,\n layer\n );\n };\n\n const _tweenCameraRotation = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toRotation: number,\n layerName: string,\n duration: number,\n easing: string,\n timeSource: gdjs.evtTools.tween.TimeSource\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n timeSource,\n duration,\n easing,\n linearInterpolation,\n layer.getCameraRotation(),\n toRotation,\n getTweenLayerCameraRotationSetter(layer),\n {\n type: 'cameraRotation',\n layerName,\n }\n );\n };\n\n /**\n * Tween a numeric object effect property.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param toValue The targeted value\n * @param layerName Layer name\n * @param effectName Effect name\n * @param propertyName Property name\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n */\n export const tweenNumberEffectPropertyTween = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toValue: float,\n layerName: string,\n effectName: string,\n propertyName: string,\n easing: string,\n duration: float\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n const effect = layer.getRendererEffects()[effectName];\n if (!effect) {\n logger.error(\n `The layer \"${layer.getName()}\" doesn't have any effect called \"${effectName}\"`\n );\n }\n getTweensMap(runtimeScene).addSimpleTween(\n identifier,\n layer,\n duration,\n easing,\n linearInterpolation,\n effect ? effect.getDoubleParameter(propertyName) : 0,\n toValue,\n getTweenNumberEffectPropertySetter(effect, propertyName),\n {\n type: 'numberEffectProperty',\n layerName,\n effectName,\n propertyName,\n }\n );\n };\n\n /**\n * Tween a color object effect property.\n * @param runtimeScene The scene\n * @param identifier Unique id to identify the tween\n * @param toColorStr The target RGB color (format \"128;200;255\" with values between 0 and 255 for red, green and blue)\n * @param layerName Layer name\n * @param effectName Effect name\n * @param propertyName Property name\n * @param easing Easing function identifier\n * @param duration Duration in seconds\n */\n export const tweenColorEffectPropertyTween = (\n runtimeScene: RuntimeScene,\n identifier: string,\n toColorStr: string,\n layerName: string,\n effectName: string,\n propertyName: string,\n easing: string,\n duration: float\n ) => {\n const layer = runtimeScene.getLayer(layerName);\n const effect = layer.getRendererEffects()[effectName];\n if (!effect) {\n logger.error(\n `The layer \"${layer.getName()}\" doesn't have any effect called \"${effectName}\"`\n );\n }\n const rgbFromColor = gdjs.hexNumberToRGB(\n effect ? effect.getColorParameter(propertyName) : 0\n );\n const rgbToColor: float[] = gdjs.rgbOrHexToRGBColor(toColorStr);\n\n getTweensMap(runtimeScene).addMultiTween(\n identifier,\n layer,\n duration,\n easing,\n linearInterpolation,\n gdjs.evtTools.tween.rgbToHsl(\n rgbFromColor.r,\n rgbFromColor.g,\n rgbFromColor.b\n ),\n gdjs.evtTools.tween.rgbToHsl(\n rgbToColor[0],\n rgbToColor[1],\n rgbToColor[2]\n ),\n getTweenColorEffectPropertySetter(effect, propertyName),\n {\n type: 'colorEffectProperty',\n layerName,\n effectName,\n propertyName,\n }\n );\n };\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "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A,EACA,EACA,EACA,EACI,EACA,EACJ,EACA,EACA,EACA,CACE,KAAM,iBAiBC,qBAAqB,CAChC,EACA,EACA,EACA,EACA,EACA,EACA,EACA,IACS,CACT,KAAM,GAAQ,EAAa,SAAS,GACpC,eAAa,GAAc,eACzB,EACA,EACA,EACA,EACA,EACI,EACA,EACJ,EACA,EACA,EACA,CACE,KAAM,aACN,eAcO,sBAAsB,CACjC,EACA,EACA,EACA,EACA,EACA,EACA,IACG,CACH,eAAa,GAAc,eACzB,EACA,EACA,EAAW,IACX,EACA,EACA,EACA,EACA,EAAuB,GACvB,CACE,KAAM,WACN,cAQO,uBAAuB,CAClC,EACA,EACA,EACA,EACA,EACA,IACG,CACH,uBACE,EACA,EACA,EACA,EACA,EACA,EAAW,MAaF,uBAAuB,CAClC,EACA,EACA,EACA,EACA,EACA,IACG,CACH,AAAI,EAAS,YAAc,UAG3B,eAAa,GAAc,eACzB,EACA,EACA,EACA,EACA,EACA,EAAS,WACT,EACA,EAAuB,GACvB,CACE,KAAM,WACN,cAQO,cAAc,CACzB,EACA,EACA,EACA,EACA,EACA,EACA,IACG,CACH,EACE,EACA,EACA,EACA,EACA,EACA,EAAW,IACX,EACA,IAcS,eAAe,CAC1B,EACA,EACA,EACA,EACA,EACA,EACA,IACG,CACH,KAAM,GAAQ,EAAa,SAAS,GACpC,EACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,IAIJ,KAAM,GAAe,CACnB,EACA,EACA,EACA,EACA,EACA,EACA,EACA,IACG,CACH,KAAM,GAAQ,EAAa,SAAS,GACpC,eAAa,GAAc,cACzB,EACA,EACA,EACA,EACA,EACA,CAAC,EAAM,aAAc,EAAM,cAC3B,CAAC,EAAK,GACN,EAAkC,GAClC,CACE,KAAM,iBACN,eAQC,AAAM,kBAAkB,CAC7B,EACA,EACA,EACA,EACA,EACA,IACG,CACH,EACE,EACA,EACA,EACA,EACA,EAAW,IACX,EACA,EACA,IAaS,mBAAmB,CAC9B,EACA,EACA,EACA,EACA,EACA,IACG,CACH,KAAM,GAAQ,EAAa,SAAS,GACpC,EACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,IAIJ,KAAM,GAAmB,CACvB,EACA,EACA,EACA,EACA,EACA,EACA,EACA,IACG,CACH,KAAM,GAAQ,EAAa,SAAS,GACpC,eAAa,GAAc,eACzB,EACA,EACA,EACA,EACA,EACA,EAAM,gBACN,EACA,EAA8B,GAC9B,CACE,KAAM,aACN,eAKC,AAAM,sBAAsB,CACjC,EACA,EACA,EACA,EACA,EACA,IACG,CACH,EACE,EACA,EACA,EACA,EACA,EAAW,IACX,EACA,IAaS,uBAAuB,CAClC,EACA,EACA,EACA,EACA,EACA,IACG,CACH,KAAM,GAAQ,EAAa,SAAS,GACpC,EACE,EACA,EACA,EACA,EACA,EACA,EACA,IAIJ,KAAM,GAAuB,CAC3B,EACA,EACA,EACA,EACA,EACA,EACA,IACG,CACH,KAAM,GAAQ,EAAa,SAAS,GACpC,eAAa,GAAc,eACzB,EACA,EACA,EACA,EACA,EACA,EAAM,oBACN,EACA,EAAkC,GAClC,CACE,KAAM,iBACN,eAgBC,AAAM,iCAAiC,CAC5C,EACA,EACA,EACA,EACA,EACA,EACA,EACA,IACG,CACH,KAAM,GAAQ,EAAa,SAAS,GAC9B,EAAS,EAAM,qBAAqB,GAC1C,AAAK,GACH,EAAO,MACL,cAAc,EAAM,8CAA8C,MAGtE,eAAa,GAAc,eACzB,EACA,EACA,EACA,EACA,EACA,EAAS,EAAO,mBAAmB,GAAgB,EACnD,EACA,EAAmC,EAAQ,GAC3C,CACE,KAAM,uBACN,YACA,aACA,kBAgBO,gCAAgC,CAC3C,EACA,EACA,EACA,EACA,EACA,EACA,EACA,IACG,CACH,KAAM,GAAQ,EAAa,SAAS,GAC9B,EAAS,EAAM,qBAAqB,GAC1C,AAAK,GACH,EAAO,MACL,cAAc,EAAM,8CAA8C,MAGtE,KAAM,GAAe,EAAK,eACxB,EAAS,EAAO,kBAAkB,GAAgB,GAE9C,EAAsB,EAAK,mBAAmB,GAEpD,eAAa,GAAc,cACzB,EACA,EACA,EACA,EACA,EACA,EAAK,SAAS,MAAM,SAClB,EAAa,EACb,EAAa,EACb,EAAa,GAEf,EAAK,SAAS,MAAM,SAClB,EAAW,GACX,EAAW,GACX,EAAW,IAEb,EAAkC,EAAQ,GAC1C,CACE,KAAM,sBACN,YACA,aACA,oBAtvBS,2BADF,iCAJT",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|