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.
Files changed (601) hide show
  1. package/GDevelop/ExtLibs/7za.exe +0 -0
  2. package/GDevelop/ExtLibs/curl.exe +0 -0
  3. package/GDevelop/scripts/libgettextlib-0-17.dll +0 -0
  4. package/GDevelop/scripts/libgettextsrc-0-17.dll +0 -0
  5. package/LICENSE +1 -1
  6. package/dist/Runtime/AsyncTasksManager.js +5 -0
  7. package/dist/Runtime/AsyncTasksManager.js.map +7 -0
  8. package/dist/Runtime/Cordova/config.xml +44 -0
  9. package/dist/Runtime/Cordova/package.json +22 -0
  10. package/dist/Runtime/Cordova/www/index.html +45 -0
  11. package/dist/Runtime/CustomRuntimeObject.js +2 -0
  12. package/dist/Runtime/CustomRuntimeObject.js.map +7 -0
  13. package/dist/Runtime/CustomRuntimeObjectInstanceContainer.js +2 -0
  14. package/dist/Runtime/CustomRuntimeObjectInstanceContainer.js.map +7 -0
  15. package/dist/Runtime/Electron/main.js +65 -0
  16. package/dist/Runtime/Electron/package.json +26 -0
  17. package/dist/Runtime/Extensions/3D/A_RuntimeObject3D.js +2 -0
  18. package/dist/Runtime/Extensions/3D/A_RuntimeObject3D.js.map +7 -0
  19. package/dist/Runtime/Extensions/3D/A_RuntimeObject3DRenderer.js +2 -0
  20. package/dist/Runtime/Extensions/3D/A_RuntimeObject3DRenderer.js.map +7 -0
  21. package/dist/Runtime/Extensions/3D/AmbientLight.js +2 -0
  22. package/dist/Runtime/Extensions/3D/AmbientLight.js.map +7 -0
  23. package/dist/Runtime/Extensions/3D/Cube3DRuntimeObject.js +2 -0
  24. package/dist/Runtime/Extensions/3D/Cube3DRuntimeObject.js.map +7 -0
  25. package/dist/Runtime/Extensions/3D/Cube3DRuntimeObjectPixiRenderer.js +2 -0
  26. package/dist/Runtime/Extensions/3D/Cube3DRuntimeObjectPixiRenderer.js.map +7 -0
  27. package/dist/Runtime/Extensions/3D/DirectionalLight.js +2 -0
  28. package/dist/Runtime/Extensions/3D/DirectionalLight.js.map +7 -0
  29. package/dist/Runtime/Extensions/3D/ExponentialFog.js +2 -0
  30. package/dist/Runtime/Extensions/3D/ExponentialFog.js.map +7 -0
  31. package/dist/Runtime/Extensions/3D/HemisphereLight.js +2 -0
  32. package/dist/Runtime/Extensions/3D/HemisphereLight.js.map +7 -0
  33. package/dist/Runtime/Extensions/3D/JsExtension.js +2809 -0
  34. package/dist/Runtime/Extensions/3D/LinearFog.js +2 -0
  35. package/dist/Runtime/Extensions/3D/LinearFog.js.map +7 -0
  36. package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js +2 -0
  37. package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js.map +7 -0
  38. package/dist/Runtime/Extensions/3D/Model3DRuntimeObject3DRenderer.js +2 -0
  39. package/dist/Runtime/Extensions/3D/Model3DRuntimeObject3DRenderer.js.map +7 -0
  40. package/dist/Runtime/Extensions/3D/Scene3DTools.js +2 -0
  41. package/dist/Runtime/Extensions/3D/Scene3DTools.js.map +7 -0
  42. package/dist/Runtime/Extensions/AdMob/JsExtension.js +798 -0
  43. package/dist/Runtime/Extensions/AdMob/admobtools.js +2 -0
  44. package/dist/Runtime/Extensions/AdMob/admobtools.js.map +7 -0
  45. package/dist/Runtime/Extensions/AdvancedWindow/JsExtension.js +719 -0
  46. package/dist/Runtime/Extensions/AdvancedWindow/electron-advancedwindowtools.js +2 -0
  47. package/dist/Runtime/Extensions/AdvancedWindow/electron-advancedwindowtools.js.map +7 -0
  48. package/dist/Runtime/Extensions/AnchorBehavior/anchorruntimebehavior.js +2 -0
  49. package/dist/Runtime/Extensions/AnchorBehavior/anchorruntimebehavior.js.map +7 -0
  50. package/dist/Runtime/Extensions/BBText/JsExtension.js +639 -0
  51. package/dist/Runtime/Extensions/BBText/bbtextruntimeobject-pixi-renderer.js +2 -0
  52. package/dist/Runtime/Extensions/BBText/bbtextruntimeobject-pixi-renderer.js.map +7 -0
  53. package/dist/Runtime/Extensions/BBText/bbtextruntimeobject.js +2 -0
  54. package/dist/Runtime/Extensions/BBText/bbtextruntimeobject.js.map +7 -0
  55. package/dist/Runtime/Extensions/BBText/pixi-multistyle-text/dist/pixi-multistyle-text.umd.js +1 -0
  56. package/dist/Runtime/Extensions/BitmapText/JsExtension.js +756 -0
  57. package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject-pixi-renderer.js +2 -0
  58. package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject-pixi-renderer.js.map +7 -0
  59. package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject.js +2 -0
  60. package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject.js.map +7 -0
  61. package/dist/Runtime/Extensions/DebuggerTools/JsExtension.js +123 -0
  62. package/dist/Runtime/Extensions/DebuggerTools/debuggertools.js +2 -0
  63. package/dist/Runtime/Extensions/DebuggerTools/debuggertools.js.map +7 -0
  64. package/dist/Runtime/Extensions/DestroyOutsideBehavior/destroyoutsideruntimebehavior.js +2 -0
  65. package/dist/Runtime/Extensions/DestroyOutsideBehavior/destroyoutsideruntimebehavior.js.map +7 -0
  66. package/dist/Runtime/Extensions/DeviceSensors/JsExtension.js +461 -0
  67. package/dist/Runtime/Extensions/DeviceSensors/devicesensortools.js +2 -0
  68. package/dist/Runtime/Extensions/DeviceSensors/devicesensortools.js.map +7 -0
  69. package/dist/Runtime/Extensions/DeviceVibration/JsExtension.js +108 -0
  70. package/dist/Runtime/Extensions/DeviceVibration/devicevibrationtools.js +2 -0
  71. package/dist/Runtime/Extensions/DeviceVibration/devicevibrationtools.js.map +7 -0
  72. package/dist/Runtime/Extensions/DialogueTree/JsExtension.js +730 -0
  73. package/dist/Runtime/Extensions/DialogueTree/bondage.js/dist/bondage.min.js +11 -0
  74. package/dist/Runtime/Extensions/DialogueTree/dialoguetools.js +3 -0
  75. package/dist/Runtime/Extensions/DialogueTree/dialoguetools.js.map +7 -0
  76. package/dist/Runtime/Extensions/DraggableBehavior/draggableruntimebehavior.js +2 -0
  77. package/dist/Runtime/Extensions/DraggableBehavior/draggableruntimebehavior.js.map +7 -0
  78. package/dist/Runtime/Extensions/Effects/JsExtension.js +1197 -0
  79. package/dist/Runtime/Extensions/Effects/adjustment-pixi-filter.js +2 -0
  80. package/dist/Runtime/Extensions/Effects/adjustment-pixi-filter.js.map +7 -0
  81. package/dist/Runtime/Extensions/Effects/advanced-bloom-pixi-filter.js +2 -0
  82. package/dist/Runtime/Extensions/Effects/advanced-bloom-pixi-filter.js.map +7 -0
  83. package/dist/Runtime/Extensions/Effects/ascii-pixi-filter.js +2 -0
  84. package/dist/Runtime/Extensions/Effects/ascii-pixi-filter.js.map +7 -0
  85. package/dist/Runtime/Extensions/Effects/bevel-pixi-filter.js +2 -0
  86. package/dist/Runtime/Extensions/Effects/bevel-pixi-filter.js.map +7 -0
  87. package/dist/Runtime/Extensions/Effects/black-and-white-pixi-filter.js +2 -0
  88. package/dist/Runtime/Extensions/Effects/black-and-white-pixi-filter.js.map +7 -0
  89. package/dist/Runtime/Extensions/Effects/blending-mode-pixi-filter.js +2 -0
  90. package/dist/Runtime/Extensions/Effects/blending-mode-pixi-filter.js.map +7 -0
  91. package/dist/Runtime/Extensions/Effects/blur-pixi-filter.js +2 -0
  92. package/dist/Runtime/Extensions/Effects/blur-pixi-filter.js.map +7 -0
  93. package/dist/Runtime/Extensions/Effects/brightness-pixi-filter.js +2 -0
  94. package/dist/Runtime/Extensions/Effects/brightness-pixi-filter.js.map +7 -0
  95. package/dist/Runtime/Extensions/Effects/bulge-pinch-pixi-filter.js +2 -0
  96. package/dist/Runtime/Extensions/Effects/bulge-pinch-pixi-filter.js.map +7 -0
  97. package/dist/Runtime/Extensions/Effects/color-map-pixi-filter.js +2 -0
  98. package/dist/Runtime/Extensions/Effects/color-map-pixi-filter.js.map +7 -0
  99. package/dist/Runtime/Extensions/Effects/color-replace-pixi-filter.js +2 -0
  100. package/dist/Runtime/Extensions/Effects/color-replace-pixi-filter.js.map +7 -0
  101. package/dist/Runtime/Extensions/Effects/crt-pixi-filter.js +2 -0
  102. package/dist/Runtime/Extensions/Effects/crt-pixi-filter.js.map +7 -0
  103. package/dist/Runtime/Extensions/Effects/displacement-pixi-filter.js +2 -0
  104. package/dist/Runtime/Extensions/Effects/displacement-pixi-filter.js.map +7 -0
  105. package/dist/Runtime/Extensions/Effects/dot-pixi-filter.js +2 -0
  106. package/dist/Runtime/Extensions/Effects/dot-pixi-filter.js.map +7 -0
  107. package/dist/Runtime/Extensions/Effects/drop-shadow-pixi-filter.js +2 -0
  108. package/dist/Runtime/Extensions/Effects/drop-shadow-pixi-filter.js.map +7 -0
  109. package/dist/Runtime/Extensions/Effects/glitch-pixi-filter.js +2 -0
  110. package/dist/Runtime/Extensions/Effects/glitch-pixi-filter.js.map +7 -0
  111. package/dist/Runtime/Extensions/Effects/glow-pixi-filter.js +2 -0
  112. package/dist/Runtime/Extensions/Effects/glow-pixi-filter.js.map +7 -0
  113. package/dist/Runtime/Extensions/Effects/godray-pixi-filter.js +2 -0
  114. package/dist/Runtime/Extensions/Effects/godray-pixi-filter.js.map +7 -0
  115. package/dist/Runtime/Extensions/Effects/kawase-blur-pixi-filter.js +2 -0
  116. package/dist/Runtime/Extensions/Effects/kawase-blur-pixi-filter.js.map +7 -0
  117. package/dist/Runtime/Extensions/Effects/light-night-pixi-filter.js +3 -0
  118. package/dist/Runtime/Extensions/Effects/light-night-pixi-filter.js.map +7 -0
  119. package/dist/Runtime/Extensions/Effects/night-pixi-filter.js +3 -0
  120. package/dist/Runtime/Extensions/Effects/night-pixi-filter.js.map +7 -0
  121. package/dist/Runtime/Extensions/Effects/noise-pixi-filter.js +2 -0
  122. package/dist/Runtime/Extensions/Effects/noise-pixi-filter.js.map +7 -0
  123. package/dist/Runtime/Extensions/Effects/old-film-pixi-filter.js +2 -0
  124. package/dist/Runtime/Extensions/Effects/old-film-pixi-filter.js.map +7 -0
  125. package/dist/Runtime/Extensions/Effects/outline-pixi-filter.js +2 -0
  126. package/dist/Runtime/Extensions/Effects/outline-pixi-filter.js.map +7 -0
  127. package/dist/Runtime/Extensions/Effects/pixelate-pixi-filter.js +2 -0
  128. package/dist/Runtime/Extensions/Effects/pixelate-pixi-filter.js.map +7 -0
  129. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-adjustment.js +8 -0
  130. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-advanced-bloom.js +8 -0
  131. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-ascii.js +8 -0
  132. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-bevel.js +8 -0
  133. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-bulge-pinch.js +8 -0
  134. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-color-map.js +8 -0
  135. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-color-replace.js +8 -0
  136. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-crt.js +8 -0
  137. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-dot.js +8 -0
  138. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-drop-shadow.js +8 -0
  139. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-glitch.js +8 -0
  140. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-glow.js +8 -0
  141. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-godray.js +8 -0
  142. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-kawase-blur.js +8 -0
  143. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-old-film.js +8 -0
  144. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-outline.js +8 -0
  145. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-pixelate.js +8 -0
  146. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-radial-blur.js +8 -0
  147. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-reflection.js +8 -0
  148. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-rgb-split.js +8 -0
  149. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-tilt-shift.js +171 -0
  150. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-twist.js +8 -0
  151. package/dist/Runtime/Extensions/Effects/pixi-filters/filter-zoom-blur.js +8 -0
  152. package/dist/Runtime/Extensions/Effects/pixi-filters/types/adjustment/types.d.ts +29 -0
  153. package/dist/Runtime/Extensions/Effects/pixi-filters/types/advanced-bloom/types.d.ts +30 -0
  154. package/dist/Runtime/Extensions/Effects/pixi-filters/types/ascii/types.d.ts +11 -0
  155. package/dist/Runtime/Extensions/Effects/pixi-filters/types/bevel/types.d.ts +25 -0
  156. package/dist/Runtime/Extensions/Effects/pixi-filters/types/bloom/types.d.ts +18 -0
  157. package/dist/Runtime/Extensions/Effects/pixi-filters/types/bulge-pinch/types.d.ts +24 -0
  158. package/dist/Runtime/Extensions/Effects/pixi-filters/types/color-map/types.d.ts +22 -0
  159. package/dist/Runtime/Extensions/Effects/pixi-filters/types/color-overlay/types.d.ts +11 -0
  160. package/dist/Runtime/Extensions/Effects/pixi-filters/types/color-replace/types.d.ts +17 -0
  161. package/dist/Runtime/Extensions/Effects/pixi-filters/types/convolution/types.d.ts +13 -0
  162. package/dist/Runtime/Extensions/Effects/pixi-filters/types/cross-hatch/types.d.ts +10 -0
  163. package/dist/Runtime/Extensions/Effects/pixi-filters/types/crt/types.d.ts +35 -0
  164. package/dist/Runtime/Extensions/Effects/pixi-filters/types/dot/types.d.ts +12 -0
  165. package/dist/Runtime/Extensions/Effects/pixi-filters/types/drop-shadow/types.d.ts +33 -0
  166. package/dist/Runtime/Extensions/Effects/pixi-filters/types/emboss/types.d.ts +11 -0
  167. package/dist/Runtime/Extensions/Effects/pixi-filters/types/glitch/types.d.ts +38 -0
  168. package/dist/Runtime/Extensions/Effects/pixi-filters/types/glow/types.d.ts +23 -0
  169. package/dist/Runtime/Extensions/Effects/pixi-filters/types/godray/types.d.ts +27 -0
  170. package/dist/Runtime/Extensions/Effects/pixi-filters/types/kawase-blur/types.d.ts +15 -0
  171. package/dist/Runtime/Extensions/Effects/pixi-filters/types/motion-blur/types.d.ts +17 -0
  172. package/dist/Runtime/Extensions/Effects/pixi-filters/types/multi-color-replace/types.d.ts +18 -0
  173. package/dist/Runtime/Extensions/Effects/pixi-filters/types/old-film/types.d.ts +33 -0
  174. package/dist/Runtime/Extensions/Effects/pixi-filters/types/outline/types.d.ts +13 -0
  175. package/dist/Runtime/Extensions/Effects/pixi-filters/types/pixelate/types.d.ts +11 -0
  176. package/dist/Runtime/Extensions/Effects/pixi-filters/types/radial-blur/types.d.ts +19 -0
  177. package/dist/Runtime/Extensions/Effects/pixi-filters/types/reflection/types.d.ts +25 -0
  178. package/dist/Runtime/Extensions/Effects/pixi-filters/types/rgb-split/types.d.ts +13 -0
  179. package/dist/Runtime/Extensions/Effects/pixi-filters/types/shockwave/types.d.ts +25 -0
  180. package/dist/Runtime/Extensions/Effects/pixi-filters/types/simple-lightmap/types.d.ts +13 -0
  181. package/dist/Runtime/Extensions/Effects/pixi-filters/types/tilt-shift/types.d.ts +19 -0
  182. package/dist/Runtime/Extensions/Effects/pixi-filters/types/twist/types.d.ts +13 -0
  183. package/dist/Runtime/Extensions/Effects/pixi-filters/types/zoom-blur/types.d.ts +28 -0
  184. package/dist/Runtime/Extensions/Effects/radial-blur-pixi-filter.js +2 -0
  185. package/dist/Runtime/Extensions/Effects/radial-blur-pixi-filter.js.map +7 -0
  186. package/dist/Runtime/Extensions/Effects/reflection-pixi-filter.js +2 -0
  187. package/dist/Runtime/Extensions/Effects/reflection-pixi-filter.js.map +7 -0
  188. package/dist/Runtime/Extensions/Effects/rgb-split-pixi-filter.js +2 -0
  189. package/dist/Runtime/Extensions/Effects/rgb-split-pixi-filter.js.map +7 -0
  190. package/dist/Runtime/Extensions/Effects/sepia-pixi-filter.js +2 -0
  191. package/dist/Runtime/Extensions/Effects/sepia-pixi-filter.js.map +7 -0
  192. package/dist/Runtime/Extensions/Effects/tilt-shift-pixi-filter.js +2 -0
  193. package/dist/Runtime/Extensions/Effects/tilt-shift-pixi-filter.js.map +7 -0
  194. package/dist/Runtime/Extensions/Effects/twist-pixi-filter.js +2 -0
  195. package/dist/Runtime/Extensions/Effects/twist-pixi-filter.js.map +7 -0
  196. package/dist/Runtime/Extensions/Effects/zoom-blur-pixi-filter.js +2 -0
  197. package/dist/Runtime/Extensions/Effects/zoom-blur-pixi-filter.js.map +7 -0
  198. package/dist/Runtime/Extensions/ExampleJsExtension/JsExtension.js +589 -0
  199. package/dist/Runtime/Extensions/ExampleJsExtension/dummyeffect.js +3 -0
  200. package/dist/Runtime/Extensions/ExampleJsExtension/dummyeffect.js.map +7 -0
  201. package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimebehavior.js +2 -0
  202. package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimebehavior.js.map +7 -0
  203. package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimeobject-pixi-renderer.js +2 -0
  204. package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimeobject-pixi-renderer.js.map +7 -0
  205. package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimeobject.js +2 -0
  206. package/dist/Runtime/Extensions/ExampleJsExtension/dummyruntimeobject.js.map +7 -0
  207. package/dist/Runtime/Extensions/ExampleJsExtension/dummywithshareddataruntimebehavior.js +2 -0
  208. package/dist/Runtime/Extensions/ExampleJsExtension/dummywithshareddataruntimebehavior.js.map +7 -0
  209. package/dist/Runtime/Extensions/ExampleJsExtension/examplejsextensiontools.js +2 -0
  210. package/dist/Runtime/Extensions/ExampleJsExtension/examplejsextensiontools.js.map +7 -0
  211. package/dist/Runtime/Extensions/FacebookInstantGames/FBInstant.d.ts +2 -0
  212. package/dist/Runtime/Extensions/FacebookInstantGames/JsExtension.js +379 -0
  213. package/dist/Runtime/Extensions/FacebookInstantGames/facebookinstantgamestools.js +2 -0
  214. package/dist/Runtime/Extensions/FacebookInstantGames/facebookinstantgamestools.js.map +7 -0
  215. package/dist/Runtime/Extensions/FileSystem/JsExtension.js +559 -0
  216. package/dist/Runtime/Extensions/FileSystem/filesystemtools.js +2 -0
  217. package/dist/Runtime/Extensions/FileSystem/filesystemtools.js.map +7 -0
  218. package/dist/Runtime/Extensions/Firebase/A_firebasejs/A_firebase-base.js +2 -0
  219. package/dist/Runtime/Extensions/Firebase/A_firebasejs/A_firebase-base.js.map +1 -0
  220. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-analytics.js +2 -0
  221. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-analytics.js.map +1 -0
  222. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-auth.js +2 -0
  223. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-auth.js.map +1 -0
  224. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-database.js +2 -0
  225. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-database.js.map +1 -0
  226. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-firestore.js +2 -0
  227. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-firestore.js.map +1 -0
  228. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-functions.js +2 -0
  229. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-functions.js.map +1 -0
  230. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-messaging.js +2 -0
  231. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-messaging.js.map +1 -0
  232. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-performance.js +2 -0
  233. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-performance.js.map +1 -0
  234. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-remote-config.js +2 -0
  235. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-remote-config.js.map +1 -0
  236. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-storage.js +2 -0
  237. package/dist/Runtime/Extensions/Firebase/A_firebasejs/B_firebase-storage.js.map +1 -0
  238. package/dist/Runtime/Extensions/Firebase/A_firebasejs/firebase.d.ts +10191 -0
  239. package/dist/Runtime/Extensions/Firebase/B_firebasetools/C_firebasetools.js +2 -0
  240. package/dist/Runtime/Extensions/Firebase/B_firebasetools/C_firebasetools.js.map +7 -0
  241. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_analyticstools.js +2 -0
  242. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_analyticstools.js.map +7 -0
  243. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_authtools.js +2 -0
  244. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_authtools.js.map +7 -0
  245. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_cloudfirestoretools.js +2 -0
  246. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_cloudfirestoretools.js.map +7 -0
  247. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_databasetools.js +2 -0
  248. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_databasetools.js.map +7 -0
  249. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_functionstools.js +2 -0
  250. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_functionstools.js.map +7 -0
  251. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_performancetools.js +2 -0
  252. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_performancetools.js.map +7 -0
  253. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_remoteconfigtools.js +2 -0
  254. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_remoteconfigtools.js.map +7 -0
  255. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_storagetools.js +2 -0
  256. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_storagetools.js.map +7 -0
  257. package/dist/Runtime/Extensions/Firebase/JsExtension.js +2323 -0
  258. package/dist/Runtime/Extensions/Inventory/inventory.js +2 -0
  259. package/dist/Runtime/Extensions/Inventory/inventory.js.map +7 -0
  260. package/dist/Runtime/Extensions/Inventory/inventorytools.js +2 -0
  261. package/dist/Runtime/Extensions/Inventory/inventorytools.js.map +7 -0
  262. package/dist/Runtime/Extensions/JsExtensionTypes.flow.js +34 -0
  263. package/dist/Runtime/Extensions/Leaderboards/JsExtension.js +299 -0
  264. package/dist/Runtime/Extensions/Leaderboards/leaderboardstools.js +2 -0
  265. package/dist/Runtime/Extensions/Leaderboards/leaderboardstools.js.map +7 -0
  266. package/dist/Runtime/Extensions/Leaderboards/sha256.d.ts +234 -0
  267. package/dist/Runtime/Extensions/Leaderboards/sha256.js +21 -0
  268. package/dist/Runtime/Extensions/Lighting/JsExtension.js +371 -0
  269. package/dist/Runtime/Extensions/Lighting/lightobstacleruntimebehavior.js +2 -0
  270. package/dist/Runtime/Extensions/Lighting/lightobstacleruntimebehavior.js.map +7 -0
  271. package/dist/Runtime/Extensions/Lighting/lightruntimeobject-pixi-renderer.js +40 -0
  272. package/dist/Runtime/Extensions/Lighting/lightruntimeobject-pixi-renderer.js.map +7 -0
  273. package/dist/Runtime/Extensions/Lighting/lightruntimeobject.js +2 -0
  274. package/dist/Runtime/Extensions/Lighting/lightruntimeobject.js.map +7 -0
  275. package/dist/Runtime/Extensions/LinkedObjects/linkedobjects.js +2 -0
  276. package/dist/Runtime/Extensions/LinkedObjects/linkedobjects.js.map +7 -0
  277. package/dist/Runtime/Extensions/P2P/A_peer.js +4 -0
  278. package/dist/Runtime/Extensions/P2P/A_peer.js.map +1 -0
  279. package/dist/Runtime/Extensions/P2P/B_p2ptools.js +2 -0
  280. package/dist/Runtime/Extensions/P2P/B_p2ptools.js.map +7 -0
  281. package/dist/Runtime/Extensions/P2P/JsExtension.js +483 -0
  282. package/dist/Runtime/Extensions/P2P/peerjs.d.ts +509 -0
  283. package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js +2 -0
  284. package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js.map +7 -0
  285. package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject.js +2 -0
  286. package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject.js.map +7 -0
  287. package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject-pixi-renderer.js +2 -0
  288. package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject-pixi-renderer.js.map +7 -0
  289. package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js +2 -0
  290. package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js.map +7 -0
  291. package/dist/Runtime/Extensions/ParticleSystem/pixi-particles-pixi-renderer.min.js +3 -0
  292. package/dist/Runtime/Extensions/PathfindingBehavior/PathTools.js +2 -0
  293. package/dist/Runtime/Extensions/PathfindingBehavior/PathTools.js.map +7 -0
  294. package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingobstacleruntimebehavior.js +2 -0
  295. package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingobstacleruntimebehavior.js.map +7 -0
  296. package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js +2 -0
  297. package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js.map +7 -0
  298. package/dist/Runtime/Extensions/Physics2Behavior/Box2D_v2.3.1_min.wasm.js +2 -0
  299. package/dist/Runtime/Extensions/Physics2Behavior/Box2D_v2.3.1_min.wasm.js.map +7 -0
  300. package/dist/Runtime/Extensions/Physics2Behavior/Box2D_v2.3.1_min.wasm.wasm +0 -0
  301. package/dist/Runtime/Extensions/Physics2Behavior/JsExtension.js +4072 -0
  302. package/dist/Runtime/Extensions/Physics2Behavior/box2d.d.ts +1804 -0
  303. package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js +2 -0
  304. package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js.map +7 -0
  305. package/dist/Runtime/Extensions/Physics2Behavior/physics2tools.js +2 -0
  306. package/dist/Runtime/Extensions/Physics2Behavior/physics2tools.js.map +7 -0
  307. package/dist/Runtime/Extensions/PhysicsBehavior/box2djs/box2d.js +804 -0
  308. package/dist/Runtime/Extensions/PhysicsBehavior/physicsruntimebehavior.js +2 -0
  309. package/dist/Runtime/Extensions/PhysicsBehavior/physicsruntimebehavior.js.map +7 -0
  310. package/dist/Runtime/Extensions/PlatformBehavior/benchmarks/platformerobjectruntimebehavior.benchmark.js +2 -0
  311. package/dist/Runtime/Extensions/PlatformBehavior/benchmarks/platformerobjectruntimebehavior.benchmark.js.map +7 -0
  312. package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js +2 -0
  313. package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js.map +7 -0
  314. package/dist/Runtime/Extensions/PlatformBehavior/platformruntimebehavior.js +2 -0
  315. package/dist/Runtime/Extensions/PlatformBehavior/platformruntimebehavior.js.map +7 -0
  316. package/dist/Runtime/Extensions/PlatformBehavior/platformtools.js +2 -0
  317. package/dist/Runtime/Extensions/PlatformBehavior/platformtools.js.map +7 -0
  318. package/dist/Runtime/Extensions/PlayerAuthentication/JsExtension.js +218 -0
  319. package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationcomponents.js +5 -0
  320. package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationcomponents.js.map +7 -0
  321. package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationtools.js +2 -0
  322. package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationtools.js.map +7 -0
  323. package/dist/Runtime/Extensions/PrimitiveDrawing/pixi-graphics-extras/graphics-extras.min.js +10 -0
  324. package/dist/Runtime/Extensions/PrimitiveDrawing/pixi-graphics-extras/graphics-extras.min.js.map +1 -0
  325. package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject-pixi-renderer.js +2 -0
  326. package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject-pixi-renderer.js.map +7 -0
  327. package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject.js +2 -0
  328. package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject.js.map +7 -0
  329. package/dist/Runtime/Extensions/Screenshot/JsExtension.js +68 -0
  330. package/dist/Runtime/Extensions/Screenshot/screenshottools.js +2 -0
  331. package/dist/Runtime/Extensions/Screenshot/screenshottools.js.map +7 -0
  332. package/dist/Runtime/Extensions/Shopify/shopify-buy.umd.polyfilled.min.js +2 -0
  333. package/dist/Runtime/Extensions/Shopify/shopifytools.js +2 -0
  334. package/dist/Runtime/Extensions/Shopify/shopifytools.js.map +7 -0
  335. package/dist/Runtime/Extensions/SpatialSound/JsExtension.js +92 -0
  336. package/dist/Runtime/Extensions/SpatialSound/howler.spatial.min.js +2 -0
  337. package/dist/Runtime/Extensions/SpatialSound/spatialsoundtools.js +2 -0
  338. package/dist/Runtime/Extensions/SpatialSound/spatialsoundtools.js.map +7 -0
  339. package/dist/Runtime/Extensions/SystemInfo/systeminfotools.js +2 -0
  340. package/dist/Runtime/Extensions/SystemInfo/systeminfotools.js.map +7 -0
  341. package/dist/Runtime/Extensions/TextEntryObject/textentryruntimeobject-pixi-renderer.js +2 -0
  342. package/dist/Runtime/Extensions/TextEntryObject/textentryruntimeobject-pixi-renderer.js.map +7 -0
  343. package/dist/Runtime/Extensions/TextEntryObject/textentryruntimeobject.js +2 -0
  344. package/dist/Runtime/Extensions/TextEntryObject/textentryruntimeobject.js.map +7 -0
  345. package/dist/Runtime/Extensions/TextInput/JsExtension.js +790 -0
  346. package/dist/Runtime/Extensions/TextInput/textinputruntimeobject-pixi-renderer.js +2 -0
  347. package/dist/Runtime/Extensions/TextInput/textinputruntimeobject-pixi-renderer.js.map +7 -0
  348. package/dist/Runtime/Extensions/TextInput/textinputruntimeobject.js +2 -0
  349. package/dist/Runtime/Extensions/TextInput/textinputruntimeobject.js.map +7 -0
  350. package/dist/Runtime/Extensions/TextObject/textruntimeobject-pixi-renderer.js +2 -0
  351. package/dist/Runtime/Extensions/TextObject/textruntimeobject-pixi-renderer.js.map +7 -0
  352. package/dist/Runtime/Extensions/TextObject/textruntimeobject.js +2 -0
  353. package/dist/Runtime/Extensions/TextObject/textruntimeobject.js.map +7 -0
  354. package/dist/Runtime/Extensions/TileMap/JsExtension.js +1653 -0
  355. package/dist/Runtime/Extensions/TileMap/TileMapRuntimeManager.js +2 -0
  356. package/dist/Runtime/Extensions/TileMap/TileMapRuntimeManager.js.map +7 -0
  357. package/dist/Runtime/Extensions/TileMap/collision/TileMapCollisionMaskRenderer.js +2 -0
  358. package/dist/Runtime/Extensions/TileMap/collision/TileMapCollisionMaskRenderer.js.map +7 -0
  359. package/dist/Runtime/Extensions/TileMap/collision/TransformedTileMap.js +2 -0
  360. package/dist/Runtime/Extensions/TileMap/collision/TransformedTileMap.js.map +7 -0
  361. package/dist/Runtime/Extensions/TileMap/example/anotherIsland.json +5769 -0
  362. package/dist/Runtime/Extensions/TileMap/example/island.json +5823 -0
  363. package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.d.ts +25 -0
  364. package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.js +2 -0
  365. package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.js.map +7 -0
  366. package/dist/Runtime/Extensions/TileMap/helper/dts/index.d.ts +16 -0
  367. package/dist/Runtime/Extensions/TileMap/helper/dts/index.d.ts.map +1 -0
  368. package/dist/Runtime/Extensions/TileMap/helper/dts/load/TileMapFileContent.d.ts +12 -0
  369. package/dist/Runtime/Extensions/TileMap/helper/dts/load/TileMapFileContent.d.ts.map +1 -0
  370. package/dist/Runtime/Extensions/TileMap/helper/dts/load/TileMapLoader.d.ts +18 -0
  371. package/dist/Runtime/Extensions/TileMap/helper/dts/load/TileMapLoader.d.ts.map +1 -0
  372. package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkFormat.d.ts +589 -0
  373. package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkFormat.d.ts.map +1 -0
  374. package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkTileMapLoader.d.ts +16 -0
  375. package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkTileMapLoader.d.ts.map +1 -0
  376. package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkTileMapLoaderHelper.d.ts +5 -0
  377. package/dist/Runtime/Extensions/TileMap/helper/dts/load/ldtk/LDtkTileMapLoaderHelper.d.ts.map +1 -0
  378. package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledFormat.d.ts +343 -0
  379. package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledFormat.d.ts.map +1 -0
  380. package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoader.d.ts +16 -0
  381. package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoader.d.ts.map +1 -0
  382. package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoader.spec.d.ts +2 -0
  383. package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoader.spec.d.ts.map +1 -0
  384. package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoaderHelper.d.ts +37 -0
  385. package/dist/Runtime/Extensions/TileMap/helper/dts/load/tiled/TiledTileMapLoaderHelper.d.ts.map +1 -0
  386. package/dist/Runtime/Extensions/TileMap/helper/dts/model/CommonTypes.d.ts +5 -0
  387. package/dist/Runtime/Extensions/TileMap/helper/dts/model/CommonTypes.d.ts.map +1 -0
  388. package/dist/Runtime/Extensions/TileMap/helper/dts/model/GID.d.ts +45 -0
  389. package/dist/Runtime/Extensions/TileMap/helper/dts/model/GID.d.ts.map +1 -0
  390. package/dist/Runtime/Extensions/TileMap/helper/dts/model/TileMapModel.d.ts +361 -0
  391. package/dist/Runtime/Extensions/TileMap/helper/dts/model/TileMapModel.d.ts.map +1 -0
  392. package/dist/Runtime/Extensions/TileMap/helper/dts/render/ResourceCache.d.ts +27 -0
  393. package/dist/Runtime/Extensions/TileMap/helper/dts/render/ResourceCache.d.ts.map +1 -0
  394. package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts +70 -0
  395. package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts.map +1 -0
  396. package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts +56 -0
  397. package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts.map +1 -0
  398. package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileTextureCache.d.ts +24 -0
  399. package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileTextureCache.d.ts.map +1 -0
  400. package/dist/Runtime/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts +26 -0
  401. package/dist/Runtime/Extensions/TileMap/helper/dts/render/ldtk/LDtkPixiHelper.d.ts.map +1 -0
  402. package/dist/Runtime/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts +21 -0
  403. package/dist/Runtime/Extensions/TileMap/helper/dts/render/tiled/TiledPixiHelper.d.ts.map +1 -0
  404. package/dist/Runtime/Extensions/TileMap/helper/dts/types/index.d.ts +12 -0
  405. package/dist/Runtime/Extensions/TileMap/helper/dts/types/index.d.ts.map +1 -0
  406. package/dist/Runtime/Extensions/TileMap/pako/dist/pako.d.ts +166 -0
  407. package/dist/Runtime/Extensions/TileMap/pako/dist/pako.min.js +2 -0
  408. package/dist/Runtime/Extensions/TileMap/pixi-tilemap/dist/global-pixi-tilemap.d.ts +23 -0
  409. package/dist/Runtime/Extensions/TileMap/pixi-tilemap/dist/pixi-tilemap.d.ts +270 -0
  410. package/dist/Runtime/Extensions/TileMap/pixi-tilemap/dist/pixi-tilemap.umd.js +74 -0
  411. package/dist/Runtime/Extensions/TileMap/pixi-tilemap/dist/pixi-tilemap.umd.js.map +7 -0
  412. package/dist/Runtime/Extensions/TileMap/tilemapcollisionmaskruntimeobject.js +2 -0
  413. package/dist/Runtime/Extensions/TileMap/tilemapcollisionmaskruntimeobject.js.map +7 -0
  414. package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject-pixi-renderer.js +2 -0
  415. package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject-pixi-renderer.js.map +7 -0
  416. package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject.js +2 -0
  417. package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject.js.map +7 -0
  418. package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject-pixi-renderer.js +2 -0
  419. package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject-pixi-renderer.js.map +7 -0
  420. package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js +2 -0
  421. package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js.map +7 -0
  422. package/dist/Runtime/Extensions/TopDownMovementBehavior/topdownmovementruntimebehavior.js +2 -0
  423. package/dist/Runtime/Extensions/TopDownMovementBehavior/topdownmovementruntimebehavior.js.map +7 -0
  424. package/dist/Runtime/Extensions/TweenBehavior/JsExtension.js +1087 -0
  425. package/dist/Runtime/Extensions/TweenBehavior/shifty.d.ts +839 -0
  426. package/dist/Runtime/Extensions/TweenBehavior/shifty.js +5 -0
  427. package/dist/Runtime/Extensions/TweenBehavior/shifty.js.map +1 -0
  428. package/dist/Runtime/Extensions/TweenBehavior/shifty_setup.js +2 -0
  429. package/dist/Runtime/Extensions/TweenBehavior/shifty_setup.js.map +7 -0
  430. package/dist/Runtime/Extensions/TweenBehavior/tweenruntimebehavior.js +2 -0
  431. package/dist/Runtime/Extensions/TweenBehavior/tweenruntimebehavior.js.map +7 -0
  432. package/dist/Runtime/Extensions/TweenBehavior/tweentools.js +2 -0
  433. package/dist/Runtime/Extensions/TweenBehavior/tweentools.js.map +7 -0
  434. package/dist/Runtime/Extensions/Video/JsExtension.js +694 -0
  435. package/dist/Runtime/Extensions/Video/videoruntimeobject-pixi-renderer.js +2 -0
  436. package/dist/Runtime/Extensions/Video/videoruntimeobject-pixi-renderer.js.map +7 -0
  437. package/dist/Runtime/Extensions/Video/videoruntimeobject.js +2 -0
  438. package/dist/Runtime/Extensions/Video/videoruntimeobject.js.map +7 -0
  439. package/dist/Runtime/FacebookInstantGames/fbapp-config.json +17 -0
  440. package/dist/Runtime/FacebookInstantGames/index.html +68 -0
  441. package/dist/Runtime/Model3DManager.js +2 -0
  442. package/dist/Runtime/Model3DManager.js.map +7 -0
  443. package/dist/Runtime/RuntimeCustomObjectLayer.js +2 -0
  444. package/dist/Runtime/RuntimeCustomObjectLayer.js.map +7 -0
  445. package/dist/Runtime/RuntimeInstanceContainer.js +2 -0
  446. package/dist/Runtime/RuntimeInstanceContainer.js.map +7 -0
  447. package/dist/Runtime/RuntimeLayer.js +2 -0
  448. package/dist/Runtime/RuntimeLayer.js.map +7 -0
  449. package/dist/Runtime/affinetransformation.js +2 -0
  450. package/dist/Runtime/affinetransformation.js.map +7 -0
  451. package/dist/Runtime/debugger-client/abstract-debugger-client.js +2 -0
  452. package/dist/Runtime/debugger-client/abstract-debugger-client.js.map +7 -0
  453. package/dist/Runtime/debugger-client/hot-reloader.js +2 -0
  454. package/dist/Runtime/debugger-client/hot-reloader.js.map +7 -0
  455. package/dist/Runtime/debugger-client/websocket-debugger-client.js +2 -0
  456. package/dist/Runtime/debugger-client/websocket-debugger-client.js.map +7 -0
  457. package/dist/Runtime/debugger-client/window-message-debugger-client.js +2 -0
  458. package/dist/Runtime/debugger-client/window-message-debugger-client.js.map +7 -0
  459. package/dist/Runtime/events-tools/cameratools.js +2 -0
  460. package/dist/Runtime/events-tools/cameratools.js.map +7 -0
  461. package/dist/Runtime/events-tools/commontools.js +2 -0
  462. package/dist/Runtime/events-tools/commontools.js.map +7 -0
  463. package/dist/Runtime/events-tools/inputtools.js +2 -0
  464. package/dist/Runtime/events-tools/inputtools.js.map +7 -0
  465. package/dist/Runtime/events-tools/networktools.js +2 -0
  466. package/dist/Runtime/events-tools/networktools.js.map +7 -0
  467. package/dist/Runtime/events-tools/objecttools.js +2 -0
  468. package/dist/Runtime/events-tools/objecttools.js.map +7 -0
  469. package/dist/Runtime/events-tools/runtimescenetools.js +2 -0
  470. package/dist/Runtime/events-tools/runtimescenetools.js.map +7 -0
  471. package/dist/Runtime/events-tools/soundtools.js +2 -0
  472. package/dist/Runtime/events-tools/soundtools.js.map +7 -0
  473. package/dist/Runtime/events-tools/storagetools.js +2 -0
  474. package/dist/Runtime/events-tools/storagetools.js.map +7 -0
  475. package/dist/Runtime/events-tools/stringtools.js +3 -0
  476. package/dist/Runtime/events-tools/stringtools.js.map +7 -0
  477. package/dist/Runtime/events-tools/variabletools.js +2 -0
  478. package/dist/Runtime/events-tools/variabletools.js.map +7 -0
  479. package/dist/Runtime/events-tools/windowtools.js +2 -0
  480. package/dist/Runtime/events-tools/windowtools.js.map +7 -0
  481. package/dist/Runtime/fontfaceobserver-font-manager/fontfaceobserver-font-manager.js +2 -0
  482. package/dist/Runtime/fontfaceobserver-font-manager/fontfaceobserver-font-manager.js.map +7 -0
  483. package/dist/Runtime/fontfaceobserver-font-manager/fontfaceobserver.js +16 -0
  484. package/dist/Runtime/force.js +2 -0
  485. package/dist/Runtime/force.js.map +7 -0
  486. package/dist/Runtime/gd.js +2 -0
  487. package/dist/Runtime/gd.js.map +7 -0
  488. package/dist/Runtime/howler-sound-manager/howler-sound-manager.js +2 -0
  489. package/dist/Runtime/howler-sound-manager/howler-sound-manager.js.map +7 -0
  490. package/dist/Runtime/howler-sound-manager/howler.min.js +3 -0
  491. package/dist/Runtime/index.html +55 -0
  492. package/dist/Runtime/inputmanager.js +2 -0
  493. package/dist/Runtime/inputmanager.js.map +7 -0
  494. package/dist/Runtime/jsonmanager.js +2 -0
  495. package/dist/Runtime/jsonmanager.js.map +7 -0
  496. package/dist/Runtime/layer.js +2 -0
  497. package/dist/Runtime/layer.js.map +7 -0
  498. package/dist/Runtime/libs/CocoonJS/cocoon.min.js +4 -0
  499. package/dist/Runtime/libs/jshashtable.js +2 -0
  500. package/dist/Runtime/libs/jshashtable.js.map +7 -0
  501. package/dist/Runtime/libs/rbush.js +624 -0
  502. package/dist/Runtime/logger.js +2 -0
  503. package/dist/Runtime/logger.js.map +7 -0
  504. package/dist/Runtime/oncetriggers.js +2 -0
  505. package/dist/Runtime/oncetriggers.js.map +7 -0
  506. package/dist/Runtime/pixi-renderers/CustomObjectPixiRenderer.js +2 -0
  507. package/dist/Runtime/pixi-renderers/CustomObjectPixiRenderer.js.map +7 -0
  508. package/dist/Runtime/pixi-renderers/DebuggerPixiRenderer.js +2 -0
  509. package/dist/Runtime/pixi-renderers/DebuggerPixiRenderer.js.map +7 -0
  510. package/dist/Runtime/pixi-renderers/RuntimeInstanceContainerPixiRenderer.js +1 -0
  511. package/dist/Runtime/pixi-renderers/RuntimeInstanceContainerPixiRenderer.js.map +7 -0
  512. package/dist/Runtime/pixi-renderers/ThreeAddons.js +2 -0
  513. package/dist/Runtime/pixi-renderers/draco/gltf/draco_decoder.wasm +0 -0
  514. package/dist/Runtime/pixi-renderers/draco/gltf/draco_wasm_wrapper.js +116 -0
  515. package/dist/Runtime/pixi-renderers/layer-pixi-renderer.js +15 -0
  516. package/dist/Runtime/pixi-renderers/layer-pixi-renderer.js.map +7 -0
  517. package/dist/Runtime/pixi-renderers/loadingscreen-pixi-renderer.js +2 -0
  518. package/dist/Runtime/pixi-renderers/loadingscreen-pixi-renderer.js.map +7 -0
  519. package/dist/Runtime/pixi-renderers/pixi-bitmapfont-manager.js +2 -0
  520. package/dist/Runtime/pixi-renderers/pixi-bitmapfont-manager.js.map +7 -0
  521. package/dist/Runtime/pixi-renderers/pixi-effects-manager.js +2 -0
  522. package/dist/Runtime/pixi-renderers/pixi-effects-manager.js.map +7 -0
  523. package/dist/Runtime/pixi-renderers/pixi-filters-tools.js +2 -0
  524. package/dist/Runtime/pixi-renderers/pixi-filters-tools.js.map +7 -0
  525. package/dist/Runtime/pixi-renderers/pixi-image-manager.js +2 -0
  526. package/dist/Runtime/pixi-renderers/pixi-image-manager.js.map +7 -0
  527. package/dist/Runtime/pixi-renderers/pixi.js +11 -0
  528. package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js +2 -0
  529. package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js.map +7 -0
  530. package/dist/Runtime/pixi-renderers/runtimescene-pixi-renderer.js +3 -0
  531. package/dist/Runtime/pixi-renderers/runtimescene-pixi-renderer.js.map +7 -0
  532. package/dist/Runtime/pixi-renderers/spriteruntimeobject-pixi-renderer.js +2 -0
  533. package/dist/Runtime/pixi-renderers/spriteruntimeobject-pixi-renderer.js.map +7 -0
  534. package/dist/Runtime/pixi-renderers/three.js +7 -0
  535. package/dist/Runtime/polygon.js +2 -0
  536. package/dist/Runtime/polygon.js.map +7 -0
  537. package/dist/Runtime/profiler.js +2 -0
  538. package/dist/Runtime/profiler.js.map +7 -0
  539. package/dist/Runtime/runtimebehavior.js +2 -0
  540. package/dist/Runtime/runtimebehavior.js.map +7 -0
  541. package/dist/Runtime/runtimegame.js +2 -0
  542. package/dist/Runtime/runtimegame.js.map +7 -0
  543. package/dist/Runtime/runtimeobject.js +2 -0
  544. package/dist/Runtime/runtimeobject.js.map +7 -0
  545. package/dist/Runtime/runtimescene.js +2 -0
  546. package/dist/Runtime/runtimescene.js.map +7 -0
  547. package/dist/Runtime/runtimewatermark.js +100 -0
  548. package/dist/Runtime/runtimewatermark.js.map +7 -0
  549. package/dist/Runtime/scenestack.js +2 -0
  550. package/dist/Runtime/scenestack.js.map +7 -0
  551. package/dist/Runtime/splash/gd-logo-dark-colored.js +2 -0
  552. package/dist/Runtime/splash/gd-logo-dark-colored.js.map +7 -0
  553. package/dist/Runtime/splash/gd-logo-dark.js +2 -0
  554. package/dist/Runtime/splash/gd-logo-dark.js.map +7 -0
  555. package/dist/Runtime/splash/gd-logo-light-colored.js +2 -0
  556. package/dist/Runtime/splash/gd-logo-light-colored.js.map +7 -0
  557. package/dist/Runtime/splash/gd-logo-light.js +2 -0
  558. package/dist/Runtime/splash/gd-logo-light.js.map +7 -0
  559. package/dist/Runtime/spriteruntimeobject.js +2 -0
  560. package/dist/Runtime/spriteruntimeobject.js.map +7 -0
  561. package/dist/Runtime/timemanager.js +2 -0
  562. package/dist/Runtime/timemanager.js.map +7 -0
  563. package/dist/Runtime/timer.js +2 -0
  564. package/dist/Runtime/timer.js.map +7 -0
  565. package/dist/Runtime/types/global-pixi.d.ts +22 -0
  566. package/dist/Runtime/types/global-three-addons.d.ts +9 -0
  567. package/dist/Runtime/types/global-three.d.ts +3 -0
  568. package/dist/Runtime/types/global-types.d.ts +61 -0
  569. package/dist/Runtime/types/howler.d.ts +313 -0
  570. package/dist/Runtime/types/project-data.d.ts +276 -0
  571. package/dist/Runtime/variable.js +2 -0
  572. package/dist/Runtime/variable.js.map +7 -0
  573. package/dist/Runtime/variablescontainer.js +2 -0
  574. package/dist/Runtime/variablescontainer.js.map +7 -0
  575. package/dist/lib/libGD.cjs +22 -0
  576. package/dist/lib/libGD.wasm +0 -0
  577. package/dist/loaders.js +1 -0
  578. package/package.json +24 -10
  579. package/src/downloadGD.js +0 -70
  580. package/src/index.js +21 -14
  581. package/examples/create-objects-from-json/assets/Blank button.png +0 -0
  582. package/examples/create-objects-from-json/game.json +0 -258
  583. package/examples/create-objects-from-json/index.js +0 -50
  584. package/examples/create-objects-from-json/mylist.json +0 -7
  585. package/examples/export-game/game.json +0 -205
  586. package/examples/export-game/index.js +0 -13
  587. package/src/CaseSensitiveSlug.js +0 -34
  588. package/src/EventsFunctionsExtensionsLoader/LocalEventsFunctionCodeWriter.js +0 -56
  589. package/src/EventsFunctionsExtensionsLoader/MetadataDeclarationHelpers.js +0 -489
  590. package/src/EventsFunctionsExtensionsLoader/index.js +0 -451
  591. package/src/JsExtensionsLoader/LocalJsExtensionsFinder.js +0 -42
  592. package/src/JsExtensionsLoader/LocalJsExtensionsLoader.js +0 -57
  593. package/src/JsExtensionsLoader/index.js +0 -101
  594. package/src/LocalFileSystem.js +0 -158
  595. package/src/LocalProjectOpener.js +0 -46
  596. package/src/LocalProjectWriter.js +0 -96
  597. package/src/MapFor.js +0 -46
  598. package/src/ObjectSplitter.js +0 -187
  599. package/src/Serializer.js +0 -35
  600. package/src/build.js +0 -51
  601. package/src/runtime-files-list.js +0 -143
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../GDevelop/Extensions/Video/videoruntimeobject-pixi-renderer.ts"],
4
+ "sourcesContent": ["namespace gdjs {\n const logger = new gdjs.Logger('Video object PIXI renderer');\n\n import PIXI = GlobalPIXIModule.PIXI;\n\n /**\n * The PIXI.js renderer for the VideoRuntimeObject.\n */\n export class VideoRuntimeObjectPixiRenderer {\n _object: gdjs.VideoRuntimeObject;\n\n // Load (or reset) the video\n _pixiObject: any;\n _textureWasValid: boolean = false;\n\n /**\n * @param runtimeObject The object to render\n * @param instanceContainer The gdjs.RuntimeScene in which the object is\n */\n constructor(\n runtimeObject: gdjs.VideoRuntimeObject,\n instanceContainer: gdjs.RuntimeInstanceContainer\n ) {\n this._object = runtimeObject;\n this._pixiObject = new PIXI.Sprite(\n instanceContainer\n .getGame()\n .getImageManager()\n .getPIXIVideoTexture(this._object._videoResource)\n );\n this._pixiObject._texture.baseTexture.resource.autoPlay = false;\n\n // Needed to avoid video not playing/crashing in Chrome/Chromium browsers.\n // See https://github.com/pixijs/pixi.js/issues/5996\n this._pixiObject._texture.baseTexture.resource.source.preload = 'auto';\n this._pixiObject._texture.baseTexture.resource.source.autoload = true;\n\n // Will be set to true when video texture is loaded.\n instanceContainer\n .getLayer('')\n .getRenderer()\n .addRendererObject(this._pixiObject, runtimeObject.getZOrder());\n\n // Set the anchor in the center, so that the object rotates around\n // its center\n this._pixiObject.anchor.x = 0.5;\n this._pixiObject.anchor.y = 0.5;\n this.updatePosition();\n this.updateAngle();\n this.updateOpacity();\n this.updateVolume();\n this.updateLoop();\n }\n\n getRendererObject() {\n return this._pixiObject;\n }\n\n /**\n * To be called when the object is removed from the scene: will pause the video.\n */\n onDestroy() {\n this.pause();\n }\n\n ensureUpToDate() {\n // Make sure that the video is repositioned after the texture was loaded\n // (as width and height will change).\n if (\n !this._textureWasValid &&\n this._pixiObject.texture &&\n this._pixiObject.texture.valid\n ) {\n this.updatePosition();\n this._textureWasValid = true;\n }\n }\n\n updatePosition(): void {\n this._pixiObject.position.x = this._object.x + this._pixiObject.width / 2;\n this._pixiObject.position.y =\n this._object.y + this._pixiObject.height / 2;\n }\n\n updateLoop(): void {\n this._pixiObject._texture.baseTexture.resource.source.loop = this._object._loop;\n }\n\n updateVolume(): void {\n this._pixiObject._texture.baseTexture.resource.source.volume =\n this._object._volume / 100;\n }\n\n updateAngle(): void {\n this._pixiObject.rotation = gdjs.toRad(this._object.angle);\n }\n\n updateOpacity(): void {\n this._pixiObject.alpha = this._object._opacity / 255;\n }\n\n getWidth(): float {\n return this._pixiObject.width;\n }\n\n getHeight(): float {\n return this._pixiObject.height;\n }\n\n /**\n * Set the rendered video width\n * @param width The new width, in pixels.\n */\n setWidth(width: float): void {\n this._pixiObject.width = width;\n\n // Position needs to be updated, as position in the center of the PIXI Sprite.\n this.updatePosition();\n }\n\n /**\n * Set the rendered video height\n * @param height The new height, in pixels.\n */\n setHeight(height: float): void {\n this._pixiObject.height = height;\n\n // Position needs to be updated, as position in the center of the PIXI Sprite.\n this.updatePosition();\n }\n\n /**\n * Get the internal HTMLVideoElement used for the video source.\n * @returns The video element, if any.\n */\n _getHTMLVideoElementSource(): HTMLVideoElement | null {\n if (\n !this._pixiObject.texture ||\n !this._pixiObject.texture.baseTexture.resource.source\n ) {\n return null;\n }\n const source = this._pixiObject.texture.baseTexture.resource.source;\n if (!(source instanceof HTMLVideoElement)) {\n return null;\n }\n return source;\n }\n\n /**\n * Start the video\n */\n play() {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return;\n }\n const promise = source.play();\n if (promise !== undefined) {\n // Autoplay started\n promise\n .then(() => {})\n .catch(() => {\n // Autoplay was prevented.\n logger.warn(\n 'The video did not start because: video is invalid or no interaction with the game has been captured before (this is blocked by the navigator: https://goo.gl/xX8pDD)'\n );\n });\n }\n }\n\n /**\n * Pause the video\n */\n pause() {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return;\n }\n source.pause();\n }\n\n // Autoplay was prevented.\n /**\n * Set the loop on video in renderer\n * @param enable true to loop the video\n */\n setLoop(enable: boolean): void {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return;\n }\n source.loop = enable;\n }\n\n /**\n * Set or unset mute on the video.\n * @param enable true to mute\n */\n setMute(enable: boolean): void {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return;\n }\n this._pixiObject._texture.baseTexture.resource.source.muted = enable;\n }\n\n /**\n * Return true if the video is muted.\n */\n isMuted(): boolean {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return false;\n }\n return source.muted;\n }\n\n /**\n * Set the current time of the video.\n */\n setCurrentTime(number): void {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return;\n }\n source.currentTime = number;\n }\n\n /**\n * Set the volume of the video, between 0 and 1.\n * @param volume The new volume.\n */\n setVolume(volume: number): void {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return;\n }\n source.volume = volume;\n }\n\n /**\n * Get the volume on video, between 0 and 1.\n */\n getVolume() {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return 0;\n }\n return source.volume;\n }\n\n /**\n * Return true if the video is playing\n */\n isPlayed(): boolean {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return false;\n }\n return !source.paused && !source.ended;\n }\n\n /**\n * Return true if the video is looping\n */\n isLooped(): boolean {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return false;\n }\n return source.loop;\n }\n\n /**\n * Get the current time of the playback.\n */\n getCurrentTime(): float {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return 0;\n }\n return source.currentTime;\n }\n\n /**\n * Get the duration of the video.\n */\n getDuration() {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return 0;\n }\n return source.duration;\n }\n\n /**\n * Return true if the video has ended.\n */\n isEnded(): boolean {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return false;\n }\n return source.ended;\n }\n\n /**\n * Set the playback speed (1 = 100%)\n */\n setPlaybackSpeed(playbackRate): void {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return;\n }\n source.playbackRate = playbackRate;\n }\n\n /**\n * Return the playback speed (1 = 100%)\n */\n getPlaybackSpeed() {\n const source = this._getHTMLVideoElementSource();\n if (!source) {\n return 0;\n }\n return source.playbackRate;\n }\n }\n\n export const VideoRuntimeObjectRenderer = VideoRuntimeObjectPixiRenderer;\n export type VideoRuntimeObjectRenderer = VideoRuntimeObjectPixiRenderer;\n}\n"],
5
+ "mappings": "AAAA,IAAU,MAAAA,GAAV,CACE,MAAMC,EAAS,IAAID,EAAK,OAAO,4BAA4B,EAEpDE,EAAO,iBAAiB,KAKxB,MAAMC,CAA+B,CAC1C,QAGA,YACA,iBAA4B,GAM5B,YACEC,EACAC,EACA,CACA,KAAK,QAAUD,EACf,KAAK,YAAc,IAAIF,EAAK,OAC1BG,EACG,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,KAAK,QAAQ,cAAc,CACpD,EACA,KAAK,YAAY,SAAS,YAAY,SAAS,SAAW,GAI1D,KAAK,YAAY,SAAS,YAAY,SAAS,OAAO,QAAU,OAChE,KAAK,YAAY,SAAS,YAAY,SAAS,OAAO,SAAW,GAGjEA,EACG,SAAS,EAAE,EACX,YAAY,EACZ,kBAAkB,KAAK,YAAaD,EAAc,UAAU,CAAC,EAIhE,KAAK,YAAY,OAAO,EAAI,GAC5B,KAAK,YAAY,OAAO,EAAI,GAC5B,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,WAAW,CAClB,CAEA,mBAAo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B,MAAML,EAAS,KAAK,2BAA2B,EAC/C,OAAKA,EAGEA,EAAO,aAFL,CAGX,CACF,CAhUOR,EAAM,+BAAAG,EAkUAH,EAAA,2BAA6BG,IA1UlC",
6
+ "names": ["gdjs", "logger", "PIXI", "VideoRuntimeObjectPixiRenderer", "runtimeObject", "instanceContainer", "width", "height", "source", "promise", "enable", "number", "volume", "playbackRate"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var gdjs;(o=>{class i extends o.RuntimeObject{_opacity;_loop;_volume;_videoResource;_pausedAsScenePaused=!1;_renderer;_playbackSpeed;constructor(e,t){super(e,t),this._opacity=t.content.opacity,this._loop=t.content.loop,this._volume=t.content.volume,this._videoResource=t.content.videoResource,this._renderer=new o.VideoRuntimeObjectRenderer(this,e),this.onCreated()}getRendererObject(){return this._renderer.getRendererObject()}updateFromObjectData(e,t){return e.content.opacity!==t.content.opacity&&this.setOpacity(t.content.opacity),e.content.loop!==t.content.loop&&this.setLoop(t.content.loop),e.content.volume!==t.content.volume&&this.setVolume(t.content.volume),e.content.videoResource===t.content.videoResource}extraInitializationFromInitialInstance(e){e.customSize&&(this.setWidth(e.width),this.setHeight(e.height))}onDestroyFromScene(e){super.onDestroyFromScene(e),this._renderer.onDestroy()}update(e){this._renderer.ensureUpToDate()}setX(e){super.setX(e),this._renderer.updatePosition()}setY(e){super.setY(e),this._renderer.updatePosition()}setAngle(e){super.setAngle(e),this._renderer.updateAngle()}setOpacity(e){this._opacity=e,this._renderer.updateOpacity()}getOpacity(){return this._opacity}setWidth(e){this._renderer.getWidth()!==e&&(this._renderer.setWidth(e),this.invalidateHitboxes())}setHeight(e){this._renderer.getHeight()!==e&&(this._renderer.setHeight(e),this.invalidateHitboxes())}getWidth(){return this._renderer.getWidth()}getHeight(){return this._renderer.getHeight()}play(){this._renderer.play()}pause(){this._renderer.pause()}setLoop(e){this._renderer.setLoop(e)}mute(e){this._renderer.setMute(e)}isMuted(){return this._renderer.isMuted()}setVolume(e){this._volume=o.evtTools.common.clamp(o.evtTools.common.normalize(e,0,100),0,1)*100,this._renderer.updateVolume()}getVolume(){return o.evtTools.common.normalize(this._renderer.getVolume(),0,1)*100}isPlayed(){return this._renderer.isPlayed()}isPaused(){return!this._renderer.isPlayed()}isLooped(){return this._renderer.isLooped()}getDuration(){return this._renderer.getDuration()}isEnded(){return this._renderer.isEnded()}setCurrentTime(e){this._renderer.setCurrentTime(e)}getCurrentTime(){return this._renderer.getCurrentTime()}setPlaybackSpeed(e){this._playbackSpeed=o.evtTools.common.clamp(e,.5,2),this._renderer.setPlaybackSpeed(this._playbackSpeed)}getPlaybackSpeed(){return this._renderer.getPlaybackSpeed()}}o.VideoRuntimeObject=i,o.registerObject("Video::VideoObject",o.VideoRuntimeObject),o.registerRuntimeSceneUnloadedCallback(function(r){const e=r.getAdhocListOfAllInstances();for(let t=0;t<e.length;++t){const n=e[t];n instanceof o.VideoRuntimeObject&&n.isPlayed()&&n.pause()}}),o.registerRuntimeScenePausedCallback(function(r){const e=r.getAdhocListOfAllInstances();for(let t=0;t<e.length;++t){const n=e[t];n instanceof o.VideoRuntimeObject&&n.isPlayed()&&(n.pause(),n._pausedAsScenePaused=!0)}}),o.registerRuntimeSceneResumedCallback(function(r){const e=r.getAdhocListOfAllInstances();for(let t=0;t<e.length;++t){const n=e[t];n instanceof o.VideoRuntimeObject&&n._pausedAsScenePaused&&n.play()}})})(gdjs||={});
2
+ //# sourceMappingURL=videoruntimeobject.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../GDevelop/Extensions/Video/videoruntimeobject.ts"],
4
+ "sourcesContent": ["namespace gdjs {\n /** The initial properties for {@link gdjs.VideoRuntimeObject} */\n export type VideoObjectDataType = {\n /** The base parameters of the video */\n content: {\n /** The opacity of the video */\n opacity: number;\n /** Does the video loops itself? */\n loop: boolean;\n /** The volume of the video */\n volume: number;\n /** Name of the resource corresponding to the video */\n videoResource: string;\n };\n };\n\n export type VideoObjectData = ObjectData & VideoObjectDataType;\n\n /**\n * An object displaying a video on screen.\n *\n * For the same video resource, only one video is being created in memory (\n * as a HTMLVideoElement). This means that two objects displaying the same\n * video will have the same state for this video (paused/playing, current time,\n * volume, etc...).\n */\n export class VideoRuntimeObject extends gdjs.RuntimeObject {\n _opacity: float;\n _loop: boolean;\n _volume: float;\n _videoResource: string;\n\n // Use a boolean to track if the video was paused because we\n // navigated to another scene, and so should resume if we're back.\n _pausedAsScenePaused: boolean = false;\n _renderer: gdjs.VideoRuntimeObjectRenderer;\n _playbackSpeed: any;\n\n /**\n * @param instanceContainer The scene the object belongs to.\n * @param videoObjectData The data defining the object\n */\n constructor(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n videoObjectData: VideoObjectData\n ) {\n super(instanceContainer, videoObjectData);\n this._opacity = videoObjectData.content.opacity;\n this._loop = videoObjectData.content.loop;\n this._volume = videoObjectData.content.volume;\n this._videoResource = videoObjectData.content.videoResource;\n this._renderer = new gdjs.VideoRuntimeObjectRenderer(\n this,\n instanceContainer\n );\n\n // *ALWAYS* call `this.onCreated()` at the very end of your object constructor.\n this.onCreated();\n }\n\n getRendererObject() {\n return this._renderer.getRendererObject();\n }\n\n updateFromObjectData(\n oldObjectData: VideoObjectData,\n newObjectData: VideoObjectData\n ): boolean {\n if (oldObjectData.content.opacity !== newObjectData.content.opacity) {\n this.setOpacity(newObjectData.content.opacity);\n }\n if (oldObjectData.content.loop !== newObjectData.content.loop) {\n this.setLoop(newObjectData.content.loop);\n }\n if (oldObjectData.content.volume !== newObjectData.content.volume) {\n this.setVolume(newObjectData.content.volume);\n }\n if (\n oldObjectData.content.videoResource !==\n newObjectData.content.videoResource\n ) {\n return false;\n }\n return true;\n }\n\n /**\n * Initialize the extra parameters that could be set for an instance.\n * @param initialInstanceData The initial instance data\n */\n extraInitializationFromInitialInstance(initialInstanceData: InstanceData) {\n if (initialInstanceData.customSize) {\n this.setWidth(initialInstanceData.width);\n this.setHeight(initialInstanceData.height);\n }\n }\n\n onDestroyFromScene(instanceContainer: gdjs.RuntimeInstanceContainer): void {\n super.onDestroyFromScene(instanceContainer);\n this._renderer.onDestroy();\n }\n\n update(instanceContainer: gdjs.RuntimeInstanceContainer): void {\n this._renderer.ensureUpToDate();\n }\n\n /**\n * Set object position on X axis.\n * @param x The new position X of the object.\n */\n setX(x: float): void {\n super.setX(x);\n this._renderer.updatePosition();\n }\n\n /**\n * Set object position on Y axis.\n * @param y The new position Y of the object.\n */\n setY(y: float): void {\n super.setY(y);\n this._renderer.updatePosition();\n }\n\n /**\n * Set the angle of the object.\n * @param angle The new angle of the object.\n */\n setAngle(angle: float): void {\n super.setAngle(angle);\n this._renderer.updateAngle();\n }\n\n /**\n * Set object opacity.\n * @param opacity The new opacity of the object (0-255).\n */\n setOpacity(opacity: float): void {\n this._opacity = opacity;\n this._renderer.updateOpacity();\n }\n\n /**\n * Get object opacity.\n * @returns The current opacity\n */\n getOpacity(): number {\n return this._opacity;\n }\n\n /**\n * Set the width of the video.\n * @param width The new width in pixels.\n */\n setWidth(width: float): void {\n if (this._renderer.getWidth() === width) return;\n\n this._renderer.setWidth(width);\n this.invalidateHitboxes();\n }\n\n /**\n * Set the height of the video.\n * @param height The new height in pixels.\n */\n setHeight(height: float): void {\n if (this._renderer.getHeight() === height) return;\n\n this._renderer.setHeight(height);\n this.invalidateHitboxes();\n }\n\n /**\n * Get the width of the video object.\n * @returns The current width of the object\n */\n getWidth(): float {\n return this._renderer.getWidth();\n }\n\n /**\n * Get the height of the video object.\n * @returns The current height of the object\n */\n getHeight(): float {\n return this._renderer.getHeight();\n }\n\n /**\n * Play the video.\n */\n play(): void {\n this._renderer.play();\n }\n\n /**\n * Pause the video.\n */\n pause(): void {\n this._renderer.pause();\n }\n\n /**\n * Set the state looped of the video.\n * @param enable true to loop the video\n */\n setLoop(enable: boolean): void {\n this._renderer.setLoop(enable);\n }\n\n /**\n * Set the state muted of the video.\n * @param enable The new state.\n */\n mute(enable: boolean) {\n this._renderer.setMute(enable);\n }\n\n /**\n * Return the state muted of video object.\n * @returns Is the video muted?\n */\n isMuted(): boolean {\n return this._renderer.isMuted();\n }\n\n /**\n * Set the volume of the video object.\n * @param volume The new volume, between 0 and 100.\n */\n setVolume(volume: number): void {\n this._volume =\n gdjs.evtTools.common.clamp(\n gdjs.evtTools.common.normalize(volume, 0, 100),\n 0,\n 1\n ) * 100;\n this._renderer.updateVolume();\n }\n\n /**\n * Get the volume of the video object.\n * @returns The current video's volume, between 0 and 100.\n */\n getVolume(): number {\n return (\n gdjs.evtTools.common.normalize(this._renderer.getVolume(), 0, 1) * 100\n );\n }\n\n /**\n * Check if the video is being played.\n * @returns Is the video being played?\n */\n isPlayed(): boolean {\n return this._renderer.isPlayed();\n }\n\n /**\n * Check if the video is paused.\n * @returns Is the video being paused?\n */\n isPaused(): boolean {\n return !this._renderer.isPlayed();\n }\n\n /**\n * Check if the video is looping.\n * @returns Is the video looping?\n */\n isLooped(): boolean {\n return this._renderer.isLooped();\n }\n\n /**\n * Return the total time of the video.\n * @returns The duration of the video\n */\n getDuration(): number {\n return this._renderer.getDuration();\n }\n\n /**\n * Check if the video has ended.\n * @returns Has the video ended?\n */\n isEnded(): boolean {\n return this._renderer.isEnded();\n }\n\n /**\n * Set the new time of the video object.\n * @param time The new time.\n */\n setCurrentTime(time: float): void {\n this._renderer.setCurrentTime(time);\n }\n\n /**\n * Get the current time of the video object.\n * @returns The current time of the video\n */\n getCurrentTime(): float {\n return this._renderer.getCurrentTime();\n }\n\n /**\n * Set the new playback speed of the video object.\n * @param playbackSpeed The new playback speed.\n */\n setPlaybackSpeed(playbackSpeed: number): void {\n this._playbackSpeed = gdjs.evtTools.common.clamp(playbackSpeed, 0.5, 2);\n this._renderer.setPlaybackSpeed(this._playbackSpeed);\n }\n\n /**\n * Get the playback speed of the video object.\n * @returns The current playback speed of the video.\n */\n getPlaybackSpeed(): number {\n return this._renderer.getPlaybackSpeed();\n }\n }\n gdjs.registerObject('Video::VideoObject', gdjs.VideoRuntimeObject);\n\n /**\n * When a scene is unloaded, pause any video being run.\n * TODO: Investigate how to dispose the video source?\n */\n gdjs.registerRuntimeSceneUnloadedCallback(function (runtimeScene) {\n // Manually find all the gdjs.VideoRuntimeObject living on the scene,\n // and pause them.\n const instances = runtimeScene.getAdhocListOfAllInstances();\n for (let i = 0; i < instances.length; ++i) {\n const obj = instances[i];\n if (obj instanceof gdjs.VideoRuntimeObject) {\n if (obj.isPlayed()) {\n obj.pause();\n }\n }\n }\n });\n\n /**\n * When a scene is paused, pause any video being run.\n */\n gdjs.registerRuntimeScenePausedCallback(function (runtimeScene) {\n // Manually find all the gdjs.VideoRuntimeObject living on the scene,\n // and pause them.\n const instances = runtimeScene.getAdhocListOfAllInstances();\n for (let i = 0; i < instances.length; ++i) {\n const obj = instances[i];\n if (obj instanceof gdjs.VideoRuntimeObject) {\n if (obj.isPlayed()) {\n obj.pause();\n obj._pausedAsScenePaused = true;\n }\n }\n }\n });\n\n // Flag it to be started again when scene is resumed.\n\n /**\n * When a scene is resumed, resume any video previously paused.\n */\n gdjs.registerRuntimeSceneResumedCallback(function (runtimeScene) {\n // Manually find all the gdjs.VideoRuntimeObject living on the scene,\n // and play them if they have been previously paused.\n const instances = runtimeScene.getAdhocListOfAllInstances();\n for (let i = 0; i < instances.length; ++i) {\n const obj = instances[i];\n if (obj instanceof gdjs.VideoRuntimeObject) {\n if (obj._pausedAsScenePaused) {\n obj.play();\n }\n }\n }\n });\n}\n"],
5
+ "mappings": "AAAA,IAAU,MAAAA,GAAV,CA0BS,MAAMC,UAA2BD,EAAK,aAAc,CACzD,SACA,MACA,QACA,eAIA,qBAAgC,GAChC,UACA,eAMA,YACEE,EACAC,EACA,CACA,MAAMD,EAAmBC,CAAe,EACxC,KAAK,SAAWA,EAAgB,QAAQ,QACxC,KAAK,MAAQA,EAAgB,QAAQ,KACrC,KAAK,QAAUA,EAAgB,QAAQ,OACvC,KAAK,eAAiBA,EAAgB,QAAQ,cAC9C,KAAK,UAAY,IAAIH,EAAK,2B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CAAqC,SAAUiB,EAAc,CAGhE,MAAMC,EAAYD,EAAa,2BAA2B,EAC1D,QAASE,EAAI,EAAGA,EAAID,EAAU,OAAQ,EAAEC,EAAG,CACzC,MAAMC,EAAMF,EAAUC,CAAC,EACnBC,aAAepB,EAAK,oBAClBoB,EAAI,SAAS,GACfA,EAAI,MAAM,CAGhB,CACF,CAAC,EAKDpB,EAAK,mCAAmC,SAAUiB,EAAc,CAG9D,MAAMC,EAAYD,EAAa,2BAA2B,EAC1D,QAASE,EAAI,EAAGA,EAAID,EAAU,OAAQ,EAAEC,EAAG,CACzC,MAAMC,EAAMF,EAAUC,CAAC,EACnBC,aAAepB,EAAK,oBAClBoB,EAAI,SAAS,IACfA,EAAI,MAAM,EACVA,EAAI,qBAAuB,GAGjC,CACF,CAAC,EAODpB,EAAK,oCAAoC,SAAUiB,EAAc,CAG/D,MAAMC,EAAYD,EAAa,2BAA2B,EAC1D,QAASE,EAAI,EAAGA,EAAID,EAAU,OAAQ,EAAEC,EAAG,CACzC,MAAMC,EAAMF,EAAUC,CAAC,EACnBC,aAAepB,EAAK,oBAClBoB,EAAI,sBACNA,EAAI,KAAK,CAGf,CACF,CAAC,IA1XO",
6
+ "names": ["gdjs", "VideoRuntimeObject", "instanceContainer", "videoObjectData", "oldObjectData", "newObjectData", "initialInstanceData", "x", "y", "angle", "opacity", "width", "height", "enable", "volume", "time", "playbackSpeed", "runtimeScene", "instances", "i", "obj"]
7
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "instant_games": {
3
+ "custom_update_templates": {
4
+ },
5
+ "bot": {
6
+ "subscription_type": "OPT_IN_DEV"
7
+ },
8
+ "surfaceable_stats": {
9
+ },
10
+ "orientation": "GDJS_ORIENTATION",
11
+ "navigation_menu_version": "NAV_BAR",
12
+ "match_player_config": {
13
+ "min_context_size": 2,
14
+ "max_context_size": 20
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,68 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8"/>
5
+
6
+ <meta name="apple-mobile-web-app-capable" content="yes">
7
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
8
+
9
+ <meta name="theme-color" content="#000000" />
10
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
11
+
12
+ <style>
13
+ body {
14
+ margin: 0;
15
+ padding: 0;
16
+ background-color: #000000;
17
+ overflow: hidden;
18
+ }
19
+ #canvasArea {
20
+ margin-left: auto;
21
+ margin-right: auto;
22
+ overflow: hidden;
23
+ }
24
+
25
+ /* GDJS_CUSTOM_STYLE */
26
+ </style>
27
+
28
+ <!-- Facebook Instant Games SDK (see https://developers.facebook.com/docs/games/instant-games/getting-started/quickstart) -->
29
+ <script src="https://connect.facebook.net/en_US/fbinstant.6.0.js"></script>
30
+
31
+ <!-- Libs and GDJS core files : -->
32
+ <!-- GDJS_CODE_FILES -->
33
+
34
+ </head>
35
+ <body>
36
+ <div id="canvasArea"></div>
37
+
38
+ <!-- GDJS_CUSTOM_HTML -->
39
+ <script>
40
+
41
+ (function() {
42
+ //Initialization
43
+ var game = new gdjs.RuntimeGame(gdjs.projectData, {}/*GDJS_ADDITIONAL_SPEC*/);
44
+
45
+ //Create a renderer
46
+ var canvasArea = document.getElementById("canvasArea");
47
+ game.getRenderer().createStandardCanvas(canvasArea);
48
+
49
+ //Bind keyboards/mouse/touch events
50
+ game.getRenderer().bindStandardEvents(game.getInputManager(), window, document);
51
+
52
+ FBInstant.initializeAsync()
53
+ .then(function() {
54
+ //Load all assets and start the game
55
+ game.loadAllAssets(function() {
56
+ FBInstant.startGameAsync()
57
+ .then(function() {
58
+ game.startGameLoop();
59
+ });
60
+ }, function(percent) {
61
+ FBInstant.setLoadingProgress(percent);
62
+ });
63
+ });
64
+ })();
65
+
66
+ </script>
67
+ </body>
68
+ </html>
@@ -0,0 +1,2 @@
1
+ var gdjs;(c=>{const i=new c.Logger("Model3DManager");class u{_loadedThreeModels=new Map;_resourcesLoader;_resources;_loader=null;_dracoLoader=null;_invalidModel;constructor(r,s){if(this._resources=r,this._resourcesLoader=s,typeof THREE<"u"){this._loader=new THREE_ADDONS.GLTFLoader,this._dracoLoader=new THREE_ADDONS.DRACOLoader,this._dracoLoader.setDecoderPath("./pixi-renderers/draco/gltf/"),this._loader.setDRACOLoader(this._dracoLoader);const a=new THREE.Group;a.add(new THREE.Mesh(new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:"#ff00ff"}))),this._invalidModel={scene:a,animations:[],cameras:[],scenes:[],asset:{},userData:{},parser:null}}}setResources(r){this._resources=r}loadModels(r,s){const e=this._resources.filter(function(t){return t.kind==="model3D"});if(e.length===0||!this._loader)return s(e.length);let o=0;for(let t=0;t<e.length;++t){const d=e[t],n=this._resourcesLoader.getFullUrl(d.file);this._loader.withCredentials=this._resourcesLoader.checkIfCredentialsRequired(n),this._loader.load(n,l=>{this._loadedThreeModels.set(d.name,l),o++,o===e.length?s(e.length):r(o,e.length)},void 0,l=>{i.error(l),o++,o===e.length?s(e.length):r(o,e.length)})}}getModel(r){return this._loadedThreeModels.get(r)||this._invalidModel}}c.Model3DManager=u})(gdjs||={});
2
+ //# sourceMappingURL=Model3DManager.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../GDevelop/GDJS/Runtime/Model3DManager.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('Model3DManager');\n type OnProgressCallback = (loadedCount: integer, totalCount: integer) => void;\n type OnCompleteCallback = (totalCount: integer) => void;\n\n /**\n * Load GLB files (using `Three.js`), using the \"model3D\" resources\n * registered in the game resources.\n */\n export class Model3DManager {\n /**\n * Map associating a resource name to the loaded Three.js model.\n */\n private _loadedThreeModels = new Map<String, THREE_ADDONS.GLTF>();\n\n _resourcesLoader: RuntimeGameResourcesLoader;\n _resources: ResourceData[];\n\n _loader: THREE_ADDONS.GLTFLoader | null = null;\n _dracoLoader: THREE_ADDONS.DRACOLoader | null = null;\n\n //@ts-ignore Can only be null if THREE is not loaded.\n _invalidModel: THREE_ADDONS.GLTF;\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 if (typeof THREE !== 'undefined') {\n this._loader = new THREE_ADDONS.GLTFLoader();\n\n this._dracoLoader = new THREE_ADDONS.DRACOLoader();\n this._dracoLoader.setDecoderPath('./pixi-renderers/draco/gltf/');\n this._loader.setDRACOLoader(this._dracoLoader);\n\n /**\n * The invalid model is a box with magenta (#ff00ff) faces, to be\n * easily spotted if rendered on screen.\n */\n const group = new THREE.Group();\n group.add(\n new THREE.Mesh(\n new THREE.BoxGeometry(1, 1, 1),\n new THREE.MeshBasicMaterial({ color: '#ff00ff' })\n )\n );\n this._invalidModel = {\n scene: group,\n animations: [],\n cameras: [],\n scenes: [],\n asset: {},\n userData: {},\n //@ts-ignore\n parser: null,\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 * Load all the 3D models.\n *\n * Note that even if a file is already loaded, it will be reloaded (useful for hot-reloading,\n * as files can have been modified without the editor knowing).\n *\n * @param onProgress The function called after each file is loaded.\n * @param onComplete The function called when all file are loaded.\n */\n loadModels(\n onProgress: OnProgressCallback,\n onComplete: OnCompleteCallback\n ): void {\n const resources = this._resources;\n const model3DResources = resources.filter(function (resource) {\n return resource.kind === 'model3D';\n });\n if (model3DResources.length === 0 || !this._loader) {\n return onComplete(model3DResources.length);\n }\n\n let loaded = 0;\n for (let i = 0; i < model3DResources.length; ++i) {\n const resource = model3DResources[i];\n const url = this._resourcesLoader.getFullUrl(resource.file);\n\n this._loader.withCredentials = this._resourcesLoader.checkIfCredentialsRequired(\n url\n );\n this._loader.load(\n url,\n (gltf: THREE_ADDONS.GLTF) => {\n this._loadedThreeModels.set(resource.name, gltf);\n\n loaded++;\n if (loaded === model3DResources.length) {\n onComplete(model3DResources.length);\n } else {\n onProgress(loaded, model3DResources.length);\n }\n },\n undefined,\n (error) => {\n logger.error(error);\n\n loaded++;\n if (loaded === model3DResources.length) {\n onComplete(model3DResources.length);\n } else {\n onProgress(loaded, model3DResources.length);\n }\n }\n );\n }\n }\n\n /**\n * Return a 3D model.\n *\n * Caller should not modify the object but clone it.\n *\n * @param resourceName The name of the json resource.\n * @returns a 3D model if it exists.\n */\n getModel(resourceName: string): THREE_ADDONS.GLTF {\n return this._loadedThreeModels.get(resourceName) || this._invalidModel;\n }\n }\n}\n"],
5
+ "mappings": "AAKA,IAAU,MAAAA,GAAV,CACE,MAAMC,EAAS,IAAID,EAAK,OAAO,gBAAgB,EAQxC,MAAME,CAAe,CAIlB,mBAAqB,IAAI,IAEjC,iBACA,WAEA,QAA0C,KAC1C,aAAgD,KAGhD,cAMA,YACEC,EACAC,EACA,CAIA,GAHA,KAAK,WAAaD,EAClB,KAAK,iBAAmBC,EAEpB,OAAO,MAAU,IAAa,CAChC,KAAK,QAAU,IAAI,aAAa,WAEhC,KAAK,aAAe,IAAI,aAAa,YACrC,KAAK,aAAa,eAAe,8BAA8B,EAC/D,KAAK,QAAQ,eAAe,KAAK,YAAY,EAM7C,MAAMC,EAAQ,IAAI,MAAM,MACxBA,EAAM,IACJ,IAAI,MAAM,KACR,IAAI,MAAM,YAAY,EAAG,EAAG,CAAC,EAC7B,IAAI,MAAM,kBAAkB,CAAE,MAAO,SAAU,CAAC,CAClD,CACF,EACA,KAAK,cAAgB,CACnB,MAAOA,EACP,WAAY,CAAC,EACb,QAAS,CAAC,EACV,OAAQ,CAAC,EACT,MAAO,CAAC,EACR,SAAU,CAAC,EAEX,OAAQ,IACV,CACF,CACF,CAOA,aAAaF,EAAiC,CAC5C,KAAK,WAAaA,CACpB,CAWA,WACEG,EACAC,EACM,CAEN,MAAMC,EADY,KAAK,WACY,OAAO,SAAUC,EAAU,CAC5D,OAAOA,EAAS,OAAS,SAC3B,CAAC,EACD,GAAID,EAAiB,SAAW,GAAK,CAAC,KAAK,QACzC,OAAOD,EAAWC,EAAiB,MAAM,EAG3C,IAAIE,EAAS,EACb,QAASC,EAAI,EAAGA,EAAIH,EAAiB,OAAQ,EAAEG,EAAG,CAChD,MAAMF,EAAWD,EAAiBG,CAAC,EAC7BC,EAAM,KAAK,iBAAiB,WAAWH,EAAS,IAAI,EAE1D,KAAK,QAAQ,gBAAkB,KAAK,iBAAiB,2BACnDG,CACF,EACA,KAAK,QAAQ,KACXA,EACCC,GAA4B,CAC3B,KAAK,mBAAmB,IAAIJ,EAAS,KAAMI,CAAI,EAE/CH,IACIA,IAAWF,EAAiB,OAC9BD,EAAWC,EAAiB,MAAM,EAElCF,EAAWI,EAAQF,EAAiB,MAAM,CAE9C,EACA,OACCM,GAAU,CACTb,EAAO,MAAMa,CAAK,EAElBJ,IACIA,IAAWF,EAAiB,OAC9BD,EAAWC,EAAiB,MAAM,EAElCF,EAAWI,EAAQF,EAAiB,MAAM,CAE9C,CACF,CACF,CACF,CAUA,SAASO,EAAyC,CAChD,OAAO,KAAK,mBAAmB,IAAIA,CAAY,GAAK,KAAK,aAC3D,CACF,CArIOf,EAAM,eAAAE,IATL",
6
+ "names": ["gdjs", "logger", "Model3DManager", "resources", "resourcesLoader", "group", "onProgress", "onComplete", "model3DResources", "resource", "loaded", "i", "url", "gltf", "error", "resourceName"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var gdjs;(o=>{class n extends o.RuntimeLayer{constructor(e,a){super(e,a),this._renderer.onCreated()}onGameResolutionResized(e,a){}getCameraX(e){return 0}getCameraY(e){return 0}setCameraX(e,a){}setCameraY(e,a){}getCameraWidth(e){return 0}getCameraHeight(e){return 0}setCameraZoom(e,a){}getCameraZoom(e){return 1}setCameraZ(e,a,r){}getCameraZ(e=45,a){return 0}getCameraRotation(e){return 0}setCameraRotation(e,a){}convertCoords(e,a,r,t){return this._runtimeScene.convertCoords(e,a,t||[0,0])}convertInverseCoords(e,a,r,t){return this._runtimeScene.convertInverseCoords(e,a,t||[0,0])}applyLayerInverseTransformation(e,a,r,t){return t[0]=e,t[1]=a,t}applyLayerTransformation(e,a,r,t){return t[0]=e,t[1]=a,t}}o.RuntimeCustomObjectLayer=n})(gdjs||={});
2
+ //# sourceMappingURL=RuntimeCustomObjectLayer.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../GDevelop/GDJS/Runtime/RuntimeCustomObjectLayer.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 custom object. It doesn't allow to move any camera\n * because it doesn't make sense inside an object.\n */\n export class RuntimeCustomObjectLayer extends gdjs.RuntimeLayer {\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 // Let the renderer do its final set up:\n this._renderer.onCreated();\n }\n\n onGameResolutionResized(\n oldGameResolutionOriginX: float,\n oldGameResolutionOriginY: float\n ): void {}\n\n getCameraX(cameraId?: integer): float {\n return 0;\n }\n\n getCameraY(cameraId?: integer): float {\n return 0;\n }\n\n setCameraX(x: float, cameraId?: integer): void {}\n\n setCameraY(y: float, cameraId?: integer): void {}\n\n getCameraWidth(cameraId?: integer): float {\n return 0;\n }\n\n getCameraHeight(cameraId?: integer): float {\n return 0;\n }\n\n setCameraZoom(newZoom: float, cameraId?: integer): void {}\n\n getCameraZoom(cameraId?: integer): float {\n return 1;\n }\n\n setCameraZ(z: float, fov: float, cameraId?: integer): void {}\n\n getCameraZ(fov: float = 45, cameraId?: integer): float {\n return 0;\n }\n\n getCameraRotation(cameraId?: integer): float {\n return 0;\n }\n\n setCameraRotation(rotation: float, cameraId?: integer): void {}\n\n convertCoords(\n x: float,\n y: float,\n cameraId: integer,\n result: FloatPoint\n ): FloatPoint {\n // TODO EBO use an AffineTransformation to avoid chained calls.\n // The result parameter used to be optional.\n return this._runtimeScene.convertCoords(x, y, result || [0, 0]);\n }\n\n convertInverseCoords(\n x: float,\n y: float,\n cameraId: integer,\n result: FloatPoint\n ): FloatPoint {\n // TODO EBO use an AffineTransformation to avoid chained calls.\n // The result parameter used to be optional.\n return this._runtimeScene.convertInverseCoords(x, y, result || [0, 0]);\n }\n\n applyLayerInverseTransformation(\n x: float,\n y: float,\n cameraId: integer,\n result: FloatPoint\n ): FloatPoint {\n result[0] = x;\n result[1] = y;\n return result;\n }\n\n applyLayerTransformation(\n x: float,\n y: float,\n cameraId: integer,\n result: FloatPoint\n ): FloatPoint {\n result[0] = x;\n result[1] = y;\n return result;\n }\n }\n}\n"],
5
+ "mappings": "AAKA,IAAU,MAAAA,GAAV,CAKS,MAAMC,UAAiCD,EAAK,YAAa,CAK9D,YACEE,EACAC,EACA,CACA,MAAMD,EAAWC,CAAiB,EAGlC,KAAK,UAAU,UAAU,CAC3B,CAEA,wBACEC,EACAC,EACM,CAAC,CAET,WAAWC,EAA2B,CACpC,MAAO,EACT,CAEA,WAAWA,EAA2B,CACpC,MAAO,EACT,CAEA,WAAWC,EAAUD,EAA0B,CAAC,CAEhD,WAAWE,EAAUF,EAA0B,CAAC,CAEhD,eAAeA,EAA2B,CACxC,MAAO,EACT,CAEA,gBAAgBA,EAA2B,CACzC,MAAO,EACT,CAEA,cAAcG,EAAgBH,EAA0B,CAAC,CAEzD,cAAcA,EAA2B,CACvC,MAAO,EACT,CAEA,WAAWI,EAAUC,EAAYL,EAA0B,CAAC,CAE5D,WAAWK,EAAa,GAAIL,EAA2B,CACrD,MAAO,EACT,CAEA,kBAAkBA,EAA2B,CAC3C,MAAO,EACT,CAEA,kBAAkBM,EAAiBN,EAA0B,CAAC,CAE9D,cACEC,EACAC,EACAF,EACAO,EACY,CAGZ,OAAO,KAAK,cAAc,cAAcN,EAAGC,EAAGK,GAAU,CAAC,EAAG,CAAC,CAAC,CAChE,CAEA,qBACEN,EACAC,EACAF,EACAO,EACY,CAGZ,OAAO,KAAK,cAAc,qBAAqBN,EAAGC,EAAGK,GAAU,CAAC,EAAG,CAAC,CAAC,CACvE,CAEA,gCACEN,EACAC,EACAF,EACAO,EACY,CACZ,OAAAA,EAAO,CAAC,EAAIN,EACZM,EAAO,CAAC,EAAIL,EACLK,CACT,CAEA,yBACEN,EACAC,EACAF,EACAO,EACY,CACZ,OAAAA,EAAO,CAAC,EAAIN,EACZM,EAAO,CAAC,EAAIL,EACLK,CACT,CACF,CArGOb,EAAM,yBAAAC,IALL",
6
+ "names": ["gdjs", "RuntimeCustomObjectLayer", "layerData", "instanceContainer", "oldGameResolutionOriginX", "oldGameResolutionOriginY", "cameraId", "x", "y", "newZoom", "z", "fov", "rotation", "result"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var gdjs;(c=>{const l=new c.Logger("RuntimeInstanceContainer");class d{_initialBehaviorSharedData;_instances;_allInstancesList=[];_allInstancesListIsUpToDate=!0;_instancesCache;_instancesRemoved=[];_objects;_objectsCtor;_layers;_orderedLayers;_layersCameraCoordinates={};_debugDrawEnabled=!1;_debugDrawShowHiddenInstances=!1;_debugDrawShowPointsNames=!1;_debugDrawShowCustomPoints=!1;constructor(){this._initialBehaviorSharedData=new Hashtable,this._instances=new Hashtable,this._instancesCache=new Hashtable,this._objects=new Hashtable,this._objectsCtor=new Hashtable,this._layers=new Hashtable,this._orderedLayers=[]}enableDebugDraw(e,t,s,a){this._debugDrawEnabled&&!e&&this.getDebuggerRenderer().clearDebugDraw(),this._debugDrawEnabled=e,this._debugDrawShowHiddenInstances=t,this._debugDrawShowPointsNames=s,this._debugDrawShowCustomPoints=a}isObjectRegistered(e){return this._objects.containsKey(e)&&this._instances.containsKey(e)&&this._objectsCtor.containsKey(e)}registerObject(e){this._objects.put(e.name,e),this._instances.put(e.name,[]);const t=c.getObjectConstructor(e.type);this._objectsCtor.put(e.name,t),t.supportsReinitialization&&this._instancesCache.put(e.name,[])}updateObject(e){this.isObjectRegistered(e.name)||l.warn("Tried to call updateObject for an object that was not registered ("+e.name+"). Call registerObject first."),this._objects.put(e.name,e)}unregisterObject(e){const t=this._instances.get(e);if(t){const s=t.slice();for(let a=0;a<s.length;a++)this.markObjectForDeletion(s[a]);this._cacheOrClearRemovedInstances()}this._objects.remove(e),this._instances.remove(e),this._instancesCache.remove(e),this._objectsCtor.remove(e)}createObjectsFrom(e,t,s,a){for(let n=0,r=e.length;n<r;++n){const i=e[n],h=i.name,o=this.createObject(h);o!==null&&(a&&(o.persistentUuid=i.persistentUuid||null),o.setPosition(i.x+t,i.y+s),o.setAngle(i.angle),c.RuntimeObject3D&&o instanceof c.RuntimeObject3D&&(i.z!==void 0&&o.setZ(i.z),i.rotationX!==void 0&&o.setRotationX(i.rotationX),i.rotationY!==void 0&&o.setRotationY(i.rotationY)),o.setZOrder(i.zOrder),o.setLayer(i.layer),o.getVariables().initFrom(i.initialVariables,!0),o.extraInitializationFromInitialInstance(i))}}getInitialSharedDataForBehavior(e){return this._initialBehaviorSharedData.get(e)}setInitialSharedDataForBehavior(e,t){this._initialBehaviorSharedData.put(e,t)}_setLayerDefaultZOrders(){if(this.getGame().getGameData().properties.useDeprecatedZeroAsDefaultZOrder)return;const e={},t=this.getAdhocListOfAllInstances();for(let s=0,a=t.length;s<a;++s){const n=t[s];let r=n.getLayer();const i=n.getZOrder();(e[r]===void 0||e[r]<i)&&(e[r]=i)}for(let s in e)this.getLayer(s).setDefaultZOrder(e[s]+1)}_updateLayersCameraCoordinates(e){this._layersCameraCoordinates=this._layersCameraCoordinates||{};for(const t in this._layers.items)if(this._layers.items.hasOwnProperty(t)){const s=this._layers.items[t];this._layersCameraCoordinates[t]=this._layersCameraCoordinates[t]||[0,0,0,0],this._layersCameraCoordinates[t][0]=s.getCameraX()-s.getCameraWidth()/2*e,this._layersCameraCoordinates[t][1]=s.getCameraY()-s.getCameraHeight()/2*e,this._layersCameraCoordinates[t][2]=s.getCameraX()+s.getCameraWidth()/2*e,this._layersCameraCoordinates[t][3]=s.getCameraY()+s.getCameraHeight()/2*e}}_updateLayersPreRender(){for(const e of this._orderedLayers)e.updatePreRender(this)}_updateObjectsPreRender(){const e=this.getAdhocListOfAllInstances();for(let t=0,s=e.length;t<s;++t){const a=e[t],n=a.getRendererObject();n&&(n.visible=!a.isHidden(),n.visible&&this.getGame().getEffectsManager().updatePreRender(a.getRendererEffects(),a)),a.updatePreRender(this)}}_cacheOrClearRemovedInstances(){for(let e=0,t=this._instancesRemoved.length;e<t;++e){const s=this._instancesCache.get(this._instancesRemoved[e].getName());s&&s.length<128&&s.push(this._instancesRemoved[e])}this._instancesRemoved.length=0}_constructListOfAllInstances(){let e=0;for(const t in this._instances.items)if(this._instances.items.hasOwnProperty(t)){const s=this._instances.items[t],a=e;e+=s.length;for(let n=0,r=s.length;n<r;++n)a+n<this._allInstancesList.length?this._allInstancesList[a+n]=s[n]:this._allInstancesList.push(s[n])}this._allInstancesList.length=e,this._allInstancesListIsUpToDate=!0}getInstancesOf(e){return this._instances.items[e]}getAdhocListOfAllInstances(){return this._allInstancesListIsUpToDate||this._constructListOfAllInstances(),this._allInstancesList}_updateObjectsPreEvents(){const e=this.getAdhocListOfAllInstances();for(let t=0,s=e.length;t<s;++t){const a=e[t],n=a.getElapsedTime();if(a.hasNoForces())a.update(this);else{const r=a.getAverageForce(),i=n/1e3;a.setX(a.getX()+r.getX()*i),a.setY(a.getY()+r.getY()*i),a.update(this),a.updateForces(i)}a.updateTimers(n),e[t].stepBehaviorsPreEvents(this)}this._cacheOrClearRemovedInstances()}_updateObjectsPostEvents(){this._cacheOrClearRemovedInstances();const e=this.getAdhocListOfAllInstances();for(let t=0,s=e.length;t<s;++t)e[t].stepBehaviorsPostEvents(this);this._cacheOrClearRemovedInstances()}addObject(e){this._instances.containsKey(e.name)||this._instances.put(e.name,[]),this._instances.get(e.name).push(e),this._allInstancesListIsUpToDate=!1}getObjects(e){return this._instances.containsKey(e)||(l.info('RuntimeScene.getObjects: No instances called "'+e+'"! Adding it.'),this._instances.put(e,[])),this._instances.get(e)}createObject(e){if(!this._objectsCtor.containsKey(e)||!this._objects.containsKey(e))return null;const t=this._instancesCache.get(e),s=this._objectsCtor.get(e);let a;return!t||t.length===0?a=new s(this,this._objects.get(e)):(a=t.pop(),a.reinitialize(this._objects.get(e))),this.addObject(a),a}markObjectForDeletion(e){if(this._instancesRemoved.indexOf(e)===-1&&this._instancesRemoved.push(e),this._instances.containsKey(e.getName())){const t=e.id,s=this._instances.get(e.getName());for(let a=0,n=s.length;a<n;++a)if(s[a].id==t){s.splice(a,1),this._allInstancesListIsUpToDate=!1;break}}e.onDestroyFromScene(this);for(let t=0;t<c.callbacksObjectDeletedFromScene.length;++t)c.callbacksObjectDeletedFromScene[t](this,e)}getLayer(e){return this._layers.containsKey(e)?this._layers.get(e):this._layers.get("")}hasLayer(e){return this._layers.containsKey(e)}removeLayer(e){const t=this._layers.get(e);if(!t)return;const s=this.getAdhocListOfAllInstances();for(let n=0;n<s.length;++n){const r=s[n];r.getLayer()===e&&r.setLayer("")}this._layers.remove(e);const a=this._orderedLayers.indexOf(t);this._orderedLayers.splice(a,1)}setLayerIndex(e,t){const s=this._layers.get(e);if(!s)return;const a=this._orderedLayers.indexOf(s);a!==t&&(this._orderedLayers.splice(a,1),this._orderedLayers.splice(t,0,s),this.getRenderer().setLayerIndex(s,t))}getAllLayerNames(e){this._layers.keys(e)}getInstancesCountOnScene(e){const t=this._instances.get(e);return t?t.length:0}updateObjectsForces(){for(const e in this._instances.items)if(this._instances.items.hasOwnProperty(e)){const t=this._instances.items[e];for(let s=0,a=t.length;s<a;++s){const n=t[s];if(!n.hasNoForces()){const r=n.getAverageForce(),i=n.getElapsedTime()/1e3;n.setX(n.getX()+r.getX()*i),n.setY(n.getY()+r.getY()*i),n.updateForces(i)}}}}_destroy(){this._layers=new Hashtable,this._orderedLayers=[],this._objects=new Hashtable,this._instances=new Hashtable,this._instancesCache=new Hashtable,this._objectsCtor=new Hashtable,this._allInstancesList=[],this._instancesRemoved=[]}}c.RuntimeInstanceContainer=d})(gdjs||={});
2
+ //# sourceMappingURL=RuntimeInstanceContainer.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../GDevelop/GDJS/Runtime/RuntimeInstanceContainer.ts"],
4
+ "sourcesContent": ["/*\n * GDevelop JS Platform\n * Copyright 2013-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.\n * This project is released under the MIT License.\n */\nnamespace gdjs {\n const logger = new gdjs.Logger('RuntimeInstanceContainer');\n\n /**\n * A container of object instances rendered on screen.\n */\n export abstract class RuntimeInstanceContainer {\n _initialBehaviorSharedData: Hashtable<BehaviorSharedData | null>;\n\n /** Contains the instances living on the container */\n _instances: Hashtable<RuntimeObject[]>;\n\n /**\n * An array used to create a list of all instance when necessary.\n * @see gdjs.RuntimeInstanceContainer#_constructListOfAllInstances}\n */\n private _allInstancesList: gdjs.RuntimeObject[] = [];\n _allInstancesListIsUpToDate = true;\n\n /** Used to recycle destroyed instance instead of creating new ones. */\n _instancesCache: Hashtable<RuntimeObject[]>;\n\n /** The instances removed from the container and waiting to be sent to the cache. */\n _instancesRemoved: gdjs.RuntimeObject[] = [];\n\n /** Contains the objects data stored in the project */\n _objects: Hashtable<ObjectData>;\n _objectsCtor: Hashtable<typeof RuntimeObject>;\n\n _layers: Hashtable<RuntimeLayer>;\n _orderedLayers: RuntimeLayer[]; // TODO: should this be a single structure with _layers, to enforce its usage?\n _layersCameraCoordinates: Record<string, [float, float, float, float]> = {};\n\n // Options for the debug draw:\n _debugDrawEnabled: boolean = false;\n _debugDrawShowHiddenInstances: boolean = false;\n _debugDrawShowPointsNames: boolean = false;\n _debugDrawShowCustomPoints: boolean = false;\n\n constructor() {\n this._initialBehaviorSharedData = new Hashtable();\n this._instances = new Hashtable();\n this._instancesCache = new Hashtable();\n this._objects = new Hashtable();\n this._objectsCtor = new Hashtable();\n this._layers = new Hashtable();\n this._orderedLayers = [];\n }\n\n /**\n * Return the time elapsed since the last frame,\n * in milliseconds, for objects on the layer.\n */\n abstract getElapsedTime(): float;\n\n /**\n * Get the renderer associated to the container.\n */\n abstract getRenderer(): gdjs.RuntimeInstanceContainerRenderer;\n\n /**\n * Get the renderer for visual debugging associated to the container.\n */\n abstract getDebuggerRenderer(): gdjs.DebuggerRenderer;\n\n /**\n * Get the {@link gdjs.RuntimeGame} associated to this.\n */\n abstract getGame(): gdjs.RuntimeGame;\n\n /**\n * Get the {@link gdjs.RuntimeScene} associated to this.\n */\n abstract getScene(): gdjs.RuntimeScene;\n\n /**\n * Convert a point from the canvas coordinates (for example,\n * the mouse position) to the container coordinates.\n *\n * @param x The x position, in container coordinates.\n * @param y The y position, in container coordinates.\n * @param result The point instance that is used to return the result.\n */\n abstract convertCoords(x: float, y: float, result?: FloatPoint): FloatPoint;\n\n /**\n * Convert a point from the container coordinates (for example,\n * an object position) to the canvas coordinates.\n *\n * @param sceneX The x position, in container coordinates.\n * @param sceneY The y position, in container coordinates.\n * @param result The point instance that is used to return the result.\n */\n abstract convertInverseCoords(\n sceneX: float,\n sceneY: float,\n result: FloatPoint\n ): FloatPoint;\n\n /**\n * @return the width of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getViewportWidth(): float;\n\n /**\n * @return the height of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getViewportHeight(): float;\n\n /**\n * @return the center X of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getViewportOriginX(): float;\n\n /**\n * @return the center Y of:\n * - the game resolution for a {@link gdjs.RuntimeScene}\n * - the default dimensions (the AABB of all its children) for a\n * {@link gdjs.CustomRuntimeObject}.\n */\n abstract getViewportOriginY(): float;\n\n /**\n * Triggered when the AABB of a child of the container could have changed.\n */\n abstract onChildrenLocationChanged(): void;\n\n /**\n * Activate or deactivate the debug visualization for collisions and points.\n */\n enableDebugDraw(\n enableDebugDraw: boolean,\n showHiddenInstances: boolean,\n showPointsNames: boolean,\n showCustomPoints: boolean\n ): void {\n if (this._debugDrawEnabled && !enableDebugDraw) {\n this.getDebuggerRenderer().clearDebugDraw();\n }\n\n this._debugDrawEnabled = enableDebugDraw;\n this._debugDrawShowHiddenInstances = showHiddenInstances;\n this._debugDrawShowPointsNames = showPointsNames;\n this._debugDrawShowCustomPoints = showCustomPoints;\n }\n\n /**\n * Check if an object is registered, meaning that instances of it can be\n * created and lives in the container.\n * @see gdjs.RuntimeInstanceContainer#registerObject\n */\n isObjectRegistered(objectName: string): boolean {\n return (\n this._objects.containsKey(objectName) &&\n this._instances.containsKey(objectName) &&\n this._objectsCtor.containsKey(objectName)\n );\n }\n\n /**\n * Register a {@link gdjs.RuntimeObject} so that instances of it can be\n * used in the container.\n * @param objectData The data for the object to register.\n */\n registerObject(objectData: ObjectData) {\n this._objects.put(objectData.name, objectData);\n this._instances.put(objectData.name, []);\n\n // Cache the constructor\n const Ctor = gdjs.getObjectConstructor(objectData.type);\n this._objectsCtor.put(objectData.name, Ctor);\n\n // Also prepare a cache for recycled instances, if the object supports it.\n if (Ctor.supportsReinitialization) {\n this._instancesCache.put(objectData.name, []);\n }\n }\n\n /**\n * Update the data of a {@link gdjs.RuntimeObject} so that instances use\n * this when constructed.\n * @param objectData The data for the object to register.\n */\n updateObject(objectData: ObjectData): void {\n if (!this.isObjectRegistered(objectData.name)) {\n logger.warn(\n 'Tried to call updateObject for an object that was not registered (' +\n objectData.name +\n '). Call registerObject first.'\n );\n }\n this._objects.put(objectData.name, objectData);\n }\n\n // Don't erase instances, nor instances cache, or objectsCtor cache.\n /**\n * Unregister a {@link gdjs.RuntimeObject}. Instances will be destroyed.\n * @param objectName The name of the object to unregister.\n */\n unregisterObject(objectName: string) {\n const instances = this._instances.get(objectName);\n if (instances) {\n // This is sub-optimal: markObjectForDeletion will search the instance to\n // remove in instances, so cost is O(n^2), n being the number of instances.\n // As we're unregistering an object which only happen during a hot-reloading,\n // this is fine.\n const instancesToRemove = instances.slice();\n for (let i = 0; i < instancesToRemove.length; i++) {\n this.markObjectForDeletion(instancesToRemove[i]);\n }\n this._cacheOrClearRemovedInstances();\n }\n this._objects.remove(objectName);\n this._instances.remove(objectName);\n this._instancesCache.remove(objectName);\n this._objectsCtor.remove(objectName);\n }\n\n /**\n * Create objects from initial instances data (for example, the initial instances\n * of the scene or the instances of an external layout).\n *\n * @param data The instances data\n * @param xPos The offset on X axis\n * @param yPos The offset on Y axis\n * @param trackByPersistentUuid If true, objects are tracked by setting their `persistentUuid`\n * to the same as the associated instance. Useful for hot-reloading when instances are changed.\n */\n createObjectsFrom(\n data: InstanceData[],\n xPos: float,\n yPos: float,\n trackByPersistentUuid: boolean\n ) {\n for (let i = 0, len = data.length; i < len; ++i) {\n const instanceData = data[i];\n const objectName = instanceData.name;\n const newObject = this.createObject(objectName);\n if (newObject !== null) {\n if (trackByPersistentUuid) {\n // Give the object the same persistentUuid as the instance, so that\n // it can be hot-reloaded.\n newObject.persistentUuid = instanceData.persistentUuid || null;\n }\n newObject.setPosition(instanceData.x + xPos, instanceData.y + yPos);\n newObject.setAngle(instanceData.angle);\n if (\n gdjs.RuntimeObject3D &&\n newObject instanceof gdjs.RuntimeObject3D\n ) {\n if (instanceData.z !== undefined) newObject.setZ(instanceData.z);\n if (instanceData.rotationX !== undefined)\n newObject.setRotationX(instanceData.rotationX);\n if (instanceData.rotationY !== undefined)\n newObject.setRotationY(instanceData.rotationY);\n }\n\n newObject.setZOrder(instanceData.zOrder);\n newObject.setLayer(instanceData.layer);\n newObject\n .getVariables()\n .initFrom(instanceData.initialVariables, true);\n newObject.extraInitializationFromInitialInstance(instanceData);\n }\n }\n }\n\n /**\n * Get the data representing the initial shared data of the scene for the specified behavior.\n * @param name The name of the behavior\n * @returns The shared data for the behavior, if any.\n */\n getInitialSharedDataForBehavior(name: string): BehaviorSharedData | null {\n return this._initialBehaviorSharedData.get(name);\n }\n\n /**\n * Set the data representing the initial shared data of the scene for the specified behavior.\n * @param name The name of the behavior\n * @param sharedData The shared data for the behavior, or null to remove it.\n */\n setInitialSharedDataForBehavior(\n name: string,\n sharedData: BehaviorSharedData | null\n ): void {\n this._initialBehaviorSharedData.put(name, sharedData);\n }\n\n /**\n * Set the default Z order for each layer, which is the highest Z order found on each layer.\n * Useful as it ensures that instances created from events are, by default, shown in front\n * of other instances.\n */\n _setLayerDefaultZOrders() {\n if (\n this.getGame().getGameData().properties.useDeprecatedZeroAsDefaultZOrder\n ) {\n // Deprecated option to still support games that were made considered 0 as the\n // default Z order for all layers.\n return;\n }\n const layerHighestZOrders: Record<string, number> = {};\n const allInstances = this.getAdhocListOfAllInstances();\n for (let i = 0, len = allInstances.length; i < len; ++i) {\n const object = allInstances[i];\n let layerName = object.getLayer();\n const zOrder = object.getZOrder();\n if (\n layerHighestZOrders[layerName] === undefined ||\n layerHighestZOrders[layerName] < zOrder\n ) {\n layerHighestZOrders[layerName] = zOrder;\n }\n }\n for (let layerName in layerHighestZOrders) {\n this.getLayer(layerName).setDefaultZOrder(\n layerHighestZOrders[layerName] + 1\n );\n }\n }\n\n _updateLayersCameraCoordinates(scale: float) {\n this._layersCameraCoordinates = this._layersCameraCoordinates || {};\n for (const name in this._layers.items) {\n if (this._layers.items.hasOwnProperty(name)) {\n const theLayer = this._layers.items[name];\n this._layersCameraCoordinates[name] = this._layersCameraCoordinates[\n name\n ] || [0, 0, 0, 0];\n this._layersCameraCoordinates[name][0] =\n theLayer.getCameraX() - (theLayer.getCameraWidth() / 2) * scale;\n this._layersCameraCoordinates[name][1] =\n theLayer.getCameraY() - (theLayer.getCameraHeight() / 2) * scale;\n this._layersCameraCoordinates[name][2] =\n theLayer.getCameraX() + (theLayer.getCameraWidth() / 2) * scale;\n this._layersCameraCoordinates[name][3] =\n theLayer.getCameraY() + (theLayer.getCameraHeight() / 2) * scale;\n }\n }\n }\n\n /**\n * Called to update effects of layers before rendering.\n */\n _updateLayersPreRender() {\n for (const layer of this._orderedLayers) {\n layer.updatePreRender(this);\n }\n }\n\n /**\n * Called to update visibility of the renderers of objects\n * rendered on the scene (\"culling\"), update effects (of visible objects)\n * and give a last chance for objects to update before rendering.\n *\n * Visibility is set to false if object is hidden, or if\n * object is too far from the camera of its layer (\"culling\").\n */\n _updateObjectsPreRender() {\n const allInstancesList = this.getAdhocListOfAllInstances();\n // TODO (3D) culling - add support for 3D object culling?\n for (let i = 0, len = allInstancesList.length; i < len; ++i) {\n const object = allInstancesList[i];\n const rendererObject = object.getRendererObject();\n if (rendererObject) {\n rendererObject.visible = !object.isHidden();\n\n // Update effects, only for visible objects.\n if (rendererObject.visible) {\n this.getGame()\n .getEffectsManager()\n .updatePreRender(object.getRendererEffects(), object);\n }\n }\n\n // Perform pre-render update.\n object.updatePreRender(this);\n }\n return;\n }\n\n /**\n * Empty the list of the removed objects:\n *\n * When an object is removed from the container, it is still kept in\n * {@link gdjs.RuntimeInstanceContainer#_instancesRemoved}.\n *\n * This method should be called regularly (after events or behaviors steps) so as to clear this list\n * and allows the removed objects to be cached (or destroyed if the cache is full).\n *\n * The removed objects could not be sent directly to the cache, as events may still be using them after\n * removing them from the scene for example.\n */\n _cacheOrClearRemovedInstances() {\n for (let k = 0, lenk = this._instancesRemoved.length; k < lenk; ++k) {\n // Cache the instance to recycle it into a new instance later.\n // If the object does not support recycling, the cache won't be defined.\n const cache = this._instancesCache.get(\n this._instancesRemoved[k].getName()\n );\n if (cache) {\n if (cache.length < 128) {\n cache.push(this._instancesRemoved[k]);\n }\n }\n }\n this._instancesRemoved.length = 0;\n }\n\n /**\n * Tool function filling _allInstancesList member with all the living object instances.\n */\n private _constructListOfAllInstances() {\n let currentListSize = 0;\n for (const name in this._instances.items) {\n if (this._instances.items.hasOwnProperty(name)) {\n const list = this._instances.items[name];\n const oldSize = currentListSize;\n currentListSize += list.length;\n for (let j = 0, lenj = list.length; j < lenj; ++j) {\n if (oldSize + j < this._allInstancesList.length) {\n this._allInstancesList[oldSize + j] = list[j];\n } else {\n this._allInstancesList.push(list[j]);\n }\n }\n }\n }\n this._allInstancesList.length = currentListSize;\n this._allInstancesListIsUpToDate = true;\n }\n\n /**\n * @param objectName The name of the object\n * @returns the instances of a given object in the container.\n */\n getInstancesOf(objectName: string): gdjs.RuntimeObject[] {\n return this._instances.items[objectName];\n }\n\n /**\n * Get a list of all {@link gdjs.RuntimeObject} living in the container.\n * You should not, normally, need this method at all. It's only to be used\n * in exceptional use cases where you need to loop through all objects,\n * and it won't be performant.\n *\n * @returns The list of all runtime objects in the container\n */\n getAdhocListOfAllInstances(): gdjs.RuntimeObject[] {\n if (!this._allInstancesListIsUpToDate) {\n this._constructListOfAllInstances();\n }\n return this._allInstancesList;\n }\n\n /**\n * Update the objects before launching the events.\n */\n _updateObjectsPreEvents() {\n // It is *mandatory* to create and iterate on a external list of all objects, as the behaviors\n // may delete the objects.\n const allInstancesList = this.getAdhocListOfAllInstances();\n for (let i = 0, len = allInstancesList.length; i < len; ++i) {\n const obj = allInstancesList[i];\n const elapsedTime = obj.getElapsedTime();\n if (!obj.hasNoForces()) {\n const averageForce = obj.getAverageForce();\n const elapsedTimeInSeconds = elapsedTime / 1000;\n obj.setX(obj.getX() + averageForce.getX() * elapsedTimeInSeconds);\n obj.setY(obj.getY() + averageForce.getY() * elapsedTimeInSeconds);\n obj.update(this);\n obj.updateForces(elapsedTimeInSeconds);\n } else {\n obj.update(this);\n }\n obj.updateTimers(elapsedTime);\n allInstancesList[i].stepBehaviorsPreEvents(this);\n }\n\n // Some behaviors may have request objects to be deleted.\n this._cacheOrClearRemovedInstances();\n }\n\n /**\n * Update the objects (update positions, time management...)\n */\n _updateObjectsPostEvents() {\n this._cacheOrClearRemovedInstances();\n\n // It is *mandatory* to create and iterate on a external list of all objects, as the behaviors\n // may delete the objects.\n const allInstancesList = this.getAdhocListOfAllInstances();\n for (let i = 0, len = allInstancesList.length; i < len; ++i) {\n allInstancesList[i].stepBehaviorsPostEvents(this);\n }\n\n // Some behaviors may have request objects to be deleted.\n this._cacheOrClearRemovedInstances();\n }\n\n /**\n * Add an object to the instances living in the container.\n * @param obj The object to be added.\n */\n addObject(obj: gdjs.RuntimeObject) {\n if (!this._instances.containsKey(obj.name)) {\n this._instances.put(obj.name, []);\n }\n this._instances.get(obj.name).push(obj);\n this._allInstancesListIsUpToDate = false;\n }\n\n /**\n * Get all the instances of the object called name.\n * @param name Name of the object for which the instances must be returned.\n * @return The list of objects with the given name\n */\n getObjects(name: string): gdjs.RuntimeObject[] | undefined {\n if (!this._instances.containsKey(name)) {\n logger.info(\n 'RuntimeScene.getObjects: No instances called \"' +\n name +\n '\"! Adding it.'\n );\n this._instances.put(name, []);\n }\n return this._instances.get(name);\n }\n\n /**\n * Create a new object from its name. The object is also added to the instances\n * living in the container (No need to call {@link gdjs.RuntimeScene.addObject})\n * @param objectName The name of the object to be created\n * @return The created object\n */\n createObject(objectName: string): gdjs.RuntimeObject | null {\n if (\n !this._objectsCtor.containsKey(objectName) ||\n !this._objects.containsKey(objectName)\n ) {\n // There is no such object in this container.\n return null;\n }\n\n // Create a new object using the object constructor (cached during loading)\n // and the stored object's data:\n const cache = this._instancesCache.get(objectName);\n const ctor = this._objectsCtor.get(objectName);\n let obj;\n if (!cache || cache.length === 0) {\n obj = new ctor(this, this._objects.get(objectName));\n } else {\n // Reuse an objet destroyed before. If there is an object in the cache,\n // then it means it does support reinitialization.\n obj = cache.pop();\n obj.reinitialize(this._objects.get(objectName));\n }\n this.addObject(obj);\n return obj;\n }\n\n /**\n * Must be called whenever an object must be removed from the container.\n * @param obj The object to be removed.\n */\n markObjectForDeletion(obj: gdjs.RuntimeObject) {\n // Add to the objects removed list.\n // The objects will be sent to the instances cache or really deleted from memory later.\n if (this._instancesRemoved.indexOf(obj) === -1) {\n this._instancesRemoved.push(obj);\n }\n\n // Delete from the living instances.\n if (this._instances.containsKey(obj.getName())) {\n const objId = obj.id;\n const allInstances = this._instances.get(obj.getName());\n for (let i = 0, len = allInstances.length; i < len; ++i) {\n if (allInstances[i].id == objId) {\n allInstances.splice(i, 1);\n this._allInstancesListIsUpToDate = false;\n break;\n }\n }\n }\n\n // Notify the object it was removed from the container\n obj.onDestroyFromScene(this);\n\n // Notify the global callbacks\n for (let j = 0; j < gdjs.callbacksObjectDeletedFromScene.length; ++j) {\n gdjs.callbacksObjectDeletedFromScene[j](this, obj);\n }\n return;\n }\n\n /**\n * Get the layer with the given name\n * @param name The name of the layer\n * @returns The layer, or the base layer if not found\n */\n getLayer(name: string): gdjs.RuntimeLayer {\n if (this._layers.containsKey(name)) {\n return this._layers.get(name);\n }\n return this._layers.get('');\n }\n\n /**\n * Check if a layer exists\n * @param name The name of the layer\n */\n hasLayer(name: string): boolean {\n return this._layers.containsKey(name);\n }\n\n /**\n * Add a layer.\n * @param layerData The data to construct the layer\n */\n abstract addLayer(layerData: LayerData);\n\n /**\n * Remove a layer. All {@link gdjs.RuntimeObject} on this layer will\n * be moved back to the base layer.\n * @param layerName The name of the layer to remove\n */\n removeLayer(layerName: string) {\n const existingLayer = this._layers.get(layerName);\n if (!existingLayer) return;\n\n const allInstances = this.getAdhocListOfAllInstances();\n for (let i = 0; i < allInstances.length; ++i) {\n const runtimeObject = allInstances[i];\n if (runtimeObject.getLayer() === layerName) {\n runtimeObject.setLayer('');\n }\n }\n this._layers.remove(layerName);\n const layerIndex = this._orderedLayers.indexOf(existingLayer);\n this._orderedLayers.splice(layerIndex, 1);\n }\n\n /**\n * Change the position of a layer.\n *\n * @param layerName The name of the layer to reorder\n * @param index The new position in the list of layers\n */\n setLayerIndex(layerName: string, newIndex: integer): void {\n const layer: gdjs.RuntimeLayer = this._layers.get(layerName);\n if (!layer) {\n return;\n }\n const layerIndex = this._orderedLayers.indexOf(layer);\n if (layerIndex === newIndex) return;\n\n this._orderedLayers.splice(layerIndex, 1);\n this._orderedLayers.splice(newIndex, 0, layer);\n\n this.getRenderer().setLayerIndex(layer, newIndex);\n }\n\n /**\n * Fill the array passed as argument with the names of all layers\n * @param result The array where to put the layer names\n */\n getAllLayerNames(result: string[]) {\n this._layers.keys(result);\n }\n\n /**\n * Return the number of instances of the specified object living in the container.\n * @param objectName The object name for which instances must be counted.\n */\n getInstancesCountOnScene(objectName: string): integer {\n const instances = this._instances.get(objectName);\n if (instances) {\n return instances.length;\n }\n\n return 0;\n }\n\n /**\n * Update the objects positions according to their forces\n */\n updateObjectsForces(): void {\n for (const name in this._instances.items) {\n if (this._instances.items.hasOwnProperty(name)) {\n const list = this._instances.items[name];\n for (let j = 0, listLen = list.length; j < listLen; ++j) {\n const obj = list[j];\n if (!obj.hasNoForces()) {\n const averageForce = obj.getAverageForce();\n const elapsedTimeInSeconds = obj.getElapsedTime() / 1000;\n obj.setX(obj.getX() + averageForce.getX() * elapsedTimeInSeconds);\n obj.setY(obj.getY() + averageForce.getY() * elapsedTimeInSeconds);\n obj.updateForces(elapsedTimeInSeconds);\n }\n }\n }\n }\n }\n\n /**\n * Clear any data structures to make sure memory is freed as soon as\n * possible.\n */\n _destroy() {\n // It should not be necessary to reset these variables, but this help\n // ensuring that all memory related to the container is released immediately.\n this._layers = new Hashtable();\n this._orderedLayers = [];\n this._objects = new Hashtable();\n this._instances = new Hashtable();\n this._instancesCache = new Hashtable();\n this._objectsCtor = new Hashtable();\n this._allInstancesList = [];\n this._instancesRemoved = [];\n }\n }\n}\n"],
5
+ "mappings": "AAKA,IAAU,MAAAA,GAAV,CACE,MAAMC,EAAS,IAAID,EAAK,OAAO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IE,EAAa,KAAK,EAAIC,CAAoB,EAChEH,EAAI,aAAaG,CAAoB,CACvC,CACF,CACF,CAEJ,CAMA,UAAW,CAGT,KAAK,QAAU,IAAI,UACnB,KAAK,eAAiB,CAAC,EACvB,KAAK,SAAW,IAAI,UACpB,KAAK,WAAa,IAAI,UACtB,KAAK,gBAAkB,IAAI,UAC3B,KAAK,aAAe,IAAI,UACxB,KAAK,kBAAoB,CAAC,EAC1B,KAAK,kBAAoB,CAAC,CAC5B,CACF,CAntBO3C,EAAe,yBAAAE,IANd",
6
+ "names": ["gdjs", "logger", "RuntimeInstanceContainer", "enableDebugDraw", "showHiddenInstances", "showPointsNames", "showCustomPoints", "objectName", "objectData", "Ctor", "instances", "instancesToRemove", "i", "data", "xPos", "yPos", "trackByPersistentUuid", "len", "instanceData", "newObject", "name", "sharedData", "layerHighestZOrders", "allInstances", "object", "layerName", "zOrder", "scale", "theLayer", "layer", "allInstancesList", "rendererObject", "k", "lenk", "cache", "currentListSize", "list", "oldSize", "j", "lenj", "obj", "elapsedTime", "averageForce", "elapsedTimeInSeconds", "ctor", "objId", "existingLayer", "runtimeObject", "layerIndex", "newIndex", "result", "listLen"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var gdjs;(i=>{let n;(t=>(t[t.TWO_D=0]="TWO_D",t[t.THREE_D=1]="THREE_D",t[t.TWO_D_PLUS_THREE_D=2]="TWO_D_PLUS_THREE_D"))(n=i.RuntimeLayerRenderingType||={});const s=r=>r==="3d"?1:r==="2d+3d"||r===""?2:0;class o{_name;_renderingType;_timeScale=1;_defaultZOrder=0;_hidden;_initialEffectsData;_initialCamera3DFieldOfView;_initialCamera3DFarPlaneDistance;_initialCamera3DNearPlaneDistance;_runtimeScene;_effectsManager;_isLightingLayer;_followBaseLayerCamera;_clearColor;_rendererEffects={};_renderer;constructor(e,a){this._name=e.name,this._renderingType=s(e.renderingType),this._hidden=!e.visibility,this._initialCamera3DFieldOfView=e.camera3DFieldOfView||45,this._initialCamera3DFarPlaneDistance=e.camera3DFarPlaneDistance||.1,this._initialCamera3DNearPlaneDistance=e.camera3DNearPlaneDistance||2e3,this._initialEffectsData=e.effects||[],this._runtimeScene=a,this._effectsManager=a.getGame().getEffectsManager(),this._isLightingLayer=e.isLightingLayer,this._followBaseLayerCamera=e.followBaseLayerCamera,this._clearColor=[e.ambientLightColorR/255,e.ambientLightColorG/255,e.ambientLightColorB/255,1],this._renderer=new i.LayerRenderer(this,a.getRenderer(),a.getGame().getRenderer()),this.show(!this._hidden);for(let t=0;t<e.effects.length;++t)this.addEffect(e.effects[t])}getRenderer(){return this._renderer}getRendererObject(){return this._renderer.getRendererObject()}get3DRendererObject(){return this._renderer.getThreeScene()}getRenderingType(){return this._renderingType}getDefaultZOrder(){return this._defaultZOrder}setDefaultZOrder(e){this._defaultZOrder=e}getRuntimeScene(){return this._runtimeScene.getScene()}updatePreRender(e){this._followBaseLayerCamera&&this.followBaseLayer(),this._renderer.updatePreRender(),this._effectsManager.updatePreRender(this._rendererEffects,this)}getName(){return this._name}show(e){this._hidden=!e,this._renderer.updateVisibility(e)}isVisible(){return!this._hidden}getWidth(){return this._runtimeScene.getViewportWidth()}getHeight(){return this._runtimeScene.getViewportHeight()}getInitialCamera3DFieldOfView(){return this._initialCamera3DFieldOfView}getInitialCamera3DNearPlaneDistance(){return this._initialCamera3DNearPlaneDistance}getInitialCamera3DFarPlaneDistance(){return this._initialCamera3DFarPlaneDistance}getInitialEffectsData(){return this._initialEffectsData}addEffect(e){this._effectsManager.addEffect(e,this._rendererEffects,this)}removeEffect(e){this._effectsManager.removeEffect(this._rendererEffects,this,e)}setEffectDoubleParameter(e,a,t){this._effectsManager.setEffectDoubleParameter(this._rendererEffects,e,a,t)}setEffectStringParameter(e,a,t){this._effectsManager.setEffectStringParameter(this._rendererEffects,e,a,t)}setEffectBooleanParameter(e,a,t){this._effectsManager.setEffectBooleanParameter(this._rendererEffects,e,a,t)}enableEffect(e,a){this._effectsManager.enableEffect(this._rendererEffects,this,e,a)}isEffectEnabled(e){return this._effectsManager.isEffectEnabled(this._rendererEffects,this,e)}hasEffect(e){return this._effectsManager.hasEffect(this._rendererEffects,e)}setTimeScale(e){e>=0&&(this._timeScale=e)}getTimeScale(){return this._timeScale}getElapsedTime(e){return(e||this._runtimeScene).getElapsedTime()*this._timeScale}followBaseLayer(){const e=this._runtimeScene.getLayer("");this.setCameraX(e.getCameraX()),this.setCameraY(e.getCameraY()),this.setCameraRotation(e.getCameraRotation()),this.setCameraZoom(e.getCameraZoom())}getClearColor(){return this._clearColor}setClearColor(e,a,t){this._clearColor[0]=e/255,this._clearColor[1]=a/255,this._clearColor[2]=t/255,this._renderer.updateClearColor()}setFollowBaseLayerCamera(e){this._followBaseLayerCamera=e}isLightingLayer(){return this._isLightingLayer}}i.RuntimeLayer=o})(gdjs||={});
2
+ //# sourceMappingURL=RuntimeLayer.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../GDevelop/GDJS/Runtime/RuntimeLayer.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 export enum RuntimeLayerRenderingType {\n TWO_D,\n THREE_D,\n TWO_D_PLUS_THREE_D,\n }\n\n const getRenderingTypeFromString = (\n renderingTypeAsString: string | undefined\n ) =>\n renderingTypeAsString === '3d'\n ? RuntimeLayerRenderingType.THREE_D\n : renderingTypeAsString === '2d+3d' || renderingTypeAsString === ''\n ? RuntimeLayerRenderingType.TWO_D_PLUS_THREE_D\n : RuntimeLayerRenderingType.TWO_D;\n\n /**\n * Represents a layer of a \"container\", used to display objects.\n * The container can be a scene (see gdjs.Layer)\n * or a custom object (see gdjs.RuntimeCustomObjectLayer).\n */\n export abstract class RuntimeLayer implements EffectsTarget {\n _name: string;\n _renderingType: RuntimeLayerRenderingType;\n _timeScale: float = 1;\n _defaultZOrder: integer = 0;\n _hidden: boolean;\n _initialEffectsData: Array<EffectData>;\n\n // TODO EBO Don't store scene layer related data in layers used by custom objects.\n // (both these 3D settings and the lighting layer properties below).\n _initialCamera3DFieldOfView: float;\n _initialCamera3DFarPlaneDistance: float;\n _initialCamera3DNearPlaneDistance: float;\n\n _runtimeScene: gdjs.RuntimeInstanceContainer;\n _effectsManager: gdjs.EffectsManager;\n\n // Lighting layer properties.\n _isLightingLayer: boolean;\n _followBaseLayerCamera: boolean;\n _clearColor: Array<integer>;\n\n _rendererEffects: Record<string, gdjs.PixiFiltersTools.Filter> = {};\n _renderer: gdjs.LayerRenderer;\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 this._name = layerData.name;\n this._renderingType = getRenderingTypeFromString(layerData.renderingType);\n this._hidden = !layerData.visibility;\n this._initialCamera3DFieldOfView = layerData.camera3DFieldOfView || 45;\n this._initialCamera3DFarPlaneDistance =\n layerData.camera3DFarPlaneDistance || 0.1;\n this._initialCamera3DNearPlaneDistance =\n layerData.camera3DNearPlaneDistance || 2000;\n this._initialEffectsData = layerData.effects || [];\n this._runtimeScene = instanceContainer;\n this._effectsManager = instanceContainer.getGame().getEffectsManager();\n this._isLightingLayer = layerData.isLightingLayer;\n this._followBaseLayerCamera = layerData.followBaseLayerCamera;\n this._clearColor = [\n layerData.ambientLightColorR / 255,\n layerData.ambientLightColorG / 255,\n layerData.ambientLightColorB / 255,\n 1.0,\n ];\n this._renderer = new gdjs.LayerRenderer(\n this,\n instanceContainer.getRenderer(),\n instanceContainer.getGame().getRenderer()\n );\n this.show(!this._hidden);\n for (let i = 0; i < layerData.effects.length; ++i) {\n this.addEffect(layerData.effects[i]);\n }\n }\n\n getRenderer(): gdjs.LayerRenderer {\n return this._renderer;\n }\n\n getRendererObject() {\n return this._renderer.getRendererObject();\n }\n\n get3DRendererObject() {\n return this._renderer.getThreeScene();\n }\n\n getRenderingType(): RuntimeLayerRenderingType {\n return this._renderingType;\n }\n\n /**\n * Get the default Z order to be attributed to objects created on this layer\n * (usually from events generated code).\n */\n getDefaultZOrder(): float {\n return this._defaultZOrder;\n }\n\n /**\n * Set the default Z order to be attributed to objects created on this layer.\n * @param defaultZOrder The Z order to use when creating a new object from events.\n */\n setDefaultZOrder(defaultZOrder: integer): void {\n this._defaultZOrder = defaultZOrder;\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 abstract onGameResolutionResized(\n oldGameResolutionOriginX: float,\n oldGameResolutionOriginY: float\n ): void;\n\n /**\n * Returns the scene the layer belongs to directly or indirectly\n * @returns the scene the layer belongs to directly or indirectly\n */\n getRuntimeScene(): gdjs.RuntimeScene {\n return this._runtimeScene.getScene();\n }\n\n /**\n * Called at each frame, after events are run and before rendering.\n */\n updatePreRender(instanceContainer?: gdjs.RuntimeInstanceContainer): void {\n if (this._followBaseLayerCamera) {\n this.followBaseLayer();\n }\n this._renderer.updatePreRender();\n this._effectsManager.updatePreRender(this._rendererEffects, this);\n }\n\n /**\n * Get the name of the layer\n * @return The name of the layer\n */\n getName(): string {\n return this._name;\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 abstract getCameraX(cameraId?: integer): float;\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 abstract getCameraY(cameraId?: integer): float;\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 abstract setCameraX(x: float, cameraId?: integer): void;\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 abstract setCameraY(y: float, cameraId?: integer): void;\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 abstract getCameraWidth(cameraId?: integer): float;\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 abstract getCameraHeight(cameraId?: integer): float;\n\n /**\n * Show (or hide) the layer.\n * @param enable true to show the layer, false to hide it.\n */\n show(enable: boolean): void {\n this._hidden = !enable;\n this._renderer.updateVisibility(enable);\n }\n\n /**\n * Check if the layer is visible.\n *\n * @return true if the layer is visible.\n */\n isVisible(): boolean {\n return !this._hidden;\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 abstract setCameraZoom(newZoom: float, cameraId?: integer): void;\n\n /**\n * Get the zoom of a camera.\n *\n * @param cameraId The camera number. Currently ignored.\n * @return The zoom.\n */\n abstract getCameraZoom(cameraId?: integer): float;\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 abstract setCameraZ(z: float, fov: float, cameraId?: integer): void;\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 abstract getCameraZ(fov: float, cameraId?: integer): float;\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 abstract getCameraRotation(cameraId?: integer): float;\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 abstract setCameraRotation(rotation: float, cameraId?: integer): void;\n\n /**\n * Convert a point from the canvas coordinates (for example,\n * the mouse position) to the container coordinates.\n *\n * @param x The x position, in 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 abstract convertCoords(\n x: float,\n y: float,\n cameraId: integer,\n result: FloatPoint\n ): FloatPoint;\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 * @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 abstract applyLayerTransformation(\n x: float,\n y: float,\n cameraId: integer,\n result: FloatPoint\n ): FloatPoint;\n\n /**\n * Convert a point from the container coordinates (for example,\n * an object position) to the canvas coordinates.\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 abstract convertInverseCoords(\n x: float,\n y: float,\n cameraId: integer,\n result: FloatPoint\n ): FloatPoint;\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 * @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 abstract applyLayerInverseTransformation(\n x: float,\n y: float,\n cameraId: integer,\n result: FloatPoint\n ): FloatPoint;\n\n getWidth(): float {\n return this._runtimeScene.getViewportWidth();\n }\n\n getHeight(): float {\n return this._runtimeScene.getViewportHeight();\n }\n\n getInitialCamera3DFieldOfView(): float {\n return this._initialCamera3DFieldOfView;\n }\n getInitialCamera3DNearPlaneDistance(): float {\n return this._initialCamera3DNearPlaneDistance;\n }\n getInitialCamera3DFarPlaneDistance(): float {\n return this._initialCamera3DFarPlaneDistance;\n }\n\n /**\n * Return the initial effects data for the layer. Only to\n * be used by renderers.\n * @deprecated\n */\n getInitialEffectsData(): EffectData[] {\n return this._initialEffectsData;\n }\n\n /**\n * Add a new effect, or replace the one with the same name.\n * @param effectData The data of the effect to add.\n */\n addEffect(effectData: EffectData): void {\n this._effectsManager.addEffect(effectData, this._rendererEffects, this);\n }\n\n /**\n * Remove the effect with the specified name\n * @param effectName The name of the effect.\n */\n removeEffect(effectName: string): void {\n this._effectsManager.removeEffect(\n this._rendererEffects,\n this,\n effectName\n );\n }\n\n /**\n * Change an effect parameter value (for parameters that are numbers).\n * @param name The name of the effect to update.\n * @param parameterName The name of the parameter to update.\n * @param value The new value (number).\n */\n setEffectDoubleParameter(\n name: string,\n parameterName: string,\n value: float\n ): void {\n this._effectsManager.setEffectDoubleParameter(\n this._rendererEffects,\n name,\n parameterName,\n value\n );\n }\n\n /**\n * Change an effect parameter value (for parameters that are strings).\n * @param name The name of the effect to update.\n * @param parameterName The name of the parameter to update.\n * @param value The new value (string).\n */\n setEffectStringParameter(\n name: string,\n parameterName: string,\n value: string\n ): void {\n this._effectsManager.setEffectStringParameter(\n this._rendererEffects,\n name,\n parameterName,\n value\n );\n }\n\n /**\n * Change an effect parameter value (for parameters that are booleans).\n * @param name The name of the effect to update.\n * @param parameterName The name of the parameter to update.\n * @param value The new value (boolean).\n */\n setEffectBooleanParameter(\n name: string,\n parameterName: string,\n value: boolean\n ): void {\n this._effectsManager.setEffectBooleanParameter(\n this._rendererEffects,\n name,\n parameterName,\n value\n );\n }\n\n /**\n * Enable or disable an effect.\n * @param name The name of the effect to enable or disable.\n * @param enable true to enable, false to disable\n */\n enableEffect(name: string, enable: boolean): void {\n this._effectsManager.enableEffect(\n this._rendererEffects,\n this,\n name,\n enable\n );\n }\n\n /**\n * Check if an effect is enabled\n * @param name The name of the effect\n * @return true if the effect is enabled, false otherwise.\n */\n isEffectEnabled(name: string): boolean {\n return this._effectsManager.isEffectEnabled(\n this._rendererEffects,\n this,\n name\n );\n }\n\n /**\n * Check if an effect exists on this layer\n * @param name The name of the effect\n * @return true if the effect exists, false otherwise.\n */\n hasEffect(name: string): boolean {\n return this._effectsManager.hasEffect(this._rendererEffects, name);\n }\n\n /**\n * Set the time scale for the objects on the layer:\n * time will be slower if time scale is < 1, faster if > 1.\n * @param timeScale The new time scale (must be positive).\n */\n setTimeScale(timeScale: float): void {\n if (timeScale >= 0) {\n this._timeScale = timeScale;\n }\n }\n\n /**\n * Get the time scale for the objects on the layer.\n */\n getTimeScale(): float {\n return this._timeScale;\n }\n\n /**\n * Return the time elapsed since the last frame,\n * in milliseconds, for objects on the layer.\n *\n * @param instanceContainer The instance container the layer belongs to (deprecated - can be omitted).\n */\n getElapsedTime(instanceContainer?: gdjs.RuntimeInstanceContainer): float {\n const container = instanceContainer || this._runtimeScene;\n return container.getElapsedTime() * this._timeScale;\n }\n\n /**\n * Change the position, rotation and scale (zoom) of the layer camera to be the same as the base layer camera.\n */\n followBaseLayer(): void {\n const baseLayer = this._runtimeScene.getLayer('');\n this.setCameraX(baseLayer.getCameraX());\n this.setCameraY(baseLayer.getCameraY());\n this.setCameraRotation(baseLayer.getCameraRotation());\n this.setCameraZoom(baseLayer.getCameraZoom());\n }\n\n /**\n * The clear color is defined in the format [r, g, b], with components in the range of 0 to 1.\n * @return the clear color of layer in the range of [0, 1].\n */\n getClearColor(): Array<integer> {\n return this._clearColor;\n }\n\n /**\n * Set the clear color in format [r, g, b], with components in the range of 0 to 1.;\n * @param r Red color component in the range 0-255.\n * @param g Green color component in the range 0-255.\n * @param b Blue color component in the range 0-255.\n */\n setClearColor(r: integer, g: integer, b: integer): void {\n this._clearColor[0] = r / 255;\n this._clearColor[1] = g / 255;\n this._clearColor[2] = b / 255;\n this._renderer.updateClearColor();\n }\n\n /**\n * Set whether layer's camera follows base layer's camera or not.\n */\n setFollowBaseLayerCamera(follow: boolean): void {\n this._followBaseLayerCamera = follow;\n }\n\n /**\n * Return true if the layer is a lighting layer, false otherwise.\n * @return true if it is a lighting layer, false otherwise.\n */\n isLightingLayer(): boolean {\n return this._isLightingLayer;\n }\n }\n}\n"],
5
+ "mappings": "AAKA,IAAU,MAAAA,GAAV,CACS,IAAKC,OACVA,IAAA,iBACAA,IAAA,qBACAA,IAAA,6CAHUA,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A,UAAUA,EAAuB,CAC/B,OAAO,KAAK,gBAAgB,UAAU,KAAK,iBAAkBA,CAAI,CACnE,CAOA,aAAaG,EAAwB,CAC/BA,GAAa,IACf,KAAK,WAAaA,EAEtB,CAKA,cAAsB,CACpB,OAAO,KAAK,UACd,CAQA,eAAeT,EAA0D,CAEvE,OADkBA,GAAqB,KAAK,eAC3B,eAAe,EAAI,KAAK,UAC3C,CAKA,iBAAwB,CACtB,MAAMU,EAAY,KAAK,cAAc,SAAS,EAAE,EAChD,KAAK,WAAWA,EAAU,WAAW,CAAC,EACtC,KAAK,WAAWA,EAAU,WAAW,CAAC,EACtC,KAAK,kBAAkBA,EAAU,kBAAkB,CAAC,EACpD,KAAK,cAAcA,EAAU,cAAc,CAAC,CAC9C,CAMA,eAAgC,CAC9B,OAAO,KAAK,WACd,CAQA,cAAcC,EAAYC,EAAYC,EAAkB,CACtD,KAAK,YAAY,CAAC,EAAIF,EAAI,IAC1B,KAAK,YAAY,CAAC,EAAIC,EAAI,IAC1B,KAAK,YAAY,CAAC,EAAIC,EAAI,IAC1B,KAAK,UAAU,iBAAiB,CAClC,CAKA,yBAAyBC,EAAuB,CAC9C,KAAK,uBAAyBA,CAChC,CAMA,iBAA2B,CACzB,OAAO,KAAK,gBACd,CACF,CAthBOpB,EAAe,aAAAI,IArBd",
6
+ "names": ["gdjs", "RuntimeLayerRenderingType", "getRenderingTypeFromString", "renderingTypeAsString", "RuntimeLayer", "layerData", "instanceContainer", "i", "defaultZOrder", "enable", "effectData", "effectName", "name", "parameterName", "value", "timeScale", "baseLayer", "r", "g", "b", "follow"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var gdjs;(c=>{class y{matrix;constructor(){this.matrix=new Float32Array([1,0,0,1,0,0])}setToIdentity(){const o=this.matrix;o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0}isIdentity(){const o=this.matrix;return o[0]===1&&o[1]===0&&o[2]===0&&o[3]===1&&o[4]===0&&o[5]===0}equals(o){const t=this.matrix,a=o.matrix;return this===o||t[0]===a[0]&&t[1]===a[1]&&t[2]===a[2]&&t[3]===a[3]&&t[4]===a[4]&&t[5]===a[5]}nearlyEquals(o,t){const a=this.matrix,s=o.matrix;return this===o||c.nearlyEqual(a[0],s[0],t)&&c.nearlyEqual(a[1],s[1],t)&&c.nearlyEqual(a[2],s[2],t)&&c.nearlyEqual(a[3],s[3],t)&&c.nearlyEqual(a[4],s[4],t)&&c.nearlyEqual(a[5],s[5],t)}copyFrom(o){const t=this.matrix,a=o.matrix;return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],this}setToTranslation(o,t){const a=this.matrix;a[0]=1,a[1]=0,a[2]=0,a[3]=1,a[4]=o,a[5]=t}translate(o,t){var a=this.matrix;a[4]=a[0]*o+a[2]*t+a[4],a[5]=a[1]*o+a[3]*t+a[5]}setToScale(o,t){const a=this.matrix;a[0]=o,a[1]=0,a[2]=0,a[3]=t,a[4]=0,a[5]=0}scale(o,t){const a=this.matrix;a[0]*=o,a[1]*=o,a[2]*=t,a[3]*=t}setToRotation(o){const t=this.matrix;let a=Math.cos(o),s=Math.sin(o);(a===-1||a===1)&&(s=0),(s===-1||s===1)&&(a=0),t[0]=a,t[1]=s,t[2]=-s,t[3]=a,t[4]=0,t[5]=0}rotate(o){const t=this.matrix;let a=Math.cos(o),s=Math.sin(o);(a===-1||a===1)&&(s=0),(s===-1||s===1)&&(a=0);const i=t[0],n=t[1],m=t[2],r=t[3];t[0]=i*a+m*s,t[1]=n*a+r*s,t[2]=i*-s+m*a,t[3]=n*-s+r*a}setToRotationAround(o,t,a){const s=this.matrix;let i=Math.cos(o),n=Math.sin(o);(i===-1||i===1)&&(n=0),(n===-1||n===1)&&(i=0),s[0]=i,s[1]=n,s[2]=-n,s[3]=i,s[4]=t-t*i+a*n,s[5]=a-t*n+a*i}rotateAround(o,t,a){this.translate(t,a),this.rotate(o),this.translate(-t,-a)}setToFlipX(o){const t=this.matrix;t[0]=-1,t[1]=0,t[2]=0,t[3]=1,t[4]=2*o,t[5]=0}flipX(o){this.translate(o,0),this.scale(-1,1),this.translate(-o,0)}setToFlipY(o){const t=this.matrix;t[0]=-1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=2*o}flipY(o){this.translate(0,o),this.scale(1,-1),this.translate(0,-o)}concatenate(o){const t=this.matrix,a=o.matrix,s=t[0],i=t[1],n=t[2],m=t[3],r=t[4],h=t[5],l=a[0],e=a[1],x=a[2],f=a[3],u=a[4],T=a[5];t[0]=l*s+e*n,t[1]=l*i+e*m,t[2]=x*s+f*n,t[3]=x*i+f*m,t[4]=u*s+T*n+r,t[5]=u*i+T*m+h}preConcatenate(o){const t=this.matrix,a=o.matrix,s=t[0],i=t[1],n=t[2],m=t[3],r=t[4],h=t[5],l=a[0],e=a[1],x=a[2],f=a[3],u=a[4],T=a[5];t[0]=s*l+i*x,t[1]=s*e+i*f,t[2]=n*l+m*x,t[3]=n*e+m*f,t[4]=r*l+h*x+u,t[5]=r*e+h*f+T}transform(o,t){const a=this.matrix,s=a[0]*o[0]+a[2]*o[1]+a[4],i=a[1]*o[0]+a[3]*o[1]+a[5];t[0]=s,t[1]=i}invert(){const o=this.matrix,t=o[0],a=o[1],s=o[2],i=o[3],n=o[4],m=o[5],r=t*i-a*s;return o[0]=i/r,o[1]=-a/r,o[2]=-s/r,o[3]=t/r,o[4]=(s*m-i*n)/r,o[5]=-(t*m-a*n)/r,this}toString(){const o=this.matrix;return`[[${o[0]} ${o[1]}] [${o[2]} ${o[3]}] [${o[4]} ${o[5]}]]`}}c.AffineTransformation=y})(gdjs||={});
2
+ //# sourceMappingURL=affinetransformation.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../GDevelop/GDJS/Runtime/affinetransformation.ts"],
4
+ "sourcesContent": ["namespace gdjs {\n /**\n * An affine transformation that can transform points.\n */\n export class AffineTransformation {\n private matrix: Float32Array;\n\n /**\n * Initialize to the identity.\n */\n constructor() {\n // | 1 0 0 |\n // | 0 1 0 |\n // | 0 0 1 |\n this.matrix = new Float32Array([1, 0, 0, 1, 0, 0]);\n }\n\n /**\n * Reset to the identity.\n */\n setToIdentity() {\n const matrix = this.matrix;\n // | 1 0 0 |\n // | 0 1 0 |\n // | 0 0 1 |\n matrix[0] = 1;\n matrix[1] = 0;\n matrix[2] = 0;\n matrix[3] = 1;\n matrix[4] = 0;\n matrix[5] = 0;\n }\n\n /**\n * Check if this transformation is the identity.\n */\n isIdentity(): boolean {\n const matrix = this.matrix;\n return (\n matrix[0] === 1 &&\n matrix[1] === 0 &&\n matrix[2] === 0 &&\n matrix[3] === 1 &&\n matrix[4] === 0 &&\n matrix[5] === 0\n );\n }\n\n /**\n * Check if this is equals to another transformation.\n * @param other The transformation to check.\n */\n equals(other: AffineTransformation): boolean {\n const matrix = this.matrix;\n const otherMatrix = other.matrix;\n return (\n this === other ||\n (matrix[0] === otherMatrix[0] &&\n matrix[1] === otherMatrix[1] &&\n matrix[2] === otherMatrix[2] &&\n matrix[3] === otherMatrix[3] &&\n matrix[4] === otherMatrix[4] &&\n matrix[5] === otherMatrix[5])\n );\n }\n\n /**\n * Check if this is almost equals to another transformation.\n * @param other The transformation to check.\n * @param epsilon The relative margin error.\n */\n nearlyEquals(other: AffineTransformation, epsilon: float): boolean {\n const matrix = this.matrix;\n const otherMatrix = other.matrix;\n return (\n this === other ||\n (gdjs.nearlyEqual(matrix[0], otherMatrix[0], epsilon) &&\n gdjs.nearlyEqual(matrix[1], otherMatrix[1], epsilon) &&\n gdjs.nearlyEqual(matrix[2], otherMatrix[2], epsilon) &&\n gdjs.nearlyEqual(matrix[3], otherMatrix[3], epsilon) &&\n gdjs.nearlyEqual(matrix[4], otherMatrix[4], epsilon) &&\n gdjs.nearlyEqual(matrix[5], otherMatrix[5], epsilon))\n );\n }\n\n /**\n * Copy a transformation.\n * @param other The transformation to copy.\n */\n copyFrom(other: AffineTransformation) {\n const matrix = this.matrix;\n const otherMatrix = other.matrix;\n\n matrix[0] = otherMatrix[0];\n matrix[1] = otherMatrix[1];\n matrix[2] = otherMatrix[2];\n matrix[3] = otherMatrix[3];\n matrix[4] = otherMatrix[4];\n matrix[5] = otherMatrix[5];\n\n return this;\n }\n\n /**\n * Reset to a translation.\n *\n * @param x The horizontal translation value.\n * @param y The vertical translation value.\n */\n setToTranslation(tx: float, ty: float) {\n const matrix = this.matrix;\n // | m0 m2 m4 | | 1 0 tx |\n // | m1 m3 m5 | = | 0 1 ty |\n // | 0 0 1 | | 0 0 1 |\n matrix[0] = 1;\n matrix[1] = 0;\n matrix[2] = 0;\n matrix[3] = 1;\n matrix[4] = tx;\n matrix[5] = ty;\n }\n\n /**\n * Concatenate a translation.\n *\n * @param tx The horizontal translation value.\n * @param ty The vertical translation value.\n */\n translate(tx: float, ty: float) {\n var matrix = this.matrix;\n // 1 0 tx\n // 0 1 ty\n // 0 0 1\n // m0 m2 m4\n // m1 m3 m5\n // 0 0 1\n matrix[4] = matrix[0] * tx + matrix[2] * ty + matrix[4];\n matrix[5] = matrix[1] * tx + matrix[3] * ty + matrix[5];\n }\n\n /**\n * Reset to a scale.\n *\n * @param sx The horizontal scale value.\n * @param sy The vertical scale value.\n */\n setToScale(sx: float, sy: float) {\n const matrix = this.matrix;\n // | m0 m2 m4 | | sx 0 0 |\n // | m1 m3 m5 | = | 0 sy 0 |\n // | 0 0 1 | | 0 0 1 |\n matrix[0] = sx;\n matrix[1] = 0;\n matrix[2] = 0;\n matrix[3] = sy;\n matrix[4] = 0;\n matrix[5] = 0;\n }\n\n /**\n * Concatenate a scale.\n *\n * @param sx The horizontal scale value.\n * @param sy The vertical scale value.\n */\n scale(sx: float, sy: float) {\n const matrix = this.matrix;\n // sx 0 0\n // 0 sy 0\n // 0 0 1\n // m0 m2 m4\n // m1 m3 m5\n // 0 0 1\n matrix[0] *= sx;\n matrix[1] *= sx;\n matrix[2] *= sy;\n matrix[3] *= sy;\n }\n\n /**\n * Reset to a rotation.\n *\n * @param angle The angle of rotation in radians.\n */\n setToRotation(theta: float) {\n const matrix = this.matrix;\n let cost = Math.cos(theta);\n let sint = Math.sin(theta);\n\n // Avoid rounding errors around 0.\n if (cost === -1 || cost === 1) {\n sint = 0;\n }\n if (sint === -1 || sint === 1) {\n cost = 0;\n }\n\n // | m0 m2 m4 | | cost -sint 0 |\n // | m1 m3 m5 | = | sint cost 0 |\n // | 0 0 1 | | 0 0 1 |\n matrix[0] = cost;\n matrix[1] = sint;\n matrix[2] = -sint;\n matrix[3] = cost;\n matrix[4] = 0;\n matrix[5] = 0;\n }\n\n /**\n * Concatenate a rotation.\n *\n * @param angle The angle of rotation in radians.\n */\n rotate(angle: float) {\n const matrix = this.matrix;\n let cost = Math.cos(angle);\n let sint = Math.sin(angle);\n\n // Avoid rounding errors around 0.\n if (cost === -1 || cost === 1) {\n sint = 0;\n }\n if (sint === -1 || sint === 1) {\n cost = 0;\n }\n\n // cost -sint 0\n // sint cost 0\n // 0 0 1\n // m0 m2 m4\n // m1 m3 m5\n // 0 0 1\n\n const m0 = matrix[0];\n const m1 = matrix[1];\n const m2 = matrix[2];\n const m3 = matrix[3];\n\n matrix[0] = m0 * cost + m2 * sint;\n matrix[1] = m1 * cost + m3 * sint;\n matrix[2] = m0 * -sint + m2 * cost;\n matrix[3] = m1 * -sint + m3 * cost;\n }\n\n /**\n * Reset to a rotation.\n *\n * @param angle The angle of rotation in radians.\n * @param anchorX The rotation anchor point X.\n * @param anchorY The rotation anchor point Y.\n */\n setToRotationAround(angle: float, anchorX: float, anchorY: float) {\n const matrix = this.matrix;\n let cost = Math.cos(angle);\n let sint = Math.sin(angle);\n\n // Avoid rounding errors around 0.\n if (cost === -1 || cost === 1) {\n sint = 0;\n }\n if (sint === -1 || sint === 1) {\n cost = 0;\n }\n\n // | m0 m2 m4 | | cost -sint x-x*cost+y*sint |\n // | m1 m3 m5 | = | sint cost y-x*sint-y*cost |\n // | 0 0 1 | | 0 0 1 |\n matrix[0] = cost;\n matrix[1] = sint;\n matrix[2] = -sint;\n matrix[3] = cost;\n matrix[4] = anchorX - anchorX * cost + anchorY * sint;\n matrix[5] = anchorY - anchorX * sint + anchorY * cost;\n }\n\n /**\n * Concatenate a rotation.\n *\n * @param angle The angle of rotation in radians.\n * @param anchorX The rotation anchor point X.\n * @param anchorY The rotation anchor point Y.\n */\n rotateAround(angle: float, anchorX: float, anchorY: float) {\n this.translate(anchorX, anchorY);\n this.rotate(angle);\n // First: translate anchor to origin\n this.translate(-anchorX, -anchorY);\n }\n\n /**\n * Reset to an horizontal flip.\n *\n * @param anchorX The flip anchor point X.\n */\n setToFlipX(anchorX: float) {\n const matrix = this.matrix;\n // | m0 m2 m4 | | -1 0 2x |\n // | m1 m3 m5 | = | 0 1 0 |\n // | 0 0 1 | | 0 0 1 |\n matrix[0] = -1;\n matrix[1] = 0;\n matrix[2] = 0;\n matrix[3] = 1;\n matrix[4] = 2 * anchorX;\n matrix[5] = 0;\n }\n\n /**\n * Concatenate an horizontal flip.\n *\n * @param anchorX The flip anchor point X.\n */\n flipX(anchorX: float) {\n this.translate(anchorX, 0);\n this.scale(-1, 1);\n // First: translate anchor to origin\n this.translate(-anchorX, 0);\n }\n\n /**\n * Reset to an vertical flip.\n *\n * @param anchorY The flip anchor point Y.\n */\n setToFlipY(anchorY: float) {\n const matrix = this.matrix;\n // | m0 m2 m4 | | 1 0 0 |\n // | m1 m3 m5 | = | 0 -1 2x |\n // | 0 0 1 | | 0 0 1 |\n matrix[0] = -1;\n matrix[1] = 0;\n matrix[2] = 0;\n matrix[3] = 1;\n matrix[4] = 0;\n matrix[5] = 2 * anchorY;\n }\n\n /**\n * Concatenate an vertical flip.\n *\n * @param anchorY The flip anchor point Y.\n */\n flipY(anchorY: float) {\n this.translate(0, anchorY);\n this.scale(1, -1);\n // First: translate anchor to origin\n this.translate(0, -anchorY);\n }\n\n /**\n * Concatenate a transformation after this one.\n * @param other The transformation to concatenate.\n */\n concatenate(other: AffineTransformation) {\n const matrix = this.matrix;\n const otherMatrix = other.matrix;\n\n const m0 = matrix[0];\n const m1 = matrix[1];\n const m2 = matrix[2];\n const m3 = matrix[3];\n const m4 = matrix[4];\n const m5 = matrix[5];\n\n const o0 = otherMatrix[0];\n const o1 = otherMatrix[1];\n const o2 = otherMatrix[2];\n const o3 = otherMatrix[3];\n const o4 = otherMatrix[4];\n const o5 = otherMatrix[5];\n\n // o0 o2 o4\n // o1 o3 o5\n // 0 0 1\n // m0 m2 m4\n // m1 m3 m5\n // 0 0 1\n matrix[0] = o0 * m0 + o1 * m2;\n matrix[1] = o0 * m1 + o1 * m3;\n matrix[2] = o2 * m0 + o3 * m2;\n matrix[3] = o2 * m1 + o3 * m3;\n matrix[4] = o4 * m0 + o5 * m2 + m4;\n matrix[5] = o4 * m1 + o5 * m3 + m5;\n }\n\n /**\n * Concatenate a transformation before this one.\n * @param other The transformation to concatenate.\n */\n preConcatenate(other: AffineTransformation) {\n const matrix = this.matrix;\n const otherMatrix = other.matrix;\n\n const m0 = matrix[0];\n const m1 = matrix[1];\n const m2 = matrix[2];\n const m3 = matrix[3];\n const m4 = matrix[4];\n const m5 = matrix[5];\n\n const o0 = otherMatrix[0];\n const o1 = otherMatrix[1];\n const o2 = otherMatrix[2];\n const o3 = otherMatrix[3];\n const o4 = otherMatrix[4];\n const o5 = otherMatrix[5];\n\n // m0 m2 m4\n // m1 m3 m5\n // 0 0 1\n // o0 o2 o4\n // o1 o3 o5\n // 0 0 1\n matrix[0] = m0 * o0 + m1 * o2;\n matrix[1] = m0 * o1 + m1 * o3;\n matrix[2] = m2 * o0 + m3 * o2;\n matrix[3] = m2 * o1 + m3 * o3;\n matrix[4] = m4 * o0 + m5 * o2 + o4;\n matrix[5] = m4 * o1 + m5 * o3 + o5;\n }\n\n /**\n * Transform a point.\n *\n * @param source The point to transform.\n * @param destination The Point to store the transformed coordinates.\n */\n transform(source: FloatPoint, destination: FloatPoint) {\n const matrix = this.matrix;\n // x\n // y\n // 1\n // m0 m2 m4\n // m1 m3 m5\n // 0 0 1\n const x = matrix[0] * source[0] + matrix[2] * source[1] + matrix[4];\n const y = matrix[1] * source[0] + matrix[3] * source[1] + matrix[5];\n destination[0] = x;\n destination[1] = y;\n }\n\n /**\n * Invert the matrix.\n */\n invert() {\n const matrix = this.matrix;\n\n const m0 = matrix[0];\n const m1 = matrix[1];\n const m2 = matrix[2];\n const m3 = matrix[3];\n const m4 = matrix[4];\n const m5 = matrix[5];\n\n const n = m0 * m3 - m1 * m2;\n\n matrix[0] = m3 / n;\n matrix[1] = -m1 / n;\n matrix[2] = -m2 / n;\n matrix[3] = m0 / n;\n matrix[4] = (m2 * m5 - m3 * m4) / n;\n matrix[5] = -(m0 * m5 - m1 * m4) / n;\n\n return this;\n }\n\n toString() {\n const matrix = this.matrix;\n return `[[${matrix[0]} ${matrix[1]}] [${matrix[2]} ${matrix[3]}] [${matrix[4]} ${matrix[5]}]]`;\n }\n }\n}\n"],
5
+ "mappings": "AAAA,IAAU,MAAAA,GAAV,CAIS,MAAMC,CAAqB,CACxB,OAKR,aAAc,CAIZ,KAAK,OAAS,IAAI,aAAa,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,CAAC,CAAC,CACnD,CAKA,eAAgB,CACd,MAAMC,EAAS,KAAK,OAIpBA,EAAO,CAAC,EAAI,EACZA,EAAO,CAAC,EAAI,EACZA,EAAO,CAAC,EAAI,EACZA,EAAO,CAAC,EAAI,EACZA,EAAO,CAAC,EAAI,EACZA,EAAO,CAAC,EAAI,CACd,CAKA,YAAsB,CACpB,MAAMA,EAAS,KAAK,OACpB,OACEA,EAAO,CAAC,IAAM,GACdA,EAAO,CAAC,IAAM,GACdA,EAAO,CAAC,IAAM,GACdA,EAAO,CAAC,IAAM,GACdA,EAAO,CAAC,IAAM,GACdA,EAAO,CAAC,IAAM,CAElB,CAMA,OAAOC,EAAsC,CAC3C,MAAMD,EAAS,KAAK,OACdE,EAAcD,EAAM,OAC1B,OACE,OAASA,GACRD,EAAO,CAAC,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AO,CAAC,GAAKc,EAAKK,EAAKJ,EAAKG,GAAMY,EAClC9B,EAAO,CAAC,EAAI,EAAEY,EAAKO,EAAKN,EAAKK,GAAMY,EAE5B,IACT,CAEA,UAAW,CACT,MAAM9B,EAAS,KAAK,OACpB,MAAO,KAAKA,EAAO,CAAC,CAAC,IAAIA,EAAO,CAAC,CAAC,MAAMA,EAAO,CAAC,CAAC,IAAIA,EAAO,CAAC,CAAC,MAAMA,EAAO,CAAC,CAAC,IAAIA,EAAO,CAAC,CAAC,IAC5F,CACF,CAldOF,EAAM,qBAAAC,IAJL",
6
+ "names": ["gdjs", "AffineTransformation", "matrix", "other", "otherMatrix", "epsilon", "tx", "ty", "sx", "sy", "theta", "cost", "sint", "angle", "m0", "m1", "m2", "m3", "anchorX", "anchorY", "m4", "m5", "o0", "o1", "o2", "o3", "o4", "o5", "source", "destination", "x", "y", "n"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var gdjs;(c=>{const a=new c.Logger("Debugger client"),g={log:console.log,info:console.info,debug:console.debug,warn:console.warn,error:console.error},m=(d,e,o)=>{const r=[],n=[];return e==null&&(e=function(i,t){return r[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(t)).join(".")+"]"}),function(i,t){if(r.length>0){const s=r.indexOf(this);if(~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,i):n.push(i),o!=null&&s>o)return"[Max depth reached]";~r.indexOf(t)&&(t=e.call(this,i,t))}else r.push(t);return d==null?t:d.call(this,i,t)}},l=(d,e,o,r,n)=>JSON.stringify(d,m(e,n,o),r);class p{_runtimegame;_hotReloader;_originalConsole=g;constructor(e){this._runtimegame=e,this._hotReloader=new c.HotReloader(e);const o=(n,...i)=>{this.log("JavaScript",i.reduce((t,s)=>t+s,""),n,!1)};console.log=(...n)=>{g.log(...n),o("info",...n)},console.debug=(...n)=>{g.debug(...n),o("info",...n)},console.info=(...n)=>{g.info(...n),o("info",...n)},console.warn=(...n)=>{g.warn(...n),o("warning",...n)},console.error=(...n)=>{g.error(...n),o("error",...n)};const r=c.Logger.getLoggerOutput();c.Logger.setLoggerOutput({log:(n,i,t="info",s=!0)=>{r.log(n,i,t,s),this.log(n,i,t,s)}})}handleCommand(e){const o=this,r=this._runtimegame;e&&e.command?e.command==="play"?r.pause(!1):e.command==="pause"?(r.pause(!0),o.sendRuntimeGameDump()):e.command==="refresh"?o.sendRuntimeGameDump():e.command==="set"?o.set(e.path,e.newValue):e.command==="call"?o.call(e.path,e.args):e.command==="profiler.start"?(r.startCurrentSceneProfiler(function(n){o.sendProfilerOutput(n.getFramesAverageMeasures(),n.getStats()),o.sendProfilerStopped()}),o.sendProfilerStarted()):e.command==="profiler.stop"?r.stopCurrentSceneProfiler():e.command==="hotReload"?o._hotReloader.hotReload().then(n=>{o.sendHotReloaderLogs(n)}):a.info('Unknown command "'+e.command+'" received by the debugger.'):a.info("Debugger received a message with badly formatted data.")}log(e,o,r,n){this._sendMessage(JSON.stringify({command:"console.log",payload:{message:o,type:r,group:e,internal:n,timestamp:performance.now()}}))}set(e,o){if(!e||!e.length)return a.warn("No path specified, set operation from debugger aborted"),!1;let r=this._runtimegame,n=0;for(;n<e.length-1;){const t=e[n];if(!r||!r[t])return a.error("Incorrect path specified. No "+t+" in ",r),!1;r=r[t],n++}const i=r[e[n]];return typeof i=="number"?o=parseFloat(o):typeof i=="string"&&(o=""+o),a.log("Updating",e,"to",o),r[e[n]]=o,!0}call(e,o){if(!e||!e.length)return a.warn("No path specified, call operation from debugger aborted"),!1;let r=this._runtimegame,n=0;for(;n<e.length-1;){const i=e[n];if(!r||!r[i])return a.error("Incorrect path specified. No "+i+" in ",r),!1;r=r[i],n++}return r[e[n]]?(a.log("Calling",e,"with",o),r[e[n]].apply(r,o),!0):(a.error("Unable to call",e),!1)}sendRuntimeGameDump(){const e=this,o={command:"dump",payload:this._runtimegame},r=Date.now(),n=[e._runtimegame.getGameData()],i=["_debuggerClient","_allInstancesList","_runtimeGame","_runtimeScene","_behaviorsTable","_animations","_animationFrame","linkedObjectsManager","_platformRBush","HSHG","_obstaclesHSHG","owner","_renderer","_gameRenderer","_imageManager","baseTexture","_baseTexture","_invalidTexture"],t=l(o,function(f,u){return n.indexOf(u)!==-1||i.indexOf(f)!==-1?"[Removed from the debugger]":u},18),s=Date.now()-r;a.log("RuntimeGame serialization took "+s+"ms"),s>500&&a.warn("Serialization took a long time: please check if there is a need to remove some objects from serialization"),this._sendMessage(t)}sendHotReloaderLogs(e){this._sendMessage(l({command:"hotReloader.logs",payload:e}))}sendProfilerStarted(){this._sendMessage(l({command:"profiler.started",payload:null}))}sendProfilerStopped(){this._sendMessage(l({command:"profiler.stopped",payload:null}))}sendGamePaused(){this._sendMessage(l({command:"game.paused",payload:null}))}sendGameResumed(){this._sendMessage(l({command:"game.resumed",payload:null}))}sendProfilerOutput(e,o){this._sendMessage(l({command:"profiler.output",payload:{framesAverageMeasures:e,stats:o}}))}}c.AbstractDebuggerClient=p})(gdjs||={});
2
+ //# sourceMappingURL=abstract-debugger-client.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../GDevelop/GDJS/Runtime/debugger-client/abstract-debugger-client.ts"],
4
+ "sourcesContent": ["namespace gdjs {\n const logger = new gdjs.Logger('Debugger client');\n\n const originalConsole = {\n log: console.log,\n info: console.info,\n debug: console.debug,\n warn: console.warn,\n error: console.error,\n };\n\n /**\n * A function used to replace circular references with a new value.\n * @param key - The key corresponding to the value.\n * @param value - The value.\n * @returns The new value.\n */\n type DebuggerClientCycleReplacer = (key: string, value: any) => any;\n\n /**\n * Generates a JSON serializer that prevent circular references and stop if maxDepth is reached.\n * @param [replacer] - A function called for each property on the object or array being stringified, with the property key and its value, and that returns the new value. If not specified, values are not altered.\n * @param [cycleReplacer] - Function used to replace circular references with a new value.\n * @param [maxDepth] - The maximum depth, after which values are replaced by a string (\"[Max depth reached]\"). If not specified, there is no maximum depth.\n */\n const depthLimitedSerializer = (\n replacer?: DebuggerClientCycleReplacer,\n cycleReplacer?: DebuggerClientCycleReplacer,\n maxDepth?: number\n ): DebuggerClientCycleReplacer => {\n const stack: Array<string> = [],\n keys: Array<string> = [];\n if (cycleReplacer === undefined || cycleReplacer === null) {\n cycleReplacer = function (key, value) {\n if (stack[0] === value) {\n return '[Circular ~]';\n }\n return (\n '[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']'\n );\n };\n }\n\n return function (key: string, value: any): any {\n if (stack.length > 0) {\n const thisPos = stack.indexOf(this);\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);\n if (maxDepth != null && thisPos > maxDepth) {\n return '[Max depth reached]';\n } else {\n if (~stack.indexOf(value)) {\n value = (cycleReplacer as DebuggerClientCycleReplacer).call(\n this,\n key,\n value\n );\n }\n }\n } else {\n stack.push(value);\n }\n return replacer == null ? value : replacer.call(this, key, value);\n };\n };\n\n /**\n * This is an alternative to JSON.stringify that ensure that circular references\n * are replaced by a placeholder.\n *\n * @param obj - The object to serialize.\n * @param [replacer] - A function called for each property on the object or array being stringified, with the property key and its value, and that returns the new value. If not specified, values are not altered.\n * @param [maxDepth] - The maximum depth, after which values are replaced by a string (\"[Max depth reached]\"). If not specified, there is no maximum depth.\n * @param [spaces] - The number of spaces for indentation.\n * @param [cycleReplacer] - Function used to replace circular references with a new value.\n */\n const circularSafeStringify = (\n obj: any,\n replacer?: DebuggerClientCycleReplacer,\n maxDepth?: number,\n spaces?: number,\n cycleReplacer?: DebuggerClientCycleReplacer\n ) => {\n return JSON.stringify(\n obj,\n depthLimitedSerializer(replacer, cycleReplacer, maxDepth),\n spaces\n );\n };\n\n /**\n * The base class describing a debugger client, that can be used to inspect\n * a runtime game (dump its state) or alter it.\n */\n export abstract class AbstractDebuggerClient {\n _runtimegame: gdjs.RuntimeGame;\n _hotReloader: gdjs.HotReloader;\n _originalConsole = originalConsole;\n\n constructor(runtimeGame: RuntimeGame) {\n this._runtimegame = runtimeGame;\n this._hotReloader = new gdjs.HotReloader(runtimeGame);\n\n const redirectJsLog = (\n type: 'info' | 'warning' | 'error',\n ...messages: any[]\n ) => {\n this.log(\n 'JavaScript',\n messages.reduce((accumulator, value) => accumulator + value, ''),\n type,\n false\n );\n };\n\n // Hook the console logging functions to log to the Debugger as well\n console.log = (...messages: any[]) => {\n originalConsole.log(...messages);\n redirectJsLog('info', ...messages);\n };\n\n console.debug = (...messages: any[]) => {\n originalConsole.debug(...messages);\n redirectJsLog('info', ...messages);\n };\n\n console.info = (...messages: any[]) => {\n originalConsole.info(...messages);\n redirectJsLog('info', ...messages);\n };\n\n console.warn = (...messages: any[]) => {\n originalConsole.warn(...messages);\n redirectJsLog('warning', ...messages);\n };\n\n console.error = (...messages: any[]) => {\n originalConsole.error(...messages);\n redirectJsLog('error', ...messages);\n };\n\n // Overwrite the default GDJS log outputs so that they\n // both go to the console (or wherever they were configured to go)\n // and sent to the remote debugger.\n const existingLoggerOutput = gdjs.Logger.getLoggerOutput();\n gdjs.Logger.setLoggerOutput({\n log: (\n group: string,\n message: string,\n type: 'info' | 'warning' | 'error' = 'info',\n internal = true\n ) => {\n existingLoggerOutput.log(group, message, type, internal);\n this.log(group, message, type, internal);\n },\n });\n }\n\n /**\n * Should be called by derived class to handle a command\n * received from the debugger server.\n *\n * @param data An object containing the command to do.\n */\n protected handleCommand(data: any) {\n const that = this;\n const runtimeGame = this._runtimegame;\n if (data && data.command) {\n if (data.command === 'play') {\n runtimeGame.pause(false);\n } else if (data.command === 'pause') {\n runtimeGame.pause(true);\n that.sendRuntimeGameDump();\n } else if (data.command === 'refresh') {\n that.sendRuntimeGameDump();\n } else if (data.command === 'set') {\n that.set(data.path, data.newValue);\n } else if (data.command === 'call') {\n that.call(data.path, data.args);\n } else if (data.command === 'profiler.start') {\n runtimeGame.startCurrentSceneProfiler(function (stoppedProfiler) {\n that.sendProfilerOutput(\n stoppedProfiler.getFramesAverageMeasures(),\n stoppedProfiler.getStats()\n );\n that.sendProfilerStopped();\n });\n that.sendProfilerStarted();\n } else if (data.command === 'profiler.stop') {\n runtimeGame.stopCurrentSceneProfiler();\n } else if (data.command === 'hotReload') {\n that._hotReloader.hotReload().then((logs) => {\n that.sendHotReloaderLogs(logs);\n });\n } else {\n logger.info(\n 'Unknown command \"' + data.command + '\" received by the debugger.'\n );\n }\n } else {\n logger.info('Debugger received a message with badly formatted data.');\n }\n }\n\n /**\n * Should be re-implemented by derived class to send a stringified message object\n * to the debugger server.\n * @param message\n */\n protected abstract _sendMessage(message: string): void;\n\n /**\n * Send a message (a log) to debugger server.\n */\n log(\n group: string,\n message: string,\n type: 'info' | 'warning' | 'error',\n internal: boolean\n ) {\n this._sendMessage(\n JSON.stringify({\n command: 'console.log',\n payload: {\n message,\n type,\n group,\n internal,\n timestamp: performance.now(),\n },\n })\n );\n }\n\n /**\n * Update a value, specified by a path starting from the {@link RuntimeGame} instance.\n * @param path - The path to the variable, starting from {@link RuntimeGame}.\n * @param newValue - The new value.\n * @return Was the operation successful?\n */\n set(path: string[], newValue: any): boolean {\n if (!path || !path.length) {\n logger.warn('No path specified, set operation from debugger aborted');\n return false;\n }\n let object = this._runtimegame;\n let currentIndex = 0;\n while (currentIndex < path.length - 1) {\n const key = path[currentIndex];\n if (!object || !object[key]) {\n logger.error('Incorrect path specified. No ' + key + ' in ', object);\n return false;\n }\n object = object[key];\n currentIndex++;\n }\n\n // Ensure the newValue is properly typed to avoid breaking anything in\n // the game engine.\n const currentValue = object[path[currentIndex]];\n if (typeof currentValue === 'number') {\n newValue = parseFloat(newValue);\n } else {\n if (typeof currentValue === 'string') {\n newValue = '' + newValue;\n }\n }\n logger.log('Updating', path, 'to', newValue);\n object[path[currentIndex]] = newValue;\n return true;\n }\n\n /**\n * Call a method, specified by a path starting from the {@link RuntimeGame} instance.\n * @param path - The path to the method, starting from {@link RuntimeGame}.\n * @param args - The arguments to pass the method.\n * @return Was the operation successful?\n */\n call(path: string[], args: any[]): boolean {\n if (!path || !path.length) {\n logger.warn('No path specified, call operation from debugger aborted');\n return false;\n }\n let object = this._runtimegame;\n let currentIndex = 0;\n while (currentIndex < path.length - 1) {\n const key = path[currentIndex];\n if (!object || !object[key]) {\n logger.error('Incorrect path specified. No ' + key + ' in ', object);\n return false;\n }\n object = object[key];\n currentIndex++;\n }\n if (!object[path[currentIndex]]) {\n logger.error('Unable to call', path);\n return false;\n }\n logger.log('Calling', path, 'with', args);\n object[path[currentIndex]].apply(object, args);\n return true;\n }\n\n /**\n * Dump all the relevant data from the {@link RuntimeGame} instance and send it to the server.\n */\n sendRuntimeGameDump(): void {\n const that = this;\n const message = { command: 'dump', payload: this._runtimegame };\n const serializationStartTime = Date.now();\n\n // Stringify the message, excluding some known data that are big and/or not\n // useful for the debugger.\n const excludedValues = [that._runtimegame.getGameData()];\n const excludedKeys = [\n // Exclude reference to the debugger\n '_debuggerClient',\n // Exclude some RuntimeScene fields:\n '_allInstancesList',\n // Exclude circular references to parent runtimeGame or runtimeScene:\n '_runtimeGame',\n '_runtimeScene',\n // Exclude some runtimeObject duplicated data:\n '_behaviorsTable',\n // Exclude some objects data:\n '_animations',\n '_animationFrame',\n // Exclude linked objects to avoid too much repetitions:\n 'linkedObjectsManager',\n // Could be improved by using private fields and excluding these (_)\n // Exclude some behaviors data:\n '_platformRBush',\n // PlatformBehavior\n 'HSHG',\n // Pathfinding\n '_obstaclesHSHG',\n // Pathfinding\n 'owner',\n // Avoid circular reference from behavior to parent runtimeObject\n // Exclude rendering related objects:\n '_renderer',\n '_gameRenderer',\n '_imageManager',\n // Exclude PIXI textures:\n 'baseTexture',\n '_baseTexture',\n '_invalidTexture',\n ];\n const stringifiedMessage = circularSafeStringify(\n message,\n function (key, value) {\n if (\n excludedValues.indexOf(value) !== -1 ||\n excludedKeys.indexOf(key) !== -1\n ) {\n return '[Removed from the debugger]';\n }\n return value;\n },\n /* Limit maximum depth to prevent any crashes */\n 18\n );\n const serializationDuration = Date.now() - serializationStartTime;\n logger.log(\n 'RuntimeGame serialization took ' + serializationDuration + 'ms'\n );\n if (serializationDuration > 500) {\n logger.warn(\n 'Serialization took a long time: please check if there is a need to remove some objects from serialization'\n );\n }\n this._sendMessage(stringifiedMessage);\n }\n\n /**\n * Send logs from the hot reloader to the server.\n * @param logs The hot reloader logs.\n */\n sendHotReloaderLogs(logs: HotReloaderLog[]): void {\n this._sendMessage(\n circularSafeStringify({\n command: 'hotReloader.logs',\n payload: logs,\n })\n );\n }\n\n /**\n * Callback called when profiling is starting.\n */\n sendProfilerStarted(): void {\n this._sendMessage(\n circularSafeStringify({\n command: 'profiler.started',\n payload: null,\n })\n );\n }\n\n /**\n * Callback called when profiling is ending.\n */\n sendProfilerStopped(): void {\n this._sendMessage(\n circularSafeStringify({\n command: 'profiler.stopped',\n payload: null,\n })\n );\n }\n\n /**\n * Callback called when the game is paused.\n */\n sendGamePaused(): void {\n this._sendMessage(\n circularSafeStringify({\n command: 'game.paused',\n payload: null,\n })\n );\n }\n\n /**\n * Callback called when the game is resumed.\n */\n sendGameResumed(): void {\n this._sendMessage(\n circularSafeStringify({\n command: 'game.resumed',\n payload: null,\n })\n );\n }\n\n /**\n * Send profiling results.\n * @param framesAverageMeasures The measures made for each frames.\n * @param stats Other measures done during the profiler run.\n */\n sendProfilerOutput(\n framesAverageMeasures: FrameMeasure,\n stats: ProfilerStats\n ): void {\n this._sendMessage(\n circularSafeStringify({\n command: 'profiler.output',\n payload: {\n framesAverageMeasures: framesAverageMeasures,\n stats: stats,\n },\n })\n );\n }\n }\n}\n"],
5
+ "mappings": "AAAA,IAAU,MAAAA,GAAV,CACE,MAAMC,EAAS,IAAID,EAAK,OAAO,iBAAiB,EAE1CE,EAAkB,CACtB,IAAK,QAAQ,IACb,KAAM,QAAQ,KACd,MAAO,QAAQ,MACf,KAAM,QAAQ,KACd,MAAO,QAAQ,KACjB,EAgBMC,EAAyB,CAC7BC,EACAC,EACAC,IACgC,CAChC,MAAMC,EAAuB,CAAC,EAC5BC,EAAsB,CAAC,EACzB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AS,IACX,CAAC,CACH,CACF,CAKA,iBAAwB,CACtB,KAAK,aACHA,EAAsB,CACpB,QAAS,eACT,QAAS,IACX,CAAC,CACH,CACF,CAOA,mBACE4B,EACAC,EACM,CACN,KAAK,aACH7B,EAAsB,CACpB,QAAS,kBACT,QAAS,CACP,sBAAuB4B,EACvB,MAAOC,CACT,CACF,CAAC,CACH,CACF,CACF,CAxWOzC,EAAe,uBAAAe,IA9Fd",
6
+ "names": ["gdjs", "logger", "originalConsole", "depthLimitedSerializer", "replacer", "cycleReplacer", "maxDepth", "stack", "keys", "key", "value", "thisPos", "circularSafeStringify", "obj", "spaces", "AbstractDebuggerClient", "runtimeGame", "redirectJsLog", "type", "messages", "accumulator", "existingLoggerOutput", "group", "message", "internal", "data", "that", "stoppedProfiler", "logs", "path", "newValue", "object", "currentIndex", "currentValue", "args", "serializationStartTime", "excludedValues", "excludedKeys", "stringifiedMessage", "serializationDuration", "framesAverageMeasures", "stats"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var gdjs;(l=>{const c=new l.Logger("Hot reloader");class m{_runtimeGame;_reloadedScriptElement={};_logs=[];_alreadyLoadedScriptFiles={};constructor(i){this._runtimeGame=i}static groupByPersistentUuid(i){return i.reduce(function(e,r){return r.persistentUuid&&(e[r.persistentUuid]=r),e},{})}_canReloadScriptFile(i){function e(r,t){const o=r.indexOf(t);return o!==-1&&o===r.length-t.length}return!(e(i,".h")||this._alreadyLoadedScriptFiles[i]&&(e(i,"box2d.js")||e(i,"sha256.js")||e(i,"shifty.js")||e(i,"shopify-buy.umd.polyfilled.min.js")||e(i,"pixi-multistyle-text.umd.js")||e(i,"pixi-tilemap.umd.js")||e(i,"bondage.min.js")||e(i,"pixi-particles-pixi-renderer.min.js")||e(i,"pixi-tilemap.umd.js")||e(i,"pixi-tilemap-helper.js")||e(i,"pako/dist/pako.min")))}_reloadScript(i){function e(t,o){const a=t.indexOf(o);return a!==-1&&a===t.length-o.length}if(!this._canReloadScriptFile(i))return this._logs.push({kind:"info",message:"Not reloading "+i+" as it is blocked for hot-reloading."}),Promise.resolve();const r=document.getElementsByTagName("head")[0];return r?new Promise((t,o)=>{const a=this._reloadedScriptElement[i];if(a)r.removeChild(a);else{const n=r.getElementsByTagName("script");for(let h=0;h<n.length;++h){const d=n[h];e(d.src,i)&&r.removeChild(d)}}const s=document.createElement("script");s.src=i+"?timestamp="+Date.now(),s.onload=()=>{t()},s.onerror=n=>{o(n)},r.appendChild(s),this._reloadedScriptElement[i]=s}):Promise.reject(new Error("No head element found, are you in a navigator?"))}hotReload(){c.info("Hot reload started"),this._runtimeGame.pause(!0),this._logs=[];const i=l.projectData,e=l.runtimeGameOptions.scriptFiles;e.forEach(t=>{this._alreadyLoadedScriptFiles[t.path]=!0});const r={};for(let t in l.behaviorsTypes.items)r[t]=l.behaviorsTypes.items[t];return this._reloadScript("data.js").then(()=>{const t=l.projectData,o=l.runtimeGameOptions,a=o.scriptFiles,s=!!o.projectDataOnlyExport;return this.reloadScriptFiles(t,e,a,s).then(()=>{const n=this._computeChangedRuntimeBehaviors(r,l.behaviorsTypes.items);return this._hotReloadRuntimeGame(i,t,n,this._runtimeGame)}).catch(n=>{const h=n.target;h instanceof HTMLScriptElement?this._logs.push({kind:"fatal",message:"Unable to reload script:"+h.src}):this._logs.push({kind:"fatal",message:"Unexpected error happened while hot-reloading:"+n.message})}).then(()=>(c.info("Hot reload finished with logs:",this._logs),this._runtimeGame.pause(!1),this._logs))})}_computeChangedRuntimeBehaviors(i,e){const r=[];for(let t in i){const o=i[t],a=e[t];a?o!==a&&(this._logs.push({kind:"info",message:"Behavior with type "+t+" was changed, and will be re-instantiated in gdjs.RuntimeObjects using it."}),r.push({oldBehaviorConstructor:o,newBehaviorConstructor:a,behaviorTypeName:t})):this._logs.push({kind:"warning",message:"Behavior with type "+t+" was removed from the registered behaviors in gdjs."})}return r}reloadScriptFiles(i,e,r,t){const o=[];t||i.layouts.forEach((a,s)=>{o.push(this._reloadScript("code"+s+".js"))});for(let a=0;a<r.length;++a){const s=r[a],n=e.filter(h=>h.path===s.path)[0];n?s.hash!==n.hash&&(this._logs.push({kind:"info",message:"Reloading "+s.path+" because it was changed."}),o.push(this._reloadScript(s.path))):(this._logs.push({kind:"info",message:"Loading "+s.path+" as it was added to the list of scripts."}),o.push(this._reloadScript(s.path)))}for(let a=0;a<e.length;++a){const s=e[a];!r.filter(h=>h.path===s.path)[0]&&!t&&this._logs.push({kind:"warning",message:"Script file "+s.path+" was removed."})}return Promise.all(o)}_hotReloadRuntimeGame(i,e,r,t){return new Promise(o=>{t.setProjectData(e),t.loadAllAssets(()=>{this._hotReloadVariablesContainer(i.variables,e.variables,t.getVariables());const a=t.getSceneStack();a._stack.forEach(s=>{const n=i.layouts.filter(d=>d.name===s.getName())[0],h=e.layouts.filter(d=>d.name===s.getName())[0];n&&h?this._hotReloadRuntimeScene(n,h,r,s):this._logs.push({kind:"error",message:"Scene "+n.name+" was removed. A fresh preview should be launched."})}),e.externalLayouts.forEach(s=>{const n=i.externalLayouts.filter(h=>h.name===s.name)[0];n&&!m.deepEqual(n,s)&&a._stack.forEach(h=>{this._hotReloadRuntimeSceneInstances(n.instances,s.instances,h)})}),o()})})}_hotReloadVariablesContainer(i,e,r){e.forEach(t=>{const o=t.name,a=i.find(n=>n.name===o),s=r.get(t.name);a?l.Variable.isPrimitive(t.type||"number")&&(a.value!==t.value||!l.Variable.isPrimitive(a.type||"number"))?(r.remove(o),r.add(o,new l.Variable(t))):l.Variable.isPrimitive(t.type||"number")||(t.type==="structure"?this._hotReloadStructureVariable(a.children,t.children,s):(r.remove(o),r.add(o,new l.Variable(t)))):r.add(o,new l.Variable(t))}),i.forEach(t=>{e.find(a=>a.name===t.name)||r.remove(t.name)})}_hotReloadStructureVariable(i,e,r){i?(i.forEach(t=>{const o=e.find(a=>a.name===t.name);o?l.Variable.isPrimitive(o.type||"number")&&(t.value!==o.value||!l.Variable.isPrimitive(t.type||"number"))?r.addChild(o.name,new l.Variable(o)):l.Variable.isPrimitive(o.type||"number")||(o.type==="structure"?this._hotReloadStructureVariable(t.children,o.children,r.getChild(o.name)):r.addChild(o.name,new l.Variable(o))):r.removeChild(t.name)}),e.forEach(t=>{i.find(a=>a.name===t.name)||r.addChild(t.name,new l.Variable(t))})):e.forEach(t=>{r.addChild(t.name,new l.Variable(t))})}_hotReloadRuntimeScene(i,e,r,t){t.setBackgroundColor(e.r,e.v,e.b),i.title!==e.title&&t.getGame().getRenderer().setWindowTitle(e.title),this._hotReloadVariablesContainer(i.variables,e.variables,t.getVariables()),this._hotReloadRuntimeSceneBehaviorsSharedData(i.behaviorsSharedData,e.behaviorsSharedData,t),this._reinstantiateRuntimeSceneRuntimeBehaviors(r,e.objects,t),this._hotReloadRuntimeSceneObjects(i.objects,e.objects,t),this._hotReloadRuntimeSceneInstances(i.instances,e.instances,t),this._hotReloadRuntimeSceneLayers(i.layers,e.layers,t),t.setEventsGeneratedCodeFunction(e)}_hotReloadRuntimeSceneBehaviorsSharedData(i,e,r){i.forEach(t=>{const o=t.name,a=e.filter(s=>s.name===o)[0];a?m.deepEqual(t,a)||r.setInitialSharedDataForBehavior(a.name,a):r.setInitialSharedDataForBehavior(t.name,null)}),e.forEach(t=>{const o=t.name;i.filter(s=>s.name===o)[0]||r.setInitialSharedDataForBehavior(t.name,t)})}_reinstantiateRuntimeSceneRuntimeBehaviors(i,e,r){e.forEach(t=>{const o=t.name,a=t.behaviors,s=r.getObjects(o);i.forEach(n=>{const h=n.behaviorTypeName;a.filter(d=>d.type===h).forEach(d=>{const f=d.name;this._logs.push({kind:"info",message:'Re-instantiating behavior named "'+f+'" for instances of object "'+o+'".'}),s.forEach(u=>{this._reinstantiateRuntimeObjectRuntimeBehavior(d,u)})})})})}_reinstantiateRuntimeObjectRuntimeBehavior(i,e){const r=i.name,t=e.getBehavior(r);if(!t)return;e.removeBehavior(r),e.addNewBehavior(i);const o=e.getBehavior(r);if(!o){this._logs.push({kind:"error",message:"Could not create behavior "+r+" (type: "+i.type+") for object "+e.getName()});return}for(let a in t)if(t.hasOwnProperty(a))if(a==="_behaviorData"){o[a]=o[a]||{};for(let s in t[a])o[a][s]=t[a][s]}else o[a]=t[a]}_hotReloadRuntimeSceneObjects(i,e,r){i.forEach(t=>{const o=t.name,a=e.filter(s=>s.name===o)[0];!a||t.type!==a.type?r.unregisterObject(o):r.isObjectRegistered(o)&&this._hotReloadRuntimeSceneObject(t,a,r)}),e.forEach(t=>{const o=t.name,a=i.filter(s=>s.name===o)[0];(!a||a.type!==t.type)&&!r.isObjectRegistered(o)&&r.registerObject(t)})}_hotReloadRuntimeSceneObject(i,e,r){let t=!0;if(!m.deepEqual(i,e)){this._logs.push({kind:"info",message:'Object "'+e.name+'" was modified and is hot-reloaded.'}),r.updateObject(e);const o=r.getObjects(e.name);o.forEach(a=>{t=a.updateFromObjectData(i,e)&&t}),o.forEach(a=>{this._hotReloadVariablesContainer(i.variables,e.variables,a.getVariables())}),this._hotReloadRuntimeObjectsBehaviors(i.behaviors,e.behaviors,o),this._hotReloadRuntimeObjectsEffects(i.effects,e.effects,o)}t||this._logs.push({kind:"error",message:'Object "'+e.name+'" could not be hot-reloaded. A fresh preview should be run.'})}_hotReloadRuntimeObjectsBehaviors(i,e,r){i.forEach(t=>{const o=t.name,a=e.filter(s=>s.name===o)[0];if(!a)r.forEach(s=>{s.hasBehavior(o)&&(s.removeBehavior(o)||this._logs.push({kind:"error",message:"Behavior "+o+" could not be removed from object"+s.getName()}))});else if(!m.deepEqual(t,a)){let s=!0;r.forEach(n=>{const h=n.getBehavior(a.name);h&&(s=this._hotReloadRuntimeBehavior(t,a,h)&&s)}),s||this._logs.push({kind:"error",message:a.name+" behavior could not be hot-reloaded."})}}),e.forEach(t=>{const o=t.name;if(!i.filter(s=>s.name===o)[0]){let s=!0;r.forEach(n=>{s=n.addNewBehavior(t)&&s}),s||this._logs.push({kind:"error",message:t.name+" behavior could not be added during hot-reload."})}})}_hotReloadRuntimeObjectsEffects(i,e,r){i.forEach(t=>{const o=t.name,a=e.filter(s=>s.name===o)[0];if(!a)r.forEach(s=>{s.hasEffect(o)&&(s.removeEffect(o)||this._logs.push({kind:"error",message:"Effect "+o+" could not be removed from object"+s.getName()}))});else if(!m.deepEqual(t,a)){let s=!0;r.forEach(n=>{t.effectType===a.effectType?s=n.updateAllEffectParameters(a)&&s:(n.removeEffect(t.name),n.addEffect(a))}),s||this._logs.push({kind:"error",message:a.name+" effect could not be hot-reloaded."})}}),e.forEach(t=>{const o=t.name;if(!i.filter(s=>s.name===o)[0]){let s=!0;r.forEach(n=>{s=n.addEffect(t)&&s}),s||this._logs.push({kind:"error",message:t.name+" effect could not be added during hot-reload."})}})}_hotReloadRuntimeBehavior(i,e,r){return r.updateFromBehaviorData(i,e)}_hotReloadRuntimeSceneLayers(i,e,r){i.forEach(t=>{const o=t.name,a=e.filter(s=>s.name===o)[0];if(!a)r.removeLayer(o);else if(r.hasLayer(o)){const s=r.getLayer(o);this._hotReloadRuntimeLayer(t,a,s)}}),e.forEach(t=>{const o=t.name;!i.filter(s=>s.name===o)[0]&&!r.hasLayer(o)&&r.addLayer(t)}),e.forEach((t,o)=>{r.setLayerIndex(t.name,o)})}_hotReloadRuntimeLayer(i,e,r){i.visibility!==e.visibility&&r.show(e.visibility),e.isLightingLayer&&((i.ambientLightColorR!==e.ambientLightColorR||i.ambientLightColorG!==e.ambientLightColorG||i.ambientLightColorB!==e.ambientLightColorB)&&r.setClearColor(e.ambientLightColorR,e.ambientLightColorG,e.ambientLightColorB),i.followBaseLayerCamera!==e.followBaseLayerCamera&&r.setFollowBaseLayerCamera(e.followBaseLayerCamera)),i.renderingType!==e.renderingType&&this._logs.push({kind:"error",message:`Could not change the rendering type (2D, 3D...) layer at runtime (for layer "${e.name}").`}),e.isLightingLayer!==i.isLightingLayer&&this._logs.push({kind:"error",message:`Could not add/remove a lighting layer at runtime (for layer "${e.name}").`}),this._hotReloadRuntimeLayerEffects(i.effects,e.effects,r)}_hotReloadRuntimeLayerEffects(i,e,r){i.forEach(t=>{const o=t.name,a=e.filter(s=>s.name===o)[0];a?r.hasEffect(o)&&(t.effectType!==a.effectType?(r.removeEffect(o),r.addEffect(a)):this._hotReloadRuntimeLayerEffect(t,a,r,o)):r.removeEffect(o)}),e.forEach(t=>{const o=t.name;!i.filter(s=>s.name===o)[0]&&!r.hasEffect(o)&&r.addEffect(t)})}_hotReloadRuntimeLayerEffect(i,e,r,t){for(let o in e.booleanParameters){const a=e.booleanParameters[o];a!==i.booleanParameters[o]&&r.setEffectBooleanParameter(t,o,a)}for(let o in e.doubleParameters){const a=e.doubleParameters[o];a!==i.doubleParameters[o]&&r.setEffectDoubleParameter(t,o,a)}for(let o in e.stringParameters){const a=e.stringParameters[o];a!==i.stringParameters[o]&&r.setEffectStringParameter(t,o,a)}}_hotReloadRuntimeSceneInstances(i,e,r){const t=r.getAdhocListOfAllInstances(),o=m.groupByPersistentUuid(i),a=m.groupByPersistentUuid(e),s=m.groupByPersistentUuid(t);for(let n in o){const h=o[n],d=a[n],f=s[n];h&&(!d||h.name!==d.name)?f&&f.deleteFromScene(r):h&&d&&f&&this._hotReloadRuntimeInstance(h,d,f)}for(let n in a){const h=o[n],d=a[n],f=s[n];d&&(!h||h.name!==d.name)&&!f&&r.createObjectsFrom([d],0,0,!0)}}_hotReloadRuntimeInstance(i,e,r){let t=!1;i.x!==e.x&&(r.setX(e.x),t=!0),i.y!==e.y&&(r.setY(e.y),t=!0),i.angle!==e.angle&&(r.setAngle(e.angle),t=!0),i.zOrder!==e.zOrder&&(r.setZOrder(e.zOrder),t=!0),i.layer!==e.layer&&(r.setLayer(e.layer),t=!0),l.RuntimeObject3D&&r instanceof l.RuntimeObject3D&&(i.z!==e.z&&e.z!==void 0&&(r.setZ(e.z),t=!0),i.rotationX!==e.rotationX&&e.rotationX!==void 0&&(r.setRotationX(e.rotationX),t=!0),i.rotationY!==e.rotationY&&e.rotationY!==void 0&&(r.setRotationY(e.rotationY),t=!0));let o=!1;e.customSize?i.customSize?(i.width!==e.width&&(r.setWidth(e.width),t=!0,o=!0),i.height!==e.height&&(r.setHeight(e.height),t=!0,o=!0)):(r.setWidth(e.width),r.setHeight(e.height),t=!0,o=!0):!e.customSize&&i.customSize&&(o=!0),l.RuntimeObject3D&&r instanceof l.RuntimeObject3D&&(i.depth!==e.depth&&e.depth!==void 0?(r.setDepth(e.depth),t=!0,o=!0):e.depth===void 0&&i.depth!==void 0&&(o=!0)),this._hotReloadVariablesContainer(i.initialVariables,e.initialVariables,r.getVariables());const a=e.numberProperties.some(n=>{const h=n.name,d=n.value,f=i.numberProperties.filter(u=>u.name===h)[0];return!f||f.value!==d}),s=e.stringProperties.some(n=>{const h=n.name,d=n.value,f=i.stringProperties.filter(u=>u.name===h)[0];return!f||f.value!==d});(a||s||o)&&(r.extraInitializationFromInitialInstance(e),t=!0),t&&r.notifyBehaviorsObjectHotReloaded()}static deepEqual(i,e){if(i===e)return!0;if(i&&e&&typeof i=="object"&&typeof e=="object"){if(i.constructor!==e.constructor)return!1;let r,t,o;if(Array.isArray(i)){if(r=i.length,r!=e.length)return!1;for(t=r;t--!==0;)if(!m.deepEqual(i[t],e[t]))return!1;return!0}if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===e.valueOf();if(i.toString!==Object.prototype.toString)return i.toString()===e.toString();if(o=Object.keys(i),r=o.length,r!==Object.keys(e).length)return!1;for(t=r;t--!==0;)if(!Object.prototype.hasOwnProperty.call(e,o[t]))return!1;for(t=r;t--!==0;){const a=o[t];if(!m.deepEqual(i[a],e[a]))return!1}return!0}return i!==i&&e!==e}}l.HotReloader=m})(gdjs||={});
2
+ //# sourceMappingURL=hot-reloader.js.map