gdcore-tools 2.0.0-beta2 → 2.0.0-beta4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Runtime/AsyncTasksManager.js +2 -2
- package/dist/Runtime/AsyncTasksManager.js.map +2 -2
- package/dist/Runtime/Cordova/config.xml +23 -1
- package/dist/Runtime/Cordova/www/LICENSE.GDevelop.txt +2 -0
- package/dist/Runtime/Cordova/www/index.html +1 -1
- package/dist/Runtime/CustomRuntimeObject.js +1 -1
- package/dist/Runtime/CustomRuntimeObject.js.map +2 -2
- package/dist/Runtime/CustomRuntimeObject2D.js +2 -0
- package/dist/Runtime/CustomRuntimeObject2D.js.map +7 -0
- package/dist/Runtime/CustomRuntimeObjectInstanceContainer.js +1 -1
- package/dist/Runtime/CustomRuntimeObjectInstanceContainer.js.map +2 -2
- package/dist/Runtime/Electron/LICENSE.GDevelop.txt +2 -0
- package/dist/Runtime/Electron/package.json +3 -0
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3D.js +1 -1
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3D.js.map +2 -2
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3DRenderer.js +1 -1
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3DRenderer.js.map +2 -2
- package/dist/Runtime/Extensions/3D/AmbientLight.js +1 -1
- package/dist/Runtime/Extensions/3D/AmbientLight.js.map +2 -2
- package/dist/Runtime/Extensions/3D/Base3DBehavior.js +1 -1
- package/dist/Runtime/Extensions/3D/Base3DBehavior.js.map +2 -2
- package/dist/Runtime/Extensions/3D/BloomEffect.js +1 -1
- package/dist/Runtime/Extensions/3D/BloomEffect.js.map +2 -2
- package/dist/Runtime/Extensions/3D/BrightnessAndContrastEffect.js +1 -1
- package/dist/Runtime/Extensions/3D/BrightnessAndContrastEffect.js.map +2 -2
- package/dist/Runtime/Extensions/3D/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/3D/Cube3DRuntimeObject.js +1 -1
- package/dist/Runtime/Extensions/3D/Cube3DRuntimeObject.js.map +2 -2
- package/dist/Runtime/Extensions/3D/CustomRuntimeObject3D.js +2 -0
- package/dist/Runtime/Extensions/3D/CustomRuntimeObject3D.js.map +7 -0
- package/dist/Runtime/Extensions/3D/CustomRuntimeObject3DRenderer.js +2 -0
- package/dist/Runtime/Extensions/3D/CustomRuntimeObject3DRenderer.js.map +7 -0
- package/dist/Runtime/Extensions/3D/DirectionalLight.js +1 -1
- package/dist/Runtime/Extensions/3D/DirectionalLight.js.map +2 -2
- package/dist/Runtime/Extensions/3D/ExponentialFog.js +1 -1
- package/dist/Runtime/Extensions/3D/ExponentialFog.js.map +2 -2
- package/dist/Runtime/Extensions/3D/ExposureEffect.js +1 -1
- package/dist/Runtime/Extensions/3D/ExposureEffect.js.map +2 -2
- package/dist/Runtime/Extensions/3D/HemisphereLight.js +1 -1
- package/dist/Runtime/Extensions/3D/HemisphereLight.js.map +2 -2
- package/dist/Runtime/Extensions/3D/HueAndSaturationEffect.js +1 -1
- package/dist/Runtime/Extensions/3D/HueAndSaturationEffect.js.map +2 -2
- package/dist/Runtime/Extensions/3D/JsExtension.js +56 -24
- package/dist/Runtime/Extensions/3D/LinearFog.js +1 -1
- package/dist/Runtime/Extensions/3D/LinearFog.js.map +2 -2
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js +1 -1
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js.map +2 -2
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject3DRenderer.js +1 -1
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject3DRenderer.js.map +2 -2
- package/dist/Runtime/Extensions/AdMob/JsExtension.js +11 -10
- package/dist/Runtime/Extensions/AdMob/admobtools.js +1 -1
- package/dist/Runtime/Extensions/AdMob/admobtools.js.map +2 -2
- package/dist/Runtime/Extensions/AnchorBehavior/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/BBText/JsExtension.js +20 -11
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/BitmapText/JsExtension.js +2 -8
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/CMakeLists.txt +35 -0
- package/dist/Runtime/Extensions/CMakeUtils.txt +81 -0
- package/dist/Runtime/Extensions/DestroyOutsideBehavior/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/DestroyOutsideBehavior/destroyoutsideruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/DialogueTree/bondage.js/version.txt +5 -0
- package/dist/Runtime/Extensions/DraggableBehavior/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/Effects/adjustment-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/adjustment-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/advanced-bloom-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/advanced-bloom-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/ascii-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/ascii-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/bevel-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/bevel-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/black-and-white-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/black-and-white-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/blending-mode-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/blending-mode-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/blur-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/blur-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/brightness-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/brightness-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/bulge-pinch-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/bulge-pinch-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/color-map-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/color-map-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/color-replace-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/color-replace-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/crt-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/crt-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/displacement-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/displacement-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/dot-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/dot-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/drop-shadow-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/drop-shadow-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/glitch-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/glitch-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/glow-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/glow-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/godray-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/godray-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/hsl-adjustment-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/hsl-adjustment-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/kawase-blur-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/kawase-blur-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/light-night-pixi-filter.js +2 -2
- package/dist/Runtime/Extensions/Effects/light-night-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/motion-blur-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/motion-blur-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/night-pixi-filter.js +2 -2
- package/dist/Runtime/Extensions/Effects/night-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/noise-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/noise-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/old-film-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/old-film-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/outline-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/outline-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/pixelate-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/pixelate-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/radial-blur-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/radial-blur-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/reflection-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/reflection-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/rgb-split-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/rgb-split-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/sepia-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/sepia-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/shockwave-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/shockwave-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/tilt-shift-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/tilt-shift-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/twist-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/twist-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/zoom-blur-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/zoom-blur-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/ExampleJsExtension/JsExtension.js +2 -11
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyeffect.js +1 -1
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyeffect.js.map +2 -2
- package/dist/Runtime/Extensions/FileSystem/JsExtension.js +22 -0
- package/dist/Runtime/Extensions/FileSystem/filesystemtools.js +1 -1
- package/dist/Runtime/Extensions/FileSystem/filesystemtools.js.map +2 -2
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/NOTICE.txt +6 -0
- package/dist/Runtime/Extensions/Inventory/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/JsExtensionTypes.d.ts +13 -4
- package/dist/Runtime/Extensions/Leaderboards/JsExtension.js +42 -1
- package/dist/Runtime/Extensions/Leaderboards/leaderboardstools.js +1 -1
- package/dist/Runtime/Extensions/Leaderboards/leaderboardstools.js.map +2 -2
- package/dist/Runtime/Extensions/Lighting/JsExtension.js +2 -11
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/LinkedObjects/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/LinkedObjects/linkedobjects.js +1 -1
- package/dist/Runtime/Extensions/LinkedObjects/linkedobjects.js.map +2 -2
- package/dist/Runtime/Extensions/Multiplayer/JsExtension.js +1130 -0
- package/dist/Runtime/Extensions/Multiplayer/messageManager.js +2 -0
- package/dist/Runtime/Extensions/Multiplayer/messageManager.js.map +7 -0
- package/dist/Runtime/Extensions/Multiplayer/multiplayerVariablesManager.js +2 -0
- package/dist/Runtime/Extensions/Multiplayer/multiplayerVariablesManager.js.map +7 -0
- package/dist/Runtime/Extensions/Multiplayer/multiplayercomponents.js +2 -0
- package/dist/Runtime/Extensions/Multiplayer/multiplayercomponents.js.map +7 -0
- package/dist/Runtime/Extensions/Multiplayer/multiplayerobjectruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/Multiplayer/multiplayerobjectruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/Multiplayer/multiplayertools.js +2 -0
- package/dist/Runtime/Extensions/Multiplayer/multiplayertools.js.map +7 -0
- package/dist/Runtime/Extensions/Multiplayer/peer.js +10 -0
- package/dist/Runtime/Extensions/Multiplayer/peer.js.map +1 -0
- package/dist/Runtime/Extensions/Multiplayer/peerJsHelper.js +2 -0
- package/dist/Runtime/Extensions/Multiplayer/peerJsHelper.js.map +7 -0
- package/dist/Runtime/Extensions/Multiplayer/peerjs.d.ts +509 -0
- package/dist/Runtime/Extensions/P2P/A_peer.js +8 -2
- package/dist/Runtime/Extensions/P2P/A_peer.js.map +1 -1
- package/dist/Runtime/Extensions/P2P/B_p2ptools.js +1 -1
- package/dist/Runtime/Extensions/P2P/B_p2ptools.js.map +2 -2
- package/dist/Runtime/Extensions/P2P/JsExtension.js +27 -0
- package/dist/Runtime/Extensions/PanelSpriteObject/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/ParticleSystem/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject-pixi-renderer.js +1 -1
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject-pixi-renderer.js.map +2 -2
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js +1 -1
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js.map +2 -2
- package/dist/Runtime/Extensions/PathfindingBehavior/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/Physics2Behavior/JsExtension.js +47 -4
- package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js +1 -1
- package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/PhysicsBehavior/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/PlatformBehavior/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/PlatformBehavior/platformruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/PlatformBehavior/platformruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/PlayerAuthentication/JsExtension.js +6 -3
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationcomponents.js +4 -4
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationcomponents.js.map +2 -2
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationtools.js +1 -1
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationtools.js.map +2 -2
- package/dist/Runtime/Extensions/PrimitiveDrawing/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject-pixi-renderer.js +1 -1
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject-pixi-renderer.js.map +2 -2
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/Shopify/CMakeLists.txt +26 -0
- package/dist/Runtime/Extensions/Spine/CMakeLists.txt +20 -0
- package/dist/Runtime/Extensions/Spine/JsExtension.js +11 -2
- package/dist/Runtime/Extensions/Spine/managers/pixi-spine-atlas-manager.js +1 -1
- package/dist/Runtime/Extensions/Spine/managers/pixi-spine-atlas-manager.js.map +2 -2
- package/dist/Runtime/Extensions/Spine/managers/pixi-spine-manager.js +1 -1
- package/dist/Runtime/Extensions/Spine/managers/pixi-spine-manager.js.map +2 -2
- package/dist/Runtime/Extensions/Spine/pixi-spine/Spine-Runtimes-License-Agreement.txt +11 -0
- package/dist/Runtime/Extensions/Spine/pixi-spine/pixi-spine.js +5 -3
- package/dist/Runtime/Extensions/Spine/spineruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/Spine/spineruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/SystemInfo/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/TextEntryObject/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/TextInput/JsExtension.js +3 -10
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject-pixi-renderer.js +1 -1
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject-pixi-renderer.js.map +2 -2
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TextObject/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/TextObject/textruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TextObject/textruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/JsExtension.js +834 -23
- package/dist/Runtime/Extensions/TileMap/TileMapRuntimeManager.js +1 -1
- package/dist/Runtime/Extensions/TileMap/TileMapRuntimeManager.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/collision/TransformedTileMap.js +1 -1
- package/dist/Runtime/Extensions/TileMap/collision/TransformedTileMap.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.d.ts +2 -0
- package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.js +1 -1
- package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.js.map +1 -1
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/CommonTypes.d.ts +12 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/CommonTypes.d.ts.map +1 -1
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/TileMapModel.d.ts +119 -5
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/TileMapModel.d.ts.map +1 -1
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts +25 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts.map +1 -1
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts +16 -1
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts.map +1 -1
- package/dist/Runtime/Extensions/TileMap/simpletilemapruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/TileMap/simpletilemapruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/tilemapcollisionmaskruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TileMap/tilemapcollisionmaskruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject-pixi-renderer.js +1 -1
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject-pixi-renderer.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TiledSpriteObject/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TopDownMovementBehavior/CMakeLists.txt +23 -0
- package/dist/Runtime/Extensions/TopDownMovementBehavior/topdownmovementruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/TopDownMovementBehavior/topdownmovementruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/TweenBehavior/JsExtension.js +2 -2
- package/dist/Runtime/Extensions/TweenBehavior/tweenruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/TweenBehavior/tweenruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/Video/JsExtension.js +2 -11
- package/dist/Runtime/Extensions/Video/videoruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/Video/videoruntimeobject.js.map +2 -2
- package/dist/Runtime/RuntimeInstanceContainer.js +1 -1
- package/dist/Runtime/RuntimeInstanceContainer.js.map +2 -2
- package/dist/Runtime/SpriteAnimator.js +2 -0
- package/dist/Runtime/SpriteAnimator.js.map +7 -0
- package/dist/Runtime/debugger-client/hot-reloader.js +1 -1
- package/dist/Runtime/debugger-client/hot-reloader.js.map +2 -2
- package/dist/Runtime/events-tools/objecttools.js +1 -1
- package/dist/Runtime/events-tools/objecttools.js.map +2 -2
- package/dist/Runtime/events-tools/runtimescenetools.js +1 -1
- package/dist/Runtime/events-tools/runtimescenetools.js.map +2 -2
- package/dist/Runtime/force.js +1 -1
- package/dist/Runtime/force.js.map +2 -2
- package/dist/Runtime/object-capabilities/TextContainerBehavior.js.map +1 -1
- package/dist/Runtime/pixi-renderers/CustomRuntimeObject2DPixiRenderer.js +2 -0
- package/dist/Runtime/pixi-renderers/CustomRuntimeObject2DPixiRenderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/DebuggerPixiRenderer.js +1 -1
- package/dist/Runtime/pixi-renderers/DebuggerPixiRenderer.js.map +2 -2
- package/dist/Runtime/pixi-renderers/layer-pixi-renderer.js +2 -2
- package/dist/Runtime/pixi-renderers/layer-pixi-renderer.js.map +2 -2
- package/dist/Runtime/pixi-renderers/pixi-filters-tools.js +1 -1
- package/dist/Runtime/pixi-renderers/pixi-filters-tools.js.map +2 -2
- package/dist/Runtime/pixi-renderers/pixi-image-manager.js.map +2 -2
- package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js +1 -1
- package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js.map +2 -2
- package/dist/Runtime/pixi-renderers/spriteruntimeobject-pixi-renderer.js +1 -1
- package/dist/Runtime/pixi-renderers/spriteruntimeobject-pixi-renderer.js.map +2 -2
- package/dist/Runtime/polygon.js +1 -1
- package/dist/Runtime/polygon.js.map +2 -2
- package/dist/Runtime/runtimebehavior.js +1 -1
- package/dist/Runtime/runtimebehavior.js.map +2 -2
- package/dist/Runtime/runtimegame.js +1 -1
- package/dist/Runtime/runtimegame.js.map +2 -2
- package/dist/Runtime/runtimeobject.js +1 -1
- package/dist/Runtime/runtimeobject.js.map +2 -2
- package/dist/Runtime/runtimescene.js +1 -1
- package/dist/Runtime/runtimescene.js.map +2 -2
- package/dist/Runtime/scenestack.js +1 -1
- package/dist/Runtime/scenestack.js.map +2 -2
- package/dist/Runtime/spriteruntimeobject.js +1 -1
- package/dist/Runtime/spriteruntimeobject.js.map +2 -2
- package/dist/Runtime/timer.js +1 -1
- package/dist/Runtime/timer.js.map +2 -2
- package/dist/Runtime/types/project-data.d.ts +115 -0
- package/dist/Runtime/variable.js +1 -1
- package/dist/Runtime/variable.js.map +2 -2
- package/dist/Runtime/variablescontainer.js +1 -1
- package/dist/Runtime/variablescontainer.js.map +2 -2
- package/dist/lib/libGD.cjs +2 -1
- package/dist/lib/libGD.wasm +0 -0
- package/dist/loaders.cjs +2 -1
- package/gd.d.ts +217 -223
- package/package.json +15 -7
- package/src/index.js +2 -0
- package/src/open_project.js +1 -1
- package/types/index.d.ts +2 -2
- package/types/open_project.d.ts +5 -5
- package/dist/Runtime/Extensions/Spine/pixi-spine/pixi-spine.js.map +0 -7
- package/dist/Runtime/pixi-renderers/CustomObjectPixiRenderer.js +0 -2
- package/dist/Runtime/pixi-renderers/CustomObjectPixiRenderer.js.map +0 -7
|
@@ -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 o: gdjs.RuntimeObject\n ): o is gdjs.RuntimeObject & gdjs.Scalable {\n //@ts-ignore We are checking if the methods are present.\n return o.setScaleX && o.setScaleY && o.getScaleX && o.getScaleY;\n }\n\n function isOpaque(\n o: gdjs.RuntimeObject\n ): o is gdjs.RuntimeObject & gdjs.OpacityHandler {\n //@ts-ignore We are checking if the methods are present.\n return o.setOpacity && o.getOpacity;\n }\n\n function isColorable(o: gdjs.RuntimeObject): o is IColorable {\n //@ts-ignore We are checking if the methods are present.\n return o.setColor && o.getColor;\n }\n\n function isCharacterScalable(o: gdjs.RuntimeObject): o is ICharacterScalable {\n //@ts-ignore We are checking if the methods are present.\n return o.setCharacterSize && o.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 (!(owner instanceof gdjs.RuntimeObject3D)) 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 (!(owner instanceof gdjs.RuntimeObject3D)) 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 (!(owner instanceof gdjs.RuntimeObject3D)) 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 =\n gdjs.RuntimeObject3D && owner instanceof gdjs.RuntimeObject3D\n ? owner\n : 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 (!(owner instanceof gdjs.RuntimeObject3D)) 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,EACyC,CAEzC,MAAO,GAAE,WAAa,EAAE,WAAa,EAAE,WAAa,EAAE,UAGxD,WACE,EAC+C,CAE/C,MAAO,GAAE,YAAc,EAAE,WAG3B,WAAqB,EAAwC,CAE3D,MAAO,GAAE,UAAY,EAAE,SAGzB,WAA6B,EAAgD,CAE3E,MAAO,GAAE,kBAAoB,EAAE,iBAGjC,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,AAAM,YAAiB,GAAK,iBAE5B,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,AAAM,YAAiB,GAAK,iBAE5B,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,AAAM,YAAiB,GAAK,iBAE5B,KAAK,QAAQ,eACX,EACA,KAAK,MACL,EACA,EACA,EACA,EAAM,eACN,EACA,AAAC,GAAiB,EAAM,aAAa,GACrC,EAA4B,IAAM,KAAK,mBAAqB,MAehE,oBACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EAAW,IACX,EACA,EACA,KAAK,MAAM,kBACX,GAeJ,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,GAAI,CAAC,EAAW,GAAQ,OAExB,AAAI,EAAW,GAAG,GAAW,GACzB,EAAW,GAAG,GAAW,GAE7B,KAAM,GAAW,EACb,CAAC,CAAC,EAAQ,KAAqB,CAC7B,KAAM,GAAO,EAAM,oBACb,EAAO,EAAM,oBACnB,EAAM,UAAU,GAChB,EAAM,UAAU,GAChB,EAAM,yBAAyB,EAAM,IAEvC,CAAC,CAAC,EAAQ,KAAqB,CAC7B,EAAM,UAAU,GAChB,EAAM,UAAU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ACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EAAW,IACX,EACA,EACA,KAAK,MAAM,kBACX,GAaJ,sBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,sBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,GAAI,CAAC,EAAW,GAAQ,OAExB,KAAM,GAAW,EACb,AAAC,GAAkB,CACjB,KAAM,GAAO,EAAM,oBACnB,EAAM,UAAU,GAChB,EAAM,kBAAkB,IAE1B,AAAC,GAAkB,EAAM,UAAU,GAEvC,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,YACN,EACA,EACA,EAA4B,IAAM,KAAK,mBAAqB,MAahE,sBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,uBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,uBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,uBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,uBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,AAAI,CAAC,EAAS,IAEd,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,aACN,EACA,AAAC,GAAiB,EAAM,WAAW,GACnC,EAA4B,IAAM,KAAK,mBAAqB,MAehE,6BACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAS,KAAK,MAAM,qBAAqB,GAC/C,AAAK,GACH,EAAO,MACL,eAAe,KAAK,MAAM,yCAAyC,MAGvE,KAAK,QAAQ,eACX,EACA,KAAK,MACL,EACA,EACA,EACA,EAAS,EAAO,mBAAmB,GAAgB,EACnD,EACA,AAAC,GAAiB,CAChB,AAAI,GACF,EAAO,sBAAsB,EAAc,IAG/C,EAA4B,IAAM,KAAK,mB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EAAgB,IACzB,IACA,KAAK,MAAM,EAAgB,IAC3B,IACA,KAAK,MAAM,EAAgB,MAIjC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,gCACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,iCACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,kBACX,GAYJ,iCACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,iCACH,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,iCACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,AAAI,CAAC,EAAoB,IAEzB,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,mBACN,EACA,AAAC,GAAiB,EAAM,iBAAiB,GACzC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,oBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,qBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,WACX,EACA,AAAC,GAAiB,KAAK,MAAM,SAAS,GACtC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,qBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,sBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,sBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,YACX,EACA,AAAC,GAAiB,KAAK,MAAM,UAAU,GACvC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,oBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAaf,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,CAAE,SAAU,KAClB,AAAM,YAAiB,GAAK,iBAE5B,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,IA3xDd,EAAM,uBA8xDb,EAAK,iBAAiB,uBAAwB,EAAK,wBAt0D3C",
|
|
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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A,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAEF,KAAM,GAAQ,KAAK,MACnB,GAAI,CAAC,EAAW,GAAQ,OAKxB,KAAM,GAAU,EAAK,GAAS,EAAQ,KAEhC,EAAW,EACb,AAAC,GAAiB,CAChB,KAAM,GAAO,EAAM,oBACb,EAAO,EAAM,oBACb,EAAO,EAAU,EAAQ,oBAAsB,EACrD,EAAM,SAAS,GACf,EAAM,kBAAkB,GACxB,EAAM,kBAAkB,GACpB,GACF,EAAQ,kBAAkB,IAG9B,AAAC,GAAiB,EAAM,SAAS,GAErC,KAAK,QAAQ,eACX,EACA,KAAK,MACL,EACA,EACA,EACA,EAAM,WACN,EACA,EACA,EAA4B,IAAM,KAAK,mBAAqB,MAchE,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EAAW,IACX,EACA,EACA,KAAK,MAAM,kBACX,GAaJ,sBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,sBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,GAAI,CAAC,EAAW,GAAQ,OAExB,KAAM,GAAW,EACb,AAAC,GAAkB,CACjB,KAAM,GAAO,EAAM,oBACnB,EAAM,UAAU,GAChB,EAAM,kBAAkB,IAE1B,AAAC,GAAkB,EAAM,UAAU,GAEvC,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,YACN,EACA,EACA,EAA4B,IAAM,KAAK,mBAAqB,MAchE,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EAAW,IACX,EACA,EACA,KAAK,MAAM,kBACX,GAaJ,sBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,sBACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,GAAI,CAAC,EAAW,GAAQ,OAExB,KAAM,GAAW,EACb,AAAC,GAAkB,CACjB,KAAM,GAAO,EAAM,oBACnB,EAAM,UAAU,GAChB,EAAM,kBAAkB,IAE1B,AAAC,GAAkB,EAAM,UAAU,GAEvC,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,YACN,EACA,EACA,EAA4B,IAAM,KAAK,mBAAqB,MAahE,sBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,uBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,uBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,uBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,uBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,AAAI,CAAC,EAAS,IAEd,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,aACN,EACA,AAAC,GAAiB,EAAM,WAAW,GACnC,EAA4B,IAAM,KAAK,mBAAqB,MAehE,6BACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAS,KAAK,MAAM,qBAAqB,GAC/C,AAAK,GACH,EAAO,MACL,eAAe,KAAK,MAAM,yCAAyC,MAGvE,KAAK,QAAQ,eACX,EACA,KAAK,MACL,EACA,EACA,EACA,EAAS,EAAO,mBAAmB,GAAgB,EACnD,EACA,AAAC,GAAiB,CAChB,AAAI,GACF,EAAO,sBAAsB,EAAc,IAG/C,EAA4B,IAAM,KAAK,mBAAqB,MAehE,4BACE,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAS,KAAK,MAAM,qBAAqB,GAC/C,AAAK,GACH,EAAO,MACL,eAAe,KAAK,MAAM,yCAAyC,MAGvE,KAAM,GAAe,EA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EAAW,IACX,EACA,KAAK,MAAM,kBACX,GAYJ,iCACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,iCACH,EACA,EACA,EACA,EACA,EACA,KAAK,MACL,GAII,iCACN,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,GAAQ,KAAK,MACnB,AAAI,CAAC,EAAoB,IAEzB,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,mBACN,EACA,AAAC,GAAiB,EAAM,iBAAiB,GACzC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,oBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,qBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,WACX,EACA,AAAC,GAAiB,KAAK,MAAM,SAAS,GACtC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,qBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAYf,sBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,sBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,sBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,KAAK,MAAM,YACX,EACA,AAAC,GAAiB,KAAK,MAAM,UAAU,GACvC,EAA4B,IAAM,KAAK,mBAAqB,MAahE,oBACE,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EAAW,IACX,EACA,KAAK,MAAM,mBAaf,qBACE,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAK,qBACH,EACA,EACA,EACA,EACA,EACA,KAAK,OAID,qBACN,EACA,EACA,EACA,EACA,EACA,EACA,CACA,KAAM,CAAE,SAAU,KAClB,AAAI,CAAC,EAAK,IAEV,KAAK,QAAQ,eACX,EACA,EACA,EACA,EACA,EACA,EAAM,WACN,EACA,AAAC,GAAiB,EAAM,SAAS,GACjC,EAA4B,IAAM,KAAK,mBAAqB,MAQhE,UAAU,EAA6B,CACrC,MAAO,MAAK,QAAQ,UAAU,GAQhC,OAAO,EAA6B,CAClC,MAAO,MAAK,QAAQ,OAAO,GAO7B,YAAY,EAA6B,CACvC,MAAO,MAAK,QAAQ,YAAY,GAOlC,WAAW,EAAoB,CAC7B,AAAI,KAAK,WACP,KAAK,QAAQ,WAAW,GAS5B,UAAU,EAAoB,EAAqB,CACjD,AAAI,KAAK,WACP,KAAK,QAAQ,UAAU,EAAY,GAQvC,YAAY,EAAoB,CAC9B,AAAI,KAAK,WACP,KAAK,QAAQ,YAAY,GAQ7B,YAAY,EAAoB,CAC9B,KAAK,QAAQ,YAAY,GAQ3B,YAAY,EAA2B,CACrC,MAAO,MAAK,QAAQ,YAAY,GAWlC,SAAS,EAA2B,CAClC,MAAO,MAAK,QAAQ,SAAS,GAG/B,cAAe,CACb,KAAK,UAAY,GAGnB,YAAa,CACX,KAAK,UAAY,IAxxDd,EAAM,uBA2xDb,EAAK,iBAAiB,uBAAwB,EAAK,wBAp1D3C",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -102,18 +102,11 @@ module.exports = {
|
|
|
102
102
|
objectContent,
|
|
103
103
|
instance,
|
|
104
104
|
propertyName,
|
|
105
|
-
newValue
|
|
106
|
-
project,
|
|
107
|
-
layout
|
|
105
|
+
newValue
|
|
108
106
|
) {
|
|
109
107
|
return false;
|
|
110
108
|
};
|
|
111
|
-
videoObject.getInitialInstanceProperties = function (
|
|
112
|
-
content,
|
|
113
|
-
instance,
|
|
114
|
-
project,
|
|
115
|
-
layout
|
|
116
|
-
) {
|
|
109
|
+
videoObject.getInitialInstanceProperties = function (content, instance) {
|
|
117
110
|
var instanceProperties = new gd.MapStringPropertyDescriptor();
|
|
118
111
|
return instanceProperties;
|
|
119
112
|
};
|
|
@@ -558,7 +551,6 @@ module.exports = {
|
|
|
558
551
|
class RenderedVideoObjectInstance extends RenderedInstance {
|
|
559
552
|
constructor(
|
|
560
553
|
project,
|
|
561
|
-
layout,
|
|
562
554
|
instance,
|
|
563
555
|
associatedObjectConfiguration,
|
|
564
556
|
pixiContainer,
|
|
@@ -566,7 +558,6 @@ module.exports = {
|
|
|
566
558
|
) {
|
|
567
559
|
super(
|
|
568
560
|
project,
|
|
569
|
-
layout,
|
|
570
561
|
instance,
|
|
571
562
|
associatedObjectConfiguration,
|
|
572
563
|
pixiContainer,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var gdjs;(function(
|
|
1
|
+
var gdjs;(function(i){class n extends i.RuntimeObject{constructor(e,t){super(e,t);this._pausedAsScenePaused=!1;this._opacity=t.content.opacity,this._loop=t.content.loop,this._volume=t.content.volume,this._videoResource=t.content.videoResource,this._renderer=new i.VideoRuntimeObjectRenderer(this,e),this.onCreated()}getRendererObject(){return this._renderer.getRendererObject()}updateFromObjectData(e,t){return e.content.opacity!==t.content.opacity&&this.setOpacity(t.content.opacity),e.content.loop!==t.content.loop&&this.setLoop(t.content.loop),e.content.volume!==t.content.volume&&this.setVolume(t.content.volume),e.content.videoResource===t.content.videoResource}getNetworkSyncData(){return{...super.getNetworkSyncData(),op:this._opacity,wid:this.getWidth(),hei:this.getHeight(),pla:this.isPlayed(),loop:this.isLooped(),ct:this.getCurrentTime(),ps:this.getPlaybackSpeed()}}updateFromNetworkSyncData(e){super.updateFromNetworkSyncData(e),this._opacity!==void 0&&this._opacity&&e.op&&this.setOpacity(e.op),this.getWidth()!==void 0&&this.getWidth()!==e.wid&&this.setWidth(e.wid),this.getHeight()!==void 0&&this.getHeight()!==e.hei&&this.setHeight(e.hei),e.pla!==void 0&&this.isPlayed()!==e.pla&&(e.pla?this.play():this.pause()),e.loop!==void 0&&this.isLooped()!==e.loop&&this.setLoop(e.loop),e.ct!==void 0&&Math.abs(this.getCurrentTime()-e.ct)>3&&this.setCurrentTime(e.ct),e.ps!==void 0&&this.getPlaybackSpeed()!==e.ps&&this.setPlaybackSpeed(e.ps)}extraInitializationFromInitialInstance(e){e.customSize&&(this.setWidth(e.width),this.setHeight(e.height))}onDestroyed(){super.onDestroyed(),this._renderer.onDestroy()}update(e){this._renderer.ensureUpToDate()}setX(e){super.setX(e),this._renderer.updatePosition()}setY(e){super.setY(e),this._renderer.updatePosition()}setAngle(e){super.setAngle(e),this._renderer.updateAngle()}setOpacity(e){this._opacity=e,this._renderer.updateOpacity()}getOpacity(){return this._opacity}setWidth(e){this._renderer.getWidth()!==e&&(this._renderer.setWidth(e),this.invalidateHitboxes())}setHeight(e){this._renderer.getHeight()!==e&&(this._renderer.setHeight(e),this.invalidateHitboxes())}getWidth(){return this._renderer.getWidth()}getHeight(){return this._renderer.getHeight()}play(){this._renderer.play()}pause(){this._renderer.pause()}setLoop(e){this._renderer.setLoop(e)}mute(e){this._renderer.setMute(e)}isMuted(){return this._renderer.isMuted()}setVolume(e){this._volume=i.evtTools.common.clamp(i.evtTools.common.normalize(e,0,100),0,1)*100,this._renderer.updateVolume()}getVolume(){return i.evtTools.common.normalize(this._renderer.getVolume(),0,1)*100}isPlayed(){return this._renderer.isPlayed()}isPaused(){return!this._renderer.isPlayed()}isLooped(){return this._renderer.isLooped()}getDuration(){return this._renderer.getDuration()}isEnded(){return this._renderer.isEnded()}setCurrentTime(e){this._renderer.setCurrentTime(e)}getCurrentTime(){return this._renderer.getCurrentTime()}setPlaybackSpeed(e){this._playbackSpeed=i.evtTools.common.clamp(e,.5,2),this._renderer.setPlaybackSpeed(this._playbackSpeed)}getPlaybackSpeed(){return this._renderer.getPlaybackSpeed()}}i.VideoRuntimeObject=n,i.registerObject("Video::VideoObject",i.VideoRuntimeObject),i.registerRuntimeSceneUnloadedCallback(function(r){const e=r.getAdhocListOfAllInstances();for(let t=0;t<e.length;++t){const o=e[t];o instanceof i.VideoRuntimeObject&&o.isPlayed()&&o.pause()}}),i.registerRuntimeScenePausedCallback(function(r){const e=r.getAdhocListOfAllInstances();for(let t=0;t<e.length;++t){const o=e[t];o instanceof i.VideoRuntimeObject&&o.isPlayed()&&(o.pause(),o._pausedAsScenePaused=!0)}}),i.registerRuntimeSceneResumedCallback(function(r){const e=r.getAdhocListOfAllInstances();for(let t=0;t<e.length;++t){const o=e[t];o instanceof i.VideoRuntimeObject&&o._pausedAsScenePaused&&o.play()}})})(gdjs||(gdjs={}));
|
|
2
2
|
//# sourceMappingURL=videoruntimeobject.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../GDevelop/Extensions/Video/videoruntimeobject.ts"],
|
|
4
|
-
"sourcesContent": ["namespace gdjs {\n /** The initial properties for {@link gdjs.VideoRuntimeObject} */\n export type VideoObjectDataType = {\n /** The base parameters of the video */\n content: {\n /** The opacity of the video */\n opacity: number;\n /** Does the video loops itself? */\n loop: boolean;\n /** The volume of the video */\n volume: number;\n /** Name of the resource corresponding to the video */\n videoResource: string;\n };\n };\n\n export type VideoObjectData = ObjectData & VideoObjectDataType;\n\n /**\n * An object displaying a video on screen.\n *\n * For the same video resource, only one video is being created in memory (\n * as a HTMLVideoElement). This means that two objects displaying the same\n * video will have the same state for this video (paused/playing, current time,\n * volume, etc...).\n */\n export class VideoRuntimeObject\n extends gdjs.RuntimeObject\n implements gdjs.OpacityHandler {\n _opacity: float;\n _loop: boolean;\n _volume: float;\n _videoResource: string;\n\n // Use a boolean to track if the video was paused because we\n // navigated to another scene, and so should resume if we're back.\n _pausedAsScenePaused: boolean = false;\n _renderer: gdjs.VideoRuntimeObjectRenderer;\n _playbackSpeed: any;\n\n /**\n * @param instanceContainer The scene the object belongs to.\n * @param videoObjectData The data defining the object\n */\n constructor(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n videoObjectData: VideoObjectData\n ) {\n super(instanceContainer, videoObjectData);\n this._opacity = videoObjectData.content.opacity;\n this._loop = videoObjectData.content.loop;\n this._volume = videoObjectData.content.volume;\n this._videoResource = videoObjectData.content.videoResource;\n this._renderer = new gdjs.VideoRuntimeObjectRenderer(\n this,\n instanceContainer\n );\n\n // *ALWAYS* call `this.onCreated()` at the very end of your object constructor.\n this.onCreated();\n }\n\n getRendererObject() {\n return this._renderer.getRendererObject();\n }\n\n updateFromObjectData(\n oldObjectData: VideoObjectData,\n newObjectData: VideoObjectData\n ): boolean {\n if (oldObjectData.content.opacity !== newObjectData.content.opacity) {\n this.setOpacity(newObjectData.content.opacity);\n }\n if (oldObjectData.content.loop !== newObjectData.content.loop) {\n this.setLoop(newObjectData.content.loop);\n }\n if (oldObjectData.content.volume !== newObjectData.content.volume) {\n this.setVolume(newObjectData.content.volume);\n }\n if (\n oldObjectData.content.videoResource !==\n newObjectData.content.videoResource\n ) {\n return false;\n }\n return true;\n }\n\n /**\n * Initialize the extra parameters that could be set for an instance.\n * @param initialInstanceData The initial instance data\n */\n extraInitializationFromInitialInstance(initialInstanceData: InstanceData) {\n if (initialInstanceData.customSize) {\n this.setWidth(initialInstanceData.width);\n this.setHeight(initialInstanceData.height);\n }\n }\n\n onDestroyed(): void {\n super.onDestroyed();\n this._renderer.onDestroy();\n }\n\n update(instanceContainer: gdjs.RuntimeInstanceContainer): void {\n this._renderer.ensureUpToDate();\n }\n\n /**\n * Set object position on X axis.\n * @param x The new position X of the object.\n */\n setX(x: float): void {\n super.setX(x);\n this._renderer.updatePosition();\n }\n\n /**\n * Set object position on Y axis.\n * @param y The new position Y of the object.\n */\n setY(y: float): void {\n super.setY(y);\n this._renderer.updatePosition();\n }\n\n /**\n * Set the angle of the object.\n * @param angle The new angle of the object.\n */\n setAngle(angle: float): void {\n super.setAngle(angle);\n this._renderer.updateAngle();\n }\n\n /**\n * Set object opacity.\n * @param opacity The new opacity of the object (0-255).\n */\n setOpacity(opacity: float): void {\n this._opacity = opacity;\n this._renderer.updateOpacity();\n }\n\n /**\n * Get object opacity.\n * @returns The current opacity\n */\n getOpacity(): number {\n return this._opacity;\n }\n\n /**\n * Set the width of the video.\n * @param width The new width in pixels.\n */\n setWidth(width: float): void {\n if (this._renderer.getWidth() === width) return;\n\n this._renderer.setWidth(width);\n this.invalidateHitboxes();\n }\n\n /**\n * Set the height of the video.\n * @param height The new height in pixels.\n */\n setHeight(height: float): void {\n if (this._renderer.getHeight() === height) return;\n\n this._renderer.setHeight(height);\n this.invalidateHitboxes();\n }\n\n /**\n * Get the width of the video object.\n * @returns The current width of the object\n */\n getWidth(): float {\n return this._renderer.getWidth();\n }\n\n /**\n * Get the height of the video object.\n * @returns The current height of the object\n */\n getHeight(): float {\n return this._renderer.getHeight();\n }\n\n /**\n * Play the video.\n */\n play(): void {\n this._renderer.play();\n }\n\n /**\n * Pause the video.\n */\n pause(): void {\n this._renderer.pause();\n }\n\n /**\n * Set the state looped of the video.\n * @param enable true to loop the video\n */\n setLoop(enable: boolean): void {\n this._renderer.setLoop(enable);\n }\n\n /**\n * Set the state muted of the video.\n * @param enable The new state.\n */\n mute(enable: boolean) {\n this._renderer.setMute(enable);\n }\n\n /**\n * Return the state muted of video object.\n * @returns Is the video muted?\n */\n isMuted(): boolean {\n return this._renderer.isMuted();\n }\n\n /**\n * Set the volume of the video object.\n * @param volume The new volume, between 0 and 100.\n */\n setVolume(volume: number): void {\n this._volume =\n gdjs.evtTools.common.clamp(\n gdjs.evtTools.common.normalize(volume, 0, 100),\n 0,\n 1\n ) * 100;\n this._renderer.updateVolume();\n }\n\n /**\n * Get the volume of the video object.\n * @returns The current video's volume, between 0 and 100.\n */\n getVolume(): number {\n return (\n gdjs.evtTools.common.normalize(this._renderer.getVolume(), 0, 1) * 100\n );\n }\n\n /**\n * Check if the video is being played.\n * @returns Is the video being played?\n */\n isPlayed(): boolean {\n return this._renderer.isPlayed();\n }\n\n /**\n * Check if the video is paused.\n * @returns Is the video being paused?\n */\n isPaused(): boolean {\n return !this._renderer.isPlayed();\n }\n\n /**\n * Check if the video is looping.\n * @returns Is the video looping?\n */\n isLooped(): boolean {\n return this._renderer.isLooped();\n }\n\n /**\n * Return the total time of the video.\n * @returns The duration of the video\n */\n getDuration(): number {\n return this._renderer.getDuration();\n }\n\n /**\n * Check if the video has ended.\n * @returns Has the video ended?\n */\n isEnded(): boolean {\n return this._renderer.isEnded();\n }\n\n /**\n * Set the new time of the video object.\n * @param time The new time.\n */\n setCurrentTime(time: float): void {\n this._renderer.setCurrentTime(time);\n }\n\n /**\n * Get the current time of the video object.\n * @returns The current time of the video\n */\n getCurrentTime(): float {\n return this._renderer.getCurrentTime();\n }\n\n /**\n * Set the new playback speed of the video object.\n * @param playbackSpeed The new playback speed.\n */\n setPlaybackSpeed(playbackSpeed: number): void {\n this._playbackSpeed = gdjs.evtTools.common.clamp(playbackSpeed, 0.5, 2);\n this._renderer.setPlaybackSpeed(this._playbackSpeed);\n }\n\n /**\n * Get the playback speed of the video object.\n * @returns The current playback speed of the video.\n */\n getPlaybackSpeed(): number {\n return this._renderer.getPlaybackSpeed();\n }\n }\n gdjs.registerObject('Video::VideoObject', gdjs.VideoRuntimeObject);\n\n /**\n * When a scene is unloaded, pause any video being run.\n * TODO: Investigate how to dispose the video source?\n */\n gdjs.registerRuntimeSceneUnloadedCallback(function (runtimeScene) {\n // Manually find all the gdjs.VideoRuntimeObject living on the scene,\n // and pause them.\n const instances = runtimeScene.getAdhocListOfAllInstances();\n for (let i = 0; i < instances.length; ++i) {\n const obj = instances[i];\n if (obj instanceof gdjs.VideoRuntimeObject) {\n if (obj.isPlayed()) {\n obj.pause();\n }\n }\n }\n });\n\n /**\n * When a scene is paused, pause any video being run.\n */\n gdjs.registerRuntimeScenePausedCallback(function (runtimeScene) {\n // Manually find all the gdjs.VideoRuntimeObject living on the scene,\n // and pause them.\n const instances = runtimeScene.getAdhocListOfAllInstances();\n for (let i = 0; i < instances.length; ++i) {\n const obj = instances[i];\n if (obj instanceof gdjs.VideoRuntimeObject) {\n if (obj.isPlayed()) {\n obj.pause();\n obj._pausedAsScenePaused = true;\n }\n }\n }\n });\n\n // Flag it to be started again when scene is resumed.\n\n /**\n * When a scene is resumed, resume any video previously paused.\n */\n gdjs.registerRuntimeSceneResumedCallback(function (runtimeScene) {\n // Manually find all the gdjs.VideoRuntimeObject living on the scene,\n // and play them if they have been previously paused.\n const instances = runtimeScene.getAdhocListOfAllInstances();\n for (let i = 0; i < instances.length; ++i) {\n const obj = instances[i];\n if (obj instanceof gdjs.VideoRuntimeObject) {\n if (obj._pausedAsScenePaused) {\n obj.play();\n }\n }\n }\n });\n}\n"],
|
|
5
|
-
"mappings": "AAAA,GAAU,MAAV,UAAU,EAAV,
|
|
4
|
+
"sourcesContent": ["namespace gdjs {\n /** The initial properties for {@link gdjs.VideoRuntimeObject} */\n export type VideoObjectDataType = {\n /** The base parameters of the video */\n content: {\n /** The opacity of the video */\n opacity: number;\n /** Does the video loops itself? */\n loop: boolean;\n /** The volume of the video */\n volume: number;\n /** Name of the resource corresponding to the video */\n videoResource: string;\n };\n };\n\n export type VideoObjectData = ObjectData & VideoObjectDataType;\n\n export type VideoNetworkSyncDataType = {\n op: float;\n wid: float;\n hei: float;\n // We don't sync volume, as it's probably a user setting?\n pla: boolean;\n loop: boolean;\n ct: float;\n ps: number;\n };\n\n export type VideoNetworkSyncData = ObjectNetworkSyncData &\n VideoNetworkSyncDataType;\n\n /**\n * An object displaying a video on screen.\n *\n * For the same video resource, only one video is being created in memory (\n * as a HTMLVideoElement). This means that two objects displaying the same\n * video will have the same state for this video (paused/playing, current time,\n * volume, etc...).\n */\n export class VideoRuntimeObject\n extends gdjs.RuntimeObject\n implements gdjs.OpacityHandler {\n _opacity: float;\n _loop: boolean;\n _volume: float;\n _videoResource: string;\n\n // Use a boolean to track if the video was paused because we\n // navigated to another scene, and so should resume if we're back.\n _pausedAsScenePaused: boolean = false;\n _renderer: gdjs.VideoRuntimeObjectRenderer;\n _playbackSpeed: any;\n\n /**\n * @param instanceContainer The scene the object belongs to.\n * @param videoObjectData The data defining the object\n */\n constructor(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n videoObjectData: VideoObjectData\n ) {\n super(instanceContainer, videoObjectData);\n this._opacity = videoObjectData.content.opacity;\n this._loop = videoObjectData.content.loop;\n this._volume = videoObjectData.content.volume;\n this._videoResource = videoObjectData.content.videoResource;\n this._renderer = new gdjs.VideoRuntimeObjectRenderer(\n this,\n instanceContainer\n );\n\n // *ALWAYS* call `this.onCreated()` at the very end of your object constructor.\n this.onCreated();\n }\n\n getRendererObject() {\n return this._renderer.getRendererObject();\n }\n\n updateFromObjectData(\n oldObjectData: VideoObjectData,\n newObjectData: VideoObjectData\n ): boolean {\n if (oldObjectData.content.opacity !== newObjectData.content.opacity) {\n this.setOpacity(newObjectData.content.opacity);\n }\n if (oldObjectData.content.loop !== newObjectData.content.loop) {\n this.setLoop(newObjectData.content.loop);\n }\n if (oldObjectData.content.volume !== newObjectData.content.volume) {\n this.setVolume(newObjectData.content.volume);\n }\n if (\n oldObjectData.content.videoResource !==\n newObjectData.content.videoResource\n ) {\n return false;\n }\n return true;\n }\n\n getNetworkSyncData(): VideoNetworkSyncData {\n return {\n ...super.getNetworkSyncData(),\n op: this._opacity,\n wid: this.getWidth(),\n hei: this.getHeight(),\n pla: this.isPlayed(),\n loop: this.isLooped(),\n ct: this.getCurrentTime(),\n ps: this.getPlaybackSpeed(),\n };\n }\n\n updateFromNetworkSyncData(syncData: VideoNetworkSyncData): void {\n super.updateFromNetworkSyncData(syncData);\n\n if (this._opacity !== undefined && this._opacity && syncData.op) {\n this.setOpacity(syncData.op);\n }\n if (this.getWidth() !== undefined && this.getWidth() !== syncData.wid) {\n this.setWidth(syncData.wid);\n }\n if (this.getHeight() !== undefined && this.getHeight() !== syncData.hei) {\n this.setHeight(syncData.hei);\n }\n if (syncData.pla !== undefined && this.isPlayed() !== syncData.pla) {\n syncData.pla ? this.play() : this.pause();\n }\n if (syncData.loop !== undefined && this.isLooped() !== syncData.loop) {\n this.setLoop(syncData.loop);\n }\n // We don't update the current time too regularly, only if it's off by a lot.\n if (\n syncData.ct !== undefined &&\n Math.abs(this.getCurrentTime() - syncData.ct) > 3 // More than 3 seconds off\n ) {\n this.setCurrentTime(syncData.ct);\n }\n if (\n syncData.ps !== undefined &&\n this.getPlaybackSpeed() !== syncData.ps\n ) {\n this.setPlaybackSpeed(syncData.ps);\n }\n }\n\n /**\n * Initialize the extra parameters that could be set for an instance.\n * @param initialInstanceData The initial instance data\n */\n extraInitializationFromInitialInstance(initialInstanceData: InstanceData) {\n if (initialInstanceData.customSize) {\n this.setWidth(initialInstanceData.width);\n this.setHeight(initialInstanceData.height);\n }\n }\n\n onDestroyed(): void {\n super.onDestroyed();\n this._renderer.onDestroy();\n }\n\n update(instanceContainer: gdjs.RuntimeInstanceContainer): void {\n this._renderer.ensureUpToDate();\n }\n\n /**\n * Set object position on X axis.\n * @param x The new position X of the object.\n */\n setX(x: float): void {\n super.setX(x);\n this._renderer.updatePosition();\n }\n\n /**\n * Set object position on Y axis.\n * @param y The new position Y of the object.\n */\n setY(y: float): void {\n super.setY(y);\n this._renderer.updatePosition();\n }\n\n /**\n * Set the angle of the object.\n * @param angle The new angle of the object.\n */\n setAngle(angle: float): void {\n super.setAngle(angle);\n this._renderer.updateAngle();\n }\n\n /**\n * Set object opacity.\n * @param opacity The new opacity of the object (0-255).\n */\n setOpacity(opacity: float): void {\n this._opacity = opacity;\n this._renderer.updateOpacity();\n }\n\n /**\n * Get object opacity.\n * @returns The current opacity\n */\n getOpacity(): number {\n return this._opacity;\n }\n\n /**\n * Set the width of the video.\n * @param width The new width in pixels.\n */\n setWidth(width: float): void {\n if (this._renderer.getWidth() === width) return;\n\n this._renderer.setWidth(width);\n this.invalidateHitboxes();\n }\n\n /**\n * Set the height of the video.\n * @param height The new height in pixels.\n */\n setHeight(height: float): void {\n if (this._renderer.getHeight() === height) return;\n\n this._renderer.setHeight(height);\n this.invalidateHitboxes();\n }\n\n /**\n * Get the width of the video object.\n * @returns The current width of the object\n */\n getWidth(): float {\n return this._renderer.getWidth();\n }\n\n /**\n * Get the height of the video object.\n * @returns The current height of the object\n */\n getHeight(): float {\n return this._renderer.getHeight();\n }\n\n /**\n * Play the video.\n */\n play(): void {\n this._renderer.play();\n }\n\n /**\n * Pause the video.\n */\n pause(): void {\n this._renderer.pause();\n }\n\n /**\n * Set the state looped of the video.\n * @param enable true to loop the video\n */\n setLoop(enable: boolean): void {\n this._renderer.setLoop(enable);\n }\n\n /**\n * Set the state muted of the video.\n * @param enable The new state.\n */\n mute(enable: boolean) {\n this._renderer.setMute(enable);\n }\n\n /**\n * Return the state muted of video object.\n * @returns Is the video muted?\n */\n isMuted(): boolean {\n return this._renderer.isMuted();\n }\n\n /**\n * Set the volume of the video object.\n * @param volume The new volume, between 0 and 100.\n */\n setVolume(volume: number): void {\n this._volume =\n gdjs.evtTools.common.clamp(\n gdjs.evtTools.common.normalize(volume, 0, 100),\n 0,\n 1\n ) * 100;\n this._renderer.updateVolume();\n }\n\n /**\n * Get the volume of the video object.\n * @returns The current video's volume, between 0 and 100.\n */\n getVolume(): number {\n return (\n gdjs.evtTools.common.normalize(this._renderer.getVolume(), 0, 1) * 100\n );\n }\n\n /**\n * Check if the video is being played.\n * @returns Is the video being played?\n */\n isPlayed(): boolean {\n return this._renderer.isPlayed();\n }\n\n /**\n * Check if the video is paused.\n * @returns Is the video being paused?\n */\n isPaused(): boolean {\n return !this._renderer.isPlayed();\n }\n\n /**\n * Check if the video is looping.\n * @returns Is the video looping?\n */\n isLooped(): boolean {\n return this._renderer.isLooped();\n }\n\n /**\n * Return the total time of the video.\n * @returns The duration of the video\n */\n getDuration(): number {\n return this._renderer.getDuration();\n }\n\n /**\n * Check if the video has ended.\n * @returns Has the video ended?\n */\n isEnded(): boolean {\n return this._renderer.isEnded();\n }\n\n /**\n * Set the new time of the video object.\n * @param time The new time.\n */\n setCurrentTime(time: float): void {\n this._renderer.setCurrentTime(time);\n }\n\n /**\n * Get the current time of the video object.\n * @returns The current time of the video\n */\n getCurrentTime(): float {\n return this._renderer.getCurrentTime();\n }\n\n /**\n * Set the new playback speed of the video object.\n * @param playbackSpeed The new playback speed.\n */\n setPlaybackSpeed(playbackSpeed: number): void {\n this._playbackSpeed = gdjs.evtTools.common.clamp(playbackSpeed, 0.5, 2);\n this._renderer.setPlaybackSpeed(this._playbackSpeed);\n }\n\n /**\n * Get the playback speed of the video object.\n * @returns The current playback speed of the video.\n */\n getPlaybackSpeed(): number {\n return this._renderer.getPlaybackSpeed();\n }\n }\n gdjs.registerObject('Video::VideoObject', gdjs.VideoRuntimeObject);\n\n /**\n * When a scene is unloaded, pause any video being run.\n * TODO: Investigate how to dispose the video source?\n */\n gdjs.registerRuntimeSceneUnloadedCallback(function (runtimeScene) {\n // Manually find all the gdjs.VideoRuntimeObject living on the scene,\n // and pause them.\n const instances = runtimeScene.getAdhocListOfAllInstances();\n for (let i = 0; i < instances.length; ++i) {\n const obj = instances[i];\n if (obj instanceof gdjs.VideoRuntimeObject) {\n if (obj.isPlayed()) {\n obj.pause();\n }\n }\n }\n });\n\n /**\n * When a scene is paused, pause any video being run.\n */\n gdjs.registerRuntimeScenePausedCallback(function (runtimeScene) {\n // Manually find all the gdjs.VideoRuntimeObject living on the scene,\n // and pause them.\n const instances = runtimeScene.getAdhocListOfAllInstances();\n for (let i = 0; i < instances.length; ++i) {\n const obj = instances[i];\n if (obj instanceof gdjs.VideoRuntimeObject) {\n if (obj.isPlayed()) {\n obj.pause();\n obj._pausedAsScenePaused = true;\n }\n }\n }\n });\n\n // Flag it to be started again when scene is resumed.\n\n /**\n * When a scene is resumed, resume any video previously paused.\n */\n gdjs.registerRuntimeSceneResumedCallback(function (runtimeScene) {\n // Manually find all the gdjs.VideoRuntimeObject living on the scene,\n // and play them if they have been previously paused.\n const instances = runtimeScene.getAdhocListOfAllInstances();\n for (let i = 0; i < instances.length; ++i) {\n const obj = instances[i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
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,
|
|
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,o;arguments.length===5?(i=a,o=n):(i=0,o=arguments[3]);for(let h=0,g=e.length;h<g;++h){const r=e[h],_=r.name,c=this.createObject(_);c!==null&&(o&&(c.persistentUuid=r.persistentUuid||null),c.setPosition(r.x+t,r.y+s),c.setAngle(r.angle),l.Base3DHandler&&l.Base3DHandler.is3D(c)&&(r.z!==void 0&&c.setZ(r.z+i),r.rotationX!==void 0&&c.setRotationX(r.rotationX),r.rotationY!==void 0&&c.setRotationY(r.rotationY)),c.setZOrder(r.zOrder),c.setLayer(r.layer),c.getVariables().initFrom(r.initialVariables,!0),c.extraInitializationFromInitialInstance(r))}}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 o=n.getZOrder();(e[i]===void 0||e[i]<o)&&(e[i]=o)}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(),o=n/1e3;a.setX(a.getX()+i.getX()*o),a.setY(a.getY()+i.getY()*o),a.update(this),a.updateForces(o)}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(),o=n.getElapsedTime()/1e3;n.setX(n.getX()+i.getX()*o),n.setY(n.getY()+i.getY()*o),n.updateForces(o)}}}}_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={}));
|
|
2
2
|
//# sourceMappingURL=RuntimeInstanceContainer.js.map
|