gdcore-tools 2.0.0-beta3 → 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.d.cts +5 -0
- package/dist/lib/libGD.wasm +0 -0
- package/dist/loaders.cjs +2 -1
- package/dist/loaders.d.cts +2 -0
- package/gd.d.ts +217 -223
- package/package.json +8 -6
- package/src/index.js +2 -0
- package/types/index.d.ts +2 -2
- package/types/open_project.d.ts +4 -4
- 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
|
@@ -164,18 +164,11 @@ const defineTileMap = function (extension, _, gd) {
|
|
|
164
164
|
objectContent,
|
|
165
165
|
instance,
|
|
166
166
|
propertyName,
|
|
167
|
-
newValue
|
|
168
|
-
project,
|
|
169
|
-
layout
|
|
167
|
+
newValue
|
|
170
168
|
) {
|
|
171
169
|
return false;
|
|
172
170
|
};
|
|
173
|
-
objectTileMap.getInitialInstanceProperties = function (
|
|
174
|
-
content,
|
|
175
|
-
instance,
|
|
176
|
-
project,
|
|
177
|
-
layout
|
|
178
|
-
) {
|
|
171
|
+
objectTileMap.getInitialInstanceProperties = function (content, instance) {
|
|
179
172
|
var instanceProperties = new gd.MapStringPropertyDescriptor();
|
|
180
173
|
return instanceProperties;
|
|
181
174
|
};
|
|
@@ -183,7 +176,7 @@ const defineTileMap = function (extension, _, gd) {
|
|
|
183
176
|
const object = extension
|
|
184
177
|
.addObject(
|
|
185
178
|
'TileMap',
|
|
186
|
-
_('Tilemap'),
|
|
179
|
+
_('External Tilemap (Tiled/LDtk)'),
|
|
187
180
|
_(
|
|
188
181
|
'Displays a tiled-based map, made with the Tiled editor (https://www.mapeditor.org/) or the LDtk editor (https://ldtk.io/).'
|
|
189
182
|
),
|
|
@@ -598,6 +591,471 @@ const defineTileMap = function (extension, _, gd) {
|
|
|
598
591
|
.setFunctionName('setHeight');
|
|
599
592
|
};
|
|
600
593
|
|
|
594
|
+
/**
|
|
595
|
+
* @param {gd.PlatformExtension} extension
|
|
596
|
+
* @param {(translationSource: string) => string} _
|
|
597
|
+
* @param {GDNamespace} gd
|
|
598
|
+
*/
|
|
599
|
+
const defineSimpleTileMap = function (extension, _, gd) {
|
|
600
|
+
var objectSimpleTileMap = new gd.ObjectJsImplementation();
|
|
601
|
+
objectSimpleTileMap.updateProperty = function (
|
|
602
|
+
objectContent,
|
|
603
|
+
propertyName,
|
|
604
|
+
newValue
|
|
605
|
+
) {
|
|
606
|
+
if (propertyName === 'atlasImage') {
|
|
607
|
+
objectContent.atlasImage = newValue;
|
|
608
|
+
return true;
|
|
609
|
+
}
|
|
610
|
+
if (propertyName === 'columnCount') {
|
|
611
|
+
objectContent.columnCount = parseFloat(newValue);
|
|
612
|
+
return true;
|
|
613
|
+
}
|
|
614
|
+
if (propertyName === 'rowCount') {
|
|
615
|
+
objectContent.rowCount = parseFloat(newValue);
|
|
616
|
+
return true;
|
|
617
|
+
}
|
|
618
|
+
if (propertyName === 'tileSize') {
|
|
619
|
+
objectContent.tileSize = parseFloat(newValue);
|
|
620
|
+
return true;
|
|
621
|
+
}
|
|
622
|
+
if (propertyName === 'tilesWithHitBox') {
|
|
623
|
+
objectContent.tilesWithHitBox = newValue;
|
|
624
|
+
return true;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
return false;
|
|
628
|
+
};
|
|
629
|
+
objectSimpleTileMap.getProperties = function (objectContent) {
|
|
630
|
+
var objectProperties = new gd.MapStringPropertyDescriptor();
|
|
631
|
+
|
|
632
|
+
objectProperties.set(
|
|
633
|
+
'columnCount',
|
|
634
|
+
new gd.PropertyDescriptor((objectContent.columnCount || 4).toString())
|
|
635
|
+
.setType('number')
|
|
636
|
+
.setLabel(_('Columns'))
|
|
637
|
+
.setDescription(_('Number of columns.'))
|
|
638
|
+
.setHidden(true)
|
|
639
|
+
);
|
|
640
|
+
objectProperties.set(
|
|
641
|
+
'rowCount',
|
|
642
|
+
new gd.PropertyDescriptor((objectContent.rowCount || 4).toString())
|
|
643
|
+
.setType('number')
|
|
644
|
+
.setLabel(_('Rows'))
|
|
645
|
+
.setDescription(_('Number of rows.'))
|
|
646
|
+
.setHidden(true)
|
|
647
|
+
);
|
|
648
|
+
objectProperties.set(
|
|
649
|
+
'tileSize',
|
|
650
|
+
new gd.PropertyDescriptor((objectContent.tileSize || 8).toString())
|
|
651
|
+
.setType('number')
|
|
652
|
+
.setLabel(_('Tile size'))
|
|
653
|
+
.setDescription(_('Tile size in pixels.'))
|
|
654
|
+
);
|
|
655
|
+
objectProperties.set(
|
|
656
|
+
'tilesWithHitBox',
|
|
657
|
+
new gd.PropertyDescriptor(objectContent.tilesWithHitBox || '')
|
|
658
|
+
.setType('string')
|
|
659
|
+
.setLabel(_('Tile ids with hit box'))
|
|
660
|
+
.setDescription(
|
|
661
|
+
_('The list of tile ids with a hit box (separated by commas).')
|
|
662
|
+
)
|
|
663
|
+
.setHidden(true)
|
|
664
|
+
);
|
|
665
|
+
|
|
666
|
+
objectProperties.set(
|
|
667
|
+
'atlasImage',
|
|
668
|
+
new gd.PropertyDescriptor(objectContent.atlasImage)
|
|
669
|
+
.setType('resource')
|
|
670
|
+
.addExtraInfo('image')
|
|
671
|
+
.setLabel(_('Atlas image'))
|
|
672
|
+
.setDescription(_('The Atlas image containing the tileset.'))
|
|
673
|
+
);
|
|
674
|
+
|
|
675
|
+
return objectProperties;
|
|
676
|
+
};
|
|
677
|
+
objectSimpleTileMap.setRawJSONContent(
|
|
678
|
+
JSON.stringify({
|
|
679
|
+
atlasImage: '',
|
|
680
|
+
rowCount: 1,
|
|
681
|
+
columnCount: 1,
|
|
682
|
+
tileSize: 8,
|
|
683
|
+
tilesWithHitBox: '',
|
|
684
|
+
})
|
|
685
|
+
);
|
|
686
|
+
|
|
687
|
+
objectSimpleTileMap.updateInitialInstanceProperty = function (
|
|
688
|
+
instance,
|
|
689
|
+
propertyName,
|
|
690
|
+
newValue
|
|
691
|
+
) {
|
|
692
|
+
if (propertyName === 'tilemap') {
|
|
693
|
+
instance.setRawStringProperty('tilemap', newValue);
|
|
694
|
+
return true;
|
|
695
|
+
}
|
|
696
|
+
return false;
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
objectSimpleTileMap.getInitialInstanceProperties = function (
|
|
700
|
+
objectContent,
|
|
701
|
+
instance
|
|
702
|
+
) {
|
|
703
|
+
var instanceProperties = new gd.MapStringPropertyDescriptor();
|
|
704
|
+
|
|
705
|
+
instanceProperties
|
|
706
|
+
.getOrCreate('tilemap')
|
|
707
|
+
.setValue(instance.getRawStringProperty('tileMap'))
|
|
708
|
+
.setType('string')
|
|
709
|
+
.setLabel('Tilemap')
|
|
710
|
+
.setHidden(true);
|
|
711
|
+
|
|
712
|
+
return instanceProperties;
|
|
713
|
+
};
|
|
714
|
+
|
|
715
|
+
const object = extension
|
|
716
|
+
.addObject(
|
|
717
|
+
'SimpleTileMap',
|
|
718
|
+
_('Tile map'),
|
|
719
|
+
_('Displays a tiled-based map.'),
|
|
720
|
+
'JsPlatform/Extensions/tile_map.svg',
|
|
721
|
+
objectSimpleTileMap
|
|
722
|
+
)
|
|
723
|
+
.setCategoryFullName(_('General'))
|
|
724
|
+
.addDefaultBehavior('EffectCapability::EffectBehavior')
|
|
725
|
+
.addDefaultBehavior('ResizableCapability::ResizableBehavior')
|
|
726
|
+
.addDefaultBehavior('ScalableCapability::ScalableBehavior')
|
|
727
|
+
.addDefaultBehavior('OpacityCapability::OpacityBehavior')
|
|
728
|
+
.setIncludeFile('Extensions/TileMap/simpletilemapruntimeobject.js')
|
|
729
|
+
.addIncludeFile('Extensions/TileMap/TileMapRuntimeManager.js')
|
|
730
|
+
.addIncludeFile('Extensions/TileMap/tilemapruntimeobject-pixi-renderer.js')
|
|
731
|
+
.addIncludeFile('Extensions/TileMap/pixi-tilemap/dist/pixi-tilemap.umd.js')
|
|
732
|
+
.addIncludeFile('Extensions/TileMap/collision/TransformedTileMap.js')
|
|
733
|
+
.addIncludeFile('Extensions/TileMap/pako/dist/pako.min.js')
|
|
734
|
+
.addIncludeFile('Extensions/TileMap/helper/TileMapHelper.js');
|
|
735
|
+
|
|
736
|
+
object
|
|
737
|
+
.addExpression(
|
|
738
|
+
'TilesetColumnCount',
|
|
739
|
+
_('Tileset column count'),
|
|
740
|
+
_('Get the number of column in the tileset.'),
|
|
741
|
+
'',
|
|
742
|
+
'JsPlatform/Extensions/tile_map.svg'
|
|
743
|
+
)
|
|
744
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
745
|
+
.setFunctionName('getTilesetColumnCount');
|
|
746
|
+
|
|
747
|
+
object
|
|
748
|
+
.addExpression(
|
|
749
|
+
'TilesetRowCount',
|
|
750
|
+
_('Tileset row count'),
|
|
751
|
+
_('Get the number of row in the tileset.'),
|
|
752
|
+
'',
|
|
753
|
+
'JsPlatform/Extensions/tile_map.svg'
|
|
754
|
+
)
|
|
755
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
756
|
+
.setFunctionName('getTilesetRowCount');
|
|
757
|
+
|
|
758
|
+
object
|
|
759
|
+
.addExpression(
|
|
760
|
+
'TileCenterX',
|
|
761
|
+
_('Scene X coordinate of tile'),
|
|
762
|
+
_('Get the scene X position of the center of the tile.'),
|
|
763
|
+
'',
|
|
764
|
+
'JsPlatform/Extensions/tile_map.svg'
|
|
765
|
+
)
|
|
766
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
767
|
+
.addParameter('number', _('Grid X'), '', false)
|
|
768
|
+
.addParameter('number', _('Grid Y'), '', false)
|
|
769
|
+
.setFunctionName('getSceneXCoordinateOfTileCenter');
|
|
770
|
+
|
|
771
|
+
object
|
|
772
|
+
.addExpression(
|
|
773
|
+
'TileCenterY',
|
|
774
|
+
_('Scene Y coordinate of tile'),
|
|
775
|
+
_('Get the scene Y position of the center of the tile.'),
|
|
776
|
+
'',
|
|
777
|
+
'JsPlatform/Extensions/tile_map.svg'
|
|
778
|
+
)
|
|
779
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
780
|
+
.addParameter('number', _('Grid X'), '', false)
|
|
781
|
+
.addParameter('number', _('Grid Y'), '', false)
|
|
782
|
+
.setFunctionName('getSceneYCoordinateOfTileCenter');
|
|
783
|
+
|
|
784
|
+
object
|
|
785
|
+
.addExpression(
|
|
786
|
+
'GridX',
|
|
787
|
+
_('Tile map grid column coordinate'),
|
|
788
|
+
_(
|
|
789
|
+
'Get the grid column coordinates in the tile map corresponding to the scene coordinates.'
|
|
790
|
+
),
|
|
791
|
+
'',
|
|
792
|
+
'JsPlatform/Extensions/tile_map.svg'
|
|
793
|
+
)
|
|
794
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
795
|
+
.addParameter('number', _('Position X'), '', false)
|
|
796
|
+
.addParameter('number', _('Position Y'), '', false)
|
|
797
|
+
.setFunctionName('getColumnIndexAtPosition');
|
|
798
|
+
|
|
799
|
+
object
|
|
800
|
+
.addExpression(
|
|
801
|
+
'GridY',
|
|
802
|
+
_('Tile map grid row coordinate'),
|
|
803
|
+
_(
|
|
804
|
+
'Get the grid row coordinates in the tile map corresponding to the scene coordinates.'
|
|
805
|
+
),
|
|
806
|
+
'',
|
|
807
|
+
'JsPlatform/Extensions/tile_map.svg'
|
|
808
|
+
)
|
|
809
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
810
|
+
.addParameter('number', _('Position X'), '', false)
|
|
811
|
+
.addParameter('number', _('Position Y'), '', false)
|
|
812
|
+
.setFunctionName('getRowIndexAtPosition');
|
|
813
|
+
|
|
814
|
+
object
|
|
815
|
+
.addExpressionAndConditionAndAction(
|
|
816
|
+
'number',
|
|
817
|
+
'TileIdAtPosition',
|
|
818
|
+
_('Tile (at position)'),
|
|
819
|
+
_('the id of the tile at the scene coordinates'),
|
|
820
|
+
_('the tile id at scene coordinates _PARAM3_ ; _PARAM4_'),
|
|
821
|
+
'',
|
|
822
|
+
'JsPlatform/Extensions/tile_map.svg'
|
|
823
|
+
)
|
|
824
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
825
|
+
.useStandardParameters('number', gd.ParameterOptions.makeNewOptions())
|
|
826
|
+
.addParameter('number', _('Position X'), '', false)
|
|
827
|
+
.addParameter('number', _('Position Y'), '', false)
|
|
828
|
+
.setFunctionName('setTileAtPosition')
|
|
829
|
+
.setGetter('getTileAtPosition');
|
|
830
|
+
|
|
831
|
+
object
|
|
832
|
+
.addAction(
|
|
833
|
+
'FlipTileOnYAtPosition',
|
|
834
|
+
_('Flip tile vertically (at position)'),
|
|
835
|
+
_('Flip tile vertically at scene coordinates.'),
|
|
836
|
+
_(
|
|
837
|
+
'Flip tile vertically at scene coordinates _PARAM1_ ; _PARAM2_: _PARAM3_'
|
|
838
|
+
),
|
|
839
|
+
_('Effects'),
|
|
840
|
+
'res/actions/flipY24.png',
|
|
841
|
+
'res/actions/flipY.png'
|
|
842
|
+
)
|
|
843
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
844
|
+
.addParameter('number', _('Position X'), '', false)
|
|
845
|
+
.addParameter('number', _('Position Y'), '', false)
|
|
846
|
+
.addParameter('yesorno', _('Flip vertically'), '', false)
|
|
847
|
+
.setDefaultValue('false')
|
|
848
|
+
.setFunctionName('flipTileOnYAtPosition');
|
|
849
|
+
|
|
850
|
+
object
|
|
851
|
+
.addAction(
|
|
852
|
+
'FlipTileOnXAtPosition',
|
|
853
|
+
_('Flip tile horizontally (at position)'),
|
|
854
|
+
_('Flip tile horizontally at scene coordinates.'),
|
|
855
|
+
_(
|
|
856
|
+
'Flip tile horizontally at scene coordinates _PARAM1_ ; _PARAM2_: _PARAM3_'
|
|
857
|
+
),
|
|
858
|
+
_('Effects'),
|
|
859
|
+
'res/actions/flipX24.png',
|
|
860
|
+
'res/actions/flipX.png'
|
|
861
|
+
)
|
|
862
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
863
|
+
.addParameter('number', _('Position X'), '', false)
|
|
864
|
+
.addParameter('number', _('Position Y'), '', false)
|
|
865
|
+
.addParameter('yesorno', _('Flip horizontally'), '', false)
|
|
866
|
+
.setDefaultValue('false')
|
|
867
|
+
.setFunctionName('flipTileOnXAtPosition');
|
|
868
|
+
|
|
869
|
+
object
|
|
870
|
+
.addAction(
|
|
871
|
+
'RemoveTileAtPosition',
|
|
872
|
+
_('Remove tile (at position)'),
|
|
873
|
+
_('Remove the tile at the scene coordinates.'),
|
|
874
|
+
_('Remove tile at scene coordinates _PARAM1_ ; _PARAM2_'),
|
|
875
|
+
'',
|
|
876
|
+
'JsPlatform/Extensions/tile_map.svg',
|
|
877
|
+
'JsPlatform/Extensions/tile_map.svg'
|
|
878
|
+
)
|
|
879
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
880
|
+
.addParameter('number', _('Position X'), '', false)
|
|
881
|
+
.addParameter('number', _('Position Y'), '', false)
|
|
882
|
+
.getCodeExtraInformation()
|
|
883
|
+
.setFunctionName('removeTileAtPosition');
|
|
884
|
+
|
|
885
|
+
object
|
|
886
|
+
.addExpressionAndConditionAndAction(
|
|
887
|
+
'number',
|
|
888
|
+
'TileIdAtGrid',
|
|
889
|
+
_('Tile (on the grid)'),
|
|
890
|
+
_('the id of the tile at the grid coordinates'),
|
|
891
|
+
_('the tile id at grid coordinates _PARAM3_ ; _PARAM4_'),
|
|
892
|
+
'',
|
|
893
|
+
'JsPlatform/Extensions/tile_map.svg'
|
|
894
|
+
)
|
|
895
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
896
|
+
.useStandardParameters('number', gd.ParameterOptions.makeNewOptions())
|
|
897
|
+
.addParameter('number', _('Grid X'), '', false)
|
|
898
|
+
.addParameter('number', _('Grid Y'), '', false)
|
|
899
|
+
.setFunctionName('setTileAtGridCoordinates')
|
|
900
|
+
.setGetter('getTileAtGridCoordinates');
|
|
901
|
+
|
|
902
|
+
object
|
|
903
|
+
.addAction(
|
|
904
|
+
'FlipTileOnYAtGridCoordinates',
|
|
905
|
+
_('Flip tile vertically (on the grid)'),
|
|
906
|
+
_('Flip tile vertically at grid coordinates.'),
|
|
907
|
+
_(
|
|
908
|
+
'Flip tile vertically at grid coordinates _PARAM1_ ; _PARAM2_: _PARAM3_'
|
|
909
|
+
),
|
|
910
|
+
_('Effects'),
|
|
911
|
+
'res/actions/flipY24.png',
|
|
912
|
+
'res/actions/flipY.png'
|
|
913
|
+
)
|
|
914
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
915
|
+
.addParameter('number', _('Grid X'), '', false)
|
|
916
|
+
.addParameter('number', _('Grid Y'), '', false)
|
|
917
|
+
.addParameter('yesorno', _('Flip vertically'), '', false)
|
|
918
|
+
.setDefaultValue('false')
|
|
919
|
+
.setFunctionName('flipTileOnYAtGridCoordinates');
|
|
920
|
+
|
|
921
|
+
object
|
|
922
|
+
.addAction(
|
|
923
|
+
'FlipTileOnXAtGridCoordinates',
|
|
924
|
+
_('Flip tile horizontally (on the grid)'),
|
|
925
|
+
_('Flip tile horizontally at grid coordinates.'),
|
|
926
|
+
_(
|
|
927
|
+
'Flip tile horizontally at grid coordinates _PARAM1_ ; _PARAM2_: _PARAM3_'
|
|
928
|
+
),
|
|
929
|
+
_('Effects'),
|
|
930
|
+
'res/actions/flipX24.png',
|
|
931
|
+
'res/actions/flipX.png'
|
|
932
|
+
)
|
|
933
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
934
|
+
.addParameter('number', _('Grid X'), '', false)
|
|
935
|
+
.addParameter('number', _('Grid Y'), '', false)
|
|
936
|
+
.addParameter('yesorno', _('Flip horizontally'), '', false)
|
|
937
|
+
.setDefaultValue('false')
|
|
938
|
+
.setFunctionName('flipTileOnXAtGridCoordinates');
|
|
939
|
+
|
|
940
|
+
object
|
|
941
|
+
.addAction(
|
|
942
|
+
'RemoveTileAtGridCoordinates',
|
|
943
|
+
_('Remove tile (on the grid)'),
|
|
944
|
+
_('Remove the tile at the grid coordinates.'),
|
|
945
|
+
_('Remove tile at grid coordinates _PARAM1_ ; _PARAM2_'),
|
|
946
|
+
'',
|
|
947
|
+
'JsPlatform/Extensions/tile_map.svg',
|
|
948
|
+
'JsPlatform/Extensions/tile_map.svg'
|
|
949
|
+
)
|
|
950
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
951
|
+
.addParameter('number', _('Grid X'), '', false)
|
|
952
|
+
.addParameter('number', _('Grid Y'), '', false)
|
|
953
|
+
.getCodeExtraInformation()
|
|
954
|
+
.setFunctionName('removeTileAtGridCoordinates');
|
|
955
|
+
|
|
956
|
+
object
|
|
957
|
+
.addCondition(
|
|
958
|
+
'IsTileFlippedOnXAtPosition',
|
|
959
|
+
_('Tile flipped horizontally (at position)'),
|
|
960
|
+
_('Check if tile at scene coordinates is flipped horizontally.'),
|
|
961
|
+
_(
|
|
962
|
+
'The tile at scene coordinates _PARAM1_ ; _PARAM2_ is flipped horizontally'
|
|
963
|
+
),
|
|
964
|
+
_('Effects'),
|
|
965
|
+
'res/actions/flipX24.png',
|
|
966
|
+
'res/actions/flipX.png'
|
|
967
|
+
)
|
|
968
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
969
|
+
.addParameter('number', _('Position X'), '', false)
|
|
970
|
+
.addParameter('number', _('Position Y'), '', false)
|
|
971
|
+
.getCodeExtraInformation()
|
|
972
|
+
.setFunctionName('isTileFlippedOnXAtPosition');
|
|
973
|
+
|
|
974
|
+
object
|
|
975
|
+
.addCondition(
|
|
976
|
+
'IsTileFlippedOnYAtPosition',
|
|
977
|
+
_('Tile flipped vertically (at position)'),
|
|
978
|
+
_('Check if tile at scene coordinates is flipped vertically.'),
|
|
979
|
+
_(
|
|
980
|
+
'The tile at scene coordinates _PARAM1_ ; _PARAM2_ is flipped vertically'
|
|
981
|
+
),
|
|
982
|
+
_('Effects'),
|
|
983
|
+
'res/actions/flipY24.png',
|
|
984
|
+
'res/actions/flipY.png'
|
|
985
|
+
)
|
|
986
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
987
|
+
.addParameter('number', _('Position X'), '', false)
|
|
988
|
+
.addParameter('number', _('Position Y'), '', false)
|
|
989
|
+
.getCodeExtraInformation()
|
|
990
|
+
.setFunctionName('isTileFlippedOnYAtPosition');
|
|
991
|
+
|
|
992
|
+
object
|
|
993
|
+
.addCondition(
|
|
994
|
+
'IsTileFlippedOnXAtGridCoordinates',
|
|
995
|
+
_('Tile flipped horizontally (on the grid)'),
|
|
996
|
+
_('Check if tile at grid coordinates is flipped horizontally.'),
|
|
997
|
+
_(
|
|
998
|
+
'The tile at grid coordinates _PARAM1_ ; _PARAM2_ is flipped horizontally'
|
|
999
|
+
),
|
|
1000
|
+
_('Effects'),
|
|
1001
|
+
'res/actions/flipX24.png',
|
|
1002
|
+
'res/actions/flipX.png'
|
|
1003
|
+
)
|
|
1004
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
1005
|
+
.addParameter('number', _('Grid X'), '', false)
|
|
1006
|
+
.addParameter('number', _('Grid Y'), '', false)
|
|
1007
|
+
.getCodeExtraInformation()
|
|
1008
|
+
.setFunctionName('isTileFlippedOnXAtGridCoordinates');
|
|
1009
|
+
|
|
1010
|
+
object
|
|
1011
|
+
.addCondition(
|
|
1012
|
+
'IsTileFlippedOnYAtGridCoordinates',
|
|
1013
|
+
_('Tile flipped vertically (on the grid)'),
|
|
1014
|
+
_('Check if tile at grid coordinates is flipped vertically.'),
|
|
1015
|
+
_(
|
|
1016
|
+
'The tile at grid coordinates _PARAM1_ ; _PARAM2_ is flipped vertically'
|
|
1017
|
+
),
|
|
1018
|
+
_('Effects'),
|
|
1019
|
+
'res/actions/flipY24.png',
|
|
1020
|
+
'res/actions/flipY.png'
|
|
1021
|
+
)
|
|
1022
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
1023
|
+
.addParameter('number', _('Grid X'), '', false)
|
|
1024
|
+
.addParameter('number', _('Grid Y'), '', false)
|
|
1025
|
+
.getCodeExtraInformation()
|
|
1026
|
+
.setFunctionName('isTileFlippedOnYAtGridCoordinates');
|
|
1027
|
+
|
|
1028
|
+
object
|
|
1029
|
+
.addExpressionAndConditionAndAction(
|
|
1030
|
+
'number',
|
|
1031
|
+
'GridRowCount',
|
|
1032
|
+
_('Grid row count'),
|
|
1033
|
+
_('the grid row count in the tile map'),
|
|
1034
|
+
_('the grid row count'),
|
|
1035
|
+
_('Size'),
|
|
1036
|
+
'res/actions/scaleHeight24_black.png'
|
|
1037
|
+
)
|
|
1038
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
1039
|
+
.useStandardParameters('number', gd.ParameterOptions.makeNewOptions())
|
|
1040
|
+
.setFunctionName('setGridRowCount')
|
|
1041
|
+
.setGetter('getGridRowCount');
|
|
1042
|
+
|
|
1043
|
+
object
|
|
1044
|
+
.addExpressionAndConditionAndAction(
|
|
1045
|
+
'number',
|
|
1046
|
+
'GridColumnCount',
|
|
1047
|
+
_('Grid column count'),
|
|
1048
|
+
_('the grid column count in the tile map'),
|
|
1049
|
+
_('the grid column count'),
|
|
1050
|
+
_('Size'),
|
|
1051
|
+
'res/actions/scaleWidth24_black.png'
|
|
1052
|
+
)
|
|
1053
|
+
.addParameter('object', _('Tile map'), 'SimpleTileMap', false)
|
|
1054
|
+
.useStandardParameters('number', gd.ParameterOptions.makeNewOptions())
|
|
1055
|
+
.setFunctionName('setGridColumnCount')
|
|
1056
|
+
.setGetter('getGridColumnCount');
|
|
1057
|
+
};
|
|
1058
|
+
|
|
601
1059
|
/**
|
|
602
1060
|
* @param {gd.PlatformExtension} extension
|
|
603
1061
|
* @param {(translationSource: string) => string} _
|
|
@@ -761,17 +1219,13 @@ const defineCollisionMask = function (extension, _, gd) {
|
|
|
761
1219
|
objectContent,
|
|
762
1220
|
instance,
|
|
763
1221
|
propertyName,
|
|
764
|
-
newValue
|
|
765
|
-
project,
|
|
766
|
-
layout
|
|
1222
|
+
newValue
|
|
767
1223
|
) {
|
|
768
1224
|
return false;
|
|
769
1225
|
};
|
|
770
1226
|
collisionMaskObject.getInitialInstanceProperties = function (
|
|
771
1227
|
content,
|
|
772
|
-
instance
|
|
773
|
-
project,
|
|
774
|
-
layout
|
|
1228
|
+
instance
|
|
775
1229
|
) {
|
|
776
1230
|
var instanceProperties = new gd.MapStringPropertyDescriptor();
|
|
777
1231
|
return instanceProperties;
|
|
@@ -780,7 +1234,7 @@ const defineCollisionMask = function (extension, _, gd) {
|
|
|
780
1234
|
const object = extension
|
|
781
1235
|
.addObject(
|
|
782
1236
|
'CollisionMask',
|
|
783
|
-
_('Tilemap collision mask'),
|
|
1237
|
+
_('External Tilemap (Tiled/LDtk) collision mask'),
|
|
784
1238
|
_('Invisible object handling collisions with parts of a tilemap.'),
|
|
785
1239
|
'JsPlatform/Extensions/tile_map_collision_mask32.svg',
|
|
786
1240
|
collisionMaskObject
|
|
@@ -1031,7 +1485,7 @@ module.exports = {
|
|
|
1031
1485
|
extension
|
|
1032
1486
|
.setExtensionInformation(
|
|
1033
1487
|
'TileMap',
|
|
1034
|
-
_('
|
|
1488
|
+
_('Tile map'),
|
|
1035
1489
|
_(
|
|
1036
1490
|
"The Tilemap object can be used to display tile-based objects. It's a good way to create maps for RPG, strategy games or create objects by assembling tiles, useful for platformer, retro-looking games, etc..."
|
|
1037
1491
|
),
|
|
@@ -1046,6 +1500,7 @@ module.exports = {
|
|
|
1046
1500
|
.setIcon('JsPlatform/Extensions/tile_map.svg');
|
|
1047
1501
|
|
|
1048
1502
|
defineTileMap(extension, _, gd);
|
|
1503
|
+
defineSimpleTileMap(extension, _, gd);
|
|
1049
1504
|
defineCollisionMask(extension, _, gd);
|
|
1050
1505
|
|
|
1051
1506
|
return extension;
|
|
@@ -1141,7 +1596,6 @@ module.exports = {
|
|
|
1141
1596
|
class RenderedTileMapInstance extends RenderedInstance {
|
|
1142
1597
|
constructor(
|
|
1143
1598
|
project,
|
|
1144
|
-
layout,
|
|
1145
1599
|
instance,
|
|
1146
1600
|
associatedObjectConfiguration,
|
|
1147
1601
|
pixiContainer,
|
|
@@ -1149,7 +1603,6 @@ module.exports = {
|
|
|
1149
1603
|
) {
|
|
1150
1604
|
super(
|
|
1151
1605
|
project,
|
|
1152
|
-
layout,
|
|
1153
1606
|
instance,
|
|
1154
1607
|
associatedObjectConfiguration,
|
|
1155
1608
|
pixiContainer,
|
|
@@ -1424,12 +1877,371 @@ module.exports = {
|
|
|
1424
1877
|
);
|
|
1425
1878
|
|
|
1426
1879
|
/**
|
|
1427
|
-
* Renderer for instances of
|
|
1880
|
+
* Renderer for instances of SimpleTileMap inside the IDE.
|
|
1881
|
+
*/
|
|
1882
|
+
class RenderedSimpleTileMapInstance extends RenderedInstance {
|
|
1883
|
+
_placeholderTextPixiObject = new PIXI.Text(
|
|
1884
|
+
'Select this instance\nto start painting',
|
|
1885
|
+
new PIXI.TextStyle({
|
|
1886
|
+
fontFamily: 'Arial',
|
|
1887
|
+
fontSize: 16,
|
|
1888
|
+
align: 'center',
|
|
1889
|
+
padding: 5,
|
|
1890
|
+
})
|
|
1891
|
+
);
|
|
1892
|
+
_placeholderImagePixiObject = new PIXI.Sprite(
|
|
1893
|
+
PIXI.Texture.from(
|
|
1894
|
+
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAgMAAAAOFJJnAAAADFBMVEUAAAAkMoYsfqH///8FP6xgAAAAAXRSTlMAQObYZgAAAAFiS0dEAxEMTPIAAAAjSURBVBjTpcYxAQAADIMwTGISlTsmoVcCQClzSmvNo2ueGnMajGpBwI5BnwAAAABJRU5ErkJggg=='
|
|
1895
|
+
)
|
|
1896
|
+
);
|
|
1897
|
+
_placeholderPixiObject = new PIXI.Container();
|
|
1898
|
+
|
|
1899
|
+
constructor(
|
|
1900
|
+
project,
|
|
1901
|
+
instance,
|
|
1902
|
+
associatedObjectConfiguration,
|
|
1903
|
+
pixiContainer,
|
|
1904
|
+
pixiResourcesLoader
|
|
1905
|
+
) {
|
|
1906
|
+
super(
|
|
1907
|
+
project,
|
|
1908
|
+
instance,
|
|
1909
|
+
associatedObjectConfiguration,
|
|
1910
|
+
pixiContainer,
|
|
1911
|
+
pixiResourcesLoader
|
|
1912
|
+
);
|
|
1913
|
+
|
|
1914
|
+
// This setting allows tile maps with more than 16K tiles.
|
|
1915
|
+
Tilemap.settings.use32bitIndex = true;
|
|
1916
|
+
|
|
1917
|
+
this.tileMapPixiObject = new Tilemap.CompositeTilemap();
|
|
1918
|
+
this._pixiObject = new PIXI.Container();
|
|
1919
|
+
this._pixiObject.addChild(this.tileMapPixiObject);
|
|
1920
|
+
this._editableTileMap = null;
|
|
1921
|
+
|
|
1922
|
+
// Implement `containsPoint` so that we can set `interactive` to true and
|
|
1923
|
+
// the Tilemap will properly emit events when hovered/clicked.
|
|
1924
|
+
// By default, this is not implemented in pixi-tilemap.
|
|
1925
|
+
this._pixiObject.containsPoint = (position) => {
|
|
1926
|
+
// Turns the world position to the local object coordinates
|
|
1927
|
+
const localPosition = new PIXI.Point();
|
|
1928
|
+
if (this.tileMapPixiObject.visible) {
|
|
1929
|
+
this.tileMapPixiObject.worldTransform.applyInverse(
|
|
1930
|
+
position,
|
|
1931
|
+
localPosition
|
|
1932
|
+
);
|
|
1933
|
+
} else {
|
|
1934
|
+
this._placeholderImagePixiObject.worldTransform.applyInverse(
|
|
1935
|
+
position,
|
|
1936
|
+
localPosition
|
|
1937
|
+
);
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
return (
|
|
1941
|
+
localPosition.x >= 0 &&
|
|
1942
|
+
localPosition.x < this.width &&
|
|
1943
|
+
localPosition.y >= 0 &&
|
|
1944
|
+
localPosition.y < this.height
|
|
1945
|
+
);
|
|
1946
|
+
};
|
|
1947
|
+
this._placeholderTextPixiObject.interactive = true;
|
|
1948
|
+
this._placeholderImagePixiObject.interactive = true;
|
|
1949
|
+
this._placeholderTextPixiObject.anchor.x = 0.5;
|
|
1950
|
+
this._placeholderTextPixiObject.anchor.y = 0.5;
|
|
1951
|
+
this._placeholderTextPixiObject.y = 30;
|
|
1952
|
+
this._placeholderImagePixiObject.y = -30;
|
|
1953
|
+
this._placeholderImagePixiObject.x = -16;
|
|
1954
|
+
this._placeholderPixiObject.addChild(this._placeholderTextPixiObject);
|
|
1955
|
+
this._placeholderPixiObject.addChild(this._placeholderImagePixiObject);
|
|
1956
|
+
this._pixiObject.addChild(this._placeholderPixiObject);
|
|
1957
|
+
this._pixiContainer.addChild(this._pixiObject);
|
|
1958
|
+
this.width = 48;
|
|
1959
|
+
this.height = 48;
|
|
1960
|
+
this._objectName = instance.getObjectName();
|
|
1961
|
+
this.update();
|
|
1962
|
+
this.updateTileMap();
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
onRemovedFromScene() {
|
|
1966
|
+
super.onRemovedFromScene();
|
|
1967
|
+
// Keep textures because they are shared by all tile maps.
|
|
1968
|
+
this._pixiObject.destroy(false);
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
onLoadingError() {
|
|
1972
|
+
this.errorPixiObject =
|
|
1973
|
+
this.errorPixiObject ||
|
|
1974
|
+
new PIXI.Sprite(this._pixiResourcesLoader.getInvalidPIXITexture());
|
|
1975
|
+
this._pixiContainer.addChild(this.errorPixiObject);
|
|
1976
|
+
this._pixiObject = this.errorPixiObject;
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
onLoadingSuccess() {
|
|
1980
|
+
if (this.errorPixiObject) {
|
|
1981
|
+
this._pixiContainer.removeChild(this.errorPixiObject);
|
|
1982
|
+
this.errorPixiObject = null;
|
|
1983
|
+
this._pixiObject = this.tileMapPixiObject;
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* Return the path to the thumbnail of the specified object.
|
|
1989
|
+
*/
|
|
1990
|
+
static getThumbnail(project, resourcesLoader, objectConfiguration) {
|
|
1991
|
+
const atlasImageResourceName = objectConfiguration
|
|
1992
|
+
.getProperties()
|
|
1993
|
+
.get('atlasImage')
|
|
1994
|
+
.getValue();
|
|
1995
|
+
return resourcesLoader.getResourceFullUrl(
|
|
1996
|
+
project,
|
|
1997
|
+
atlasImageResourceName,
|
|
1998
|
+
{}
|
|
1999
|
+
);
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
getEditableTileMap() {
|
|
2003
|
+
return this._editableTileMap;
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
/**
|
|
2007
|
+
* This is used to reload the Tilemap
|
|
2008
|
+
*/
|
|
2009
|
+
updateTileMap() {
|
|
2010
|
+
const atlasImageResourceName = this._associatedObjectConfiguration
|
|
2011
|
+
.getProperties()
|
|
2012
|
+
.get('atlasImage')
|
|
2013
|
+
.getValue();
|
|
2014
|
+
const tilemapAsJSObject = JSON.parse(
|
|
2015
|
+
this._instance.getRawStringProperty('tilemap') || '{}'
|
|
2016
|
+
);
|
|
2017
|
+
|
|
2018
|
+
const tileSize = parseInt(
|
|
2019
|
+
this._associatedObjectConfiguration
|
|
2020
|
+
.getProperties()
|
|
2021
|
+
.get('tileSize')
|
|
2022
|
+
.getValue(),
|
|
2023
|
+
10
|
|
2024
|
+
);
|
|
2025
|
+
const columnCount = parseInt(
|
|
2026
|
+
this._associatedObjectConfiguration
|
|
2027
|
+
.getProperties()
|
|
2028
|
+
.get('columnCount')
|
|
2029
|
+
.getValue(),
|
|
2030
|
+
10
|
|
2031
|
+
);
|
|
2032
|
+
const rowCount = parseInt(
|
|
2033
|
+
this._associatedObjectConfiguration
|
|
2034
|
+
.getProperties()
|
|
2035
|
+
.get('rowCount')
|
|
2036
|
+
.getValue(),
|
|
2037
|
+
10
|
|
2038
|
+
);
|
|
2039
|
+
|
|
2040
|
+
const atlasTexture = this._pixiResourcesLoader.getPIXITexture(
|
|
2041
|
+
this._project,
|
|
2042
|
+
atlasImageResourceName
|
|
2043
|
+
);
|
|
2044
|
+
|
|
2045
|
+
const loadTileMap = () => {
|
|
2046
|
+
/** @type {TileMapHelper.TileMapManager} */
|
|
2047
|
+
const manager = TilemapHelper.TileMapManager.getManager(
|
|
2048
|
+
this._project
|
|
2049
|
+
);
|
|
2050
|
+
manager.getOrLoadSimpleTileMap(
|
|
2051
|
+
tilemapAsJSObject,
|
|
2052
|
+
this._objectName,
|
|
2053
|
+
tileSize,
|
|
2054
|
+
columnCount,
|
|
2055
|
+
rowCount,
|
|
2056
|
+
(tileMap) => {
|
|
2057
|
+
if (!tileMap) {
|
|
2058
|
+
this.onLoadingError();
|
|
2059
|
+
console.error('Could not parse tilemap.');
|
|
2060
|
+
return;
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
this._editableTileMap = tileMap;
|
|
2064
|
+
|
|
2065
|
+
manager.getOrLoadSimpleTileMapTextureCache(
|
|
2066
|
+
(textureName) =>
|
|
2067
|
+
this._pixiResourcesLoader.getPIXITexture(
|
|
2068
|
+
this._project,
|
|
2069
|
+
textureName
|
|
2070
|
+
),
|
|
2071
|
+
atlasImageResourceName,
|
|
2072
|
+
tileSize,
|
|
2073
|
+
columnCount,
|
|
2074
|
+
rowCount,
|
|
2075
|
+
(
|
|
2076
|
+
/** @type {TileMapHelper.TileTextureCache | null} */
|
|
2077
|
+
textureCache
|
|
2078
|
+
) => {
|
|
2079
|
+
this.onLoadingSuccess();
|
|
2080
|
+
if (!this._editableTileMap) return;
|
|
2081
|
+
|
|
2082
|
+
this.width = this._editableTileMap.getWidth();
|
|
2083
|
+
this.height = this._editableTileMap.getHeight();
|
|
2084
|
+
TilemapHelper.PixiTileMapHelper.updatePixiTileMap(
|
|
2085
|
+
this.tileMapPixiObject,
|
|
2086
|
+
this._editableTileMap,
|
|
2087
|
+
textureCache,
|
|
2088
|
+
'all', // No notion of visibility on simple tile maps.
|
|
2089
|
+
0 // Only one layer is used on simple tile maps.
|
|
2090
|
+
);
|
|
2091
|
+
}
|
|
2092
|
+
);
|
|
2093
|
+
}
|
|
2094
|
+
);
|
|
2095
|
+
};
|
|
2096
|
+
|
|
2097
|
+
if (atlasTexture.valid) {
|
|
2098
|
+
loadTileMap();
|
|
2099
|
+
} else {
|
|
2100
|
+
// Wait for the atlas image to load.
|
|
2101
|
+
atlasTexture.once('update', () => {
|
|
2102
|
+
loadTileMap();
|
|
2103
|
+
});
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
updatePixiTileMap() {
|
|
2108
|
+
const atlasImageResourceName = this._associatedObjectConfiguration
|
|
2109
|
+
.getProperties()
|
|
2110
|
+
.get('atlasImage')
|
|
2111
|
+
.getValue();
|
|
2112
|
+
|
|
2113
|
+
const tileSize = parseInt(
|
|
2114
|
+
this._associatedObjectConfiguration
|
|
2115
|
+
.getProperties()
|
|
2116
|
+
.get('tileSize')
|
|
2117
|
+
.getValue(),
|
|
2118
|
+
10
|
|
2119
|
+
);
|
|
2120
|
+
const columnCount = parseInt(
|
|
2121
|
+
this._associatedObjectConfiguration
|
|
2122
|
+
.getProperties()
|
|
2123
|
+
.get('columnCount')
|
|
2124
|
+
.getValue(),
|
|
2125
|
+
10
|
|
2126
|
+
);
|
|
2127
|
+
const rowCount = parseInt(
|
|
2128
|
+
this._associatedObjectConfiguration
|
|
2129
|
+
.getProperties()
|
|
2130
|
+
.get('rowCount')
|
|
2131
|
+
.getValue(),
|
|
2132
|
+
10
|
|
2133
|
+
);
|
|
2134
|
+
/** @type {TileMapHelper.TileMapManager} */
|
|
2135
|
+
const manager = TilemapHelper.TileMapManager.getManager(this._project);
|
|
2136
|
+
|
|
2137
|
+
manager.getOrLoadSimpleTileMapTextureCache(
|
|
2138
|
+
(textureName) =>
|
|
2139
|
+
this._pixiResourcesLoader.getPIXITexture(
|
|
2140
|
+
this._project,
|
|
2141
|
+
textureName
|
|
2142
|
+
),
|
|
2143
|
+
atlasImageResourceName,
|
|
2144
|
+
tileSize,
|
|
2145
|
+
columnCount,
|
|
2146
|
+
rowCount,
|
|
2147
|
+
(
|
|
2148
|
+
/** @type {TileMapHelper.TileTextureCache | null} */
|
|
2149
|
+
textureCache
|
|
2150
|
+
) => {
|
|
2151
|
+
this.onLoadingSuccess();
|
|
2152
|
+
if (!this._editableTileMap) return;
|
|
2153
|
+
|
|
2154
|
+
this.width = this._editableTileMap.getWidth();
|
|
2155
|
+
this.height = this._editableTileMap.getHeight();
|
|
2156
|
+
TilemapHelper.PixiTileMapHelper.updatePixiTileMap(
|
|
2157
|
+
this.tileMapPixiObject,
|
|
2158
|
+
this._editableTileMap,
|
|
2159
|
+
textureCache,
|
|
2160
|
+
'all',
|
|
2161
|
+
0
|
|
2162
|
+
);
|
|
2163
|
+
}
|
|
2164
|
+
);
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
/**
|
|
2168
|
+
* This is called to update the PIXI object on the scene editor
|
|
2169
|
+
*/
|
|
2170
|
+
update() {
|
|
2171
|
+
const isTileMapEmpty = this._editableTileMap
|
|
2172
|
+
? this._editableTileMap.isEmpty()
|
|
2173
|
+
: false;
|
|
2174
|
+
let objectToChange;
|
|
2175
|
+
if (isTileMapEmpty) {
|
|
2176
|
+
this._placeholderPixiObject.visible = true;
|
|
2177
|
+
this.tileMapPixiObject.visible = false;
|
|
2178
|
+
objectToChange = this._placeholderPixiObject;
|
|
2179
|
+
} else {
|
|
2180
|
+
this._placeholderPixiObject.visible = false;
|
|
2181
|
+
this.tileMapPixiObject.visible = true;
|
|
2182
|
+
objectToChange = this.tileMapPixiObject;
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
if (!isTileMapEmpty) {
|
|
2186
|
+
// Don't change size of placeholder object.
|
|
2187
|
+
if (this._instance.hasCustomSize()) {
|
|
2188
|
+
objectToChange.scale.x = this.getCustomWidth() / this.width;
|
|
2189
|
+
objectToChange.scale.y = this.getCustomHeight() / this.height;
|
|
2190
|
+
} else {
|
|
2191
|
+
objectToChange.scale.x = 1;
|
|
2192
|
+
objectToChange.scale.y = 1;
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
// Place the center of rotation in the center of the object. Because pivot position in Pixi
|
|
2196
|
+
// is in the **local coordinates of the object**, we need to find back the original width
|
|
2197
|
+
// and height of the object before scaling (then divide by 2 to find the center)
|
|
2198
|
+
const originalWidth = this.width;
|
|
2199
|
+
const originalHeight = this.height;
|
|
2200
|
+
objectToChange.pivot.x = originalWidth / 2;
|
|
2201
|
+
objectToChange.pivot.y = originalHeight / 2;
|
|
2202
|
+
}
|
|
2203
|
+
// Modifying the pivot position also has an impact on the transform. The instance (X,Y) position
|
|
2204
|
+
// of this object refers to the top-left point, but now in Pixi, as we changed the pivot, the Pixi
|
|
2205
|
+
// object (X,Y) position refers to the center. So we add an offset to convert from top-left to center.
|
|
2206
|
+
objectToChange.x =
|
|
2207
|
+
this._instance.getX() +
|
|
2208
|
+
objectToChange.pivot.x * objectToChange.scale.x;
|
|
2209
|
+
objectToChange.y =
|
|
2210
|
+
this._instance.getY() +
|
|
2211
|
+
objectToChange.pivot.y * objectToChange.scale.y;
|
|
2212
|
+
|
|
2213
|
+
// Rotation works as intended because we put the pivot in the center
|
|
2214
|
+
objectToChange.rotation = RenderedInstance.toRad(
|
|
2215
|
+
this._instance.getAngle()
|
|
2216
|
+
);
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
/**
|
|
2220
|
+
* Return the width of the instance, when it's not resized.
|
|
2221
|
+
*/
|
|
2222
|
+
getDefaultWidth() {
|
|
2223
|
+
return this.width;
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
/**
|
|
2227
|
+
* Return the height of the instance, when it's not resized.
|
|
2228
|
+
*/
|
|
2229
|
+
getDefaultHeight() {
|
|
2230
|
+
return this.height;
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
objectsRenderingService.registerInstanceRenderer(
|
|
2235
|
+
'TileMap::SimpleTileMap',
|
|
2236
|
+
RenderedSimpleTileMapInstance
|
|
2237
|
+
);
|
|
2238
|
+
|
|
2239
|
+
/**
|
|
2240
|
+
* Renderer for instances of TileMap collision mask inside the IDE.
|
|
1428
2241
|
*/
|
|
1429
2242
|
class RenderedCollisionMaskInstance extends RenderedInstance {
|
|
1430
2243
|
constructor(
|
|
1431
2244
|
project,
|
|
1432
|
-
layout,
|
|
1433
2245
|
instance,
|
|
1434
2246
|
associatedObjectConfiguration,
|
|
1435
2247
|
pixiContainer,
|
|
@@ -1437,7 +2249,6 @@ module.exports = {
|
|
|
1437
2249
|
) {
|
|
1438
2250
|
super(
|
|
1439
2251
|
project,
|
|
1440
|
-
layout,
|
|
1441
2252
|
instance,
|
|
1442
2253
|
associatedObjectConfiguration,
|
|
1443
2254
|
pixiContainer,
|