gdcore-tools 2.0.0-gd-v5.5.230-autobuild → 2.0.0-gd-v5.5.232-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.
Files changed (61) hide show
  1. package/dist/Runtime/CustomRuntimeObject.js +1 -1
  2. package/dist/Runtime/CustomRuntimeObject.js.map +2 -2
  3. package/dist/Runtime/CustomRuntimeObject2D.js +1 -1
  4. package/dist/Runtime/CustomRuntimeObject2D.js.map +2 -2
  5. package/dist/Runtime/CustomRuntimeObjectInstanceContainer.js +1 -1
  6. package/dist/Runtime/CustomRuntimeObjectInstanceContainer.js.map +2 -2
  7. package/dist/Runtime/Extensions/3D/CustomRuntimeObject3D.js +1 -1
  8. package/dist/Runtime/Extensions/3D/CustomRuntimeObject3D.js.map +2 -2
  9. package/dist/Runtime/Extensions/3D/CustomRuntimeObject3DRenderer.js +1 -1
  10. package/dist/Runtime/Extensions/3D/CustomRuntimeObject3DRenderer.js.map +2 -2
  11. package/dist/Runtime/Extensions/3D/JsExtension.js +6 -2
  12. package/dist/Runtime/Extensions/DestroyOutsideBehavior/destroyoutsideruntimebehavior.js +1 -1
  13. package/dist/Runtime/Extensions/DestroyOutsideBehavior/destroyoutsideruntimebehavior.js.map +2 -2
  14. package/dist/Runtime/Extensions/Multiplayer/messageManager.js +1 -1
  15. package/dist/Runtime/Extensions/Multiplayer/messageManager.js.map +2 -2
  16. package/dist/Runtime/Extensions/Multiplayer/multiplayerobjectruntimebehavior.js +1 -1
  17. package/dist/Runtime/Extensions/Multiplayer/multiplayerobjectruntimebehavior.js.map +2 -2
  18. package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js +1 -1
  19. package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js.map +2 -2
  20. package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js +1 -1
  21. package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js.map +2 -2
  22. package/dist/Runtime/Extensions/Physics3DBehavior/JsExtension.js +1047 -3
  23. package/dist/Runtime/Extensions/Physics3DBehavior/Physics3DRuntimeBehavior.js +1 -1
  24. package/dist/Runtime/Extensions/Physics3DBehavior/Physics3DRuntimeBehavior.js.map +2 -2
  25. package/dist/Runtime/Extensions/Physics3DBehavior/PhysicsCar3DRuntimeBehavior.js +2 -0
  26. package/dist/Runtime/Extensions/Physics3DBehavior/PhysicsCar3DRuntimeBehavior.js.map +7 -0
  27. package/dist/Runtime/Extensions/Physics3DBehavior/PhysicsCharacter3DRuntimeBehavior.js +1 -1
  28. package/dist/Runtime/Extensions/Physics3DBehavior/PhysicsCharacter3DRuntimeBehavior.js.map +2 -2
  29. package/dist/Runtime/Extensions/Physics3DBehavior/jolt-physics.d.ts +94 -9
  30. package/dist/Runtime/Extensions/Physics3DBehavior/jolt-physics.wasm.js +1 -1
  31. package/dist/Runtime/Extensions/Physics3DBehavior/jolt-physics.wasm.js.map +2 -2
  32. package/dist/Runtime/Extensions/Physics3DBehavior/jolt-physics.wasm.wasm +0 -0
  33. package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js +1 -1
  34. package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js.map +2 -2
  35. package/dist/Runtime/Extensions/TopDownMovementBehavior/topdownmovementruntimebehavior.js +1 -1
  36. package/dist/Runtime/Extensions/TopDownMovementBehavior/topdownmovementruntimebehavior.js.map +2 -2
  37. package/dist/Runtime/Extensions/TweenBehavior/JsExtension.js +1 -1
  38. package/dist/Runtime/Extensions/TweenBehavior/tweenruntimebehavior.js +1 -1
  39. package/dist/Runtime/Extensions/TweenBehavior/tweenruntimebehavior.js.map +2 -2
  40. package/dist/Runtime/RuntimeInstanceContainer.js +1 -1
  41. package/dist/Runtime/RuntimeInstanceContainer.js.map +2 -2
  42. package/dist/Runtime/debugger-client/hot-reloader.js +3 -2
  43. package/dist/Runtime/debugger-client/hot-reloader.js.map +2 -2
  44. package/dist/Runtime/events-tools/cameratools.js +1 -1
  45. package/dist/Runtime/events-tools/cameratools.js.map +2 -2
  46. package/dist/Runtime/howler-sound-manager/howler-sound-manager.js +1 -1
  47. package/dist/Runtime/howler-sound-manager/howler-sound-manager.js.map +2 -2
  48. package/dist/Runtime/pixi-renderers/CustomRuntimeObject2DPixiRenderer.js +1 -1
  49. package/dist/Runtime/pixi-renderers/CustomRuntimeObject2DPixiRenderer.js.map +2 -2
  50. package/dist/Runtime/runtimeobject.js +1 -1
  51. package/dist/Runtime/runtimeobject.js.map +2 -2
  52. package/dist/Runtime/runtimescene.js +1 -1
  53. package/dist/Runtime/runtimescene.js.map +2 -2
  54. package/dist/Runtime/spriteruntimeobject.js +1 -1
  55. package/dist/Runtime/spriteruntimeobject.js.map +2 -2
  56. package/dist/Runtime/types/project-data.d.ts +1 -1
  57. package/dist/lib/libGD.cjs +1 -1
  58. package/dist/lib/libGD.wasm +0 -0
  59. package/dist/loaders.cjs +3 -3
  60. package/gd.d.ts +7 -0
  61. package/package.json +1 -1
