gdcore-tools 1.0.6 → 1.0.7
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/GDevelop/ExtLibs/7za.exe +0 -0
- package/GDevelop/ExtLibs/curl.exe +0 -0
- package/GDevelop/scripts/libgettextlib-0-17.dll +0 -0
- package/GDevelop/scripts/libgettextsrc-0-17.dll +0 -0
- package/LICENSE +1 -1
- package/dist/Runtime/AsyncTasksManager.js +5 -0
- package/dist/Runtime/AsyncTasksManager.js.map +7 -0
- package/dist/Runtime/Cordova/config.xml +44 -0
- package/dist/Runtime/Cordova/package.json +22 -0
- package/dist/Runtime/Cordova/www/index.html +45 -0
- package/dist/Runtime/CustomRuntimeObject.js +2 -0
- package/dist/Runtime/CustomRuntimeObject.js.map +7 -0
- package/dist/Runtime/CustomRuntimeObjectInstanceContainer.js +2 -0
- package/dist/Runtime/CustomRuntimeObjectInstanceContainer.js.map +7 -0
- package/dist/Runtime/Electron/main.js +65 -0
- package/dist/Runtime/Electron/package.json +26 -0
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3D.js +2 -0
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3D.js.map +7 -0
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3DRenderer.js +2 -0
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3DRenderer.js.map +7 -0
- package/dist/Runtime/Extensions/3D/AmbientLight.js +2 -0
- package/dist/Runtime/Extensions/3D/AmbientLight.js.map +7 -0
- package/dist/Runtime/Extensions/3D/Cube3DRuntimeObject.js +2 -0
- package/dist/Runtime/Extensions/3D/Cube3DRuntimeObject.js.map +7 -0
- package/dist/Runtime/Extensions/3D/Cube3DRuntimeObjectPixiRenderer.js +2 -0
- package/dist/Runtime/Extensions/3D/Cube3DRuntimeObjectPixiRenderer.js.map +7 -0
- package/dist/Runtime/Extensions/3D/DirectionalLight.js +2 -0
- package/dist/Runtime/Extensions/3D/DirectionalLight.js.map +7 -0
- package/dist/Runtime/Extensions/3D/ExponentialFog.js +2 -0
- package/dist/Runtime/Extensions/3D/ExponentialFog.js.map +7 -0
- package/dist/Runtime/Extensions/3D/HemisphereLight.js +2 -0
- package/dist/Runtime/Extensions/3D/HemisphereLight.js.map +7 -0
- package/dist/Runtime/Extensions/3D/JsExtension.js +2809 -0
- package/dist/Runtime/Extensions/3D/LinearFog.js +2 -0
- package/dist/Runtime/Extensions/3D/LinearFog.js.map +7 -0
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js +2 -0
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js.map +7 -0
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject3DRenderer.js +2 -0
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject3DRenderer.js.map +7 -0
- package/dist/Runtime/Extensions/3D/Scene3DTools.js +2 -0
- package/dist/Runtime/Extensions/3D/Scene3DTools.js.map +7 -0
- package/dist/Runtime/Extensions/AdMob/JsExtension.js +798 -0
- package/dist/Runtime/Extensions/AdMob/admobtools.js +2 -0
- package/dist/Runtime/Extensions/AdMob/admobtools.js.map +7 -0
- package/dist/Runtime/Extensions/AdvancedWindow/JsExtension.js +719 -0
- package/dist/Runtime/Extensions/AdvancedWindow/electron-advancedwindowtools.js +2 -0
- package/dist/Runtime/Extensions/AdvancedWindow/electron-advancedwindowtools.js.map +7 -0
- package/dist/Runtime/Extensions/AnchorBehavior/anchorruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/AnchorBehavior/anchorruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/BBText/JsExtension.js +639 -0
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/BBText/pixi-multistyle-text/dist/pixi-multistyle-text.umd.js +1 -0
- package/dist/Runtime/Extensions/BitmapText/JsExtension.js +756 -0
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/DebuggerTools/JsExtension.js +123 -0
- package/dist/Runtime/Extensions/DebuggerTools/debuggertools.js +2 -0
- package/dist/Runtime/Extensions/DebuggerTools/debuggertools.js.map +7 -0
- package/dist/Runtime/Extensions/DestroyOutsideBehavior/destroyoutsideruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/DestroyOutsideBehavior/destroyoutsideruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/DeviceSensors/JsExtension.js +461 -0
- package/dist/Runtime/Extensions/DeviceSensors/devicesensortools.js +2 -0
- package/dist/Runtime/Extensions/DeviceSensors/devicesensortools.js.map +7 -0
- package/dist/Runtime/Extensions/DeviceVibration/JsExtension.js +108 -0
- package/dist/Runtime/Extensions/DeviceVibration/devicevibrationtools.js +2 -0
- package/dist/Runtime/Extensions/DeviceVibration/devicevibrationtools.js.map +7 -0
- package/dist/Runtime/Extensions/DialogueTree/JsExtension.js +730 -0
- package/dist/Runtime/Extensions/DialogueTree/bondage.js/dist/bondage.min.js +11 -0
- package/dist/Runtime/Extensions/DialogueTree/dialoguetools.js +3 -0
- package/dist/Runtime/Extensions/DialogueTree/dialoguetools.js.map +7 -0
- package/dist/Runtime/Extensions/DraggableBehavior/draggableruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/DraggableBehavior/draggableruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/JsExtension.js +1197 -0
- package/dist/Runtime/Extensions/Effects/adjustment-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/adjustment-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/advanced-bloom-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/advanced-bloom-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/ascii-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/ascii-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/bevel-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/bevel-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/black-and-white-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/black-and-white-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/blending-mode-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/blending-mode-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/blur-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/blur-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/brightness-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/brightness-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/bulge-pinch-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/bulge-pinch-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/color-map-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/color-map-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/color-replace-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/color-replace-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/crt-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/crt-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/displacement-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/displacement-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/dot-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/dot-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/drop-shadow-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/drop-shadow-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/glitch-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/glitch-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/glow-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/glow-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/godray-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/godray-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/kawase-blur-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/kawase-blur-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/light-night-pixi-filter.js +3 -0
- package/dist/Runtime/Extensions/Effects/light-night-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/night-pixi-filter.js +3 -0
- package/dist/Runtime/Extensions/Effects/night-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/noise-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/noise-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/old-film-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/old-film-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/outline-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/outline-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/pixelate-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/pixelate-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-adjustment.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-advanced-bloom.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-ascii.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-bevel.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-bulge-pinch.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-color-map.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-color-replace.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-crt.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-dot.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-drop-shadow.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-glitch.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-glow.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-godray.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-kawase-blur.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-old-film.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-outline.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-pixelate.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-radial-blur.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-reflection.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-rgb-split.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-tilt-shift.js +171 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-twist.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/filter-zoom-blur.js +8 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/adjustment/types.d.ts +29 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/advanced-bloom/types.d.ts +30 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/ascii/types.d.ts +11 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/bevel/types.d.ts +25 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/bloom/types.d.ts +18 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/bulge-pinch/types.d.ts +24 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/color-map/types.d.ts +22 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/color-overlay/types.d.ts +11 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/color-replace/types.d.ts +17 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/convolution/types.d.ts +13 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/cross-hatch/types.d.ts +10 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/crt/types.d.ts +35 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/dot/types.d.ts +12 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/drop-shadow/types.d.ts +33 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/emboss/types.d.ts +11 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/glitch/types.d.ts +38 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/glow/types.d.ts +23 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/godray/types.d.ts +27 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/kawase-blur/types.d.ts +15 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/motion-blur/types.d.ts +17 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/multi-color-replace/types.d.ts +18 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/old-film/types.d.ts +33 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/outline/types.d.ts +13 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/pixelate/types.d.ts +11 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/radial-blur/types.d.ts +19 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/reflection/types.d.ts +25 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/rgb-split/types.d.ts +13 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/shockwave/types.d.ts +25 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/simple-lightmap/types.d.ts +13 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/tilt-shift/types.d.ts +19 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/twist/types.d.ts +13 -0
- package/dist/Runtime/Extensions/Effects/pixi-filters/types/zoom-blur/types.d.ts +28 -0
- package/dist/Runtime/Extensions/Effects/radial-blur-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/radial-blur-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/reflection-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/reflection-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/rgb-split-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/rgb-split-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/sepia-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/sepia-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/tilt-shift-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/tilt-shift-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/twist-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/twist-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/Effects/zoom-blur-pixi-filter.js +2 -0
- package/dist/Runtime/Extensions/Effects/zoom-blur-pixi-filter.js.map +7 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/JsExtension.js +589 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyeffect.js +3 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyeffect.js.map +7 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummywithshareddataruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/dummywithshareddataruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/examplejsextensiontools.js +2 -0
- package/dist/Runtime/Extensions/ExampleJsExtension/examplejsextensiontools.js.map +7 -0
- package/dist/Runtime/Extensions/FacebookInstantGames/FBInstant.d.ts +2 -0
- package/dist/Runtime/Extensions/FacebookInstantGames/JsExtension.js +379 -0
- package/dist/Runtime/Extensions/FacebookInstantGames/facebookinstantgamestools.js +2 -0
- package/dist/Runtime/Extensions/FacebookInstantGames/facebookinstantgamestools.js.map +7 -0
- package/dist/Runtime/Extensions/FileSystem/JsExtension.js +559 -0
- package/dist/Runtime/Extensions/FileSystem/filesystemtools.js +2 -0
- package/dist/Runtime/Extensions/FileSystem/filesystemtools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/A_firebase-base.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/A_firebase-base.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-analytics.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-analytics.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-auth.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-auth.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-database.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-database.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-firestore.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-firestore.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-functions.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-functions.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-messaging.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-messaging.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-performance.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-performance.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-remote-config.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-remote-config.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-storage.js +2 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-storage.js.map +1 -0
- package/dist/Runtime/Extensions/Firebase/A_firebasejs/firebase.d.ts +10191 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/C_firebasetools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/C_firebasetools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_analyticstools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_analyticstools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_authtools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_authtools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_cloudfirestoretools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_cloudfirestoretools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_databasetools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_databasetools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_functionstools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_functionstools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_performancetools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_performancetools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_remoteconfigtools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_remoteconfigtools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_storagetools.js +2 -0
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_storagetools.js.map +7 -0
- package/dist/Runtime/Extensions/Firebase/JsExtension.js +2323 -0
- package/dist/Runtime/Extensions/Inventory/inventory.js +2 -0
- package/dist/Runtime/Extensions/Inventory/inventory.js.map +7 -0
- package/dist/Runtime/Extensions/Inventory/inventorytools.js +2 -0
- package/dist/Runtime/Extensions/Inventory/inventorytools.js.map +7 -0
- package/dist/Runtime/Extensions/JsExtensionTypes.flow.js +34 -0
- package/dist/Runtime/Extensions/Leaderboards/JsExtension.js +299 -0
- package/dist/Runtime/Extensions/Leaderboards/leaderboardstools.js +2 -0
- package/dist/Runtime/Extensions/Leaderboards/leaderboardstools.js.map +7 -0
- package/dist/Runtime/Extensions/Leaderboards/sha256.d.ts +234 -0
- package/dist/Runtime/Extensions/Leaderboards/sha256.js +21 -0
- package/dist/Runtime/Extensions/Lighting/JsExtension.js +371 -0
- package/dist/Runtime/Extensions/Lighting/lightobstacleruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/Lighting/lightobstacleruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject-pixi-renderer.js +40 -0
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/LinkedObjects/linkedobjects.js +2 -0
- package/dist/Runtime/Extensions/LinkedObjects/linkedobjects.js.map +7 -0
- package/dist/Runtime/Extensions/P2P/A_peer.js +4 -0
- package/dist/Runtime/Extensions/P2P/A_peer.js.map +1 -0
- package/dist/Runtime/Extensions/P2P/B_p2ptools.js +2 -0
- package/dist/Runtime/Extensions/P2P/B_p2ptools.js.map +7 -0
- package/dist/Runtime/Extensions/P2P/JsExtension.js +483 -0
- package/dist/Runtime/Extensions/P2P/peerjs.d.ts +509 -0
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js +2 -0
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js.map +7 -0
- package/dist/Runtime/Extensions/ParticleSystem/pixi-particles-pixi-renderer.min.js +3 -0
- package/dist/Runtime/Extensions/PathfindingBehavior/PathTools.js +2 -0
- package/dist/Runtime/Extensions/PathfindingBehavior/PathTools.js.map +7 -0
- package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingobstacleruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingobstacleruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/Physics2Behavior/Box2D_v2.3.1_min.wasm.js +2 -0
- package/dist/Runtime/Extensions/Physics2Behavior/Box2D_v2.3.1_min.wasm.js.map +7 -0
- package/dist/Runtime/Extensions/Physics2Behavior/Box2D_v2.3.1_min.wasm.wasm +0 -0
- package/dist/Runtime/Extensions/Physics2Behavior/JsExtension.js +4072 -0
- package/dist/Runtime/Extensions/Physics2Behavior/box2d.d.ts +1804 -0
- package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js +2 -0
- package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/Physics2Behavior/physics2tools.js +2 -0
- package/dist/Runtime/Extensions/Physics2Behavior/physics2tools.js.map +7 -0
- package/dist/Runtime/Extensions/PhysicsBehavior/box2djs/box2d.js +804 -0
- package/dist/Runtime/Extensions/PhysicsBehavior/physicsruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/PhysicsBehavior/physicsruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/PlatformBehavior/benchmarks/platformerobjectruntimebehavior.benchmark.js +2 -0
- package/dist/Runtime/Extensions/PlatformBehavior/benchmarks/platformerobjectruntimebehavior.benchmark.js.map +7 -0
- package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/PlatformBehavior/platformruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/PlatformBehavior/platformruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/PlatformBehavior/platformtools.js +2 -0
- package/dist/Runtime/Extensions/PlatformBehavior/platformtools.js.map +7 -0
- package/dist/Runtime/Extensions/PlayerAuthentication/JsExtension.js +218 -0
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationcomponents.js +5 -0
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationcomponents.js.map +7 -0
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationtools.js +2 -0
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationtools.js.map +7 -0
- package/dist/Runtime/Extensions/PrimitiveDrawing/pixi-graphics-extras/graphics-extras.min.js +10 -0
- package/dist/Runtime/Extensions/PrimitiveDrawing/pixi-graphics-extras/graphics-extras.min.js.map +1 -0
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/Screenshot/JsExtension.js +68 -0
- package/dist/Runtime/Extensions/Screenshot/screenshottools.js +2 -0
- package/dist/Runtime/Extensions/Screenshot/screenshottools.js.map +7 -0
- package/dist/Runtime/Extensions/Shopify/shopify-buy.umd.polyfilled.min.js +2 -0
- package/dist/Runtime/Extensions/Shopify/shopifytools.js +2 -0
- package/dist/Runtime/Extensions/Shopify/shopifytools.js.map +7 -0
- package/dist/Runtime/Extensions/SpatialSound/JsExtension.js +92 -0
- package/dist/Runtime/Extensions/SpatialSound/howler.spatial.min.js +2 -0
- package/dist/Runtime/Extensions/SpatialSound/spatialsoundtools.js +2 -0
- package/dist/Runtime/Extensions/SpatialSound/spatialsoundtools.js.map +7 -0
- package/dist/Runtime/Extensions/SystemInfo/systeminfotools.js +2 -0
- package/dist/Runtime/Extensions/SystemInfo/systeminfotools.js.map +7 -0
- package/dist/Runtime/Extensions/TextEntryObject/textentryruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/TextEntryObject/textentryruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/TextEntryObject/textentryruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/TextEntryObject/textentryruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/TextInput/JsExtension.js +790 -0
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/TextObject/textruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/TextObject/textruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/TextObject/textruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/TextObject/textruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/JsExtension.js +1653 -0
- package/dist/Runtime/Extensions/TileMap/TileMapRuntimeManager.js +2 -0
- package/dist/Runtime/Extensions/TileMap/TileMapRuntimeManager.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/collision/TileMapCollisionMaskRenderer.js +2 -0
- package/dist/Runtime/Extensions/TileMap/collision/TileMapCollisionMaskRenderer.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/collision/TransformedTileMap.js +2 -0
- package/dist/Runtime/Extensions/TileMap/collision/TransformedTileMap.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/example/anotherIsland.json +5769 -0
- package/dist/Runtime/Extensions/TileMap/example/island.json +5823 -0
- package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.d.ts +25 -0
- package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.js +2 -0
- package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/index.d.ts +16 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/index.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/TileMapFileContent.d.ts +12 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/TileMapFileContent.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/TileMapLoader.d.ts +18 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/TileMapLoader.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkFormat.d.ts +589 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkFormat.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkTileMapLoader.d.ts +16 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkTileMapLoader.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkTileMapLoaderHelper.d.ts +5 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkTileMapLoaderHelper.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledFormat.d.ts +343 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledFormat.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoader.d.ts +16 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoader.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoader.spec.d.ts +2 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoader.spec.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoaderHelper.d.ts +37 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoaderHelper.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/CommonTypes.d.ts +5 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/CommonTypes.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/GID.d.ts +45 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/GID.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/TileMapModel.d.ts +361 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/TileMapModel.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/ResourceCache.d.ts +27 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/ResourceCache.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts +70 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts +56 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileTextureCache.d.ts +24 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileTextureCache.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts +26 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts +21 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/types/index.d.ts +12 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/types/index.d.ts.map +1 -0
- package/dist/Runtime/Extensions/TileMap/pako/dist/pako.d.ts +166 -0
- package/dist/Runtime/Extensions/TileMap/pako/dist/pako.min.js +2 -0
- package/dist/Runtime/Extensions/TileMap/pixi-tilemap/dist/global-pixi-tilemap.d.ts +23 -0
- package/dist/Runtime/Extensions/TileMap/pixi-tilemap/dist/pixi-tilemap.d.ts +270 -0
- package/dist/Runtime/Extensions/TileMap/pixi-tilemap/dist/pixi-tilemap.umd.js +74 -0
- package/dist/Runtime/Extensions/TileMap/pixi-tilemap/dist/pixi-tilemap.umd.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/tilemapcollisionmaskruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/TileMap/tilemapcollisionmaskruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js.map +7 -0
- package/dist/Runtime/Extensions/TopDownMovementBehavior/topdownmovementruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/TopDownMovementBehavior/topdownmovementruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/TweenBehavior/JsExtension.js +1087 -0
- package/dist/Runtime/Extensions/TweenBehavior/shifty.d.ts +839 -0
- package/dist/Runtime/Extensions/TweenBehavior/shifty.js +5 -0
- package/dist/Runtime/Extensions/TweenBehavior/shifty.js.map +1 -0
- package/dist/Runtime/Extensions/TweenBehavior/shifty_setup.js +2 -0
- package/dist/Runtime/Extensions/TweenBehavior/shifty_setup.js.map +7 -0
- package/dist/Runtime/Extensions/TweenBehavior/tweenruntimebehavior.js +2 -0
- package/dist/Runtime/Extensions/TweenBehavior/tweenruntimebehavior.js.map +7 -0
- package/dist/Runtime/Extensions/TweenBehavior/tweentools.js +2 -0
- package/dist/Runtime/Extensions/TweenBehavior/tweentools.js.map +7 -0
- package/dist/Runtime/Extensions/Video/JsExtension.js +694 -0
- package/dist/Runtime/Extensions/Video/videoruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/Extensions/Video/videoruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/Extensions/Video/videoruntimeobject.js +2 -0
- package/dist/Runtime/Extensions/Video/videoruntimeobject.js.map +7 -0
- package/dist/Runtime/FacebookInstantGames/fbapp-config.json +17 -0
- package/dist/Runtime/FacebookInstantGames/index.html +68 -0
- package/dist/Runtime/Model3DManager.js +2 -0
- package/dist/Runtime/Model3DManager.js.map +7 -0
- package/dist/Runtime/RuntimeCustomObjectLayer.js +2 -0
- package/dist/Runtime/RuntimeCustomObjectLayer.js.map +7 -0
- package/dist/Runtime/RuntimeInstanceContainer.js +2 -0
- package/dist/Runtime/RuntimeInstanceContainer.js.map +7 -0
- package/dist/Runtime/RuntimeLayer.js +2 -0
- package/dist/Runtime/RuntimeLayer.js.map +7 -0
- package/dist/Runtime/affinetransformation.js +2 -0
- package/dist/Runtime/affinetransformation.js.map +7 -0
- package/dist/Runtime/debugger-client/abstract-debugger-client.js +2 -0
- package/dist/Runtime/debugger-client/abstract-debugger-client.js.map +7 -0
- package/dist/Runtime/debugger-client/hot-reloader.js +2 -0
- package/dist/Runtime/debugger-client/hot-reloader.js.map +7 -0
- package/dist/Runtime/debugger-client/websocket-debugger-client.js +2 -0
- package/dist/Runtime/debugger-client/websocket-debugger-client.js.map +7 -0
- package/dist/Runtime/debugger-client/window-message-debugger-client.js +2 -0
- package/dist/Runtime/debugger-client/window-message-debugger-client.js.map +7 -0
- package/dist/Runtime/events-tools/cameratools.js +2 -0
- package/dist/Runtime/events-tools/cameratools.js.map +7 -0
- package/dist/Runtime/events-tools/commontools.js +2 -0
- package/dist/Runtime/events-tools/commontools.js.map +7 -0
- package/dist/Runtime/events-tools/inputtools.js +2 -0
- package/dist/Runtime/events-tools/inputtools.js.map +7 -0
- package/dist/Runtime/events-tools/networktools.js +2 -0
- package/dist/Runtime/events-tools/networktools.js.map +7 -0
- package/dist/Runtime/events-tools/objecttools.js +2 -0
- package/dist/Runtime/events-tools/objecttools.js.map +7 -0
- package/dist/Runtime/events-tools/runtimescenetools.js +2 -0
- package/dist/Runtime/events-tools/runtimescenetools.js.map +7 -0
- package/dist/Runtime/events-tools/soundtools.js +2 -0
- package/dist/Runtime/events-tools/soundtools.js.map +7 -0
- package/dist/Runtime/events-tools/storagetools.js +2 -0
- package/dist/Runtime/events-tools/storagetools.js.map +7 -0
- package/dist/Runtime/events-tools/stringtools.js +3 -0
- package/dist/Runtime/events-tools/stringtools.js.map +7 -0
- package/dist/Runtime/events-tools/variabletools.js +2 -0
- package/dist/Runtime/events-tools/variabletools.js.map +7 -0
- package/dist/Runtime/events-tools/windowtools.js +2 -0
- package/dist/Runtime/events-tools/windowtools.js.map +7 -0
- package/dist/Runtime/fontfaceobserver-font-manager/fontfaceobserver-font-manager.js +2 -0
- package/dist/Runtime/fontfaceobserver-font-manager/fontfaceobserver-font-manager.js.map +7 -0
- package/dist/Runtime/fontfaceobserver-font-manager/fontfaceobserver.js +16 -0
- package/dist/Runtime/force.js +2 -0
- package/dist/Runtime/force.js.map +7 -0
- package/dist/Runtime/gd.js +2 -0
- package/dist/Runtime/gd.js.map +7 -0
- package/dist/Runtime/howler-sound-manager/howler-sound-manager.js +2 -0
- package/dist/Runtime/howler-sound-manager/howler-sound-manager.js.map +7 -0
- package/dist/Runtime/howler-sound-manager/howler.min.js +3 -0
- package/dist/Runtime/index.html +55 -0
- package/dist/Runtime/inputmanager.js +2 -0
- package/dist/Runtime/inputmanager.js.map +7 -0
- package/dist/Runtime/jsonmanager.js +2 -0
- package/dist/Runtime/jsonmanager.js.map +7 -0
- package/dist/Runtime/layer.js +2 -0
- package/dist/Runtime/layer.js.map +7 -0
- package/dist/Runtime/libs/CocoonJS/cocoon.min.js +4 -0
- package/dist/Runtime/libs/jshashtable.js +2 -0
- package/dist/Runtime/libs/jshashtable.js.map +7 -0
- package/dist/Runtime/libs/rbush.js +624 -0
- package/dist/Runtime/logger.js +2 -0
- package/dist/Runtime/logger.js.map +7 -0
- package/dist/Runtime/oncetriggers.js +2 -0
- package/dist/Runtime/oncetriggers.js.map +7 -0
- package/dist/Runtime/pixi-renderers/CustomObjectPixiRenderer.js +2 -0
- package/dist/Runtime/pixi-renderers/CustomObjectPixiRenderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/DebuggerPixiRenderer.js +2 -0
- package/dist/Runtime/pixi-renderers/DebuggerPixiRenderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/RuntimeInstanceContainerPixiRenderer.js +1 -0
- package/dist/Runtime/pixi-renderers/RuntimeInstanceContainerPixiRenderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/ThreeAddons.js +2 -0
- package/dist/Runtime/pixi-renderers/draco/gltf/draco_decoder.wasm +0 -0
- package/dist/Runtime/pixi-renderers/draco/gltf/draco_wasm_wrapper.js +116 -0
- package/dist/Runtime/pixi-renderers/layer-pixi-renderer.js +15 -0
- package/dist/Runtime/pixi-renderers/layer-pixi-renderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/loadingscreen-pixi-renderer.js +2 -0
- package/dist/Runtime/pixi-renderers/loadingscreen-pixi-renderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/pixi-bitmapfont-manager.js +2 -0
- package/dist/Runtime/pixi-renderers/pixi-bitmapfont-manager.js.map +7 -0
- package/dist/Runtime/pixi-renderers/pixi-effects-manager.js +2 -0
- package/dist/Runtime/pixi-renderers/pixi-effects-manager.js.map +7 -0
- package/dist/Runtime/pixi-renderers/pixi-filters-tools.js +2 -0
- package/dist/Runtime/pixi-renderers/pixi-filters-tools.js.map +7 -0
- package/dist/Runtime/pixi-renderers/pixi-image-manager.js +2 -0
- package/dist/Runtime/pixi-renderers/pixi-image-manager.js.map +7 -0
- package/dist/Runtime/pixi-renderers/pixi.js +11 -0
- package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js +2 -0
- package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/runtimescene-pixi-renderer.js +3 -0
- package/dist/Runtime/pixi-renderers/runtimescene-pixi-renderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/spriteruntimeobject-pixi-renderer.js +2 -0
- package/dist/Runtime/pixi-renderers/spriteruntimeobject-pixi-renderer.js.map +7 -0
- package/dist/Runtime/pixi-renderers/three.js +7 -0
- package/dist/Runtime/polygon.js +2 -0
- package/dist/Runtime/polygon.js.map +7 -0
- package/dist/Runtime/profiler.js +2 -0
- package/dist/Runtime/profiler.js.map +7 -0
- package/dist/Runtime/runtimebehavior.js +2 -0
- package/dist/Runtime/runtimebehavior.js.map +7 -0
- package/dist/Runtime/runtimegame.js +2 -0
- package/dist/Runtime/runtimegame.js.map +7 -0
- package/dist/Runtime/runtimeobject.js +2 -0
- package/dist/Runtime/runtimeobject.js.map +7 -0
- package/dist/Runtime/runtimescene.js +2 -0
- package/dist/Runtime/runtimescene.js.map +7 -0
- package/dist/Runtime/runtimewatermark.js +100 -0
- package/dist/Runtime/runtimewatermark.js.map +7 -0
- package/dist/Runtime/scenestack.js +2 -0
- package/dist/Runtime/scenestack.js.map +7 -0
- package/dist/Runtime/splash/gd-logo-dark-colored.js +2 -0
- package/dist/Runtime/splash/gd-logo-dark-colored.js.map +7 -0
- package/dist/Runtime/splash/gd-logo-dark.js +2 -0
- package/dist/Runtime/splash/gd-logo-dark.js.map +7 -0
- package/dist/Runtime/splash/gd-logo-light-colored.js +2 -0
- package/dist/Runtime/splash/gd-logo-light-colored.js.map +7 -0
- package/dist/Runtime/splash/gd-logo-light.js +2 -0
- package/dist/Runtime/splash/gd-logo-light.js.map +7 -0
- package/dist/Runtime/spriteruntimeobject.js +2 -0
- package/dist/Runtime/spriteruntimeobject.js.map +7 -0
- package/dist/Runtime/timemanager.js +2 -0
- package/dist/Runtime/timemanager.js.map +7 -0
- package/dist/Runtime/timer.js +2 -0
- package/dist/Runtime/timer.js.map +7 -0
- package/dist/Runtime/types/global-pixi.d.ts +22 -0
- package/dist/Runtime/types/global-three-addons.d.ts +9 -0
- package/dist/Runtime/types/global-three.d.ts +3 -0
- package/dist/Runtime/types/global-types.d.ts +61 -0
- package/dist/Runtime/types/howler.d.ts +313 -0
- package/dist/Runtime/types/project-data.d.ts +276 -0
- package/dist/Runtime/variable.js +2 -0
- package/dist/Runtime/variable.js.map +7 -0
- package/dist/Runtime/variablescontainer.js +2 -0
- package/dist/Runtime/variablescontainer.js.map +7 -0
- package/dist/lib/libGD.cjs +22 -0
- package/dist/lib/libGD.wasm +0 -0
- package/dist/loaders.js +1 -0
- package/package.json +24 -10
- package/src/downloadGD.js +0 -70
- package/src/index.js +21 -14
- package/examples/create-objects-from-json/assets/Blank button.png +0 -0
- package/examples/create-objects-from-json/game.json +0 -258
- package/examples/create-objects-from-json/index.js +0 -50
- package/examples/create-objects-from-json/mylist.json +0 -7
- package/examples/export-game/game.json +0 -205
- package/examples/export-game/index.js +0 -13
- package/src/CaseSensitiveSlug.js +0 -34
- package/src/EventsFunctionsExtensionsLoader/LocalEventsFunctionCodeWriter.js +0 -56
- package/src/EventsFunctionsExtensionsLoader/MetadataDeclarationHelpers.js +0 -489
- package/src/EventsFunctionsExtensionsLoader/index.js +0 -451
- package/src/JsExtensionsLoader/LocalJsExtensionsFinder.js +0 -42
- package/src/JsExtensionsLoader/LocalJsExtensionsLoader.js +0 -57
- package/src/JsExtensionsLoader/index.js +0 -101
- package/src/LocalFileSystem.js +0 -158
- package/src/LocalProjectOpener.js +0 -46
- package/src/LocalProjectWriter.js +0 -96
- package/src/MapFor.js +0 -46
- package/src/ObjectSplitter.js +0 -187
- package/src/Serializer.js +0 -35
- package/src/build.js +0 -51
- package/src/runtime-files-list.js +0 -143
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../GDevelop/GDJS/Runtime/howler-sound-manager/howler-sound-manager.ts"],
|
|
4
|
+
"sourcesContent": ["///<reference path='../types/howler'>\n/*\n * GDevelop JS Platform\n * Copyright 2013-present Florian Rival (Florian.Rival@gmail.com). All rights reserved.\n * This project is released under the MIT License.\n */\nnamespace gdjs {\n const logger = new gdjs.Logger('Audio manager');\n\n const HowlParameters: HowlOptions = {\n preload: true,\n onplayerror: (_, error) =>\n logger.error(\"Can't play an audio file: \" + error),\n onloaderror: (_, error) =>\n logger.error('Error while loading an audio file: ' + error),\n };\n\n /**\n * Ensure the volume is between 0 and 1.\n */\n const clampVolume = (volume: float): float => {\n if (volume > 1.0) {\n return 1.0;\n }\n if (volume < 0) {\n return 0;\n }\n return volume;\n };\n\n /**\n * A thin wrapper around a Howl object with:\n * * Handling of callbacks when the sound is not yet loaded.\n * * Automatic clamping when calling `setRate` to ensure a valid value is passed to Howler.js.\n * * Automatic clamping when calling `setVolume` so that the volume is always between 0 and 1.\n *\n * @memberof gdjs\n * @class HowlerSound\n */\n export class HowlerSound {\n /**\n * The ID of the played sound.\n */\n private _id: integer | null = null;\n\n /**\n * The Howl passed to the constructor.\n * It defines the sound file that is being played.\n */\n private _howl: Howl;\n\n /**\n * The **initial** volume at which the sound is being played.\n * Once the sound is started, this volume can be not in sync\n * (in the case the sound is faded by Howler), so volume must\n * be gotten from `this._howl` directly.\n *\n * This value is clamped between 0 and 1.\n */\n private _initialVolume: float;\n\n /**\n * Whether the sound is being played in a loop or not.\n */\n private _loop: boolean;\n\n /**\n * The rate (speed) the sound is being played at.\n * This value is not clamped, though technically Howler.js will only\n * accepts values between a specific range (so we clamp this when\n * passing it to Howler.js, but keep the original value here).\n */\n private _rate: float;\n\n /**\n * An array of callbacks to call once the sound starts to play.\n */\n private _oncePlay: Array<HowlCallback> = [];\n\n /**\n * An array of callbacks to call everytime the sound starts to play.\n */\n private _onPlay: Array<HowlCallback> = [];\n\n constructor(howl: Howl, volume: float, loop: boolean, rate: float) {\n this._howl = howl;\n this._initialVolume = clampVolume(volume);\n this._loop = loop;\n this._rate = rate;\n }\n\n /**\n * Returns true if the associated howl is fully loaded.\n */\n isLoaded(): boolean {\n return this._howl.state() === 'loaded';\n }\n\n /**\n * Begins playback of the sound, or if the Howl is still loading, schedule playing for once it loads.\n * @returns The current instance for chaining.\n */\n play(): this {\n if (this.isLoaded()) {\n const newID = this._howl.play(\n this._id === null ? '__default' : this._id\n );\n this._id = newID;\n\n // Set the howl properties as soon as the sound is played and we have its ID.\n this._howl.volume(this._initialVolume, newID); // this._initialVolume is already clamped between 0 and 1.\n this._howl.loop(this._loop, newID);\n // this._rate is not clamped, but we need to clamp it when passing it to Howler.js as it\n // only supports a specific range.\n this._howl.rate(gdjs.HowlerSoundManager.clampRate(this._rate), newID);\n\n // Manually handle the play event before we have an ID.\n // Before loading, howler won't register events as without an ID we cannot set a listener.\n // Once we have an ID, we can transfer control of the events to howler.\n // We also need to call them once as Howler doesn't for the first play event.\n this._onPlay.forEach((func) => {\n // Transfer the event to howler now that we have an ID\n this.on('play', func);\n func(newID);\n });\n this._oncePlay.forEach((func) => func(newID));\n this._onPlay = [];\n this._oncePlay = [];\n } else this._howl.once('load', () => this.play()); // Play only once the howl is fully loaded\n\n return this;\n }\n\n /**\n * Pauses playback of the sound, saving the seek of playback.\n * @returns The current instance for chaining.\n */\n pause(): this {\n if (this._id !== null) this._howl.pause(this._id);\n return this;\n }\n\n /**\n * Stops playback of the sound, resetting seek to 0.\n * @returns The current instance for chaining.\n */\n stop(): this {\n if (this._id !== null) this._howl.stop(this._id);\n return this;\n }\n\n /**\n * Check if the sound is currently playing.\n * Note that a loading sound is considered as playing (as it will be\n * played as soon as it's loaded). To avoid loading at runtime, prefer\n * to preload the sounds.\n */\n playing(): boolean {\n return (\n (this._id !== null ? this._howl.playing(this._id) : true) ||\n !this.isLoaded() // Loading is considered playing\n );\n }\n\n /**\n * Check if the sound is currently paused.\n */\n paused(): boolean {\n return !this.playing();\n }\n\n /**\n * Check if the sound is currently stopped.\n */\n stopped(): boolean {\n return this.paused() && this.getSeek() === 0;\n }\n\n /**\n * Get the sound playback rate. This 1 for the default speed.\n * This value is not clamped (any value greater than 0 is valid),\n * but the underlying audio system might not play the sound at the required\n * rate if it's very low or very high.\n */\n getRate(): float {\n return this._rate;\n }\n\n /**\n * Set the playback rate.\n * This value is not clamped (any value greater than 0 is valid),\n * but the underlying audio system might not play the sound at the required\n * rate if it's very low or very high.\n * @returns The current instance for chaining.\n */\n setRate(rate: float): this {\n this._rate = rate;\n // If the sound has already started playing, then change the value directly.\n if (this._id !== null) {\n rate = gdjs.HowlerSoundManager.clampRate(rate);\n this._howl.rate(rate, this._id);\n }\n return this;\n }\n\n /**\n * Get if the sound is looping.\n */\n getLoop(): boolean {\n return this._loop;\n }\n\n /**\n * Set if the sound is looping.\n * @returns The current instance for chaining.\n */\n setLoop(loop: boolean): this {\n this._loop = loop;\n // If the sound has already started playing, then change the value directly.\n if (this._id !== null) this._howl.loop(loop, this._id);\n return this;\n }\n\n //TODO: Replace float type in those 2 methods with RangeOf<0..1> once it is standardized (https://github.com/Microsoft/TypeScript/issues/15480)\n /**\n * Get the sound volume.\n * @returns A float from 0 to 1.\n */\n getVolume(): float {\n if (this._id === null) return this._initialVolume;\n return this._howl.volume(this._id);\n }\n\n /**\n * Set the sound volume.\n * @param volume A float from 0 to 1. The value is clamped if too high or too low.\n * @returns The current instance for chaining.\n */\n setVolume(volume: float): this {\n this._initialVolume = clampVolume(volume);\n\n // If the sound has already started playing, then change the value directly.\n if (this._id !== null) this._howl.volume(this._initialVolume, this._id);\n return this;\n }\n\n /**\n * Get if the sound is muted.\n */\n getMute(): boolean {\n if (this._id === null) return false;\n return this._howl.mute(this._id);\n }\n\n /**\n * Set if the sound is muted.\n * @returns The current instance for chaining.\n */\n setMute(mute: boolean): this {\n if (this._id !== null) this._howl.mute(mute, this._id);\n return this;\n }\n\n /**\n * Get the sound seek.\n */\n getSeek(): float {\n if (this._id === null) return 0;\n return this._howl.seek(this._id);\n }\n\n /**\n * Set the sound seek.\n * @returns The current instance for chaining.\n */\n setSeek(seek: float): this {\n if (this._id !== null) this._howl.seek(seek, this._id);\n return this;\n }\n\n /**\n * Get the sound spatial position.\n */\n getSpatialPosition(axis: 'x' | 'y' | 'z'): float {\n if (this._id === null) return 0;\n return this._howl.pos(this._id)[axis === 'x' ? 0 : axis === 'y' ? 1 : 2];\n }\n\n /**\n * Set the sound spatial position.\n * @returns The current instance for chaining.\n */\n setSpatialPosition(x: float, y: float, z: float): this {\n if (this._id !== null) this._howl.pos(x, y, z, this._id);\n return this;\n }\n\n /**\n * Fade the volume sound.\n * @returns The current instance for chaining.\n */\n fade(from: float, to: float, duration: float): this {\n if (this._id !== null)\n this._howl.fade(clampVolume(from), clampVolume(to), duration, this._id);\n return this;\n }\n\n /**\n * Adds an event listener to the howl.\n */\n on(event: HowlEvent, handler: HowlCallback): this {\n if (event === 'play') {\n if (this._id === null) {\n this._onPlay.push(handler);\n } else {\n this._howl.on(event, handler, this._id);\n }\n } else if (this._id === null)\n this.once('play', () => this.on(event, handler));\n else this._howl.on(event, handler, this._id);\n\n return this;\n }\n\n /**\n * Adds an event listener to the howl that removes itself after being called.\n * If the event is `play` and the sound is being played, the handler is\n * called synchronously.\n */\n once(event: HowlEvent, handler: HowlCallback): this {\n if (event === 'play') {\n if (this._id === null) {\n this._oncePlay.push(handler);\n } else if (this.playing()) {\n // Immediately call the handler if the sound is already playing.\n // This is useful for sounds that were just started and have a `.once('play', ...)`\n // handler added on them to set up the volume/rate/loop. If we don't do it\n // synchronously, the sound can play for a tiny bit at the default volume and rate.\n // See https://github.com/4ian/GDevelop/issues/2490.\n handler(this._id);\n } else {\n this._howl.once(event, handler, this._id);\n }\n } else if (this._id === null)\n this.once('play', () => this.once(event, handler));\n else this._howl.once(event, handler, this._id);\n\n return this;\n }\n\n /**\n * Removes an event listener to the howl.\n */\n off(event: HowlEvent, handler: HowlCallback): this {\n if (this._id !== null) this._howl.off(event, handler, this._id);\n return this;\n }\n }\n\n /**\n * HowlerSoundManager is used to manage the sounds and musics of a RuntimeScene.\n *\n * It is basically a container to associate channels to sounds and keep a list\n * of all sounds being played.\n */\n export class HowlerSoundManager {\n _loadedMusics: Record<string, Howl> = {};\n _loadedSounds: Record<string, Howl> = {};\n _resources: ResourceData[];\n _availableResources: Record<string, ResourceData> = {};\n _globalVolume: float = 100;\n _sounds: Record<integer, HowlerSound> = {};\n _musics: Record<integer, HowlerSound> = {};\n _freeSounds: HowlerSound[] = []; // Sounds without an assigned channel.\n _freeMusics: HowlerSound[] = []; // Musics without an assigned channel.\n\n /** Paused sounds or musics that should be played once the game is resumed. */\n _pausedSounds: HowlerSound[] = [];\n _paused: boolean = false;\n\n _resourcesLoader: RuntimeGameResourcesLoader;\n\n /**\n * @param resources The resources data of the game.\n * @param resourcesLoader The resources loader of the game.\n */\n constructor(\n resources: ResourceData[],\n resourcesLoader: RuntimeGameResourcesLoader\n ) {\n this._resources = resources;\n this._resourcesLoader = resourcesLoader;\n\n const that = this;\n document.addEventListener('deviceready', function () {\n // pause/resume sounds in Cordova when the app is being paused/resumed\n document.addEventListener(\n 'pause',\n function () {\n const soundList = that._freeSounds.concat(that._freeMusics);\n for (let key in that._sounds) {\n if (that._sounds.hasOwnProperty(key)) {\n soundList.push(that._sounds[key]);\n }\n }\n for (let key in that._musics) {\n if (that._musics.hasOwnProperty(key)) {\n soundList.push(that._musics[key]);\n }\n }\n for (let i = 0; i < soundList.length; i++) {\n const sound = soundList[i];\n if (!sound.paused() && !sound.stopped()) {\n sound.pause();\n that._pausedSounds.push(sound);\n }\n }\n that._paused = true;\n },\n false\n );\n document.addEventListener(\n 'resume',\n function () {\n for (let i = 0; i < that._pausedSounds.length; i++) {\n const sound = that._pausedSounds[i];\n if (!sound.stopped()) {\n sound.play();\n }\n }\n that._pausedSounds.length = 0;\n that._paused = false;\n },\n false\n );\n });\n }\n\n /**\n * Update the resources data of the game. Useful for hot-reloading, should not be used otherwise.\n *\n * @param resources The resources data of the game.\n */\n setResources(resources: ResourceData[]): void {\n this._resources = resources;\n }\n\n /**\n * Ensure rate is in a range valid for Howler.js\n * @return The clamped rate\n */\n static clampRate(rate: float): float {\n if (rate > 4.0) {\n return 4.0;\n }\n if (rate < 0.5) {\n return 0.5;\n }\n return rate;\n }\n\n /**\n * Return the file associated to the given sound name.\n *\n * Names and files are loaded from resources when preloadAudio is called. If no\n * file is associated to the given name, then the name will be considered as a\n * filename and will be returned.\n *\n * @return The associated filename\n */\n private _getFileFromSoundName(soundName: string): string {\n if (\n this._availableResources.hasOwnProperty(soundName) &&\n this._availableResources[soundName].file\n ) {\n return this._availableResources[soundName].file;\n }\n return soundName;\n }\n\n /**\n * Store the sound in the specified array, put it at the first index that\n * is free, or add it at the end if no element is free\n * (\"free\" means that the gdjs.HowlerSound can be destroyed).\n *\n * @param arr The array containing the sounds.\n * @param arr The gdjs.HowlerSound to add.\n * @return The gdjs.HowlerSound that have been added (i.e: the second parameter).\n */\n private _storeSoundInArray(\n arr: Array<HowlerSound>,\n sound: HowlerSound\n ): HowlerSound {\n // Try to recycle an old sound.\n for (let i = 0, len = arr.length; i < len; ++i) {\n if (arr[i] !== null && arr[i].stopped()) {\n arr[i] = sound;\n return sound;\n }\n }\n\n arr.push(sound);\n return sound;\n }\n\n /**\n * Creates a new gdjs.HowlerSound using preloaded/cached Howl instances.\n * @param soundName The name of the file or resource to play.\n * @param isMusic True if a music, false if a sound.\n * @param volume Between 0 and 1.\n * @param loop True if it should be played looping.\n * @param rate speed at which it is played.\n */\n createHowlerSound(\n soundName: string,\n isMusic: boolean,\n volume: float,\n loop: boolean,\n rate: float\n ): HowlerSound {\n const soundFile = this._getFileFromSoundName(soundName);\n const cacheContainer = isMusic ? this._loadedMusics : this._loadedSounds;\n\n if (!cacheContainer.hasOwnProperty(soundFile)) {\n cacheContainer[soundFile] = new Howl(\n Object.assign(\n {\n src: [this._resourcesLoader.getFullUrl(soundFile)],\n html5: isMusic,\n xhr: {\n withCredentials: this._resourcesLoader.checkIfCredentialsRequired(\n soundFile\n ),\n },\n // Cache the sound with no volume. This avoids a bug where it plays at full volume\n // for a split second before setting its correct volume.\n volume: 0,\n },\n HowlParameters\n )\n );\n }\n\n return new gdjs.HowlerSound(\n cacheContainer[soundFile],\n volume,\n loop,\n rate\n );\n }\n\n /**\n * Preloads a sound or a music in memory.\n * @param soundName The name of the file or resource to preload.\n * @param isMusic True if a music, false if a sound.\n */\n loadAudio(soundName: string, isMusic: boolean) {\n const soundFile = this._getFileFromSoundName(soundName);\n const cacheContainer = isMusic ? this._loadedMusics : this._loadedSounds;\n\n // Do not reload if it is already loaded.\n if (cacheContainer.hasOwnProperty(soundFile)) return;\n\n cacheContainer[soundFile] = new Howl(\n Object.assign(\n {\n src: [this._resourcesLoader.getFullUrl(soundFile)],\n html5: isMusic,\n xhr: {\n withCredentials: this._resourcesLoader.checkIfCredentialsRequired(\n soundFile\n ),\n },\n // Cache the sound with no volume. This avoids a bug where it plays at full volume\n // for a split second before setting its correct volume.\n volume: 0,\n },\n HowlParameters\n )\n );\n }\n\n /**\n * Unloads a sound or a music from memory. This will stop any sound/music using it.\n * @param soundName The name of the file or resource to unload.\n * @param isMusic True if a music, false if a sound.\n */\n unloadAudio(soundName: string, isMusic: boolean) {\n const soundFile = this._getFileFromSoundName(soundName);\n const cacheContainer = isMusic ? this._loadedMusics : this._loadedSounds;\n\n if (!cacheContainer[soundFile]) return;\n\n // Make sure any sound using the howl is deleted so\n // that the howl can be garbage collected\n // and no weird \"zombies\" using the unloaded howl can exist.\n const howl = cacheContainer[soundFile];\n function clearContainer(howlerSoundContainer: HowlerSound[]) {\n for (let i in howlerSoundContainer) {\n if (\n howlerSoundContainer[i] &&\n //@ts-ignore We really need to access the raw howl here.\n howlerSoundContainer[i]._howl === howl\n ) {\n howlerSoundContainer[i].stop();\n delete howlerSoundContainer[i];\n }\n }\n }\n\n clearContainer(this._freeMusics);\n clearContainer(this._freeSounds);\n clearContainer(Object.values(this._musics));\n clearContainer(Object.values(this._sounds));\n clearContainer(this._pausedSounds);\n\n cacheContainer[soundFile].unload();\n delete cacheContainer[soundFile];\n }\n\n /**\n * Unloads all audio from memory.\n * This will clear the Howl cache.\n * This will also stop any running music or sounds.\n */\n unloadAll() {\n Howler.unload();\n\n // Clean up old sounds that still have the dead Howl instances.\n this._freeSounds.length = 0;\n this._freeMusics.length = 0;\n this._sounds = {};\n this._musics = {};\n this._pausedSounds.length = 0;\n this._loadedMusics = {};\n this._loadedSounds = {};\n }\n\n playSound(soundName: string, loop: boolean, volume: float, pitch: float) {\n const sound = this.createHowlerSound(\n soundName,\n /* isMusic= */ false,\n volume / 100,\n loop,\n pitch\n );\n this._storeSoundInArray(this._freeSounds, sound);\n sound.once('play', () => {\n if (this._paused) {\n sound.pause();\n this._pausedSounds.push(sound);\n }\n });\n sound.play();\n }\n\n playSoundOnChannel(\n soundName: string,\n channel: integer,\n loop: boolean,\n volume: float,\n pitch: float\n ) {\n if (this._sounds[channel]) this._sounds[channel].stop();\n\n const sound = this.createHowlerSound(\n soundName,\n /* isMusic= */ false,\n volume / 100,\n loop,\n pitch\n );\n this._sounds[channel] = sound;\n sound.once('play', () => {\n if (this._paused) {\n sound.pause();\n this._pausedSounds.push(sound);\n }\n });\n sound.play();\n }\n\n getSoundOnChannel(channel: integer): HowlerSound | null {\n return this._sounds[channel] || null;\n }\n\n playMusic(soundName: string, loop: boolean, volume: float, pitch: float) {\n const music = this.createHowlerSound(\n soundName,\n /* isMusic= */ true,\n volume / 100,\n loop,\n pitch\n );\n this._storeSoundInArray(this._freeMusics, music);\n music.once('play', () => {\n if (this._paused) {\n music.pause();\n this._pausedSounds.push(music);\n }\n });\n music.play();\n }\n\n playMusicOnChannel(\n soundName: string,\n channel: integer,\n loop: boolean,\n volume: float,\n pitch: float\n ) {\n if (this._musics[channel]) this._musics[channel].stop();\n\n const music = this.createHowlerSound(\n soundName,\n /* isMusic= */ true,\n volume / 100,\n loop,\n pitch\n );\n this._musics[channel] = music;\n music.once('play', () => {\n if (this._paused) {\n music.pause();\n this._pausedSounds.push(music);\n }\n });\n music.play();\n }\n\n getMusicOnChannel(channel: integer): HowlerSound | null {\n return this._musics[channel] || null;\n }\n\n setGlobalVolume(volume: float): void {\n this._globalVolume = volume;\n if (this._globalVolume > 100) {\n this._globalVolume = 100;\n }\n if (this._globalVolume < 0) {\n this._globalVolume = 0;\n }\n Howler.volume(this._globalVolume / 100);\n }\n\n getGlobalVolume(): float {\n return this._globalVolume;\n }\n\n clearAll() {\n Howler.stop();\n\n this._freeSounds.length = 0;\n this._freeMusics.length = 0;\n this._sounds = {};\n this._musics = {};\n this._pausedSounds.length = 0;\n }\n\n preloadAudio(\n onProgress: (loadedCount: integer, totalCount: integer) => void,\n onComplete: (totalCount: integer) => void,\n resources?: ResourceData[]\n ) {\n resources = resources || this._resources;\n\n // Construct the list of files to be loaded.\n // For one loaded file, it can have one or more resources\n // that use it.\n const files = {};\n for (let i = 0, len = resources.length; i < len; ++i) {\n let res = resources[i];\n if (res.file && res.kind === 'audio') {\n if (!!this._availableResources[res.name]) {\n continue;\n }\n\n this._availableResources[res.name] = res;\n\n files[res.file] = (files[res.file] || []).concat(res);\n }\n }\n\n const filesToLoad = Object.keys(files);\n const totalCount = filesToLoad.length;\n if (totalCount === 0) return onComplete(totalCount); // Nothing to load.\n\n let loadedCount: integer = 0;\n const onLoad = (_?: any, error?: string) => {\n if (error)\n logger.warn(\n 'There was an error while preloading an audio file: ' + error\n );\n\n loadedCount++;\n if (loadedCount === totalCount) return onComplete(totalCount);\n\n onProgress(loadedCount, totalCount);\n loadNextFile();\n };\n\n const preloadAudioFile = (\n file: string,\n onLoadCallback: HowlCallback,\n isMusic: boolean\n ) => {\n const container = isMusic ? this._loadedMusics : this._loadedSounds;\n container[file] = new Howl(\n Object.assign({}, HowlParameters, {\n src: [this._resourcesLoader.getFullUrl(file)],\n onload: onLoadCallback,\n onloaderror: onLoadCallback,\n html5: isMusic,\n xhr: {\n withCredentials: this._resourcesLoader.checkIfCredentialsRequired(\n file\n ),\n },\n // Cache the sound with no volume. This avoids a bug where it plays at full volume\n // for a split second before setting its correct volume.\n volume: 0,\n })\n );\n };\n\n const loadNextFile = () => {\n if (!filesToLoad.length) return;\n const file = filesToLoad.shift()!;\n const fileData = files[file][0];\n\n let loadCounter = 0;\n const callback = (_?: any, error?: string) => {\n loadCounter--;\n if (!loadCounter) {\n onLoad(_, error);\n }\n };\n\n if (fileData.preloadAsMusic) {\n loadCounter++;\n preloadAudioFile(file, callback, /* isMusic= */ true);\n }\n\n if (fileData.preloadAsSound) {\n loadCounter++;\n preloadAudioFile(file, callback, /* isMusic= */ false);\n } else if (fileData.preloadInCache) {\n // preloading as sound already does a XHR request, hence \"else if\"\n loadCounter++;\n const sound = new XMLHttpRequest();\n sound.withCredentials = this._resourcesLoader.checkIfCredentialsRequired(\n file\n );\n sound.addEventListener('load', callback);\n sound.addEventListener('error', (_) =>\n callback(_, 'XHR error: ' + file)\n );\n sound.addEventListener('abort', (_) =>\n callback(_, 'XHR abort: ' + file)\n );\n sound.open('GET', this._resourcesLoader.getFullUrl(file));\n sound.send();\n }\n\n if (!loadCounter) {\n onLoad();\n }\n };\n loadNextFile();\n }\n }\n\n // Register the class to let the engine use it.\n export const SoundManager = HowlerSoundManager;\n export type SoundManager = HowlerSoundManager;\n}\n"],
|
|
5
|
+
"mappings": "AAMA,IAAU,MAAAA,GAAV,CACE,MAAMC,EAAS,IAAID,EAAK,OAAO,eAAe,EAExCE,EAA8B,CAClC,QAAS,GACT,YAAa,CAACC,EAAGC,IACfH,EAAO,MAAM,6BAA+BG,CAAK,EACnD,YAAa,CAACD,EAAGC,IACfH,EAAO,MAAM,sCAAwCG,CAAK,CAC9D,EAKMC,EAAeC,GACfA,EAAS,EACJ,EAELA,EAAS,EACJ,EAEFA,EAYF,MA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A,EAAM,gBAAkB,KAAK,iBAAiB,2BAC5CsB,CACF,EACAtB,EAAM,iBAAiB,OAAQ2B,CAAQ,EACvC3B,EAAM,iBAAiB,QAAU5B,GAC/BuD,EAASvD,EAAG,cAAgBkD,CAAI,CAClC,EACAtB,EAAM,iBAAiB,QAAU5B,GAC/BuD,EAASvD,EAAG,cAAgBkD,CAAI,CAClC,EACAtB,EAAM,KAAK,MAAO,KAAK,iBAAiB,WAAWsB,CAAI,CAAC,EACxDtB,EAAM,KAAK,CACb,CAEK0B,GACHP,EAAO,CAEX,EACAC,EAAa,CACf,CACF,CAzfOnD,EAAM,mBAAAwB,EA4fAxB,EAAA,aAAewB,IAn2BpB",
|
|
6
|
+
"names": ["gdjs", "logger", "HowlParameters", "_", "error", "clampVolume", "volume", "HowlerSound", "howl", "loop", "rate", "newID", "func", "mute", "seek", "axis", "x", "y", "z", "from", "to", "duration", "event", "handler", "HowlerSoundManager", "resources", "resourcesLoader", "that", "soundList", "key", "i", "sound", "soundName", "arr", "len", "isMusic", "soundFile", "cacheContainer", "clearContainer", "howlerSoundContainer", "pitch", "channel", "music", "onProgress", "onComplete", "files", "res", "filesToLoad", "totalCount", "loadedCount", "onLoad", "loadNextFile", "preloadAudioFile", "file", "onLoadCallback", "container", "fileData", "loadCounter", "callback"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! howler.js v2.2.3 | (c) 2013-2020, James Simpson of GoldFire Studios | MIT License | howlerjs.com */
|
|
2
|
+
/* Modified for GDevelop by reverting commit 0323af9b843351cacc47893aed8e65cd8ba3b0cb to fix https://github.com/goldfire/howler.js/issues/1603 */
|
|
3
|
+
!function(){"use strict";var e=function(){this.init()};e.prototype={init:function(){var e=this||n;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var o=this||n;if(e=parseFloat(e),o.ctx||_(),void 0!==e&&e>=0&&e<=1){if(o._volume=e,o._muted)return o;o.usingWebAudio&&o.masterGain.gain.setValueAtTime(e,n.ctx.currentTime);for(var t=0;t<o._howls.length;t++)if(!o._howls[t]._webAudio)for(var r=o._howls[t]._getSoundIds(),a=0;a<r.length;a++){var u=o._howls[t]._soundById(r[a]);u&&u._node&&(u._node.volume=u._volume*e)}return o}return o._volume},mute:function(e){var o=this||n;o.ctx||_(),o._muted=e,o.usingWebAudio&&o.masterGain.gain.setValueAtTime(e?0:o._volume,n.ctx.currentTime);for(var t=0;t<o._howls.length;t++)if(!o._howls[t]._webAudio)for(var r=o._howls[t]._getSoundIds(),a=0;a<r.length;a++){var u=o._howls[t]._soundById(r[a]);u&&u._node&&(u._node.muted=!!e||u._muted)}return o},stop:function(){for(var e=this||n,o=0;o<e._howls.length;o++)e._howls[o].stop();return e},unload:function(){for(var e=this||n,o=e._howls.length-1;o>=0;o--)e._howls[o].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,_()),e},codecs:function(e){return(this||n)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||n;if(e.state=e.ctx?e.ctx.state||"suspended":"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{var o=new Audio;void 0===o.oncanplaythrough&&(e._canPlayEvent="canplay")}catch(n){e.noAudio=!0}else e.noAudio=!0;try{var o=new Audio;o.muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||n,o=null;try{o="undefined"!=typeof Audio?new Audio:null}catch(n){return e}if(!o||"function"!=typeof o.canPlayType)return e;var t=o.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",a=r.match(/OPR\/([0-6].)/g),u=a&&parseInt(a[0].split("/")[1],10)<33,d=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),i=r.match(/Version\/(.*?) /),_=d&&i&&parseInt(i[1],10)<15;return e._codecs={mp3:!(u||!t&&!o.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!t,opus:!!o.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(o.canPlayType('audio/wav; codecs="1"')||o.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!o.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!o.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(o.canPlayType("audio/x-m4a;")||o.canPlayType("audio/m4a;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(o.canPlayType("audio/x-m4b;")||o.canPlayType("audio/m4b;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(o.canPlayType("audio/x-mp4;")||o.canPlayType("audio/mp4;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(_||!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(_||!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!o.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(o.canPlayType("audio/x-flac;")||o.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||n;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var o=function(n){for(;e._html5AudioPool.length<e.html5PoolSize;)try{var t=new Audio;t._unlocked=!0,e._releaseHtml5Audio(t)}catch(n){e.noAudio=!0;break}for(var r=0;r<e._howls.length;r++)if(!e._howls[r]._webAudio)for(var a=e._howls[r]._getSoundIds(),u=0;u<a.length;u++){var d=e._howls[r]._soundById(a[u]);d&&d._node&&!d._node._unlocked&&(d._node._unlocked=!0,d._node.load())}e._autoResume();var i=e.ctx.createBufferSource();i.buffer=e._scratchBuffer,i.connect(e.ctx.destination),void 0===i.start?i.noteOn(0):i.start(0),"function"==typeof e.ctx.resume&&e.ctx.resume(),i.onended=function(){i.disconnect(0),e._audioUnlocked=!0,document.removeEventListener("touchstart",o,!0),document.removeEventListener("touchend",o,!0),document.removeEventListener("click",o,!0),document.removeEventListener("keydown",o,!0);for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("unlock")}};return document.addEventListener("touchstart",o,!0),document.addEventListener("touchend",o,!0),document.addEventListener("click",o,!0),document.addEventListener("keydown",o,!0),e}},_obtainHtml5Audio:function(){var e=this||n;if(e._html5AudioPool.length)return e._html5AudioPool.pop();var o=(new Audio).play();return o&&"undefined"!=typeof Promise&&(o instanceof Promise||"function"==typeof o.then)&&o.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(e){var o=this||n;return e._unlocked&&o._html5AudioPool.push(e),o},_autoSuspend:function(){var e=this;if(e.autoSuspend&&e.ctx&&void 0!==e.ctx.suspend&&n.usingWebAudio){for(var o=0;o<e._howls.length;o++)if(e._howls[o]._webAudio)for(var t=0;t<e._howls[o]._sounds.length;t++)if(!e._howls[o]._sounds[t]._paused)return e;return e._suspendTimer&&clearTimeout(e._suspendTimer),e._suspendTimer=setTimeout(function(){if(e.autoSuspend){e._suspendTimer=null,e.state="suspending";var n=function(){e.state="suspended",e._resumeAfterSuspend&&(delete e._resumeAfterSuspend,e._autoResume())};e.ctx.suspend().then(n,n)}},3e4),e}},_autoResume:function(){var e=this;if(e.ctx&&void 0!==e.ctx.resume&&n.usingWebAudio)return"running"===e.state&&"interrupted"!==e.ctx.state&&e._suspendTimer?(clearTimeout(e._suspendTimer),e._suspendTimer=null):"suspended"===e.state||"running"===e.state&&"interrupted"===e.ctx.state?(e.ctx.resume().then(function(){e.state="running";for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("resume")}),e._suspendTimer&&(clearTimeout(e._suspendTimer),e._suspendTimer=null)):"suspending"===e.state&&(e._resumeAfterSuspend=!0),e}};var n=new e,o=function(e){var n=this;if(!e.src||0===e.src.length)return void console.error("An array of source files must be passed with any new Howl.");n.init(e)};o.prototype={init:function(e){var o=this;return n.ctx||_(),o._autoplay=e.autoplay||!1,o._format="string"!=typeof e.format?e.format:[e.format],o._html5=e.html5||!1,o._muted=e.mute||!1,o._loop=e.loop||!1,o._pool=e.pool||5,o._preload="boolean"!=typeof e.preload&&"metadata"!==e.preload||e.preload,o._rate=e.rate||1,o._sprite=e.sprite||{},o._src="string"!=typeof e.src?e.src:[e.src],o._volume=void 0!==e.volume?e.volume:1,o._xhr={method:e.xhr&&e.xhr.method?e.xhr.method:"GET",headers:e.xhr&&e.xhr.headers?e.xhr.headers:null,withCredentials:!(!e.xhr||!e.xhr.withCredentials)&&e.xhr.withCredentials},o._duration=0,o._state="unloaded",o._sounds=[],o._endTimers={},o._queue=[],o._playLock=!1,o._onend=e.onend?[{fn:e.onend}]:[],o._onfade=e.onfade?[{fn:e.onfade}]:[],o._onload=e.onload?[{fn:e.onload}]:[],o._onloaderror=e.onloaderror?[{fn:e.onloaderror}]:[],o._onplayerror=e.onplayerror?[{fn:e.onplayerror}]:[],o._onpause=e.onpause?[{fn:e.onpause}]:[],o._onplay=e.onplay?[{fn:e.onplay}]:[],o._onstop=e.onstop?[{fn:e.onstop}]:[],o._onmute=e.onmute?[{fn:e.onmute}]:[],o._onvolume=e.onvolume?[{fn:e.onvolume}]:[],o._onrate=e.onrate?[{fn:e.onrate}]:[],o._onseek=e.onseek?[{fn:e.onseek}]:[],o._onunlock=e.onunlock?[{fn:e.onunlock}]:[],o._onresume=[],o._webAudio=n.usingWebAudio&&!o._html5,void 0!==n.ctx&&n.ctx&&n.autoUnlock&&n._unlockAudio(),n._howls.push(o),o._autoplay&&o._queue.push({event:"play",action:function(){o.play()}}),o._preload&&"none"!==o._preload&&o.load(),o},load:function(){var e=this,o=null;if(n.noAudio)return void e._emit("loaderror",null,"No audio support.");"string"==typeof e._src&&(e._src=[e._src]);for(var r=0;r<e._src.length;r++){var u,d;if(e._format&&e._format[r])u=e._format[r];else{if("string"!=typeof(d=e._src[r])){e._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}u=/^data:audio\/([^;,]+);/i.exec(d),u||(u=/\.([^.]+)$/.exec(d.split("?",1)[0])),u&&(u=u[1].toLowerCase())}if(u||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),u&&n.codecs(u)){o=e._src[r];break}}return o?(e._src=o,e._state="loading","https:"===window.location.protocol&&"http:"===o.slice(0,5)&&(e._html5=!0,e._webAudio=!1),new t(e),e._webAudio&&a(e),e):void e._emit("loaderror",null,"No codec support for selected audio sources.")},play:function(e,o){var t=this,r=null;if("number"==typeof e)r=e,e=null;else{if("string"==typeof e&&"loaded"===t._state&&!t._sprite[e])return null;if(void 0===e&&(e="__default",!t._playLock)){for(var a=0,u=0;u<t._sounds.length;u++)t._sounds[u]._paused&&!t._sounds[u]._ended&&(a++,r=t._sounds[u]._id);1===a?e=null:r=null}}var d=r?t._soundById(r):t._inactiveSound();if(!d)return null;if(r&&!e&&(e=d._sprite||"__default"),"loaded"!==t._state){d._sprite=e,d._ended=!1;var i=d._id;return t._queue.push({event:"play",action:function(){t.play(i)}}),i}if(r&&!d._paused)return o||t._loadQueue("play"),d._id;t._webAudio&&n._autoResume();var _=Math.max(0,d._seek>0?d._seek:t._sprite[e][0]/1e3),s=Math.max(0,(t._sprite[e][0]+t._sprite[e][1])/1e3-_),l=1e3*s/Math.abs(d._rate),c=t._sprite[e][0]/1e3,f=(t._sprite[e][0]+t._sprite[e][1])/1e3;d._sprite=e,d._ended=!1;var p=function(){d._paused=!1,d._seek=_,d._start=c,d._stop=f,d._loop=!(!d._loop&&!t._sprite[e][2])};if(_>=f)return void t._ended(d);var m=d._node;if(t._webAudio){var v=function(){t._playLock=!1,p(),t._refreshBuffer(d);var e=d._muted||t._muted?0:d._volume;m.gain.setValueAtTime(e,n.ctx.currentTime),d._playStart=n.ctx.currentTime,void 0===m.bufferSource.start?d._loop?m.bufferSource.noteGrainOn(0,_,86400):m.bufferSource.noteGrainOn(0,_,s):d._loop?m.bufferSource.start(0,_,86400):m.bufferSource.start(0,_,s),l!==1/0&&(t._endTimers[d._id]=setTimeout(t._ended.bind(t,d),l)),o||setTimeout(function(){t._emit("play",d._id),t._loadQueue()},0)};"running"===n.state&&"interrupted"!==n.ctx.state?v():(t._playLock=!0,t.once("resume",v),t._clearTimer(d._id))}else{var h=function(){m.currentTime=_,m.muted=d._muted||t._muted||n._muted||m.muted,m.volume=d._volume*n.volume(),m.playbackRate=d._rate;try{var r=m.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(t._playLock=!0,p(),r.then(function(){t._playLock=!1,m._unlocked=!0,o||(t._emit("play",d._id),t._loadQueue())}).catch(function(){t._playLock=!1,t._emit("playerror",d._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),d._ended=!0,d._paused=!0})):o||(t._playLock=!1,p(),t._emit("play",d._id),t._loadQueue()),m.playbackRate=d._rate,m.paused)return void t._emit("playerror",d._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||d._loop?t._endTimers[d._id]=setTimeout(t._ended.bind(t,d),l):(t._endTimers[d._id]=function(){t._ended(d),m.removeEventListener("ended",t._endTimers[d._id],!1)},m.addEventListener("ended",t._endTimers[d._id],!1))}catch(e){t._emit("playerror",d._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===m.src&&(m.src=t._src,m.load());var y=window&&window.ejecta||!m.readyState&&n._navigator.isCocoonJS;if(m.readyState>=3||y)h();else{t._playLock=!0,t._state="loading";var g=function(){t._state="loaded",h(),m.removeEventListener(n._canPlayEvent,g,!1)};m.addEventListener(n._canPlayEvent,g,!1),t._clearTimer(d._id)}}return d._id},pause:function(e){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"pause",action:function(){n.pause(e)}}),n;for(var o=n._getSoundIds(e),t=0;t<o.length;t++){n._clearTimer(o[t]);var r=n._soundById(o[t]);if(r&&!r._paused&&(r._seek=n.seek(o[t]),r._rateSeek=0,r._paused=!0,n._stopFade(o[t]),r._node))if(n._webAudio){if(!r._node.bufferSource)continue;void 0===r._node.bufferSource.stop?r._node.bufferSource.noteOff(0):r._node.bufferSource.stop(0),n._cleanBuffer(r._node)}else isNaN(r._node.duration)&&r._node.duration!==1/0||r._node.pause();arguments[1]||n._emit("pause",r?r._id:null)}return n},stop:function(e,n){var o=this;if("loaded"!==o._state||o._playLock)return o._queue.push({event:"stop",action:function(){o.stop(e)}}),o;for(var t=o._getSoundIds(e),r=0;r<t.length;r++){o._clearTimer(t[r]);var a=o._soundById(t[r]);a&&(a._seek=a._start||0,a._rateSeek=0,a._paused=!0,a._ended=!0,o._stopFade(t[r]),a._node&&(o._webAudio?a._node.bufferSource&&(void 0===a._node.bufferSource.stop?a._node.bufferSource.noteOff(0):a._node.bufferSource.stop(0),o._cleanBuffer(a._node)):isNaN(a._node.duration)&&a._node.duration!==1/0||(a._node.currentTime=a._start||0,a._node.pause(),a._node.duration===1/0&&o._clearSound(a._node))),n||o._emit("stop",a._id))}return o},mute:function(e,o){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"mute",action:function(){t.mute(e,o)}}),t;if(void 0===o){if("boolean"!=typeof e)return t._muted;t._muted=e}for(var r=t._getSoundIds(o),a=0;a<r.length;a++){var u=t._soundById(r[a]);u&&(u._muted=e,u._interval&&t._stopFade(u._id),t._webAudio&&u._node?u._node.gain.setValueAtTime(e?0:u._volume,n.ctx.currentTime):u._node&&(u._node.muted=!!n._muted||e),t._emit("mute",u._id))}return t},volume:function(){var e,o,t=this,r=arguments;if(0===r.length)return t._volume;if(1===r.length||2===r.length&&void 0===r[1]){t._getSoundIds().indexOf(r[0])>=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else r.length>=2&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var a;if(!(void 0!==e&&e>=0&&e<=1))return a=o?t._soundById(o):t._sounds[0],a?a._volume:0;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"volume",action:function(){t.volume.apply(t,r)}}),t;void 0===o&&(t._volume=e),o=t._getSoundIds(o);for(var u=0;u<o.length;u++)(a=t._soundById(o[u]))&&(a._volume=e,r[2]||t._stopFade(o[u]),t._webAudio&&a._node&&!a._muted?a._node.gain.setValueAtTime(e,n.ctx.currentTime):a._node&&!a._muted&&(a._node.volume=e*n.volume()),t._emit("volume",a._id));return t},fade:function(e,o,t,r){var a=this;if("loaded"!==a._state||a._playLock)return a._queue.push({event:"fade",action:function(){a.fade(e,o,t,r)}}),a;e=Math.min(Math.max(0,parseFloat(e)),1),o=Math.min(Math.max(0,parseFloat(o)),1),t=parseFloat(t),a.volume(e,r);for(var u=a._getSoundIds(r),d=0;d<u.length;d++){var i=a._soundById(u[d]);if(i){if(r||a._stopFade(u[d]),a._webAudio&&!i._muted){var _=n.ctx.currentTime,s=_+t/1e3;i._volume=e,i._node.gain.setValueAtTime(e,_),i._node.gain.linearRampToValueAtTime(o,s)}a._startFadeInterval(i,e,o,t,u[d],void 0===r)}}return a},_startFadeInterval:function(e,n,o,t,r,a){var u=this,d=n,i=o-n,_=Math.abs(i/.01),s=Math.max(4,_>0?t/_:t),l=Date.now();e._fadeTo=o,e._interval=setInterval(function(){var r=(Date.now()-l)/t;l=Date.now(),d+=i*r,d=Math.round(100*d)/100,d=i<0?Math.max(o,d):Math.min(o,d),u._webAudio?e._volume=d:u.volume(d,e._id,!0),a&&(u._volume=d),(o<n&&d<=o||o>n&&d>=o)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,u.volume(o,e._id),u._emit("fade",e._id))},s)},_stopFade:function(e){var o=this,t=o._soundById(e);return t&&t._interval&&(o._webAudio&&t._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(t._interval),t._interval=null,o.volume(t._fadeTo,e),t._fadeTo=null,o._emit("fade",e)),o},loop:function(){var e,n,o,t=this,r=arguments;if(0===r.length)return t._loop;if(1===r.length){if("boolean"!=typeof r[0])return!!(o=t._soundById(parseInt(r[0],10)))&&o._loop;e=r[0],t._loop=e}else 2===r.length&&(e=r[0],n=parseInt(r[1],10));for(var a=t._getSoundIds(n),u=0;u<a.length;u++)(o=t._soundById(a[u]))&&(o._loop=e,t._webAudio&&o._node&&o._node.bufferSource&&(o._node.bufferSource.loop=e,e&&(o._node.bufferSource.loopStart=o._start||0,o._node.bufferSource.loopEnd=o._stop,t.playing(a[u])&&(t.pause(a[u],!0),t.play(a[u],!0)))));return t},rate:function(){var e,o,t=this,r=arguments;if(0===r.length)o=t._sounds[0]._id;else if(1===r.length){var a=t._getSoundIds(),u=a.indexOf(r[0]);u>=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var d;if("number"!=typeof e)return d=t._soundById(o),d?d._rate:t._rate;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"rate",action:function(){t.rate.apply(t,r)}}),t;void 0===o&&(t._rate=e),o=t._getSoundIds(o);for(var i=0;i<o.length;i++)if(d=t._soundById(o[i])){t.playing(o[i])&&(d._rateSeek=t.seek(o[i]),d._playStart=t._webAudio?n.ctx.currentTime:d._playStart),d._rate=e,t._webAudio&&d._node&&d._node.bufferSource?d._node.bufferSource.playbackRate.setValueAtTime(e,n.ctx.currentTime):d._node&&(d._node.playbackRate=e);var _=t.seek(o[i]),s=(t._sprite[d._sprite][0]+t._sprite[d._sprite][1])/1e3-_,l=1e3*s/Math.abs(d._rate);!t._endTimers[o[i]]&&d._paused||(t._clearTimer(o[i]),t._endTimers[o[i]]=setTimeout(t._ended.bind(t,d),l)),t._emit("rate",d._id)}return t},seek:function(){var e,o,t=this,r=arguments;if(0===r.length)t._sounds.length&&(o=t._sounds[0]._id);else if(1===r.length){var a=t._getSoundIds(),u=a.indexOf(r[0]);u>=0?o=parseInt(r[0],10):t._sounds.length&&(o=t._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));if(void 0===o)return 0;if("number"==typeof e&&("loaded"!==t._state||t._playLock))return t._queue.push({event:"seek",action:function(){t.seek.apply(t,r)}}),t;var d=t._soundById(o);if(d){if(!("number"==typeof e&&e>=0)){if(t._webAudio){var i=t.playing(o)?n.ctx.currentTime-d._playStart:0,_=d._rateSeek?d._rateSeek-d._seek:0;return d._seek+(_+i*Math.abs(d._rate))}return d._node.currentTime}var s=t.playing(o);s&&t.pause(o,!0),d._seek=e,d._ended=!1,t._clearTimer(o),t._webAudio||!d._node||isNaN(d._node.duration)||(d._node.currentTime=e);var l=function(){t._emit("seek",o),s&&t.play(o,!0)};if(s&&!t._webAudio){var c=function(){t._playLock?setTimeout(c,0):l()};setTimeout(c,0)}else l()}return t},playing:function(e){var n=this;if("number"==typeof e){var o=n._soundById(e);return!!o&&!o._paused}for(var t=0;t<n._sounds.length;t++)if(!n._sounds[t]._paused)return!0;return!1},duration:function(e){var n=this,o=n._duration,t=n._soundById(e);return t&&(o=n._sprite[t._sprite][1]/1e3),o},state:function(){return this._state},unload:function(){for(var e=this,o=e._sounds,t=0;t<o.length;t++)o[t]._paused||e.stop(o[t]._id),e._webAudio||(e._clearSound(o[t]._node),o[t]._node.removeEventListener("error",o[t]._errorFn,!1),o[t]._node.removeEventListener(n._canPlayEvent,o[t]._loadFn,!1),o[t]._node.removeEventListener("ended",o[t]._endFn,!1),n._releaseHtml5Audio(o[t]._node)),delete o[t]._node,e._clearTimer(o[t]._id);var a=n._howls.indexOf(e);a>=0&&n._howls.splice(a,1);var u=!0;for(t=0;t<n._howls.length;t++)if(n._howls[t]._src===e._src||e._src.indexOf(n._howls[t]._src)>=0){u=!1;break}return r&&u&&delete r[e._src],n.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,n,o,t){var r=this,a=r["_on"+e];return"function"==typeof n&&a.push(t?{id:o,fn:n,once:t}:{id:o,fn:n}),r},off:function(e,n,o){var t=this,r=t["_on"+e],a=0;if("number"==typeof n&&(o=n,n=null),n||o)for(a=0;a<r.length;a++){var u=o===r[a].id;if(n===r[a].fn&&u||!n&&u){r.splice(a,1);break}}else if(e)t["_on"+e]=[];else{var d=Object.keys(t);for(a=0;a<d.length;a++)0===d[a].indexOf("_on")&&Array.isArray(t[d[a]])&&(t[d[a]]=[])}return t},once:function(e,n,o){var t=this;return t.on(e,n,o,1),t},_emit:function(e,n,o){for(var t=this,r=t["_on"+e],a=r.length-1;a>=0;a--)r[a].id&&r[a].id!==n&&"load"!==e||(setTimeout(function(e){e.call(this,n,o)}.bind(t,r[a].fn),0),r[a].once&&t.off(e,r[a].fn,r[a].id));return t._loadQueue(e),t},_loadQueue:function(e){var n=this;if(n._queue.length>0){var o=n._queue[0];o.event===e&&(n._queue.shift(),n._loadQueue()),e||o.action()}return n},_ended:function(e){var o=this,t=e._sprite;if(!o._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime<e._stop)return setTimeout(o._ended.bind(o,e),100),o;var r=!(!e._loop&&!o._sprite[t][2]);if(o._emit("end",e._id),!o._webAudio&&r&&o.stop(e._id,!0).play(e._id),o._webAudio&&r){o._emit("play",e._id),e._seek=e._start||0,e._rateSeek=0,e._playStart=n.ctx.currentTime;var a=1e3*(e._stop-e._start)/Math.abs(e._rate);o._endTimers[e._id]=setTimeout(o._ended.bind(o,e),a)}return o._webAudio&&!r&&(e._paused=!0,e._ended=!0,e._seek=e._start||0,e._rateSeek=0,o._clearTimer(e._id),o._cleanBuffer(e._node),n._autoSuspend()),o._webAudio||r||o.stop(e._id,!0),o},_clearTimer:function(e){var n=this;if(n._endTimers[e]){if("function"!=typeof n._endTimers[e])clearTimeout(n._endTimers[e]);else{var o=n._soundById(e);o&&o._node&&o._node.removeEventListener("ended",n._endTimers[e],!1)}delete n._endTimers[e]}return n},_soundById:function(e){for(var n=this,o=0;o<n._sounds.length;o++)if(e===n._sounds[o]._id)return n._sounds[o];return null},_inactiveSound:function(){var e=this;e._drain();for(var n=0;n<e._sounds.length;n++)if(e._sounds[n]._ended)return e._sounds[n].reset();return new t(e)},_drain:function(){var e=this,n=e._pool,o=0,t=0;if(!(e._sounds.length<n)){for(t=0;t<e._sounds.length;t++)e._sounds[t]._ended&&o++;for(t=e._sounds.length-1;t>=0;t--){if(o<=n)return;e._sounds[t]._ended&&(e._webAudio&&e._sounds[t]._node&&e._sounds[t]._node.disconnect(0),e._sounds.splice(t,1),o--)}}},_getSoundIds:function(e){var n=this;if(void 0===e){for(var o=[],t=0;t<n._sounds.length;t++)o.push(n._sounds[t]._id);return o}return[e]},_refreshBuffer:function(e){var o=this;return e._node.bufferSource=n.ctx.createBufferSource(),e._node.bufferSource.buffer=r[o._src],e._panner?e._node.bufferSource.connect(e._panner):e._node.bufferSource.connect(e._node),e._node.bufferSource.loop=e._loop,e._loop&&(e._node.bufferSource.loopStart=e._start||0,e._node.bufferSource.loopEnd=e._stop||0),e._node.bufferSource.playbackRate.setValueAtTime(e._rate,n.ctx.currentTime),o},_cleanBuffer:function(e){var o=this,t=n._navigator&&n._navigator.vendor.indexOf("Apple")>=0;if(n._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=n._scratchBuffer}catch(e){}return e.bufferSource=null,o},_clearSound:function(e){/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var t=function(e){this._parent=e,this.init()};t.prototype={init:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,o._sounds.push(e),e.create(),e},create:function(){var e=this,o=e._parent,t=n._muted||e._muted||e._parent._muted?0:e._volume;return o._webAudio?(e._node=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),e._node.gain.setValueAtTime(t,n.ctx.currentTime),e._node.paused=!0,e._node.connect(n.masterGain)):n.noAudio||(e._node=n._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(n._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=o._src,e._node.preload=!0===o._preload?"auto":o._preload,e._node.volume=t*n.volume(),e._node.load()),e},reset:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,o=e._parent;o._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(o._sprite).length&&(o._sprite={__default:[0,1e3*o._duration]}),"loaded"!==o._state&&(o._state="loaded",o._emit("load"),o._loadQueue()),e._node.removeEventListener(n._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,n=e._parent;n._duration===1/0&&(n._duration=Math.ceil(10*e._node.duration)/10,n._sprite.__default[1]===1/0&&(n._sprite.__default[1]=1e3*n._duration),n._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var r={},a=function(e){var n=e._src;if(r[n])return e._duration=r[n].duration,void i(e);if(/^data:[^;]+;base64,/.test(n)){for(var o=atob(n.split(",")[1]),t=new Uint8Array(o.length),a=0;a<o.length;++a)t[a]=o.charCodeAt(a);d(t.buffer,e)}else{var _=new XMLHttpRequest;_.open(e._xhr.method,n,!0),_.withCredentials=e._xhr.withCredentials,_.responseType="arraybuffer",e._xhr.headers&&Object.keys(e._xhr.headers).forEach(function(n){_.setRequestHeader(n,e._xhr.headers[n])}),_.onload=function(){var n=(_.status+"")[0];if("0"!==n&&"2"!==n&&"3"!==n)return void e._emit("loaderror",null,"Failed loading audio file with status: "+_.status+".");d(_.response,e)},_.onerror=function(){e._webAudio&&(e._html5=!0,e._webAudio=!1,e._sounds=[],delete r[n],e.load())},u(_)}},u=function(e){try{e.send()}catch(n){e.onerror()}},d=function(e,o){var t=function(){o._emit("loaderror",null,"Decoding audio data failed.")},a=function(e){e&&o._sounds.length>0?(r[o._src]=e,i(o,e)):t()};"undefined"!=typeof Promise&&1===n.ctx.decodeAudioData.length?n.ctx.decodeAudioData(e).then(a).catch(t):n.ctx.decodeAudioData(e,a,t)},i=function(e,n){n&&!e._duration&&(e._duration=n.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},_=function(){if(n.usingWebAudio){try{"undefined"!=typeof AudioContext?n.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch(e){n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),o=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),t=o?parseInt(o[1],10):null;if(e&&t&&t<9){var r=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!r&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};"function"==typeof define&&define.amd&&define([],function(){return{Howler:n,Howl:o}}),"undefined"!=typeof exports&&(exports.Howler=n,exports.Howl=o),"undefined"!=typeof global?(global.HowlerGlobal=e,global.Howler=n,global.Howl=o,global.Sound=t):"undefined"!=typeof window&&(window.HowlerGlobal=e,window.Howler=n,window.Howl=o,window.Sound=t)}();
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8"/>
|
|
5
|
+
<link rel="manifest" href="manifest.webmanifest">
|
|
6
|
+
|
|
7
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
8
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
9
|
+
|
|
10
|
+
<meta name="theme-color" content="#000000" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
body {
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
background-color: #000000;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
#canvasArea {
|
|
21
|
+
margin-left: auto;
|
|
22
|
+
margin-right: auto;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* GDJS_CUSTOM_STYLE */
|
|
27
|
+
</style>
|
|
28
|
+
<!-- Libs and GDJS core files : -->
|
|
29
|
+
<!-- GDJS_CODE_FILES -->
|
|
30
|
+
|
|
31
|
+
</head>
|
|
32
|
+
<body>
|
|
33
|
+
|
|
34
|
+
<!-- GDJS_CUSTOM_HTML -->
|
|
35
|
+
<script>
|
|
36
|
+
|
|
37
|
+
(function() {
|
|
38
|
+
//Initialization
|
|
39
|
+
var game = new gdjs.RuntimeGame(gdjs.projectData, {}/*GDJS_ADDITIONAL_SPEC*/);
|
|
40
|
+
|
|
41
|
+
//Create a renderer
|
|
42
|
+
game.getRenderer().createStandardCanvas(document.body);
|
|
43
|
+
|
|
44
|
+
//Bind keyboards/mouse/touch events
|
|
45
|
+
game.getRenderer().bindStandardEvents(game.getInputManager(), window, document);
|
|
46
|
+
|
|
47
|
+
//Load all assets and start the game
|
|
48
|
+
game.loadAllAssets(function() {
|
|
49
|
+
game.startGameLoop();
|
|
50
|
+
});
|
|
51
|
+
})();
|
|
52
|
+
|
|
53
|
+
</script>
|
|
54
|
+
</body>
|
|
55
|
+
</html>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var gdjs;(r=>{class o{static MOUSE_LEFT_BUTTON=0;static MOUSE_RIGHT_BUTTON=1;static MOUSE_MIDDLE_BUTTON=2;static MOUSE_BACK_BUTTON=3;static MOUSE_FORWARD_BUTTON=4;static MOUSE_TOUCH_ID=1;static _DEFAULT_LEFT_VARIANT_KEYS=[16,17,18,91];_pressedKeys;_releasedKeys;_lastPressedKey=0;_pressedMouseButtons;_releasedMouseButtons;_cursorX=0;_cursorY=0;_mouseX=0;_mouseY=0;_isMouseInsideCanvas=!0;_mouseWheelDelta=0;_touches={firstKey:()=>{for(const e in this._mouseOrTouches.items)if(e!=="1")return e;return null}};_mouseOrTouches;_startedTouches=[];_endedTouches=[];_touchSimulateMouse=!0;_lastStartedTouchIndex=0;_lastEndedTouchIndex=0;constructor(){this._pressedKeys=new Hashtable,this._releasedKeys=new Hashtable,this._pressedMouseButtons=new Array(5),this._releasedMouseButtons=new Array(5),this._mouseOrTouches=new Hashtable}_getLocationAwareKeyCode(e,s){return s?96<=e&&e<=105?e:e+1e3*s:o._DEFAULT_LEFT_VARIANT_KEYS.indexOf(e)!==-1?e+1e3:e}onKeyPressed(e,s){const t=this._getLocationAwareKeyCode(e,s);this._pressedKeys.put(t,!0),this._lastPressedKey=t}onKeyReleased(e,s){const t=this._getLocationAwareKeyCode(e,s);this._pressedKeys.put(t,!1),this._releasedKeys.put(t,!0)}getLastPressedKey(){return this._lastPressedKey}isKeyPressed(e){return this._pressedKeys.containsKey(e)&&this._pressedKeys.get(e)}wasKeyReleased(e){return this._releasedKeys.containsKey(e)&&this._releasedKeys.get(e)}anyKeyPressed(){for(const e in this._pressedKeys.items)if(this._pressedKeys.items.hasOwnProperty(e)&&this._pressedKeys.items[e])return!0;return!1}anyKeyReleased(){for(const e in this._releasedKeys.items)if(this._releasedKeys.items.hasOwnProperty(e)&&this._releasedKeys.items[e])return!0;return!1}onMouseMove(e,s){this._setCursorPosition(e,s),this._mouseX=e,this._mouseY=s,this.isMouseButtonPressed(o.MOUSE_LEFT_BUTTON)&&this._moveTouch(o.MOUSE_TOUCH_ID,this.getCursorX(),this.getCursorY())}_setCursorPosition(e,s){this._cursorX=e,this._cursorY=s}getCursorX(){return this._cursorX}getCursorY(){return this._cursorY}getMouseX(){return this._mouseX}getMouseY(){return this._mouseY}onMouseLeave(){this._isMouseInsideCanvas=!1}onMouseEnter(){this._isMouseInsideCanvas=!0}isMouseInsideCanvas(){return this._isMouseInsideCanvas}onMouseButtonPressed(e){this._setMouseButtonPressed(e),e===o.MOUSE_LEFT_BUTTON&&this._addTouch(o.MOUSE_TOUCH_ID,this.getCursorX(),this.getCursorY())}_setMouseButtonPressed(e){this._pressedMouseButtons[e]=!0,this._releasedMouseButtons[e]=!1}onMouseButtonReleased(e){this._setMouseButtonReleased(e),e===o.MOUSE_LEFT_BUTTON&&this._removeTouch(o.MOUSE_TOUCH_ID)}_setMouseButtonReleased(e){this._pressedMouseButtons[e]=!1,this._releasedMouseButtons[e]=!0}isMouseButtonPressed(e){return this._pressedMouseButtons[e]!==void 0&&this._pressedMouseButtons[e]}isMouseButtonReleased(e){return this._releasedMouseButtons[e]!==void 0&&this._releasedMouseButtons[e]}onMouseWheel(e){this._mouseWheelDelta=e}getMouseWheelDelta(){return this._mouseWheelDelta}getTouchX(e){return this._mouseOrTouches.containsKey(e)?this._mouseOrTouches.get(e).x:0}getTouchY(e){return this._mouseOrTouches.containsKey(e)?this._mouseOrTouches.get(e).y:0}hasTouchEnded(e){return this._endedTouches.includes(e)&&this._mouseOrTouches.get(e).justEnded}getAllTouchIdentifiers(){o._allTouchIds.length=0;for(const e in this._mouseOrTouches.items)this._mouseOrTouches.items.hasOwnProperty(e)&&o._allTouchIds.push(parseInt(e,10));return o._allTouchIds}onTouchStart(e,s,t){this._addTouch(this.getPublicTouchIdentifier(e),s,t),this._touchSimulateMouse&&(this._setCursorPosition(s,t),this._setMouseButtonPressed(o.MOUSE_LEFT_BUTTON))}_addTouch(e,s,t){this._endedTouches.includes(e)||(this._startedTouches.push(e),this._mouseOrTouches.put(e,{x:s,y:t,justEnded:!1}))}onTouchMove(e,s,t){this._moveTouch(this.getPublicTouchIdentifier(e),s,t),this._touchSimulateMouse&&this._setCursorPosition(s,t)}_moveTouch(e,s,t){const u=this._mouseOrTouches.get(e);u&&(u.x=s,u.y=t)}onTouchEnd(e){this._removeTouch(this.getPublicTouchIdentifier(e)),this._touchSimulateMouse&&this._setMouseButtonReleased(o.MOUSE_LEFT_BUTTON)}onTouchCancel(e){this.onTouchEnd(e)}_removeTouch(e){this._endedTouches.push(e),this._mouseOrTouches.containsKey(e)&&(this._mouseOrTouches.get(e).justEnded=!0)}getPublicTouchIdentifier(e){return e+2}getStartedTouchIdentifiers(){return this._startedTouches}popStartedTouch(){const e=this._startedTouches[this._lastStartedTouchIndex];return this._lastStartedTouchIndex++,e}popEndedTouch(){const e=this._endedTouches[this._lastEndedTouchIndex];return this._lastEndedTouchIndex++,e}touchSimulateMouse(e){e===void 0&&(e=!0),this._touchSimulateMouse=e}isSimulatingMouseWithTouch(){return this._touchSimulateMouse}onFrameEnded(){for(const e in this._mouseOrTouches.items)this._mouseOrTouches.items.hasOwnProperty(e)&&this._mouseOrTouches.items[e].justEnded&&this._mouseOrTouches.remove(e);this._startedTouches.length=0,this._endedTouches.length=0,this._releasedKeys.clear(),this._releasedMouseButtons.length=0,this._mouseWheelDelta=0,this._lastStartedTouchIndex=0,this._lastEndedTouchIndex=0}isScrollingUp(){return this.getMouseWheelDelta()>0}isScrollingDown(){return this.getMouseWheelDelta()<0}static _allTouchIds=[]}r.InputManager=o})(gdjs||={});
|
|
2
|
+
//# sourceMappingURL=inputmanager.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../GDevelop/GDJS/Runtime/inputmanager.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * GDevelop JS Platform\n * Copyright 2013-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.\n * This project is released under the MIT License.\n */\nnamespace gdjs {\n type Touch = { x: float; y: float; justEnded: boolean };\n\n /**\n * Store input made on a canvas: mouse position, key pressed\n * and touches states.\n */\n export class InputManager {\n static MOUSE_LEFT_BUTTON: integer = 0;\n static MOUSE_RIGHT_BUTTON: integer = 1;\n static MOUSE_MIDDLE_BUTTON: integer = 2;\n static MOUSE_BACK_BUTTON: integer = 3;\n static MOUSE_FORWARD_BUTTON: integer = 4;\n static MOUSE_TOUCH_ID: integer = 1;\n\n /**\n * Holds the raw keyCodes of the keys which only have left/right\n * variants and should default to their left variant values\n * if location is not specified.\n */\n static _DEFAULT_LEFT_VARIANT_KEYS: integer[] = [16, 17, 18, 91];\n _pressedKeys: Hashtable<boolean>;\n _releasedKeys: Hashtable<boolean>;\n _lastPressedKey: float = 0;\n _pressedMouseButtons: Array<boolean>;\n _releasedMouseButtons: Array<boolean>;\n /**\n * The cursor X position (moved by mouse and touch events).\n */\n _cursorX: float = 0;\n /**\n * The cursor Y position (moved by mouse and touch events).\n */\n _cursorY: float = 0;\n /**\n * The mouse X position (only moved by mouse events).\n */\n _mouseX: float = 0;\n /**\n * The mouse Y position (only moved by mouse events).\n */\n _mouseY: float = 0;\n _isMouseInsideCanvas: boolean = true;\n _mouseWheelDelta: float = 0;\n // TODO Remove _touches when there is no longer SpritePanelButton 1.2.0\n // extension in the wild.\n _touches = {\n firstKey: (): string | number | null => {\n for (const key in this._mouseOrTouches.items) {\n // Exclude mouse key.\n if (key !== '1') {\n return key;\n }\n }\n return null;\n },\n };\n _mouseOrTouches: Hashtable<Touch>;\n //Identifiers of the touches that started during/before the frame.\n _startedTouches: Array<integer> = [];\n\n //Identifiers of the touches that ended during/before the frame.\n _endedTouches: Array<integer> = [];\n _touchSimulateMouse: boolean = true;\n\n /**\n * @deprecated\n */\n _lastStartedTouchIndex = 0;\n /**\n * @deprecated\n */\n _lastEndedTouchIndex = 0;\n\n constructor() {\n this._pressedKeys = new Hashtable();\n this._releasedKeys = new Hashtable();\n this._pressedMouseButtons = new Array(5);\n this._releasedMouseButtons = new Array(5);\n this._mouseOrTouches = new Hashtable();\n }\n\n /**\n * Returns the \"location-aware\" keyCode, given a raw keyCode\n * and location. The location corresponds to KeyboardEvent.location,\n * which should be 0 for standard keys, 1 for left keys,\n * 2 for right keys, and 3 for numpad keys.\n *\n * @param keyCode The raw key code\n * @param location The location\n */\n _getLocationAwareKeyCode(\n keyCode: number,\n location: number | null | undefined\n ): integer {\n if (location) {\n // If it is a numpad number, do not modify it.\n if (96 <= keyCode && keyCode <= 105) {\n return keyCode;\n }\n return keyCode + 1000 * location;\n }\n if (InputManager._DEFAULT_LEFT_VARIANT_KEYS.indexOf(keyCode) !== -1) {\n return keyCode + 1000;\n }\n return keyCode;\n }\n\n /**\n * Should be called whenever a key is pressed. The location corresponds to\n * KeyboardEvent.location, which should be 0 for standard keys, 1 for left keys,\n * 2 for right keys, and 3 for numpad keys.\n * @param keyCode The raw key code associated to the key press.\n * @param location The location of the event.\n */\n onKeyPressed(keyCode: number, location?: number): void {\n const locationAwareKeyCode = this._getLocationAwareKeyCode(\n keyCode,\n location\n );\n this._pressedKeys.put(locationAwareKeyCode, true);\n this._lastPressedKey = locationAwareKeyCode;\n }\n\n /**\n * Should be called whenever a key is released. The location corresponds to\n * KeyboardEvent.location, which should be 0 for standard keys, 1 for left keys,\n * 2 for right keys, and 3 for numpad keys.\n * @param keyCode The raw key code associated to the key release.\n * @param location The location of the event.\n */\n onKeyReleased(keyCode: number, location?: number): void {\n const locationAwareKeyCode = this._getLocationAwareKeyCode(\n keyCode,\n location\n );\n this._pressedKeys.put(locationAwareKeyCode, false);\n this._releasedKeys.put(locationAwareKeyCode, true);\n }\n\n /**\n * Return the location-aware code of the last key that was pressed.\n * @return The location-aware code of the last key pressed.\n */\n getLastPressedKey(): number {\n return this._lastPressedKey;\n }\n\n /**\n * Return true if the key corresponding to the location-aware keyCode is pressed.\n * @param locationAwareKeyCode The location-aware key code to be tested.\n */\n isKeyPressed(locationAwareKeyCode: number): boolean {\n return (\n this._pressedKeys.containsKey(locationAwareKeyCode) &&\n this._pressedKeys.get(locationAwareKeyCode)\n );\n }\n\n /**\n * Return true if the key corresponding to the location-aware keyCode was released during the last frame.\n * @param locationAwareKeyCode The location-aware key code to be tested.\n */\n wasKeyReleased(locationAwareKeyCode: number) {\n return (\n this._releasedKeys.containsKey(locationAwareKeyCode) &&\n this._releasedKeys.get(locationAwareKeyCode)\n );\n }\n\n /**\n * Return true if any key is pressed.\n * @return true if any key is pressed.\n */\n anyKeyPressed(): boolean {\n for (const keyCode in this._pressedKeys.items) {\n if (this._pressedKeys.items.hasOwnProperty(keyCode)) {\n if (this._pressedKeys.items[keyCode]) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Return true if any key is released.\n * @return true if any key is released.\n */\n anyKeyReleased(): boolean {\n for (const keyCode in this._releasedKeys.items) {\n if (this._releasedKeys.items.hasOwnProperty(keyCode)) {\n if (this._releasedKeys.items[keyCode]) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * Should be called when the mouse is moved.\n *\n * Please note that the coordinates must be expressed relative to the view position.\n *\n * @param x The mouse new X position\n * @param y The mouse new Y position\n */\n onMouseMove(x: float, y: float): void {\n this._setCursorPosition(x, y);\n this._mouseX = x;\n this._mouseY = y;\n if (this.isMouseButtonPressed(InputManager.MOUSE_LEFT_BUTTON)) {\n this._moveTouch(\n InputManager.MOUSE_TOUCH_ID,\n this.getCursorX(),\n this.getCursorY()\n );\n }\n }\n\n _setCursorPosition(x: float, y: float): void {\n this._cursorX = x;\n this._cursorY = y;\n }\n\n /**\n * Get the cursor X position.\n * The cursor is moved by mouse and touch events.\n *\n * @return the cursor X position, relative to the game view.\n */\n getCursorX(): float {\n return this._cursorX;\n }\n\n /**\n * Get the cursor Y position.\n * The cursor is moved by mouse and touch events.\n *\n * @return the cursor Y position, relative to the game view.\n */\n getCursorY(): float {\n return this._cursorY;\n }\n\n /**\n * Get the mouse X position.\n *\n * @return the mouse X position, relative to the game view.\n */\n getMouseX(): float {\n return this._mouseX;\n }\n\n /**\n * Get the mouse Y position.\n *\n * @return the mouse Y position, relative to the game view.\n */\n getMouseY(): float {\n return this._mouseY;\n }\n\n /**\n * Should be called when the mouse leave the canvas.\n */\n onMouseLeave(): void {\n this._isMouseInsideCanvas = false;\n }\n\n /**\n * Should be called when the mouse enter the canvas.\n */\n onMouseEnter(): void {\n this._isMouseInsideCanvas = true;\n }\n\n /**\n * @return true when the mouse is inside the canvas.\n */\n isMouseInsideCanvas(): boolean {\n return this._isMouseInsideCanvas;\n }\n\n /**\n * Should be called whenever a mouse button is pressed.\n * @param buttonCode The mouse button code associated to the event.\n * See InputManager.MOUSE_LEFT_BUTTON, InputManager.MOUSE_RIGHT_BUTTON, InputManager.MOUSE_MIDDLE_BUTTON\n */\n onMouseButtonPressed(buttonCode: number): void {\n this._setMouseButtonPressed(buttonCode);\n if (buttonCode === InputManager.MOUSE_LEFT_BUTTON) {\n this._addTouch(\n InputManager.MOUSE_TOUCH_ID,\n this.getCursorX(),\n this.getCursorY()\n );\n }\n }\n\n _setMouseButtonPressed(buttonCode: number): void {\n this._pressedMouseButtons[buttonCode] = true;\n this._releasedMouseButtons[buttonCode] = false;\n }\n\n /**\n * Should be called whenever a mouse button is released.\n * @param buttonCode The mouse button code associated to the event. (see onMouseButtonPressed)\n */\n onMouseButtonReleased(buttonCode: number): void {\n this._setMouseButtonReleased(buttonCode);\n if (buttonCode === InputManager.MOUSE_LEFT_BUTTON) {\n this._removeTouch(InputManager.MOUSE_TOUCH_ID);\n }\n }\n\n _setMouseButtonReleased(buttonCode: number): void {\n this._pressedMouseButtons[buttonCode] = false;\n this._releasedMouseButtons[buttonCode] = true;\n }\n\n /**\n * Return true if the mouse button corresponding to buttonCode is pressed.\n * @param buttonCode The mouse button code (0: Left button, 1: Right button).\n */\n isMouseButtonPressed(buttonCode: number): boolean {\n return (\n this._pressedMouseButtons[buttonCode] !== undefined &&\n this._pressedMouseButtons[buttonCode]\n );\n }\n\n /**\n * Return true if the mouse button corresponding to buttonCode was just released.\n * @param buttonCode The mouse button code (0: Left button, 1: Right button).\n */\n isMouseButtonReleased(buttonCode: number): boolean {\n return (\n this._releasedMouseButtons[buttonCode] !== undefined &&\n this._releasedMouseButtons[buttonCode]\n );\n }\n\n /**\n * Should be called whenever the mouse wheel is used\n * @param wheelDelta The mouse wheel delta\n */\n onMouseWheel(wheelDelta: number): void {\n this._mouseWheelDelta = wheelDelta;\n }\n\n /**\n * Return the mouse wheel delta\n */\n getMouseWheelDelta(): float {\n return this._mouseWheelDelta;\n }\n\n /**\n * Get a touch X position.\n *\n * @return the touch X position, relative to the game view.\n */\n getTouchX(publicIdentifier: integer): float {\n if (!this._mouseOrTouches.containsKey(publicIdentifier)) {\n return 0;\n }\n return this._mouseOrTouches.get(publicIdentifier).x;\n }\n\n /**\n * Get a touch Y position.\n *\n * @return the touch Y position, relative to the game view.\n */\n getTouchY(publicIdentifier: integer): float {\n if (!this._mouseOrTouches.containsKey(publicIdentifier)) {\n return 0;\n }\n return this._mouseOrTouches.get(publicIdentifier).y;\n }\n\n /**\n * @param publicIdentifier the touch identifier\n * @returns true if the touch has just ended.\n */\n hasTouchEnded(publicIdentifier: integer): boolean {\n return (\n this._endedTouches.includes(publicIdentifier) &&\n // A touch that end then start in one frame is ignored\n // because it's probably noise.\n this._mouseOrTouches.get(publicIdentifier).justEnded\n );\n }\n\n /**\n * Update and return the array containing the identifiers of all touches.\n */\n getAllTouchIdentifiers(): Array<integer> {\n InputManager._allTouchIds.length = 0;\n for (const id in this._mouseOrTouches.items) {\n if (this._mouseOrTouches.items.hasOwnProperty(id)) {\n InputManager._allTouchIds.push(parseInt(id, 10));\n }\n }\n return InputManager._allTouchIds;\n }\n\n onTouchStart(rawIdentifier: integer, x: float, y: float): void {\n this._addTouch(this.getPublicTouchIdentifier(rawIdentifier), x, y);\n if (this._touchSimulateMouse) {\n this._setCursorPosition(x, y);\n this._setMouseButtonPressed(InputManager.MOUSE_LEFT_BUTTON);\n }\n }\n\n _addTouch(publicIdentifier: integer, x: float, y: float): void {\n // A touch that end then start in one frame is ignored\n // because it's probably noise.\n if (!this._endedTouches.includes(publicIdentifier)) {\n this._startedTouches.push(publicIdentifier);\n this._mouseOrTouches.put(publicIdentifier, {\n x: x,\n y: y,\n justEnded: false,\n });\n }\n }\n\n onTouchMove(rawIdentifier: integer, x: float, y: float): void {\n this._moveTouch(this.getPublicTouchIdentifier(rawIdentifier), x, y);\n if (this._touchSimulateMouse) {\n this._setCursorPosition(x, y);\n }\n }\n\n _moveTouch(publicIdentifier: integer, x: float, y: float): void {\n const touch = this._mouseOrTouches.get(publicIdentifier);\n if (!touch) {\n return;\n }\n touch.x = x;\n touch.y = y;\n }\n\n onTouchEnd(rawIdentifier: number): void {\n this._removeTouch(this.getPublicTouchIdentifier(rawIdentifier));\n if (this._touchSimulateMouse) {\n this._setMouseButtonReleased(InputManager.MOUSE_LEFT_BUTTON);\n }\n }\n\n onTouchCancel(rawIdentifier: number): void {\n // Don't do anything specific for canceled touches to avoid to make\n // touches handling more complex for users.\n this.onTouchEnd(rawIdentifier);\n }\n\n _removeTouch(publicIdentifier: number): void {\n this._endedTouches.push(publicIdentifier);\n if (this._mouseOrTouches.containsKey(publicIdentifier)) {\n //Postpone deletion at the end of the frame\n this._mouseOrTouches.get(publicIdentifier).justEnded = true;\n }\n }\n\n /**\n * Add 2 to the identifier to avoid identifiers taking the GDevelop default\n * variable value which is 0 and reserve 1 for the mouse.\n * @param rawIdentifier The identifier given by the browser.\n * @returns The identifier used in events.\n */\n private getPublicTouchIdentifier(rawIdentifier: integer): integer {\n return rawIdentifier + 2;\n }\n\n getStartedTouchIdentifiers(): integer[] {\n return this._startedTouches;\n }\n\n /**\n * @deprecated\n */\n popStartedTouch(): integer | undefined {\n const publicIdentifier = this._startedTouches[\n this._lastStartedTouchIndex\n ];\n this._lastStartedTouchIndex++;\n return publicIdentifier;\n }\n\n /**\n * @deprecated\n */\n popEndedTouch(): integer | undefined {\n const publicIdentifier = this._endedTouches[this._lastEndedTouchIndex];\n this._lastEndedTouchIndex++;\n return publicIdentifier;\n }\n\n /**\n * Set if touch events should simulate mouse events.\n *\n * If true, any touch will move the mouse position and set mouse buttons\n * as pressed/released.\n * @param enable true to simulate mouse events, false to disable it.\n */\n touchSimulateMouse(enable: boolean): void {\n if (enable === undefined) {\n enable = true;\n }\n this._touchSimulateMouse = enable;\n }\n\n /**\n * @returns true if the touch events are used to simulate mouse events.\n */\n isSimulatingMouseWithTouch(): boolean {\n return this._touchSimulateMouse;\n }\n\n /**\n * Notify the input manager that the frame ended, so anything that last\n * only for one frame (started/ended touches) should be reset.\n *\n * This method should be called in the game loop (see `gdjs.RuntimeGame.startGameLoop`).\n * You don't need to call it otherwise.\n */\n onFrameEnded(): void {\n //Only clear the ended touches at the end of the frame.\n for (const id in this._mouseOrTouches.items) {\n if (this._mouseOrTouches.items.hasOwnProperty(id)) {\n const touch = this._mouseOrTouches.items[id];\n if (touch.justEnded) {\n this._mouseOrTouches.remove(id);\n }\n }\n }\n this._startedTouches.length = 0;\n this._endedTouches.length = 0;\n this._releasedKeys.clear();\n this._releasedMouseButtons.length = 0;\n this._mouseWheelDelta = 0;\n this._lastStartedTouchIndex = 0;\n this._lastEndedTouchIndex = 0;\n }\n\n /**\n * Return true if the mouse wheel scroll to up\n */\n isScrollingUp(): boolean {\n return this.getMouseWheelDelta() > 0;\n }\n\n /**\n * Return true if the mouse wheel scroll to down\n */\n isScrollingDown(): boolean {\n return this.getMouseWheelDelta() < 0;\n }\n\n static _allTouchIds: Array<integer> = [];\n }\n}\n"],
|
|
5
|
+
"mappings": "AAKA,IAAU,MAAAA,GAAV,CAOS,MAAMC,CAAa,CACxB,OAAO,kBAA6B,EACpC,OAAO,mBAA8B,EACrC,OAAO,oBAA+B,EACtC,OAAO,kBAA6B,EACpC,OAAO,qBAAgC,EACvC,OAAO,eAA0B,EAOjC,OAAO,2BAAwC,CAAC,GAAI,GAAI,GAAI,EAAE,EAC9D,aACA,cACA,gBAAyB,EACzB,qBACA,sBAIA,SAAkB,EAIlB,SAAkB,EAIlB,QAAiB,EAIjB,QAAiB,EACjB,qBAAgC,GAChC,iBAA0B,EAG1B,SAAW,CACT,SAAU,IAA8B,CACtC,UAAWC,KAAO,KAAK,gBAAgB,MAErC,GAAIA,IAAQ,IACV,OAAOA,EAGX,OAAO,IACT,CACF,EACA,gBAEA,gBAAkC,CAAC,EAGnC,cAAgC,CAAC,EACjC,oBAA+B,GAK/B,uBAAyB,EAIzB,qBAAuB,EAEvB,aAAc,CACZ,KAAK,aAAe,IAAI,UACxB,KAAK,cAAgB,IAAI,UACzB,KAAK,qBAAuB,IAAI,MAAM,CAAC,EACvC,KAAK,sBAAwB,IAAI,MAAM,CAAC,EACxC,KAAK,gBAAkB,IAAI,SAC7B,CAWA,yBACEC,EACAC,EACS,CACT,OAAIA,EAEE,IAAMD,GAAWA,GAAW,IACvBA,EAEFA,EAAU,IAAOC,EAEtBH,EAAa,2BAA2B,QAAQE,CAAO,IAAM,GACxDA,EAAU,IAEZA,CACT,CASA,aAAaA,EAAiBC,EAAyB,CACrD,MAAMC,EAAuB,KAAK,yBAChCF,EACAC,CACF,EACA,KAAK,aAAa,IAAIC,EAAsB,EAAI,EAChD,KAAK,gBAAkBA,CACzB,CASA,cAAcF,EAAiBC,EAAyB,CACtD,M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AAK,oBAAoB,EACrE,YAAK,uBACEA,CACT,CASA,mBAAmBI,EAAuB,CACpCA,IAAW,SACbA,EAAS,IAEX,KAAK,oBAAsBA,CAC7B,CAKA,4BAAsC,CACpC,OAAO,KAAK,mBACd,CASA,cAAqB,CAEnB,UAAWH,KAAM,KAAK,gBAAgB,MAChC,KAAK,gBAAgB,MAAM,eAAeA,CAAE,GAChC,KAAK,gBAAgB,MAAMA,CAAE,EACjC,WACR,KAAK,gBAAgB,OAAOA,CAAE,EAIpC,KAAK,gBAAgB,OAAS,EAC9B,KAAK,cAAc,OAAS,EAC5B,KAAK,cAAc,MAAM,EACzB,KAAK,sBAAsB,OAAS,EACpC,KAAK,iBAAmB,EACxB,KAAK,uBAAyB,EAC9B,KAAK,qBAAuB,CAC9B,CAKA,eAAyB,CACvB,OAAO,KAAK,mBAAmB,EAAI,CACrC,CAKA,iBAA2B,CACzB,OAAO,KAAK,mBAAmB,EAAI,CACrC,CAEA,OAAO,aAA+B,CAAC,CACzC,CA3iBOX,EAAM,aAAAC,IAPL",
|
|
6
|
+
"names": ["gdjs", "InputManager", "key", "keyCode", "location", "locationAwareKeyCode", "x", "y", "buttonCode", "wheelDelta", "publicIdentifier", "id", "rawIdentifier", "touch", "enable"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var gdjs;(i=>{const a=new i.Logger("JSON Manager");class c{_resourcesLoader;_resources;_loadedJsons={};_callbacks={};constructor(e,l){this._resources=e,this._resourcesLoader=l}setResources(e){this._resources=e}preloadJsons(e,l){const t=this._resources.filter(function(s){return(s.kind==="json"||s.kind==="tilemap"||s.kind==="tileset")&&!s.disablePreload});if(t.length===0)return l(t.length);let o=0;const n=function(s){s&&a.error("Error while preloading a json resource:"+s),o++,o===t.length?l(t.length):e(o,t.length)};for(let s=0;s<t.length;++s)this.loadJson(t[s].name,n)}loadJson(e,l){const r=this._resources.find(function(n){return(n.kind==="json"||n.kind==="tilemap"||n.kind==="tileset")&&n.name===e});if(!r){l(new Error(`Can't find resource with name: "`+e+'" (or is not a json resource).'),null);return}if(this._loadedJsons[e]){l(null,this._loadedJsons[e]);return}{const n=this._callbacks[e];if(n){n.push(l);return}else this._callbacks[e]=[l]}const t=this,o=new XMLHttpRequest;o.responseType="json",o.withCredentials=this._resourcesLoader.checkIfCredentialsRequired(r.file),o.open("GET",this._resourcesLoader.getFullUrl(r.file)),o.onload=function(){const n=t._callbacks[e];if(n){if(o.status!==200){for(const s of n)s(new Error("HTTP error: "+o.status+"("+o.statusText+")"),null);delete t._callbacks[e];return}t._loadedJsons[e]=o.response;for(const s of n)s(null,o.response);delete t._callbacks[e]}},o.onerror=function(){const n=t._callbacks[e];if(n){for(const s of n)s(new Error("Network error"),null);delete t._callbacks[e]}},o.onabort=function(){const n=t._callbacks[e];if(n){for(const s of n)s(new Error("Request aborted"),null);delete t._callbacks[e]}},o.send()}isJsonLoaded(e){return!!this._loadedJsons[e]}getLoadedJson(e){return this._loadedJsons[e]||null}}i.JsonManager=c})(gdjs||={});
|
|
2
|
+
//# sourceMappingURL=jsonmanager.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../GDevelop/GDJS/Runtime/jsonmanager.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * GDevelop JS Platform\n * Copyright 2013-present Florian Rival (Florian.Rival@gmail.com). All rights reserved.\n * This project is released under the MIT License.\n */\nnamespace gdjs {\n const logger = new gdjs.Logger('JSON Manager');\n type JsonManagerOnProgressCallback = (\n loadedCount: integer,\n totalCount: integer\n ) => void;\n type JsonManagerOnCompleteCallback = (totalCount: integer) => void;\n\n /** The callback called when a json that was requested is loaded (or an error occurred). */\n export type JsonManagerRequestCallback = (\n error: Error | null,\n content: Object | null\n ) => void;\n\n /**\n * JsonManager loads json files (using `XMLHttpRequest`), using the \"json\" resources\n * registered in the game resources.\n *\n * Contrary to audio/fonts, json files are loaded asynchronously, when requested.\n * You should properly handle errors, and give the developer/player a way to know\n * that loading failed.\n */\n export class JsonManager {\n _resourcesLoader: RuntimeGameResourcesLoader;\n _resources: ResourceData[];\n\n _loadedJsons: { [key: string]: Object } = {};\n _callbacks: { [key: string]: Array<JsonManagerRequestCallback> } = {};\n\n /**\n * @param resources The resources data of the game.\n * @param resourcesLoader The resources loader of the game.\n */\n constructor(\n resources: ResourceData[],\n resourcesLoader: RuntimeGameResourcesLoader\n ) {\n this._resources = resources;\n this._resourcesLoader = resourcesLoader;\n }\n\n /**\n * Update the resources data of the game. Useful for hot-reloading, should not be used otherwise.\n *\n * @param resources The resources data of the game.\n */\n setResources(resources: ResourceData[]): void {\n this._resources = resources;\n }\n\n /**\n * Request all the json resources to be preloaded (unless they are marked as not preloaded).\n *\n * Note that even if a JSON is already loaded, it will be reloaded (useful for hot-reloading,\n * as JSON files can have been modified without the editor knowing).\n *\n * @param onProgress The function called after each json is loaded.\n * @param onComplete The function called when all jsons are loaded.\n */\n preloadJsons(\n onProgress: JsonManagerOnProgressCallback,\n onComplete: JsonManagerOnCompleteCallback\n ): void {\n const resources = this._resources;\n const jsonResources = resources.filter(function (resource) {\n return (\n (resource.kind === 'json' ||\n resource.kind === 'tilemap' ||\n resource.kind === 'tileset') &&\n !resource.disablePreload\n );\n });\n if (jsonResources.length === 0) {\n return onComplete(jsonResources.length);\n }\n let loaded = 0;\n\n const onLoad: JsonManagerRequestCallback = function (error) {\n if (error) {\n logger.error('Error while preloading a json resource:' + error);\n }\n loaded++;\n if (loaded === jsonResources.length) {\n onComplete(jsonResources.length);\n } else {\n onProgress(loaded, jsonResources.length);\n }\n };\n for (let i = 0; i < jsonResources.length; ++i) {\n this.loadJson(jsonResources[i].name, onLoad);\n }\n }\n\n /**\n * Request the json file from the given resource name.\n * This method is asynchronous. When loaded, the `callback` is called with the error\n * (null if none) and the loaded json (a JS Object).\n *\n * @param resourceName The resource pointing to the json file to load.\n * @param callback The callback function called when json is loaded (or an error occurred).\n */\n loadJson(resourceName: string, callback: JsonManagerRequestCallback): void {\n const resource = this._resources.find(function (resource) {\n return (\n (resource.kind === 'json' ||\n resource.kind === 'tilemap' ||\n resource.kind === 'tileset') &&\n resource.name === resourceName\n );\n });\n if (!resource) {\n callback(\n new Error(\n 'Can\\'t find resource with name: \"' +\n resourceName +\n '\" (or is not a json resource).'\n ),\n null\n );\n return;\n }\n\n // Don't fetch again an object that is already in memory\n if (this._loadedJsons[resourceName]) {\n callback(null, this._loadedJsons[resourceName]);\n return;\n }\n // Don't fetch again an object that is already being fetched.\n {\n const callbacks = this._callbacks[resourceName];\n if (callbacks) {\n callbacks.push(callback);\n return;\n } else {\n this._callbacks[resourceName] = [callback];\n }\n }\n const that = this;\n const xhr = new XMLHttpRequest();\n xhr.responseType = 'json';\n xhr.withCredentials = this._resourcesLoader.checkIfCredentialsRequired(\n resource.file\n );\n xhr.open('GET', this._resourcesLoader.getFullUrl(resource.file));\n xhr.onload = function () {\n const callbacks = that._callbacks[resourceName];\n if (!callbacks) {\n return;\n }\n if (xhr.status !== 200) {\n for (const callback of callbacks) {\n callback(\n new Error(\n 'HTTP error: ' + xhr.status + '(' + xhr.statusText + ')'\n ),\n null\n );\n }\n delete that._callbacks[resourceName];\n return;\n }\n\n // Cache the result\n that._loadedJsons[resourceName] = xhr.response;\n for (const callback of callbacks) {\n callback(null, xhr.response);\n }\n delete that._callbacks[resourceName];\n };\n xhr.onerror = function () {\n const callbacks = that._callbacks[resourceName];\n if (!callbacks) {\n return;\n }\n for (const callback of callbacks) {\n callback(new Error('Network error'), null);\n }\n delete that._callbacks[resourceName];\n };\n xhr.onabort = function () {\n const callbacks = that._callbacks[resourceName];\n if (!callbacks) {\n return;\n }\n for (const callback of callbacks) {\n callback(new Error('Request aborted'), null);\n }\n delete that._callbacks[resourceName];\n };\n xhr.send();\n }\n\n /**\n * Check if the given json resource was loaded (preloaded or loaded with `loadJson`).\n * @param resourceName The name of the json resource.\n * @returns true if the content of the json resource is loaded. false otherwise.\n */\n isJsonLoaded(resourceName: string): boolean {\n return !!this._loadedJsons[resourceName];\n }\n\n /**\n * Get the object for the given resource that is already loaded (preloaded or loaded with `loadJson`).\n * If the resource is not loaded, `null` will be returned.\n *\n * @param resourceName The name of the json resource.\n * @returns the content of the json resource, if loaded. `null` otherwise.\n */\n getLoadedJson(resourceName: string): Object | null {\n return this._loadedJsons[resourceName] || null;\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAKA,IAAU,MAAAA,GAAV,CACE,MAAMC,EAAS,IAAID,EAAK,OAAO,cAAc,EAqBtC,MAAME,CAAY,CACvB,iBACA,WAEA,aAA0C,CAAC,EAC3C,WAAmE,CAAC,EAMpE,YACEC,EACAC,EACA,CACA,KAAK,WAAaD,EAClB,KAAK,iBAAmBC,CAC1B,CAOA,aAAaD,EAAiC,CAC5C,KAAK,WAAaA,CACpB,CAWA,aACEE,EACAC,EACM,CAEN,MAAMC,EADY,KAAK,WACS,OAAO,SAAUC,EAAU,CACzD,OACGA,EAAS,OAAS,QACjBA,EAAS,OAAS,WAClBA,EAAS,OAAS,YACpB,CAACA,EAAS,cAEd,CAAC,EACD,GAAID,EAAc,SAAW,EAC3B,OAAOD,EAAWC,EAAc,MAAM,EAExC,IAAIE,EAAS,EAEb,MAAMC,EAAqC,SAAUC,EAAO,CACtDA,GACFV,EAAO,MAAM,0CAA4CU,CAAK,EAEhEF,IACIA,IAAWF,EAAc,OAC3BD,EAAWC,EAAc,MAAM,EAE/BF,EAAWI,EAAQF,EAAc,MAAM,CAE3C,EACA,QAASK,EAAI,EAAGA,EAAIL,EAAc,OAAQ,EAAEK,EAC1C,KAAK,SAASL,EAAcK,CAAC,EAAE,KAAMF,CAAM,CAE/C,CAUA,SAASG,EAAsBC,EAA4C,CACzE,MAAMN,EAAW,KAAK,WAAW,KAAK,SAAUA,EAAU,CACxD,OACGA,EAAS,OAAS,QACjBA,EAAS,OAAS,WAClBA,EAAS,OAAS,YACpBA,EAAS,OAASK,CAEtB,CAAC,EACD,GAAI,CA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,EACrC,EACAI,EAAI,KAAK,CACX,CAOA,aAAaJ,EAA+B,CAC1C,MAAO,CAAC,CAAC,KAAK,aAAaA,CAAY,CACzC,CASA,cAAcA,EAAqC,CACjD,OAAO,KAAK,aAAaA,CAAY,GAAK,IAC5C,CACF,CA7LOb,EAAM,YAAAE,IAtBL",
|
|
6
|
+
"names": ["gdjs", "logger", "JsonManager", "resources", "resourcesLoader", "onProgress", "onComplete", "jsonResources", "resource", "loaded", "onLoad", "error", "i", "resourceName", "callback", "callbacks", "that", "xhr"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var gdjs;(m=>{class c extends m.RuntimeLayer{_cameraRotation=0;_zoomFactor=1;_cameraX;_cameraY;_cameraZ=0;_isCameraZDirty=!0;constructor(t,e){super(t,e),this._cameraX=this.getWidth()/2,this._cameraY=this.getHeight()/2,this._renderer.onCreated()}onGameResolutionResized(t,e){this._cameraX+=this._runtimeScene.getViewportOriginX()-t,this._cameraY+=this._runtimeScene.getViewportOriginY()-e,this._renderer.updatePosition()}getCameraX(t){return this._forceDimensionUpdate(),this._cameraX}getCameraY(t){return this._forceDimensionUpdate(),this._cameraY}setCameraX(t,e){this._forceDimensionUpdate(),this._cameraX=t,this._renderer.updatePosition()}setCameraY(t,e){this._forceDimensionUpdate(),this._cameraY=t,this._renderer.updatePosition()}getCameraWidth(t){return this.getWidth()/this._zoomFactor}getCameraHeight(t){return this.getHeight()/this._zoomFactor}setCameraZoom(t,e){this._zoomFactor=t,this._isCameraZDirty=!0,this._renderer.updatePosition()}getCameraZoom(t){return this._zoomFactor}setCameraZ(t,e=45,i){const o=m.toRad(e),a=Math.min(Number.MAX_SAFE_INTEGER,.5*this.getHeight()/(t*Math.tan(.5*o)));a>0&&(this._zoomFactor=a),this._cameraZ=t,this._isCameraZDirty=!1,this._renderer.updatePosition()}getCameraZ(t=45,e){return this._isCameraZDirty?.5*this.getHeight()/this.getCameraZoom()/Math.tan(.5*m.toRad(t)):this._cameraZ}getCameraRotation(t){return this._cameraRotation}setCameraRotation(t,e){this._cameraRotation=t,this._renderer.updatePosition()}convertCoords(t,e,i=0,o){let a=o||[0,0];if(this._renderer.isCameraRotatedIn3D())return this._renderer.transformTo3DWorld(t,e,0,i,o);t-=this.getRuntimeScene()._cachedGameResolutionWidth/2,e-=this.getRuntimeScene()._cachedGameResolutionHeight/2,t/=Math.abs(this._zoomFactor),e/=Math.abs(this._zoomFactor);const n=this._cameraRotation/180*Math.PI,s=t,r=Math.cos(n),h=Math.sin(n);return t=r*t-h*e,e=h*s+r*e,a[0]=t+this.getCameraX(i),a[1]=e+this.getCameraY(i),a}applyLayerInverseTransformation(t,e,i,o){t-=this._runtimeScene.getViewportOriginX(),e-=this._runtimeScene.getViewportOriginY(),t/=Math.abs(this._zoomFactor),e/=Math.abs(this._zoomFactor);const a=this._cameraRotation/180*Math.PI,n=t,s=Math.cos(a),r=Math.sin(a);return t=s*t-r*e,e=r*n+s*e,o[0]=t+this.getCameraX(i),o[1]=e+this.getCameraY(i),o}convertInverseCoords(t,e,i=0,o){let a=o||[0,0];t-=this.getCameraX(i),e-=this.getCameraY(i);const n=this._cameraRotation/180*Math.PI,s=t,r=Math.cos(-n),h=Math.sin(-n);return t=r*t-h*e,e=h*s+r*e,t*=Math.abs(this._zoomFactor),e*=Math.abs(this._zoomFactor),a[0]=t+this.getRuntimeScene()._cachedGameResolutionWidth/2,a[1]=e+this.getRuntimeScene()._cachedGameResolutionHeight/2,a}applyLayerTransformation(t,e,i,o){t-=this.getCameraX(i),e-=this.getCameraY(i);const a=this._cameraRotation/180*Math.PI,n=t,s=Math.cos(-a),r=Math.sin(-a);return t=s*t-r*e,e=r*n+s*e,t*=Math.abs(this._zoomFactor),e*=Math.abs(this._zoomFactor),t+=this._runtimeScene.getViewportOriginX(),e+=this._runtimeScene.getViewportOriginY(),o[0]=t,o[1]=e,o}_forceDimensionUpdate(){this._runtimeScene.getViewportWidth()}}m.Layer=c})(gdjs||={});
|
|
2
|
+
//# sourceMappingURL=layer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../GDevelop/GDJS/Runtime/layer.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * GDevelop JS Platform\n * Copyright 2013-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.\n * This project is released under the MIT License.\n */\nnamespace gdjs {\n /**\n * Represents a layer of a scene, used to display objects.\n */\n export class Layer extends gdjs.RuntimeLayer {\n _cameraRotation: float = 0;\n _zoomFactor: float = 1;\n _cameraX: float;\n _cameraY: float;\n _cameraZ: float = 0;\n /**\n * `_cameraZ` is dirty when the zoom factor is set last.\n */\n _isCameraZDirty: boolean = true;\n\n /**\n * @param layerData The data used to initialize the layer\n * @param instanceContainer The container in which the layer is used\n */\n constructor(\n layerData: LayerData,\n instanceContainer: gdjs.RuntimeInstanceContainer\n ) {\n super(layerData, instanceContainer);\n\n this._cameraX = this.getWidth() / 2;\n this._cameraY = this.getHeight() / 2;\n\n // Let the renderer do its final set up:\n this._renderer.onCreated();\n }\n\n /**\n * Called by the RuntimeScene whenever the game resolution size is changed.\n * Updates the layer width/height and position.\n */\n onGameResolutionResized(\n oldGameResolutionOriginX: float,\n oldGameResolutionOriginY: float\n ): void {\n // Adapt position of the camera center as:\n // * Most cameras following a player/object on the scene will be updating this\n // in events anyway.\n // * Cameras not following a player/object are usually UIs which are intuitively\n // expected not to \"move\". Not adapting the center position would make the camera\n // move from its initial position (which is centered in the screen) - and anchor\n // behavior would behave counterintuitively.\n this._cameraX +=\n this._runtimeScene.getViewportOriginX() - oldGameResolutionOriginX;\n this._cameraY +=\n this._runtimeScene.getViewportOriginY() - oldGameResolutionOriginY;\n this._renderer.updatePosition();\n }\n\n /**\n * Change the camera center X position.\n *\n * @param cameraId The camera number. Currently ignored.\n * @return The x position of the camera\n */\n getCameraX(cameraId?: integer): float {\n this._forceDimensionUpdate();\n return this._cameraX;\n }\n\n /**\n * Change the camera center Y position.\n *\n * @param cameraId The camera number. Currently ignored.\n * @return The y position of the camera\n */\n getCameraY(cameraId?: integer): float {\n this._forceDimensionUpdate();\n return this._cameraY;\n }\n\n /**\n * Set the camera center X position.\n *\n * @param x The new x position\n * @param cameraId The camera number. Currently ignored.\n */\n setCameraX(x: float, cameraId?: integer): void {\n this._forceDimensionUpdate();\n this._cameraX = x;\n this._renderer.updatePosition();\n }\n\n /**\n * Set the camera center Y position.\n *\n * @param y The new y position\n * @param cameraId The camera number. Currently ignored.\n */\n setCameraY(y: float, cameraId?: integer): void {\n this._forceDimensionUpdate();\n this._cameraY = y;\n this._renderer.updatePosition();\n }\n\n /**\n * Get the camera width (which can be different than the game resolution width\n * if the camera is zoomed).\n *\n * @param cameraId The camera number. Currently ignored.\n * @return The width of the camera\n */\n getCameraWidth(cameraId?: integer): float {\n return this.getWidth() / this._zoomFactor;\n }\n\n /**\n * Get the camera height (which can be different than the game resolution height\n * if the camera is zoomed).\n *\n * @param cameraId The camera number. Currently ignored.\n * @return The height of the camera\n */\n getCameraHeight(cameraId?: integer): float {\n return this.getHeight() / this._zoomFactor;\n }\n\n /**\n * Set the zoom of a camera.\n *\n * @param newZoom The new zoom. Must be superior to 0. 1 is the default zoom.\n * @param cameraId The camera number. Currently ignored.\n */\n setCameraZoom(newZoom: float, cameraId?: integer): void {\n this._zoomFactor = newZoom;\n this._isCameraZDirty = true;\n this._renderer.updatePosition();\n }\n\n /**\n * Get the zoom of a camera.\n *\n * @param cameraId The camera number. Currently ignored.\n * @return The zoom.\n */\n getCameraZoom(cameraId?: integer): float {\n return this._zoomFactor;\n }\n\n /**\n * Set the camera center Z position.\n *\n * @param z The new y position.\n * @param fov The field of view.\n * @param cameraId The camera number. Currently ignored.\n */\n setCameraZ(z: float, fov: float = 45, cameraId?: integer): void {\n const cameraFovInRadians = gdjs.toRad(fov);\n\n // The zoom factor is capped to a not too big value to avoid infinity.\n // MAX_SAFE_INTEGER is an arbitrary choice. It's big but not too big.\n const zoomFactor = Math.min(\n Number.MAX_SAFE_INTEGER,\n (0.5 * this.getHeight()) / (z * Math.tan(0.5 * cameraFovInRadians))\n );\n\n if (zoomFactor > 0) {\n this._zoomFactor = zoomFactor;\n }\n\n this._cameraZ = z;\n this._isCameraZDirty = false;\n this._renderer.updatePosition();\n }\n\n /**\n * Get the camera center Z position.\n *\n * @param fov The field of view.\n * @param cameraId The camera number. Currently ignored.\n * @return The z position of the camera\n */\n getCameraZ(fov: float = 45, cameraId?: integer): float {\n if (!this._isCameraZDirty) {\n return this._cameraZ;\n }\n\n // Set the camera so that it displays the whole PixiJS plane, as if it was a 2D rendering.\n // The Z position is computed by taking the half height of the displayed rendering,\n // and using the angle of the triangle defined by the field of view to compute the length\n // of the triangle defining the distance between the camera and the rendering plane.\n const cameraZPosition =\n (0.5 * this.getHeight()) /\n this.getCameraZoom() /\n Math.tan(0.5 * gdjs.toRad(fov));\n\n return cameraZPosition;\n }\n\n /**\n * Get the rotation of the camera, expressed in degrees.\n *\n * @param cameraId The camera number. Currently ignored.\n * @return The rotation, in degrees.\n */\n getCameraRotation(cameraId?: integer): float {\n return this._cameraRotation;\n }\n\n /**\n * Set the rotation of the camera, expressed in degrees.\n * The rotation is made around the camera center.\n *\n * @param rotation The new rotation, in degrees.\n * @param cameraId The camera number. Currently ignored.\n */\n setCameraRotation(rotation: float, cameraId?: integer): void {\n this._cameraRotation = rotation;\n this._renderer.updatePosition();\n }\n\n /**\n * Convert a point from the canvas coordinates (for example,\n * the mouse position) to the container coordinates.\n *\n * This method handles 3D rotations.\n *\n * @param x The x position, in canvas coordinates.\n * @param y The y position, in canvas coordinates.\n * @param cameraId The camera number. Currently ignored.\n * @param result The point instance that is used to return the result.\n */\n convertCoords(\n x: float,\n y: float,\n cameraId: integer = 0,\n result: FloatPoint\n ): FloatPoint {\n // This code duplicates applyLayerInverseTransformation for performance reasons;\n\n // The result parameter used to be optional.\n let position = result || [0, 0];\n\n if (this._renderer.isCameraRotatedIn3D()) {\n return this._renderer.transformTo3DWorld(x, y, 0, cameraId, result);\n }\n\n x -= this.getRuntimeScene()._cachedGameResolutionWidth / 2;\n y -= this.getRuntimeScene()._cachedGameResolutionHeight / 2;\n x /= Math.abs(this._zoomFactor);\n y /= Math.abs(this._zoomFactor);\n\n // Only compute angle and cos/sin once (allow heavy optimization from JS engines).\n const angleInRadians = (this._cameraRotation / 180) * Math.PI;\n const tmp = x;\n const cosValue = Math.cos(angleInRadians);\n const sinValue = Math.sin(angleInRadians);\n x = cosValue * x - sinValue * y;\n y = sinValue * tmp + cosValue * y;\n position[0] = x + this.getCameraX(cameraId);\n position[1] = y + this.getCameraY(cameraId);\n return position;\n }\n\n /**\n * Return an array containing the coordinates of the point passed as parameter\n * in layer local coordinates (as opposed to the parent coordinates).\n *\n * All transformations (scale, rotation) are supported.\n *\n * This method doesn't handle 3D rotations.\n *\n * @param x The X position of the point, in parent coordinates.\n * @param y The Y position of the point, in parent coordinates.\n * @param result Array that will be updated with the result\n * @param result The point instance that is used to return the result.\n * (x and y position of the point in layer coordinates).\n */\n applyLayerInverseTransformation(\n x: float,\n y: float,\n cameraId: integer,\n result: FloatPoint\n ): FloatPoint {\n x -= this._runtimeScene.getViewportOriginX();\n y -= this._runtimeScene.getViewportOriginY();\n x /= Math.abs(this._zoomFactor);\n y /= Math.abs(this._zoomFactor);\n\n // Only compute angle and cos/sin once (allow heavy optimization from JS engines).\n const angleInRadians = (this._cameraRotation / 180) * Math.PI;\n const tmp = x;\n const cosValue = Math.cos(angleInRadians);\n const sinValue = Math.sin(angleInRadians);\n x = cosValue * x - sinValue * y;\n y = sinValue * tmp + cosValue * y;\n result[0] = x + this.getCameraX(cameraId);\n result[1] = y + this.getCameraY(cameraId);\n\n return result;\n }\n\n /**\n * Convert a point from the container coordinates (for example,\n * an object position) to the canvas coordinates.\n *\n * This method doesn't handle 3D rotations.\n *\n * @param x The x position, in container coordinates.\n * @param y The y position, in container coordinates.\n * @param cameraId The camera number. Currently ignored.\n * @param result The point instance that is used to return the result.\n */\n convertInverseCoords(\n x: float,\n y: float,\n cameraId: integer = 0,\n result: FloatPoint\n ): FloatPoint {\n // This code duplicates applyLayerTransformation for performance reasons;\n\n // The result parameter used to be optional.\n let position = result || [0, 0];\n x -= this.getCameraX(cameraId);\n y -= this.getCameraY(cameraId);\n\n // Only compute angle and cos/sin once (allow heavy optimization from JS engines).\n const angleInRadians = (this._cameraRotation / 180) * Math.PI;\n const tmp = x;\n const cosValue = Math.cos(-angleInRadians);\n const sinValue = Math.sin(-angleInRadians);\n x = cosValue * x - sinValue * y;\n y = sinValue * tmp + cosValue * y;\n x *= Math.abs(this._zoomFactor);\n y *= Math.abs(this._zoomFactor);\n position[0] = x + this.getRuntimeScene()._cachedGameResolutionWidth / 2;\n position[1] = y + this.getRuntimeScene()._cachedGameResolutionHeight / 2;\n return position;\n }\n\n /**\n * Return an array containing the coordinates of the point passed as parameter\n * in parent coordinate coordinates (as opposed to the layer local coordinates).\n *\n * All transformations (scale, rotation) are supported.\n *\n * This method doesn't handle 3D rotations.\n *\n * @param x The X position of the point, in layer coordinates.\n * @param y The Y position of the point, in layer coordinates.\n * @param result Array that will be updated with the result\n * (x and y position of the point in parent coordinates).\n */\n applyLayerTransformation(\n x: float,\n y: float,\n cameraId: integer,\n result: FloatPoint\n ): FloatPoint {\n x -= this.getCameraX(cameraId);\n y -= this.getCameraY(cameraId);\n\n // Only compute angle and cos/sin once (allow heavy optimization from JS engines).\n const angleInRadians = (this._cameraRotation / 180) * Math.PI;\n const tmp = x;\n const cosValue = Math.cos(-angleInRadians);\n const sinValue = Math.sin(-angleInRadians);\n x = cosValue * x - sinValue * y;\n y = sinValue * tmp + cosValue * y;\n x *= Math.abs(this._zoomFactor);\n y *= Math.abs(this._zoomFactor);\n x += this._runtimeScene.getViewportOriginX();\n y += this._runtimeScene.getViewportOriginY();\n\n result[0] = x;\n result[1] = y;\n return result;\n }\n\n /**\n * This ensure that the viewport dimensions are up to date.\n *\n * It's needed because custom objects dimensions are only updated on\n * demand for efficiency reasons.\n */\n private _forceDimensionUpdate(): void {\n // This will update dimensions.\n this._runtimeScene.getViewportWidth();\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAKA,IAAU,MAAAA,GAAV,CAIS,MAAMC,UAAcD,EAAK,YAAa,CAC3C,gBAAyB,EACzB,YAAqB,EACrB,SACA,SACA,SAAkB,EAIlB,gBAA2B,GAM3B,YACEE,EACAC,EACA,CACA,MAAMD,EAAWC,CAAiB,EAElC,KAAK,SAAW,KAAK,SAAS,EAAI,EAClC,KAAK,SAAW,KAAK,UAAU,EAAI,EAGnC,KAAK,UAAU,UAAU,CAC3B,CAMA,wBACEC,EACAC,EACM,CAQN,KAAK,UACH,KAAK,cAAc,mBAAmB,EAAID,EAC5C,KAAK,UACH,KAAK,cAAc,mBAAmB,EAAIC,EAC5C,KAAK,UAAU,eAAe,CAChC,CAQA,WAAWC,EAA2B,CACpC,YAAK,sBAAsB,EACpB,KAAK,QACd,CAQA,WAAWA,EAA2B,CACpC,YAAK,sBAAsB,EACpB,KAAK,QACd,CAQA,WAAWC,EAAUD,EAA0B,CAC7C,KAAK,sBAAsB,EAC3B,KAAK,SAAWC,EAChB,KAAK,UAAU,eAAe,CAChC,CAQA,WAAWC,EAAUF,EAA0B,CAC7C,KAAK,sBAAsB,EAC3B,KAAK,SAAWE,EAChB,KAAK,UAAU,eAAe,CAChC,CASA,eAAeF,EAA2B,CACxC,OAAO,KAAK,SAAS,EAAI,KAAK,WAChC,CASA,gBAAgBA,EAA2B,CACzC,OAAO,KAAK,UAAU,EAAI,KAAK,WACjC,CAQA,cAAcG,EAAgBH,EAA0B,CACtD,KAAK,YAAcG,EACnB,KAAK,gBAAkB,GACvB,KAAK,UAAU,eAAe,CAChC,CAQA,cAAcH,EAA2B,CACvC,OAAO,KAAK,WACd,CASA,WAAWI,EAAUC,EAAa,GAAIL,EAA0B,CAC9D,MAAMM,EAAqBZ,EAAK,MAAMW,CAAG,EAInCE,EAAa,KAAK,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AAW,KAAK,IAAI,CAACH,CAAc,EACzC,OAAAV,EAAIY,EAAWZ,EAAIa,EAAWZ,EAC9BA,EAAIY,EAAWF,EAAMC,EAAWX,EAChCD,GAAK,KAAK,IAAI,KAAK,WAAW,EAC9BC,GAAK,KAAK,IAAI,KAAK,WAAW,EAC9BD,GAAK,KAAK,cAAc,mBAAmB,EAC3CC,GAAK,KAAK,cAAc,mBAAmB,EAE3CO,EAAO,CAAC,EAAIR,EACZQ,EAAO,CAAC,EAAIP,EACLO,CACT,CAQQ,uBAA8B,CAEpC,KAAK,cAAc,iBAAiB,CACtC,CACF,CA5XOf,EAAM,MAAAC,IAJL",
|
|
6
|
+
"names": ["gdjs", "Layer", "layerData", "instanceContainer", "oldGameResolutionOriginX", "oldGameResolutionOriginY", "cameraId", "x", "y", "newZoom", "z", "fov", "cameraFovInRadians", "zoomFactor", "rotation", "result", "position", "angleInRadians", "tmp", "cosValue", "sinValue"]
|
|
7
|
+
}
|