@@ -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(this.owner.getInstanceContainer());\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.floor(rgbFromHslColor[0]) +\n ';' +\n Math.floor(rgbFromHslColor[1]) +\n ';' +\n Math.floor(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: string[] = owner.getColor().split(';');\n if (rgbFromColor.length < 3) return;\n const hslFromColor = gdjs.evtTools.tween.rgbToHsl(\n parseFloat(rgbFromColor[0]),\n parseFloat(rgbFromColor[1]),\n parseFloat(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.floor(rgbFromHslColor[0]) +\n ';' +\n Math.floor(rgbFromHslColor[1]) +\n ';' +\n Math.floor(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,gBAAgB,KAAK,MAAM,wBAoBxC,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,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ACrD,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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,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,IAxxDd,EAAM,uBA2xDb,EAAK,iBAAiB,uBAAwB,EAAK,wBAp1D3C",
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.floor(rgbFromHslColor[0]) +\n ';' +\n Math.floor(rgbFromHslColor[1]) +\n ';' +\n Math.floor(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: string[] = owner.getColor().split(';');\n if (rgbFromColor.length < 3) return;\n const hslFromColor = gdjs.evtTools.tween.rgbToHsl(\n parseFloat(rgbFromColor[0]),\n parseFloat(rgbFromColor[1]),\n parseFloat(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.floor(rgbFromHslColor[0]) +\n ';' +\n Math.floor(rgbFromHslColor[1]) +\n ';' +\n Math.floor(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,O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ACA,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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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,EAC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A,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,GAEpD,GAAI,GACA,EACA,EACJ,AAAI,EACF,GAAe,EAAK,SAAS,MAAM,SACjC,EAAa,GACb,EAAa,GACb,EAAa,IAEf,EAAgB,EAAK,SAAS,MAAM,SAClC,EAAW,GACX,EAAW,GACX,EAAW,IAEb,EAAW,CAAC,CAAC,EAAK,EAAY,KAAe,CAC3C,KAAM,GAAkB,EAAK,SAAS,MAAM,SAC1C,EACA,EACA,GAEF,EAAM,SACJ,KAAK,MAAM,EAAgB,IACzB,IACA,KAAK,MAAM,EAAgB,IAC3B,IACA,KAAK,MAAM,EAAgB,OAIjC,GAAe,EACf,EAAgB,EAChB,EAAW,CAAC,CAAC,EAAK,EAAO,KAAU,CACjC,EAAM,SACJ,KAAK,MAAM,GAAO,IAAM,KAAK,MAAM,GAAS,IAAM,KAAK,MAAM,MAKnE,KAAK,QAAQ,cACX,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,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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,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,IAxxDd,EAAM,uBA2xDb,EAAK,iBAAiB,uBAAwB,EAAK,wBAp1D3C",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- var gdjs;(function(l){const d=new l.Logger("RuntimeInstanceContainer");class u{constructor(){this._allInstancesList=[];this._allInstancesListIsUpToDate=!0;this._instancesRemoved=[];this._layersCameraCoordinates={};this._debugDrawEnabled=!1;this._debugDrawShowHiddenInstances=!1;this._debugDrawShowPointsNames=!1;this._debugDrawShowCustomPoints=!1;this._initialBehaviorSharedData=new Hashtable,this._instances=new Hashtable,this._instancesCache=new Hashtable,this._objects=new Hashtable,this._objectsCtor=new Hashtable,this._layers=new Hashtable,this._orderedLayers=[]}enableDebugDraw(e,t,s,a){this._debugDrawEnabled&&!e&&this.getDebuggerRenderer().clearDebugDraw(),this._debugDrawEnabled=e,this._debugDrawShowHiddenInstances=t,this._debugDrawShowPointsNames=s,this._debugDrawShowCustomPoints=a}isObjectRegistered(e){return this._objects.containsKey(e)&&this._instances.containsKey(e)&&this._objectsCtor.containsKey(e)}registerObject(e){this._objects.put(e.name,e),this._instances.put(e.name,[]);const t=l.getObjectConstructor(e.type);this._objectsCtor.put(e.name,t),t.supportsReinitialization&&this._instancesCache.put(e.name,[])}updateObject(e){this.isObjectRegistered(e.name)||d.warn("Tried to call updateObject for an object that was not registered ("+e.name+"). Call registerObject first."),this._objects.put(e.name,e)}unregisterObject(e){const t=this._instances.get(e);if(t){const s=t.slice();for(let a=0;a<s.length;a++)this.markObjectForDeletion(s[a]);this._cacheOrClearRemovedInstances()}this._objects.remove(e),this._instances.remove(e),this._instancesCache.remove(e),this._objectsCtor.remove(e)}createObjectsFrom(e,t,s,a,n){let i,r;arguments.length===5?(i=a,r=n):(i=0,r=arguments[3]);for(let h=0,g=e.length;h<g;++h){const o=e[h],_=o.name,c=this.createObject(_);c!==null&&(r&&(c.persistentUuid=o.persistentUuid||null),c.setPosition(o.x+t,o.y+s),c.setAngle(o.angle),l.Base3DHandler&&l.Base3DHandler.is3D(c)&&(c.setZ((o.z||0)+i),o.rotationX!==void 0&&c.setRotationX(o.rotationX),o.rotationY!==void 0&&c.setRotationY(o.rotationY)),c.setZOrder(o.zOrder),c.setLayer(o.layer),c.getVariables().initFrom(o.initialVariables,!0),c.extraInitializationFromInitialInstance(o))}}getInitialSharedDataForBehavior(e){return this._initialBehaviorSharedData.get(e)}setInitialSharedDataForBehavior(e,t){this._initialBehaviorSharedData.put(e,t)}_setLayerDefaultZOrders(){if(this.getGame().getGameData().properties.useDeprecatedZeroAsDefaultZOrder)return;const e={},t=this.getAdhocListOfAllInstances();for(let s=0,a=t.length;s<a;++s){const n=t[s];let i=n.getLayer();const r=n.getZOrder();(e[i]===void 0||e[i]<r)&&(e[i]=r)}for(let s in e)this.getLayer(s).setDefaultZOrder(e[s]+1)}_updateLayersCameraCoordinates(e){this._layersCameraCoordinates=this._layersCameraCoordinates||{};for(const t in this._layers.items)if(this._layers.items.hasOwnProperty(t)){const s=this._layers.items[t];this._layersCameraCoordinates[t]=this._layersCameraCoordinates[t]||[0,0,0,0],this._layersCameraCoordinates[t][0]=s.getCameraX()-s.getCameraWidth()/2*e,this._layersCameraCoordinates[t][1]=s.getCameraY()-s.getCameraHeight()/2*e,this._layersCameraCoordinates[t][2]=s.getCameraX()+s.getCameraWidth()/2*e,this._layersCameraCoordinates[t][3]=s.getCameraY()+s.getCameraHeight()/2*e}}_updateLayersPreRender(){for(const e of this._orderedLayers)e.updatePreRender(this)}_updateObjectsPreRender(){const e=this.getAdhocListOfAllInstances();for(let t=0,s=e.length;t<s;++t){const a=e[t],n=a.getRendererObject();n&&(n.visible=!a.isHidden(),n.visible&&this.getGame().getEffectsManager().updatePreRender(a.getRendererEffects(),a)),a.updatePreRender(this)}}_cacheOrClearRemovedInstances(){for(let e=0,t=this._instancesRemoved.length;e<t;++e){const s=this._instancesRemoved[e],a=this._instancesCache.get(s.getName());a&&a.length<128&&a.push(s),s.onDestroyed()}this._instancesRemoved.length=0}_constructListOfAllInstances(){let e=0;for(const t in this._instances.items)if(this._instances.items.hasOwnProperty(t)){const s=this._instances.items[t],a=e;e+=s.length;for(let n=0,i=s.length;n<i;++n)a+n<this._allInstancesList.length?this._allInstancesList[a+n]=s[n]:this._allInstancesList.push(s[n])}this._allInstancesList.length=e,this._allInstancesListIsUpToDate=!0}getInstancesOf(e){return this._instances.items[e]}getAdhocListOfAllInstances(){return this._allInstancesListIsUpToDate||this._constructListOfAllInstances(),this._allInstancesList}_updateObjectsPreEvents(){const e=this.getAdhocListOfAllInstances();for(let t=0,s=e.length;t<s;++t){const a=e[t],n=a.getElapsedTime();if(a.hasNoForces())a.update(this);else{const i=a.getAverageForce(),r=n/1e3;a.setX(a.getX()+i.getX()*r),a.setY(a.getY()+i.getY()*r),a.update(this),a.updateForces(r)}a.updateTimers(n),e[t].stepBehaviorsPreEvents(this)}this._cacheOrClearRemovedInstances()}_updateObjectsPostEvents(){this._cacheOrClearRemovedInstances();const e=this.getAdhocListOfAllInstances();for(let t=0,s=e.length;t<s;++t)e[t].stepBehaviorsPostEvents(this);this._cacheOrClearRemovedInstances()}addObject(e){this._instances.containsKey(e.name)||this._instances.put(e.name,[]),this._instances.get(e.name).push(e),this._allInstancesListIsUpToDate=!1}getObjects(e){return this._instances.containsKey(e)||(d.info('RuntimeScene.getObjects: No instances called "'+e+'"! Adding it.'),this._instances.put(e,[])),this._instances.get(e)}createObject(e){if(!this._objectsCtor.containsKey(e)||!this._objects.containsKey(e))return null;const t=this._instancesCache.get(e),s=this._objectsCtor.get(e);let a;return!t||t.length===0?a=new s(this,this._objects.get(e)):(a=t.pop(),a.reinitialize(this._objects.get(e))),this.addObject(a),a}markObjectForDeletion(e){if(this._instancesRemoved.indexOf(e)===-1&&this._instancesRemoved.push(e),this._instances.containsKey(e.getName())){const t=e.id,s=this._instances.get(e.getName());for(let a=0,n=s.length;a<n;++a)if(s[a].id==t){s.splice(a,1),this._allInstancesListIsUpToDate=!1;break}}e.onDeletedFromScene(this);for(let t=0;t<l.callbacksObjectDeletedFromScene.length;++t)l.callbacksObjectDeletedFromScene[t](this,e)}getLayer(e){return this._layers.containsKey(e)?this._layers.get(e):this._layers.get("")}hasLayer(e){return this._layers.containsKey(e)}removeLayer(e){const t=this._layers.get(e);if(!t)return;const s=this.getAdhocListOfAllInstances();for(let n=0;n<s.length;++n){const i=s[n];i.getLayer()===e&&i.setLayer("")}this._layers.remove(e);const a=this._orderedLayers.indexOf(t);this._orderedLayers.splice(a,1)}setLayerIndex(e,t){const s=this._layers.get(e);if(!s)return;const a=this._orderedLayers.indexOf(s);a!==t&&(this._orderedLayers.splice(a,1),this._orderedLayers.splice(t,0,s),this.getRenderer().setLayerIndex(s,t))}getAllLayerNames(e){this._layers.keys(e)}getInstancesCountOnScene(e){const t=this._instances.get(e);return t?t.length:0}updateObjectsForces(){for(const e in this._instances.items)if(this._instances.items.hasOwnProperty(e)){const t=this._instances.items[e];for(let s=0,a=t.length;s<a;++s){const n=t[s];if(!n.hasNoForces()){const i=n.getAverageForce(),r=n.getElapsedTime()/1e3;n.setX(n.getX()+i.getX()*r),n.setY(n.getY()+i.getY()*r),n.updateForces(r)}}}}_destroy(){this._layers=new Hashtable,this._orderedLayers=[],this._objects=new Hashtable,this._instances=new Hashtable,this._instancesCache=new Hashtable,this._objectsCtor=new Hashtable,this._allInstancesList=[],this._instancesRemoved=[]}}l.RuntimeInstanceContainer=u})(gdjs||(gdjs={}));
1
+ var gdjs;(function(l){const d=new l.Logger("RuntimeInstanceContainer");class u{constructor(){this._allInstancesList=[];this._allInstancesListIsUpToDate=!0;this._instancesRemoved=[];this._layersCameraCoordinates={};this._debugDrawEnabled=!1;this._debugDrawShowHiddenInstances=!1;this._debugDrawShowPointsNames=!1;this._debugDrawShowCustomPoints=!1;this._initialBehaviorSharedData=new Hashtable,this._instances=new Hashtable,this._instancesCache=new Hashtable,this._objects=new Hashtable,this._objectsCtor=new Hashtable,this._layers=new Hashtable,this._orderedLayers=[]}enableDebugDraw(e,t,s,a){this._debugDrawEnabled&&!e&&this.getDebuggerRenderer().clearDebugDraw(),this._debugDrawEnabled=e,this._debugDrawShowHiddenInstances=t,this._debugDrawShowPointsNames=s,this._debugDrawShowCustomPoints=a}isObjectRegistered(e){return this._objects.containsKey(e)&&this._instances.containsKey(e)&&this._objectsCtor.containsKey(e)}registerObject(e){this._objects.put(e.name,e),this._instances.put(e.name,[]);const t=l.getObjectConstructor(e.type);this._objectsCtor.put(e.name,t),t.supportsReinitialization&&this._instancesCache.put(e.name,[])}updateObject(e){this.isObjectRegistered(e.name)||d.warn("Tried to call updateObject for an object that was not registered ("+e.name+"). Call registerObject first."),this._objects.put(e.name,e)}unregisterObject(e){const t=this._instances.get(e);if(t){const s=t.slice();for(let a=0;a<s.length;a++)this.markObjectForDeletion(s[a]);this._cacheOrClearRemovedInstances()}this._objects.remove(e),this._instances.remove(e),this._instancesCache.remove(e),this._objectsCtor.remove(e)}createObjectsFrom(e,t,s,a,n){let i,r;arguments.length===5?(i=a,r=n):(i=0,r=arguments[3]);for(let h=0,g=e.length;h<g;++h){const o=e[h],_=o.name,c=this.createObject(_);c!==null&&(r&&(c.persistentUuid=o.persistentUuid||null),c.setPosition(o.x+t,o.y+s),c.setAngle(o.angle),l.Base3DHandler&&l.Base3DHandler.is3D(c)&&(c.setZ((o.z||0)+i),o.rotationX!==void 0&&c.setRotationX(o.rotationX),o.rotationY!==void 0&&c.setRotationY(o.rotationY)),c.setZOrder(o.zOrder),c.setLayer(o.layer),c.getVariables().initFrom(o.initialVariables,!0),c.extraInitializationFromInitialInstance(o))}}getInitialSharedDataForBehavior(e){return this._initialBehaviorSharedData.get(e)}setInitialSharedDataForBehavior(e,t){this._initialBehaviorSharedData.put(e,t)}_setLayerDefaultZOrders(){if(this.getGame().getGameData().properties.useDeprecatedZeroAsDefaultZOrder)return;const e={},t=this.getAdhocListOfAllInstances();for(let s=0,a=t.length;s<a;++s){const n=t[s];let i=n.getLayer();const r=n.getZOrder();(e[i]===void 0||e[i]<r)&&(e[i]=r)}for(let s in e)this.getLayer(s).setDefaultZOrder(e[s]+1)}_updateLayersCameraCoordinates(e){this._layersCameraCoordinates=this._layersCameraCoordinates||{};for(const t in this._layers.items)if(this._layers.items.hasOwnProperty(t)){const s=this._layers.items[t];this._layersCameraCoordinates[t]=this._layersCameraCoordinates[t]||[0,0,0,0],this._layersCameraCoordinates[t][0]=s.getCameraX()-s.getCameraWidth()/2*e,this._layersCameraCoordinates[t][1]=s.getCameraY()-s.getCameraHeight()/2*e,this._layersCameraCoordinates[t][2]=s.getCameraX()+s.getCameraWidth()/2*e,this._layersCameraCoordinates[t][3]=s.getCameraY()+s.getCameraHeight()/2*e}}_updateLayersPreRender(){for(const e of this._orderedLayers)e.updatePreRender(this)}_updateObjectsPreRender(){const e=this.getAdhocListOfAllInstances();for(let t=0,s=e.length;t<s;++t){const a=e[t],n=a.getRendererObject();n&&(n.visible=!a.isHidden(),n.visible&&this.getGame().getEffectsManager().updatePreRender(a.getRendererEffects(),a)),a.updatePreRender(this)}}_cacheOrClearRemovedInstances(){for(let e=0,t=this._instancesRemoved.length;e<t;++e){const s=this._instancesRemoved[e],a=this._instancesCache.get(s.getName());a&&a.length<128&&a.push(s),s.onDestroyed()}this._instancesRemoved.length=0}_constructListOfAllInstances(){let e=0;for(const t in this._instances.items)if(this._instances.items.hasOwnProperty(t)){const s=this._instances.items[t],a=e;e+=s.length;for(let n=0,i=s.length;n<i;++n)a+n<this._allInstancesList.length?this._allInstancesList[a+n]=s[n]:this._allInstancesList.push(s[n])}this._allInstancesList.length=e,this._allInstancesListIsUpToDate=!0}getInstancesOf(e){return this._instances.items[e]}getAdhocListOfAllInstances(){return this._allInstancesListIsUpToDate||this._constructListOfAllInstances(),this._allInstancesList}_updateObjectsPreEvents(){const e=this.getAdhocListOfAllInstances();for(let t=0,s=e.length;t<s;++t){const a=e[t],n=a.getElapsedTime();if(a.hasNoForces())a.update(this);else{const i=a.getAverageForce(),r=n/1e3;a.setX(a.getX()+i.getX()*r),a.setY(a.getY()+i.getY()*r),a.update(this),a.updateForces(r)}a.updateTimers(n),e[t].stepBehaviorsPreEvents(this)}this._cacheOrClearRemovedInstances()}_updateObjectsPostEvents(){this._cacheOrClearRemovedInstances();const e=this.getAdhocListOfAllInstances();for(let t=0,s=e.length;t<s;++t)e[t].stepBehaviorsPostEvents(this);this._cacheOrClearRemovedInstances()}addObject(e){this._instances.containsKey(e.name)||this._instances.put(e.name,[]),this._instances.get(e.name).push(e),this._allInstancesListIsUpToDate=!1}getObjects(e){return this._instances.containsKey(e)||(d.info('RuntimeScene.getObjects: No instances called "'+e+'"! Adding it.'),this._instances.put(e,[])),this._instances.get(e)}createObject(e){if(!this._objectsCtor.containsKey(e)||!this._objects.containsKey(e))return null;const t=this._instancesCache.get(e),s=this._objectsCtor.get(e);let a;return!t||t.length===0?a=new s(this,this._objects.get(e)):(a=t.pop(),a.reinitialize(this._objects.get(e))),this.addObject(a),a}markObjectForDeletion(e){if(this._instancesRemoved.indexOf(e)===-1&&this._instancesRemoved.push(e),this._instances.containsKey(e.getName())){const t=e.id,s=this._instances.get(e.getName());for(let a=0,n=s.length;a<n;++a)if(s[a].id==t){s.splice(a,1),this._allInstancesListIsUpToDate=!1;break}}e.onDeletedFromScene();for(let t=0;t<l.callbacksObjectDeletedFromScene.length;++t)l.callbacksObjectDeletedFromScene[t](this,e)}getLayer(e){return this._layers.containsKey(e)?this._layers.get(e):this._layers.get("")}hasLayer(e){return this._layers.containsKey(e)}removeLayer(e){const t=this._layers.get(e);if(!t)return;const s=this.getAdhocListOfAllInstances();for(let n=0;n<s.length;++n){const i=s[n];i.getLayer()===e&&i.setLayer("")}this._layers.remove(e);const a=this._orderedLayers.indexOf(t);this._orderedLayers.splice(a,1)}setLayerIndex(e,t){const s=this._layers.get(e);if(!s)return;const a=this._orderedLayers.indexOf(s);a!==t&&(this._orderedLayers.splice(a,1),this._orderedLayers.splice(t,0,s),this.getRenderer().setLayerIndex(s,t))}getAllLayerNames(e){this._layers.keys(e)}getInstancesCountOnScene(e){const t=this._instances.get(e);return t?t.length:0}updateObjectsForces(){for(const e in this._instances.items)if(this._instances.items.hasOwnProperty(e)){const t=this._instances.items[e];for(let s=0,a=t.length;s<a;++s){const n=t[s];if(!n.hasNoForces()){const i=n.getAverageForce(),r=n.getElapsedTime()/1e3;n.setX(n.getX()+i.getX()*r),n.setY(n.getY()+i.getY()*r),n.updateForces(r)}}}}_destroy(){this._layers=new Hashtable,this._orderedLayers=[],this._objects=new Hashtable,this._instances=new Hashtable,this._instancesCache=new Hashtable,this._objectsCtor=new Hashtable,this._allInstancesList=[],this._instancesRemoved=[],this._layersCameraCoordinates={},this._initialBehaviorSharedData=new Hashtable}}l.RuntimeInstanceContainer=u})(gdjs||(gdjs={}));
2
2
  //# sourceMappingURL=RuntimeInstanceContainer.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../GDevelop/GDJS/Runtime/RuntimeInstanceContainer.ts"],
4
- "sourcesContent": ["/*\n * GDevelop JS Platform\n * Copyright 2013-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.\n * This project is released under the MIT License.\n */\nnamespace gdjs {\n const logger = new gdjs.Logger('RuntimeInstanceContainer');\n\n /**\n * A container of object instances rendered on screen.\n */\n export abstract class RuntimeInstanceContainer {\n _initialBehaviorSharedData: Hashtable<BehaviorSharedData | null>;\n\n /** Contains the instances living on the container */\n _instances: Hashtable<RuntimeObject[]>;\n\n /**\n * An array used to create a list of all instance when necessary.\n * @see gdjs.RuntimeInstanceContainer#_constructListOfAllInstances}\n */\n private _allInstancesList: gdjs.RuntimeObject[] = [];\n _allInstancesListIsUpToDate = true;\n\n /** Used to recycle destroyed instance instead of creating new ones. */\n _instancesCache: Hashtable<RuntimeObject[]>;\n\n /** The instances removed from the container and waiting to be sent to the cache. */\n _instancesRemoved: gdjs.RuntimeObject[] = [];\n\n /** Contains the objects data stored in the project */\n _objects: Hashtable<ObjectData>;\n _objectsCtor: Hashtable<typeof RuntimeObject>;\n\n _layers: Hashtable<RuntimeLayer>;\n _orderedLayers: RuntimeLayer[]; // TODO: should this be a single structure with _layers, to enforce its usage?\n _layersCameraCoordinates: Record<string, [float, float, float, float]> = {};\n\n // Options for the debug draw:\n _debugDrawEnabled: boolean = false;\n _debugDrawShowHiddenInstances: boolean = false;\n _debugDrawShowPointsNames: boolean = false;\n _debugDrawShowCustomPoints: boolean = false;\n\n constructor() {\n this._initialBehaviorSharedData = new Hashtable();\n this._instances = new Hashtable();\n this._instancesCache = new Hashtable();\n this._objects = new Hashtable();\n this._objectsCtor = new Hashtable();\n this._layers = new Hashtable();\n this._orderedLayers = [];\n }\n\n /**\n * Return the time elapsed since the last frame,\n * in milliseconds, for objects on the layer.\n */\n abstract getElapsedTime(): float;\n\n /**\n * Get the renderer associated to the container.\n */\n abstract getRenderer(): gdjs.RuntimeInstanceContainerRenderer;\n\n /**\n * Get the renderer for visual debugging associated to the container.\n */\n abstract getDebuggerRenderer(): gdjs.DebuggerRenderer;\n\n /**\n * Get the {@link gdjs.RuntimeGame} associated to this.\n */\n abstract getGame(): gdjs.RuntimeGame;\n\n /**\n * Get the {@link gdjs.RuntimeScene} associated to this.\n */\n abstract getScene(): gdjs.RuntimeScene;\n\n abstract getAsyncTasksManager(): gdjs.AsyncTasksManager;\n\n /**\n * Convert a point from the canvas coordinates (for example,\n * the mouse position) to the container coordinates.\n *\n * @param x The x position, in container coordinates.\n * @param y The y position, in container coordinates.\n * @param result The point instance that is used to return the result.\n */\n abstract convertCoords(x: float, y: float, result?: FloatPoint): FloatPoint;\n\n /**\n * Convert a point from the container coordinates (for example,\n * an object position) to the canvas coordinates.\n *\n * @param sceneX The x position, in container coordinates.\n * @param sceneY The y position, in container coordinates.\n * @param result The point instance that is used to return the result.\n */\n abstract convertInverseCoords(\n sceneX: float,\n sceneY: float,\n result: FloatPoint\n ): FloatPoint;\n\n /**\n * @return the left bound of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getUnrotatedViewportMinX(): float;\n\n /**\n * @return the top bound of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getUnrotatedViewportMinY(): float;\n\n /**\n * @return the right bound of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getUnrotatedViewportMaxX(): float;\n\n /**\n * @return the bottom bound of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getUnrotatedViewportMaxY(): float;\n\n /**\n * @return the left bound of:\n * - the initial game resolution for a {@link gdjs.RuntimeScene}\n * - the initial default dimensions (inner area) set in the editor for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getInitialUnrotatedViewportMinX(): float;\n\n /**\n * @return the top bound of:\n * - the initial game resolution for a {@link gdjs.RuntimeScene}\n * - the initial default dimensions (inner area) set in the editor for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getInitialUnrotatedViewportMinY(): float;\n\n /**\n * @return the right bound of:\n * - the initial game resolution for a {@link gdjs.RuntimeScene}\n * - the initial default dimensions (inner area) set in the editor for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getInitialUnrotatedViewportMaxX(): float;\n\n /**\n * @return the bottom bound of:\n * - the initial game resolution for a {@link gdjs.RuntimeScene}\n * - the initial default dimensions (inner area) set in the editor for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getInitialUnrotatedViewportMaxY(): float;\n\n /**\n * @return the width of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getViewportWidth(): float;\n\n /**\n * @return the height of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getViewportHeight(): float;\n\n /**\n * @return the center X of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getViewportOriginX(): float;\n\n /**\n * @return the center Y of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getViewportOriginY(): float;\n\n /**\n * Triggered when the AABB of a child of the container could have changed.\n */\n abstract onChildrenLocationChanged(): void;\n\n /**\n * Activate or deactivate the debug visualization for collisions and points.\n */\n enableDebugDraw(\n enableDebugDraw: boolean,\n showHiddenInstances: boolean,\n showPointsNames: boolean,\n showCustomPoints: boolean\n ): void {\n if (this._debugDrawEnabled && !enableDebugDraw) {\n this.getDebuggerRenderer().clearDebugDraw();\n }\n\n this._debugDrawEnabled = enableDebugDraw;\n this._debugDrawShowHiddenInstances = showHiddenInstances;\n this._debugDrawShowPointsNames = showPointsNames;\n this._debugDrawShowCustomPoints = showCustomPoints;\n }\n\n /**\n * Check if an object is registered, meaning that instances of it can be\n * created and lives in the container.\n * @see gdjs.RuntimeInstanceContainer#registerObject\n */\n isObjectRegistered(objectName: string): boolean {\n return (\n this._objects.containsKey(objectName) &&\n this._instances.containsKey(objectName) &&\n this._objectsCtor.containsKey(objectName)\n );\n }\n\n /**\n * Register a {@link gdjs.RuntimeObject} so that instances of it can be\n * used in the container.\n * @param objectData The data for the object to register.\n */\n registerObject(objectData: ObjectData) {\n this._objects.put(objectData.name, objectData);\n this._instances.put(objectData.name, []);\n\n // Cache the constructor\n const Ctor = gdjs.getObjectConstructor(objectData.type);\n this._objectsCtor.put(objectData.name, Ctor);\n\n // Also prepare a cache for recycled instances, if the object supports it.\n if (Ctor.supportsReinitialization) {\n this._instancesCache.put(objectData.name, []);\n }\n }\n\n /**\n * Update the data of a {@link gdjs.RuntimeObject} so that instances use\n * this when constructed.\n * @param objectData The data for the object to register.\n */\n updateObject(objectData: ObjectData): void {\n if (!this.isObjectRegistered(objectData.name)) {\n logger.warn(\n 'Tried to call updateObject for an object that was not registered (' +\n objectData.name +\n '). Call registerObject first.'\n );\n }\n this._objects.put(objectData.name, objectData);\n }\n\n // Don't erase instances, nor instances cache, or objectsCtor cache.\n /**\n * Unregister a {@link gdjs.RuntimeObject}. Instances will be destroyed.\n * @param objectName The name of the object to unregister.\n */\n unregisterObject(objectName: string) {\n const instances = this._instances.get(objectName);\n if (instances) {\n // This is sub-optimal: markObjectForDeletion will search the instance to\n // remove in instances, so cost is O(n^2), n being the number of instances.\n // As we're unregistering an object which only happen during a hot-reloading,\n // this is fine.\n const instancesToRemove = instances.slice();\n for (let i = 0; i < instancesToRemove.length; i++) {\n this.markObjectForDeletion(instancesToRemove[i]);\n }\n this._cacheOrClearRemovedInstances();\n }\n this._objects.remove(objectName);\n this._instances.remove(objectName);\n this._instancesCache.remove(objectName);\n this._objectsCtor.remove(objectName);\n }\n\n /**\n * Create objects from initial instances data (for example, the initial instances\n * of the scene or the instances of an external layout).\n *\n * @param data The instances data\n * @param xPos The offset on X axis\n * @param yPos The offset on Y axis\n * @param zPos The offset on Z axis\n * @param trackByPersistentUuid If true, objects are tracked by setting their `persistentUuid`\n * to the same as the associated instance. Useful for hot-reloading when instances are changed.\n */\n createObjectsFrom(\n data: InstanceData[],\n xPos: float,\n yPos: float,\n zPos: float,\n trackByPersistentUuid: boolean\n ): void {\n let zOffset: number;\n let shouldTrackByPersistentUuid: boolean;\n\n if (arguments.length === 5) {\n zOffset = zPos;\n shouldTrackByPersistentUuid = trackByPersistentUuid;\n } else {\n /**\n * Support for the previous signature (before 3D was introduced):\n * createObjectsFrom(data, xPos, yPos, trackByPersistentUuid)\n */\n zOffset = 0;\n shouldTrackByPersistentUuid = arguments[3];\n }\n\n for (let i = 0, len = data.length; i < len; ++i) {\n const instanceData = data[i];\n const objectName = instanceData.name;\n const newObject = this.createObject(objectName);\n if (newObject !== null) {\n if (shouldTrackByPersistentUuid) {\n // Give the object the same persistentUuid as the instance, so that\n // it can be hot-reloaded.\n newObject.persistentUuid = instanceData.persistentUuid || null;\n }\n newObject.setPosition(instanceData.x + xPos, instanceData.y + yPos);\n newObject.setAngle(instanceData.angle);\n if (gdjs.Base3DHandler && gdjs.Base3DHandler.is3D(newObject)) {\n newObject.setZ((instanceData.z || 0) + zOffset);\n if (instanceData.rotationX !== undefined)\n newObject.setRotationX(instanceData.rotationX);\n if (instanceData.rotationY !== undefined)\n newObject.setRotationY(instanceData.rotationY);\n }\n\n newObject.setZOrder(instanceData.zOrder);\n newObject.setLayer(instanceData.layer);\n newObject\n .getVariables()\n .initFrom(instanceData.initialVariables, true);\n newObject.extraInitializationFromInitialInstance(instanceData);\n }\n }\n }\n\n /**\n * Get the data representing the initial shared data of the scene for the specified behavior.\n * @param name The name of the behavior\n * @returns The shared data for the behavior, if any.\n */\n getInitialSharedDataForBehavior(name: string): BehaviorSharedData | null {\n return this._initialBehaviorSharedData.get(name);\n }\n\n /**\n * Set the data representing the initial shared data of the scene for the specified behavior.\n * @param name The name of the behavior\n * @param sharedData The shared data for the behavior, or null to remove it.\n */\n setInitialSharedDataForBehavior(\n name: string,\n sharedData: BehaviorSharedData | null\n ): void {\n this._initialBehaviorSharedData.put(name, sharedData);\n }\n\n /**\n * Set the default Z order for each layer, which is the highest Z order found on each layer.\n * Useful as it ensures that instances created from events are, by default, shown in front\n * of other instances.\n */\n _setLayerDefaultZOrders() {\n if (\n this.getGame().getGameData().properties.useDeprecatedZeroAsDefaultZOrder\n ) {\n // Deprecated option to still support games that were made considered 0 as the\n // default Z order for all layers.\n return;\n }\n const layerHighestZOrders: Record<string, number> = {};\n const allInstances = this.getAdhocListOfAllInstances();\n for (let i = 0, len = allInstances.length; i < len; ++i) {\n const object = allInstances[i];\n let layerName = object.getLayer();\n const zOrder = object.getZOrder();\n if (\n layerHighestZOrders[layerName] === undefined ||\n layerHighestZOrders[layerName] < zOrder\n ) {\n layerHighestZOrders[layerName] = zOrder;\n }\n }\n for (let layerName in layerHighestZOrders) {\n this.getLayer(layerName).setDefaultZOrder(\n layerHighestZOrders[layerName] + 1\n );\n }\n }\n\n _updateLayersCameraCoordinates(scale: float) {\n this._layersCameraCoordinates = this._layersCameraCoordinates || {};\n for (const name in this._layers.items) {\n if (this._layers.items.hasOwnProperty(name)) {\n const theLayer = this._layers.items[name];\n this._layersCameraCoordinates[name] = this._layersCameraCoordinates[\n name\n ] || [0, 0, 0, 0];\n this._layersCameraCoordinates[name][0] =\n theLayer.getCameraX() - (theLayer.getCameraWidth() / 2) * scale;\n this._layersCameraCoordinates[name][1] =\n theLayer.getCameraY() - (theLayer.getCameraHeight() / 2) * scale;\n this._layersCameraCoordinates[name][2] =\n theLayer.getCameraX() + (theLayer.getCameraWidth() / 2) * scale;\n this._layersCameraCoordinates[name][3] =\n theLayer.getCameraY() + (theLayer.getCameraHeight() / 2) * scale;\n }\n }\n }\n\n /**\n * Called to update effects of layers before rendering.\n */\n _updateLayersPreRender() {\n for (const layer of this._orderedLayers) {\n layer.updatePreRender(this);\n }\n }\n\n /**\n * Called to update visibility of the renderers of objects\n * rendered on the scene (\"culling\"), update effects (of visible objects)\n * and give a last chance for objects to update before rendering.\n *\n * Visibility is set to false if object is hidden, or if\n * object is too far from the camera of its layer (\"culling\").\n */\n _updateObjectsPreRender() {\n const allInstancesList = this.getAdhocListOfAllInstances();\n // TODO (3D) culling - add support for 3D object culling?\n for (let i = 0, len = allInstancesList.length; i < len; ++i) {\n const object = allInstancesList[i];\n const rendererObject = object.getRendererObject();\n if (rendererObject) {\n rendererObject.visible = !object.isHidden();\n\n // Update effects, only for visible objects.\n if (rendererObject.visible) {\n this.getGame()\n .getEffectsManager()\n .updatePreRender(object.getRendererEffects(), object);\n }\n }\n\n // Perform pre-render update.\n object.updatePreRender(this);\n }\n return;\n }\n\n /**\n * Empty the list of the removed objects:\n *\n * When an object is removed from the container, it is still kept in\n * {@link gdjs.RuntimeInstanceContainer#_instancesRemoved}.\n *\n * This method should be called regularly (after events or behaviors steps) so as to clear this list\n * and allows the removed objects to be cached (or destroyed if the cache is full).\n *\n * The removed objects could not be sent directly to the cache, as events may still be using them after\n * removing them from the scene for example.\n */\n _cacheOrClearRemovedInstances() {\n for (let k = 0, lenk = this._instancesRemoved.length; k < lenk; ++k) {\n const instance = this._instancesRemoved[k];\n // Cache the instance to recycle it into a new instance later.\n // If the object does not support recycling, the cache won't be defined.\n const cache = this._instancesCache.get(instance.getName());\n if (cache) {\n if (cache.length < 128) {\n cache.push(instance);\n }\n }\n instance.onDestroyed();\n }\n this._instancesRemoved.length = 0;\n }\n\n /**\n * Tool function filling _allInstancesList member with all the living object instances.\n */\n private _constructListOfAllInstances() {\n let currentListSize = 0;\n for (const name in this._instances.items) {\n if (this._instances.items.hasOwnProperty(name)) {\n const list = this._instances.items[name];\n const oldSize = currentListSize;\n currentListSize += list.length;\n for (let j = 0, lenj = list.length; j < lenj; ++j) {\n if (oldSize + j < this._allInstancesList.length) {\n this._allInstancesList[oldSize + j] = list[j];\n } else {\n this._allInstancesList.push(list[j]);\n }\n }\n }\n }\n this._allInstancesList.length = currentListSize;\n this._allInstancesListIsUpToDate = true;\n }\n\n /**\n * @param objectName The name of the object\n * @returns the instances of a given object in the container.\n */\n getInstancesOf(objectName: string): gdjs.RuntimeObject[] {\n return this._instances.items[objectName];\n }\n\n /**\n * Get a list of all {@link gdjs.RuntimeObject} living in the container.\n * You should not, normally, need this method at all. It's only to be used\n * in exceptional use cases where you need to loop through all objects,\n * and it won't be performant.\n *\n * @returns The list of all runtime objects in the container\n */\n getAdhocListOfAllInstances(): gdjs.RuntimeObject[] {\n if (!this._allInstancesListIsUpToDate) {\n this._constructListOfAllInstances();\n }\n return this._allInstancesList;\n }\n\n /**\n * Update the objects before launching the events.\n */\n _updateObjectsPreEvents() {\n // It is *mandatory* to create and iterate on a external list of all objects, as the behaviors\n // may delete the objects.\n const allInstancesList = this.getAdhocListOfAllInstances();\n for (let i = 0, len = allInstancesList.length; i < len; ++i) {\n const obj = allInstancesList[i];\n const elapsedTime = obj.getElapsedTime();\n if (!obj.hasNoForces()) {\n const averageForce = obj.getAverageForce();\n const elapsedTimeInSeconds = elapsedTime / 1000;\n obj.setX(obj.getX() + averageForce.getX() * elapsedTimeInSeconds);\n obj.setY(obj.getY() + averageForce.getY() * elapsedTimeInSeconds);\n obj.update(this);\n obj.updateForces(elapsedTimeInSeconds);\n } else {\n obj.update(this);\n }\n obj.updateTimers(elapsedTime);\n allInstancesList[i].stepBehaviorsPreEvents(this);\n }\n\n // Some behaviors may have request objects to be deleted.\n this._cacheOrClearRemovedInstances();\n }\n\n /**\n * Update the objects (update positions, time management...)\n */\n _updateObjectsPostEvents() {\n this._cacheOrClearRemovedInstances();\n\n // It is *mandatory* to create and iterate on a external list of all objects, as the behaviors\n // may delete the objects.\n const allInstancesList = this.getAdhocListOfAllInstances();\n for (let i = 0, len = allInstancesList.length; i < len; ++i) {\n allInstancesList[i].stepBehaviorsPostEvents(this);\n }\n\n // Some behaviors may have request objects to be deleted.\n this._cacheOrClearRemovedInstances();\n }\n\n /**\n * Add an object to the instances living in the container.\n * @param obj The object to be added.\n */\n addObject(obj: gdjs.RuntimeObject) {\n if (!this._instances.containsKey(obj.name)) {\n this._instances.put(obj.name, []);\n }\n this._instances.get(obj.name).push(obj);\n this._allInstancesListIsUpToDate = false;\n }\n\n /**\n * Get all the instances of the object called name.\n * @param name Name of the object for which the instances must be returned.\n * @return The list of objects with the given name\n */\n getObjects(name: string): gdjs.RuntimeObject[] | undefined {\n if (!this._instances.containsKey(name)) {\n logger.info(\n 'RuntimeScene.getObjects: No instances called \"' +\n name +\n '\"! Adding it.'\n );\n this._instances.put(name, []);\n }\n return this._instances.get(name);\n }\n\n /**\n * Create a new object from its name. The object is also added to the instances\n * living in the container (No need to call {@link gdjs.RuntimeScene.addObject})\n * @param objectName The name of the object to be created\n * @return The created object\n */\n createObject(objectName: string): gdjs.RuntimeObject | null {\n if (\n !this._objectsCtor.containsKey(objectName) ||\n !this._objects.containsKey(objectName)\n ) {\n // There is no such object in this container.\n return null;\n }\n\n // Create a new object using the object constructor (cached during loading)\n // and the stored object's data:\n const cache = this._instancesCache.get(objectName);\n const ctor = this._objectsCtor.get(objectName);\n let obj;\n if (!cache || cache.length === 0) {\n obj = new ctor(this, this._objects.get(objectName));\n } else {\n // Reuse an objet destroyed before. If there is an object in the cache,\n // then it means it does support reinitialization.\n obj = cache.pop();\n obj.reinitialize(this._objects.get(objectName));\n }\n this.addObject(obj);\n return obj;\n }\n\n /**\n * Must be called whenever an object must be removed from the container.\n * @param obj The object to be removed.\n */\n markObjectForDeletion(obj: gdjs.RuntimeObject) {\n // Add to the objects removed list.\n // The objects will be sent to the instances cache or really deleted from memory later.\n if (this._instancesRemoved.indexOf(obj) === -1) {\n this._instancesRemoved.push(obj);\n }\n\n // Delete from the living instances.\n if (this._instances.containsKey(obj.getName())) {\n const objId = obj.id;\n const allInstances = this._instances.get(obj.getName());\n for (let i = 0, len = allInstances.length; i < len; ++i) {\n if (allInstances[i].id == objId) {\n allInstances.splice(i, 1);\n this._allInstancesListIsUpToDate = false;\n break;\n }\n }\n }\n\n // Notify the object it was removed from the container\n obj.onDeletedFromScene(this);\n\n // Notify the global callbacks\n for (let j = 0; j < gdjs.callbacksObjectDeletedFromScene.length; ++j) {\n gdjs.callbacksObjectDeletedFromScene[j](this, obj);\n }\n return;\n }\n\n /**\n * Get the layer with the given name\n * @param name The name of the layer\n * @returns The layer, or the base layer if not found\n */\n getLayer(name: string): gdjs.RuntimeLayer {\n if (this._layers.containsKey(name)) {\n return this._layers.get(name);\n }\n return this._layers.get('');\n }\n\n /**\n * Check if a layer exists\n * @param name The name of the layer\n */\n hasLayer(name: string): boolean {\n return this._layers.containsKey(name);\n }\n\n /**\n * Add a layer.\n * @param layerData The data to construct the layer\n */\n abstract addLayer(layerData: LayerData);\n\n /**\n * Remove a layer. All {@link gdjs.RuntimeObject} on this layer will\n * be moved back to the base layer.\n * @param layerName The name of the layer to remove\n */\n removeLayer(layerName: string) {\n const existingLayer = this._layers.get(layerName);\n if (!existingLayer) return;\n\n const allInstances = this.getAdhocListOfAllInstances();\n for (let i = 0; i < allInstances.length; ++i) {\n const runtimeObject = allInstances[i];\n if (runtimeObject.getLayer() === layerName) {\n runtimeObject.setLayer('');\n }\n }\n this._layers.remove(layerName);\n const layerIndex = this._orderedLayers.indexOf(existingLayer);\n this._orderedLayers.splice(layerIndex, 1);\n }\n\n /**\n * Change the position of a layer.\n *\n * @param layerName The name of the layer to reorder\n * @param newIndex The new position in the list of layers\n */\n setLayerIndex(layerName: string, newIndex: integer): void {\n const layer: gdjs.RuntimeLayer = this._layers.get(layerName);\n if (!layer) {\n return;\n }\n const layerIndex = this._orderedLayers.indexOf(layer);\n if (layerIndex === newIndex) return;\n\n this._orderedLayers.splice(layerIndex, 1);\n this._orderedLayers.splice(newIndex, 0, layer);\n\n this.getRenderer().setLayerIndex(layer, newIndex);\n }\n\n /**\n * Fill the array passed as argument with the names of all layers\n * @param result The array where to put the layer names\n */\n getAllLayerNames(result: string[]) {\n this._layers.keys(result);\n }\n\n /**\n * Return the number of instances of the specified object living in the container.\n * @param objectName The object name for which instances must be counted.\n */\n getInstancesCountOnScene(objectName: string): integer {\n const instances = this._instances.get(objectName);\n if (instances) {\n return instances.length;\n }\n\n return 0;\n }\n\n /**\n * Update the objects positions according to their forces\n */\n updateObjectsForces(): void {\n for (const name in this._instances.items) {\n if (this._instances.items.hasOwnProperty(name)) {\n const list = this._instances.items[name];\n for (let j = 0, listLen = list.length; j < listLen; ++j) {\n const obj = list[j];\n if (!obj.hasNoForces()) {\n const averageForce = obj.getAverageForce();\n const elapsedTimeInSeconds = obj.getElapsedTime() / 1000;\n obj.setX(obj.getX() + averageForce.getX() * elapsedTimeInSeconds);\n obj.setY(obj.getY() + averageForce.getY() * elapsedTimeInSeconds);\n obj.updateForces(elapsedTimeInSeconds);\n }\n }\n }\n }\n }\n\n /**\n * Clear any data structures to make sure memory is freed as soon as\n * possible.\n */\n _destroy() {\n // It should not be necessary to reset these variables, but this help\n // ensuring that all memory related to the container is released immediately.\n this._layers = new Hashtable();\n this._orderedLayers = [];\n this._objects = new Hashtable();\n this._instances = new Hashtable();\n this._instancesCache = new Hashtable();\n this._objectsCtor = new Hashtable();\n this._allInstancesList = [];\n this._instancesRemoved = [];\n }\n }\n}\n"],
5
- "mappings": "AAKA,GAAU,MAAV,UAAU,EAAV,CACE,KAAM,GAAS,GAAI,GAAK,OAAO,4BAKxB,OAAwC,CAiC7C,aAAc,CAvBN,uBAA0C,GAClD,iCAA8B,GAM9B,uBAA0C,GAQ1C,8BAAyE,GAGzE,uBAA6B,GAC7B,mCAAyC,GACzC,+BAAqC,GACrC,gCAAsC,GAGpC,KAAK,2BAA6B,GAAI,WACtC,KAAK,WAAa,GAAI,WACtB,KAAK,gBAAkB,GAAI,WAC3B,KAAK,SAAW,GAAI,WACpB,KAAK,aAAe,GAAI,WACxB,KAAK,QAAU,GAAI,WACnB,KAAK,eAAiB,GA+JxB,gBACE,EACA,EACA,EACA,EACM,CACN,AAAI,KAAK,mBAAqB,CAAC,GAC7B,KAAK,sBAAsB,iBAG7B,KAAK,kBAAoB,EACzB,KAAK,8BAAgC,EACrC,KAAK,0BAA4B,EACjC,KAAK,2BAA6B,EAQpC,mBAAmB,EAA6B,CAC9C,MACE,MAAK,SAAS,YAAY,IAC1B,KAAK,WAA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AE,EAAG,CACvD,KAAM,GAAM,EAAK,GACjB,GAAI,CAAC,EAAI,cAAe,CACtB,KAAM,GAAe,EAAI,kBACnB,EAAuB,EAAI,iBAAmB,IACpD,EAAI,KAAK,EAAI,OAAS,EAAa,OAAS,GAC5C,EAAI,KAAK,EAAI,OAAS,EAAa,OAAS,GAC5C,EAAI,aAAa,MAW3B,UAAW,CAGT,KAAK,QAAU,GAAI,WACnB,KAAK,eAAiB,GACtB,KAAK,SAAW,GAAI,WACpB,KAAK,WAAa,GAAI,WACtB,KAAK,gBAAkB,GAAI,WAC3B,KAAK,aAAe,GAAI,WACxB,KAAK,kBAAoB,GACzB,KAAK,kBAAoB,IAjyBtB,EAAe,6BANd",
4
+ "sourcesContent": ["/*\n * GDevelop JS Platform\n * Copyright 2013-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.\n * This project is released under the MIT License.\n */\nnamespace gdjs {\n const logger = new gdjs.Logger('RuntimeInstanceContainer');\n\n /**\n * A container of object instances rendered on screen.\n */\n export abstract class RuntimeInstanceContainer {\n _initialBehaviorSharedData: Hashtable<BehaviorSharedData | null>;\n\n /** Contains the instances living on the container */\n _instances: Hashtable<RuntimeObject[]>;\n\n /**\n * An array used to create a list of all instance when necessary.\n * @see gdjs.RuntimeInstanceContainer#_constructListOfAllInstances}\n */\n private _allInstancesList: gdjs.RuntimeObject[] = [];\n _allInstancesListIsUpToDate = true;\n\n /** Used to recycle destroyed instance instead of creating new ones. */\n _instancesCache: Hashtable<RuntimeObject[]>;\n\n /** The instances removed from the container and waiting to be sent to the cache. */\n _instancesRemoved: gdjs.RuntimeObject[] = [];\n\n /** Contains the objects data stored in the project */\n _objects: Hashtable<ObjectData>;\n _objectsCtor: Hashtable<typeof RuntimeObject>;\n\n _layers: Hashtable<RuntimeLayer>;\n _orderedLayers: RuntimeLayer[]; // TODO: should this be a single structure with _layers, to enforce its usage?\n _layersCameraCoordinates: Record<string, [float, float, float, float]> = {};\n\n // Options for the debug draw:\n _debugDrawEnabled: boolean = false;\n _debugDrawShowHiddenInstances: boolean = false;\n _debugDrawShowPointsNames: boolean = false;\n _debugDrawShowCustomPoints: boolean = false;\n\n constructor() {\n this._initialBehaviorSharedData = new Hashtable();\n this._instances = new Hashtable();\n this._instancesCache = new Hashtable();\n this._objects = new Hashtable();\n this._objectsCtor = new Hashtable();\n this._layers = new Hashtable();\n this._orderedLayers = [];\n }\n\n /**\n * Return the time elapsed since the last frame,\n * in milliseconds, for objects on the layer.\n */\n abstract getElapsedTime(): float;\n\n /**\n * Get the renderer associated to the container.\n */\n abstract getRenderer(): gdjs.RuntimeInstanceContainerRenderer;\n\n /**\n * Get the renderer for visual debugging associated to the container.\n */\n abstract getDebuggerRenderer(): gdjs.DebuggerRenderer;\n\n /**\n * Get the {@link gdjs.RuntimeGame} associated to this.\n */\n abstract getGame(): gdjs.RuntimeGame;\n\n /**\n * Get the {@link gdjs.RuntimeScene} associated to this.\n */\n abstract getScene(): gdjs.RuntimeScene;\n\n abstract getAsyncTasksManager(): gdjs.AsyncTasksManager;\n\n /**\n * Convert a point from the canvas coordinates (for example,\n * the mouse position) to the container coordinates.\n *\n * @param x The x position, in container coordinates.\n * @param y The y position, in container coordinates.\n * @param result The point instance that is used to return the result.\n */\n abstract convertCoords(x: float, y: float, result?: FloatPoint): FloatPoint;\n\n /**\n * Convert a point from the container coordinates (for example,\n * an object position) to the canvas coordinates.\n *\n * @param sceneX The x position, in container coordinates.\n * @param sceneY The y position, in container coordinates.\n * @param result The point instance that is used to return the result.\n */\n abstract convertInverseCoords(\n sceneX: float,\n sceneY: float,\n result: FloatPoint\n ): FloatPoint;\n\n /**\n * @return the left bound of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getUnrotatedViewportMinX(): float;\n\n /**\n * @return the top bound of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getUnrotatedViewportMinY(): float;\n\n /**\n * @return the right bound of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getUnrotatedViewportMaxX(): float;\n\n /**\n * @return the bottom bound of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getUnrotatedViewportMaxY(): float;\n\n /**\n * @return the left bound of:\n * - the initial game resolution for a {@link gdjs.RuntimeScene}\n * - the initial default dimensions (inner area) set in the editor for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getInitialUnrotatedViewportMinX(): float;\n\n /**\n * @return the top bound of:\n * - the initial game resolution for a {@link gdjs.RuntimeScene}\n * - the initial default dimensions (inner area) set in the editor for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getInitialUnrotatedViewportMinY(): float;\n\n /**\n * @return the right bound of:\n * - the initial game resolution for a {@link gdjs.RuntimeScene}\n * - the initial default dimensions (inner area) set in the editor for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getInitialUnrotatedViewportMaxX(): float;\n\n /**\n * @return the bottom bound of:\n * - the initial game resolution for a {@link gdjs.RuntimeScene}\n * - the initial default dimensions (inner area) set in the editor for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getInitialUnrotatedViewportMaxY(): float;\n\n /**\n * @return the width of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getViewportWidth(): float;\n\n /**\n * @return the height of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getViewportHeight(): float;\n\n /**\n * @return the center X of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getViewportOriginX(): float;\n\n /**\n * @return the center Y of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getViewportOriginY(): float;\n\n /**\n * Triggered when the AABB of a child of the container could have changed.\n */\n abstract onChildrenLocationChanged(): void;\n\n /**\n * Activate or deactivate the debug visualization for collisions and points.\n */\n enableDebugDraw(\n enableDebugDraw: boolean,\n showHiddenInstances: boolean,\n showPointsNames: boolean,\n showCustomPoints: boolean\n ): void {\n if (this._debugDrawEnabled && !enableDebugDraw) {\n this.getDebuggerRenderer().clearDebugDraw();\n }\n\n this._debugDrawEnabled = enableDebugDraw;\n this._debugDrawShowHiddenInstances = showHiddenInstances;\n this._debugDrawShowPointsNames = showPointsNames;\n this._debugDrawShowCustomPoints = showCustomPoints;\n }\n\n /**\n * Check if an object is registered, meaning that instances of it can be\n * created and lives in the container.\n * @see gdjs.RuntimeInstanceContainer#registerObject\n */\n isObjectRegistered(objectName: string): boolean {\n return (\n this._objects.containsKey(objectName) &&\n this._instances.containsKey(objectName) &&\n this._objectsCtor.containsKey(objectName)\n );\n }\n\n /**\n * Register a {@link gdjs.RuntimeObject} so that instances of it can be\n * used in the container.\n * @param objectData The data for the object to register.\n */\n registerObject(objectData: ObjectData) {\n this._objects.put(objectData.name, objectData);\n this._instances.put(objectData.name, []);\n\n // Cache the constructor\n const Ctor = gdjs.getObjectConstructor(objectData.type);\n this._objectsCtor.put(objectData.name, Ctor);\n\n // Also prepare a cache for recycled instances, if the object supports it.\n if (Ctor.supportsReinitialization) {\n this._instancesCache.put(objectData.name, []);\n }\n }\n\n /**\n * Update the data of a {@link gdjs.RuntimeObject} so that instances use\n * this when constructed.\n * @param objectData The data for the object to register.\n */\n updateObject(objectData: ObjectData): void {\n if (!this.isObjectRegistered(objectData.name)) {\n logger.warn(\n 'Tried to call updateObject for an object that was not registered (' +\n objectData.name +\n '). Call registerObject first.'\n );\n }\n this._objects.put(objectData.name, objectData);\n }\n\n // Don't erase instances, nor instances cache, or objectsCtor cache.\n /**\n * Unregister a {@link gdjs.RuntimeObject}. Instances will be destroyed.\n * @param objectName The name of the object to unregister.\n */\n unregisterObject(objectName: string) {\n const instances = this._instances.get(objectName);\n if (instances) {\n // This is sub-optimal: markObjectForDeletion will search the instance to\n // remove in instances, so cost is O(n^2), n being the number of instances.\n // As we're unregistering an object which only happen during a hot-reloading,\n // this is fine.\n const instancesToRemove = instances.slice();\n for (let i = 0; i < instancesToRemove.length; i++) {\n this.markObjectForDeletion(instancesToRemove[i]);\n }\n this._cacheOrClearRemovedInstances();\n }\n this._objects.remove(objectName);\n this._instances.remove(objectName);\n this._instancesCache.remove(objectName);\n this._objectsCtor.remove(objectName);\n }\n\n /**\n * Create objects from initial instances data (for example, the initial instances\n * of the scene or the instances of an external layout).\n *\n * @param data The instances data\n * @param xPos The offset on X axis\n * @param yPos The offset on Y axis\n * @param zPos The offset on Z axis\n * @param trackByPersistentUuid If true, objects are tracked by setting their `persistentUuid`\n * to the same as the associated instance. Useful for hot-reloading when instances are changed.\n */\n createObjectsFrom(\n data: InstanceData[],\n xPos: float,\n yPos: float,\n zPos: float,\n trackByPersistentUuid: boolean\n ): void {\n let zOffset: number;\n let shouldTrackByPersistentUuid: boolean;\n\n if (arguments.length === 5) {\n zOffset = zPos;\n shouldTrackByPersistentUuid = trackByPersistentUuid;\n } else {\n /**\n * Support for the previous signature (before 3D was introduced):\n * createObjectsFrom(data, xPos, yPos, trackByPersistentUuid)\n */\n zOffset = 0;\n shouldTrackByPersistentUuid = arguments[3];\n }\n\n for (let i = 0, len = data.length; i < len; ++i) {\n const instanceData = data[i];\n const objectName = instanceData.name;\n const newObject = this.createObject(objectName);\n if (newObject !== null) {\n if (shouldTrackByPersistentUuid) {\n // Give the object the same persistentUuid as the instance, so that\n // it can be hot-reloaded.\n newObject.persistentUuid = instanceData.persistentUuid || null;\n }\n newObject.setPosition(instanceData.x + xPos, instanceData.y + yPos);\n newObject.setAngle(instanceData.angle);\n if (gdjs.Base3DHandler && gdjs.Base3DHandler.is3D(newObject)) {\n newObject.setZ((instanceData.z || 0) + zOffset);\n if (instanceData.rotationX !== undefined)\n newObject.setRotationX(instanceData.rotationX);\n if (instanceData.rotationY !== undefined)\n newObject.setRotationY(instanceData.rotationY);\n }\n\n newObject.setZOrder(instanceData.zOrder);\n newObject.setLayer(instanceData.layer);\n newObject\n .getVariables()\n .initFrom(instanceData.initialVariables, true);\n newObject.extraInitializationFromInitialInstance(instanceData);\n }\n }\n }\n\n /**\n * Get the data representing the initial shared data of the scene for the specified behavior.\n * @param name The name of the behavior\n * @returns The shared data for the behavior, if any.\n */\n getInitialSharedDataForBehavior(name: string): BehaviorSharedData | null {\n return this._initialBehaviorSharedData.get(name);\n }\n\n /**\n * Set the data representing the initial shared data of the scene for the specified behavior.\n * @param name The name of the behavior\n * @param sharedData The shared data for the behavior, or null to remove it.\n */\n setInitialSharedDataForBehavior(\n name: string,\n sharedData: BehaviorSharedData | null\n ): void {\n this._initialBehaviorSharedData.put(name, sharedData);\n }\n\n /**\n * Set the default Z order for each layer, which is the highest Z order found on each layer.\n * Useful as it ensures that instances created from events are, by default, shown in front\n * of other instances.\n */\n _setLayerDefaultZOrders() {\n if (\n this.getGame().getGameData().properties.useDeprecatedZeroAsDefaultZOrder\n ) {\n // Deprecated option to still support games that were made considered 0 as the\n // default Z order for all layers.\n return;\n }\n const layerHighestZOrders: Record<string, number> = {};\n const allInstances = this.getAdhocListOfAllInstances();\n for (let i = 0, len = allInstances.length; i < len; ++i) {\n const object = allInstances[i];\n let layerName = object.getLayer();\n const zOrder = object.getZOrder();\n if (\n layerHighestZOrders[layerName] === undefined ||\n layerHighestZOrders[layerName] < zOrder\n ) {\n layerHighestZOrders[layerName] = zOrder;\n }\n }\n for (let layerName in layerHighestZOrders) {\n this.getLayer(layerName).setDefaultZOrder(\n layerHighestZOrders[layerName] + 1\n );\n }\n }\n\n _updateLayersCameraCoordinates(scale: float) {\n this._layersCameraCoordinates = this._layersCameraCoordinates || {};\n for (const name in this._layers.items) {\n if (this._layers.items.hasOwnProperty(name)) {\n const theLayer = this._layers.items[name];\n this._layersCameraCoordinates[name] = this._layersCameraCoordinates[\n name\n ] || [0, 0, 0, 0];\n this._layersCameraCoordinates[name][0] =\n theLayer.getCameraX() - (theLayer.getCameraWidth() / 2) * scale;\n this._layersCameraCoordinates[name][1] =\n theLayer.getCameraY() - (theLayer.getCameraHeight() / 2) * scale;\n this._layersCameraCoordinates[name][2] =\n theLayer.getCameraX() + (theLayer.getCameraWidth() / 2) * scale;\n this._layersCameraCoordinates[name][3] =\n theLayer.getCameraY() + (theLayer.getCameraHeight() / 2) * scale;\n }\n }\n }\n\n /**\n * Called to update effects of layers before rendering.\n */\n _updateLayersPreRender() {\n for (const layer of this._orderedLayers) {\n layer.updatePreRender(this);\n }\n }\n\n /**\n * Called to update visibility of the renderers of objects\n * rendered on the scene (\"culling\"), update effects (of visible objects)\n * and give a last chance for objects to update before rendering.\n *\n * Visibility is set to false if object is hidden, or if\n * object is too far from the camera of its layer (\"culling\").\n */\n _updateObjectsPreRender() {\n const allInstancesList = this.getAdhocListOfAllInstances();\n // TODO (3D) culling - add support for 3D object culling?\n for (let i = 0, len = allInstancesList.length; i < len; ++i) {\n const object = allInstancesList[i];\n const rendererObject = object.getRendererObject();\n if (rendererObject) {\n rendererObject.visible = !object.isHidden();\n\n // Update effects, only for visible objects.\n if (rendererObject.visible) {\n this.getGame()\n .getEffectsManager()\n .updatePreRender(object.getRendererEffects(), object);\n }\n }\n\n // Perform pre-render update.\n object.updatePreRender(this);\n }\n return;\n }\n\n /**\n * Empty the list of the removed objects:\n *\n * When an object is removed from the container, it is still kept in\n * {@link gdjs.RuntimeInstanceContainer#_instancesRemoved}.\n *\n * This method should be called regularly (after events or behaviors steps) so as to clear this list\n * and allows the removed objects to be cached (or destroyed if the cache is full).\n *\n * The removed objects could not be sent directly to the cache, as events may still be using them after\n * removing them from the scene for example.\n */\n _cacheOrClearRemovedInstances() {\n for (let k = 0, lenk = this._instancesRemoved.length; k < lenk; ++k) {\n const instance = this._instancesRemoved[k];\n // Cache the instance to recycle it into a new instance later.\n // If the object does not support recycling, the cache won't be defined.\n const cache = this._instancesCache.get(instance.getName());\n if (cache) {\n if (cache.length < 128) {\n cache.push(instance);\n }\n }\n instance.onDestroyed();\n }\n this._instancesRemoved.length = 0;\n }\n\n /**\n * Tool function filling _allInstancesList member with all the living object instances.\n */\n private _constructListOfAllInstances() {\n let currentListSize = 0;\n for (const name in this._instances.items) {\n if (this._instances.items.hasOwnProperty(name)) {\n const list = this._instances.items[name];\n const oldSize = currentListSize;\n currentListSize += list.length;\n for (let j = 0, lenj = list.length; j < lenj; ++j) {\n if (oldSize + j < this._allInstancesList.length) {\n this._allInstancesList[oldSize + j] = list[j];\n } else {\n this._allInstancesList.push(list[j]);\n }\n }\n }\n }\n this._allInstancesList.length = currentListSize;\n this._allInstancesListIsUpToDate = true;\n }\n\n /**\n * @param objectName The name of the object\n * @returns the instances of a given object in the container.\n */\n getInstancesOf(objectName: string): gdjs.RuntimeObject[] {\n return this._instances.items[objectName];\n }\n\n /**\n * Get a list of all {@link gdjs.RuntimeObject} living in the container.\n * You should not, normally, need this method at all. It's only to be used\n * in exceptional use cases where you need to loop through all objects,\n * and it won't be performant.\n *\n * @returns The list of all runtime objects in the container\n */\n getAdhocListOfAllInstances(): gdjs.RuntimeObject[] {\n if (!this._allInstancesListIsUpToDate) {\n this._constructListOfAllInstances();\n }\n return this._allInstancesList;\n }\n\n /**\n * Update the objects before launching the events.\n */\n _updateObjectsPreEvents() {\n // It is *mandatory* to create and iterate on a external list of all objects, as the behaviors\n // may delete the objects.\n const allInstancesList = this.getAdhocListOfAllInstances();\n for (let i = 0, len = allInstancesList.length; i < len; ++i) {\n const obj = allInstancesList[i];\n const elapsedTime = obj.getElapsedTime();\n if (!obj.hasNoForces()) {\n const averageForce = obj.getAverageForce();\n const elapsedTimeInSeconds = elapsedTime / 1000;\n obj.setX(obj.getX() + averageForce.getX() * elapsedTimeInSeconds);\n obj.setY(obj.getY() + averageForce.getY() * elapsedTimeInSeconds);\n obj.update(this);\n obj.updateForces(elapsedTimeInSeconds);\n } else {\n obj.update(this);\n }\n obj.updateTimers(elapsedTime);\n allInstancesList[i].stepBehaviorsPreEvents(this);\n }\n\n // Some behaviors may have request objects to be deleted.\n this._cacheOrClearRemovedInstances();\n }\n\n /**\n * Update the objects (update positions, time management...)\n */\n _updateObjectsPostEvents() {\n this._cacheOrClearRemovedInstances();\n\n // It is *mandatory* to create and iterate on a external list of all objects, as the behaviors\n // may delete the objects.\n const allInstancesList = this.getAdhocListOfAllInstances();\n for (let i = 0, len = allInstancesList.length; i < len; ++i) {\n allInstancesList[i].stepBehaviorsPostEvents(this);\n }\n\n // Some behaviors may have request objects to be deleted.\n this._cacheOrClearRemovedInstances();\n }\n\n /**\n * Add an object to the instances living in the container.\n * @param obj The object to be added.\n */\n addObject(obj: gdjs.RuntimeObject) {\n if (!this._instances.containsKey(obj.name)) {\n this._instances.put(obj.name, []);\n }\n this._instances.get(obj.name).push(obj);\n this._allInstancesListIsUpToDate = false;\n }\n\n /**\n * Get all the instances of the object called name.\n * @param name Name of the object for which the instances must be returned.\n * @return The list of objects with the given name\n */\n getObjects(name: string): gdjs.RuntimeObject[] | undefined {\n if (!this._instances.containsKey(name)) {\n logger.info(\n 'RuntimeScene.getObjects: No instances called \"' +\n name +\n '\"! Adding it.'\n );\n this._instances.put(name, []);\n }\n return this._instances.get(name);\n }\n\n /**\n * Create a new object from its name. The object is also added to the instances\n * living in the container (No need to call {@link gdjs.RuntimeScene.addObject})\n * @param objectName The name of the object to be created\n * @return The created object\n */\n createObject(objectName: string): gdjs.RuntimeObject | null {\n if (\n !this._objectsCtor.containsKey(objectName) ||\n !this._objects.containsKey(objectName)\n ) {\n // There is no such object in this container.\n return null;\n }\n\n // Create a new object using the object constructor (cached during loading)\n // and the stored object's data:\n const cache = this._instancesCache.get(objectName);\n const ctor = this._objectsCtor.get(objectName);\n let obj;\n if (!cache || cache.length === 0) {\n obj = new ctor(this, this._objects.get(objectName));\n } else {\n // Reuse an objet destroyed before. If there is an object in the cache,\n // then it means it does support reinitialization.\n obj = cache.pop();\n obj.reinitialize(this._objects.get(objectName));\n }\n this.addObject(obj);\n return obj;\n }\n\n /**\n * Must be called whenever an object must be removed from the container.\n * @param obj The object to be removed.\n */\n markObjectForDeletion(obj: gdjs.RuntimeObject) {\n // Add to the objects removed list.\n // The objects will be sent to the instances cache or really deleted from memory later.\n if (this._instancesRemoved.indexOf(obj) === -1) {\n this._instancesRemoved.push(obj);\n }\n\n // Delete from the living instances.\n if (this._instances.containsKey(obj.getName())) {\n const objId = obj.id;\n const allInstances = this._instances.get(obj.getName());\n for (let i = 0, len = allInstances.length; i < len; ++i) {\n if (allInstances[i].id == objId) {\n allInstances.splice(i, 1);\n this._allInstancesListIsUpToDate = false;\n break;\n }\n }\n }\n\n // Notify the object it was removed from the container\n obj.onDeletedFromScene();\n\n // Notify the global callbacks\n for (let j = 0; j < gdjs.callbacksObjectDeletedFromScene.length; ++j) {\n gdjs.callbacksObjectDeletedFromScene[j](this, obj);\n }\n return;\n }\n\n /**\n * Get the layer with the given name\n * @param name The name of the layer\n * @returns The layer, or the base layer if not found\n */\n getLayer(name: string): gdjs.RuntimeLayer {\n if (this._layers.containsKey(name)) {\n return this._layers.get(name);\n }\n return this._layers.get('');\n }\n\n /**\n * Check if a layer exists\n * @param name The name of the layer\n */\n hasLayer(name: string): boolean {\n return this._layers.containsKey(name);\n }\n\n /**\n * Add a layer.\n * @param layerData The data to construct the layer\n */\n abstract addLayer(layerData: LayerData);\n\n /**\n * Remove a layer. All {@link gdjs.RuntimeObject} on this layer will\n * be moved back to the base layer.\n * @param layerName The name of the layer to remove\n */\n removeLayer(layerName: string) {\n const existingLayer = this._layers.get(layerName);\n if (!existingLayer) return;\n\n const allInstances = this.getAdhocListOfAllInstances();\n for (let i = 0; i < allInstances.length; ++i) {\n const runtimeObject = allInstances[i];\n if (runtimeObject.getLayer() === layerName) {\n runtimeObject.setLayer('');\n }\n }\n this._layers.remove(layerName);\n const layerIndex = this._orderedLayers.indexOf(existingLayer);\n this._orderedLayers.splice(layerIndex, 1);\n }\n\n /**\n * Change the position of a layer.\n *\n * @param layerName The name of the layer to reorder\n * @param newIndex The new position in the list of layers\n */\n setLayerIndex(layerName: string, newIndex: integer): void {\n const layer: gdjs.RuntimeLayer = this._layers.get(layerName);\n if (!layer) {\n return;\n }\n const layerIndex = this._orderedLayers.indexOf(layer);\n if (layerIndex === newIndex) return;\n\n this._orderedLayers.splice(layerIndex, 1);\n this._orderedLayers.splice(newIndex, 0, layer);\n\n this.getRenderer().setLayerIndex(layer, newIndex);\n }\n\n /**\n * Fill the array passed as argument with the names of all layers\n * @param result The array where to put the layer names\n */\n getAllLayerNames(result: string[]) {\n this._layers.keys(result);\n }\n\n /**\n * Return the number of instances of the specified object living in the container.\n * @param objectName The object name for which instances must be counted.\n */\n getInstancesCountOnScene(objectName: string): integer {\n const instances = this._instances.get(objectName);\n if (instances) {\n return instances.length;\n }\n\n return 0;\n }\n\n /**\n * Update the objects positions according to their forces\n */\n updateObjectsForces(): void {\n for (const name in this._instances.items) {\n if (this._instances.items.hasOwnProperty(name)) {\n const list = this._instances.items[name];\n for (let j = 0, listLen = list.length; j < listLen; ++j) {\n const obj = list[j];\n if (!obj.hasNoForces()) {\n const averageForce = obj.getAverageForce();\n const elapsedTimeInSeconds = obj.getElapsedTime() / 1000;\n obj.setX(obj.getX() + averageForce.getX() * elapsedTimeInSeconds);\n obj.setY(obj.getY() + averageForce.getY() * elapsedTimeInSeconds);\n obj.updateForces(elapsedTimeInSeconds);\n }\n }\n }\n }\n }\n\n /**\n * Clear any data structures to make sure memory is freed as soon as\n * possible.\n */\n _destroy() {\n // It should not be necessary to reset these variables, but this help\n // ensuring that all memory related to the container is released immediately.\n this._layers = new Hashtable();\n this._orderedLayers = [];\n this._objects = new Hashtable();\n this._instances = new Hashtable();\n this._instancesCache = new Hashtable();\n this._objectsCtor = new Hashtable();\n this._allInstancesList = [];\n this._instancesRemoved = [];\n this._layersCameraCoordinates = {};\n this._initialBehaviorSharedData = new Hashtable();\n }\n }\n}\n"],
5
+ "mappings": "AAKA,GAAU,MAAV,UAAU,EAAV,CACE,KAAM,GAAS,GAAI,GAAK,OAAO,4BAKxB,OAAwC,CAiC7C,aAAc,CAvBN,uBAA0C,GAClD,iCAA8B,GAM9B,uBAA0C,GAQ1C,8BAAyE,GAGzE,uBAA6B,GAC7B,mCAAyC,GACzC,+BAAqC,GACrC,gCAAsC,GAGpC,KAAK,2BAA6B,GAAI,WACtC,KAAK,WAAa,GAAI,WACtB,KAAK,gBAAkB,GAAI,WAC3B,KAAK,SAAW,GAAI,WACpB,KAAK,aAAe,GAAI,WACxB,KAAK,QAAU,GAAI,WACnB,KAAK,eAAiB,GA+JxB,gBACE,EACA,EACA,EACA,EACM,CACN,AAAI,KAAK,mBAAqB,CAAC,GAC7B,KAAK,sBAAsB,iBAG7B,KAAK,kBAAoB,EACzB,KAAK,8BAAgC,EACrC,KAAK,0BAA4B,EACjC,KAAK,2BAA6B,EAQpC,mBAAmB,EAA6B,CAC9C,MACE,MAAK,SAAS,YAAY,IAC1B,KAAK,WAAW,YAAY,IAC5B,KAAK,aAAa,YAAY,GASlC,eAAe,EAAwB,CACrC,KAAK,SAAS,IAAI,EAAW,KAAM,GACnC,KAAK,WAAW,IAAI,EAAW,KAAM,IAGrC,KAAM,GAAO,EAAK,qBAAqB,EAAW,MAClD,KAAK,aAAa,IAAI,EAAW,KAAM,GAGnC,EAAK,0BACP,KAAK,gBAAgB,IAAI,EAAW,KAAM,IAS9C,aAAa,EAA8B,CACzC,AAAK,KAAK,mBAAmB,EAAW,OACtC,EAAO,KACL,qEACE,EAAW,KACX,iCAGN,KAAK,SAAS,IAAI,EAAW,KAAM,GAQrC,iBAAi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