vue-phaserjs 2.38.0 → 2.39.0

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 (225) hide show
  1. package/dist/index.d.ts +10150 -193
  2. package/dist/index.js +1592 -890
  3. package/package.json +25 -13
  4. package/dist/components/Arc.vue.d.ts +0 -285
  5. package/dist/components/BitmapText.vue.d.ts +0 -315
  6. package/dist/components/Circle.vue.d.ts +0 -285
  7. package/dist/components/Container.vue.d.ts +0 -262
  8. package/dist/components/Curve.vue.d.ts +0 -281
  9. package/dist/components/Ellipse.vue.d.ts +0 -283
  10. package/dist/components/Game.vue.d.ts +0 -18
  11. package/dist/components/Graphics.vue.d.ts +0 -257
  12. package/dist/components/Image.vue.d.ts +0 -321
  13. package/dist/components/IsoBox.vue.d.ts +0 -295
  14. package/dist/components/IsoTriangle.vue.d.ts +0 -297
  15. package/dist/components/Line.vue.d.ts +0 -281
  16. package/dist/components/Nineslice.vue.d.ts +0 -290
  17. package/dist/components/Particles.vue.d.ts +0 -263
  18. package/dist/components/PathFollower.vue.d.ts +0 -331
  19. package/dist/components/Polygon.vue.d.ts +0 -279
  20. package/dist/components/Rectangle.vue.d.ts +0 -281
  21. package/dist/components/RenderTexture.vue.d.ts +0 -309
  22. package/dist/components/Scene.vue.d.ts +0 -27
  23. package/dist/components/Sprite.vue.d.ts +0 -322
  24. package/dist/components/Star.vue.d.ts +0 -283
  25. package/dist/components/Text.vue.d.ts +0 -308
  26. package/dist/components/TileSprite.vue.d.ts +0 -16
  27. package/dist/components/Tilemap.vue.d.ts +0 -19
  28. package/dist/components/Triangle.vue.d.ts +0 -279
  29. package/dist/components/Video.vue.d.ts +0 -313
  30. package/dist/components/Zone.vue.d.ts +0 -260
  31. package/dist/components/index.d.ts +0 -28
  32. package/dist/composables/useAnimations.d.ts +0 -45
  33. package/dist/composables/useGame.d.ts +0 -2
  34. package/dist/composables/useInitializeGameObject.d.ts +0 -5
  35. package/dist/composables/useInitializeGameObjectEvents.d.ts +0 -7
  36. package/dist/composables/useInitializeGameObjectSetters.d.ts +0 -7
  37. package/dist/composables/useInjectSceneKey.d.ts +0 -2
  38. package/dist/composables/useTween.d.ts +0 -2
  39. package/dist/hooks/onCreate.d.ts +0 -2
  40. package/dist/hooks/onInit.d.ts +0 -2
  41. package/dist/hooks/onNextTick.d.ts +0 -2
  42. package/dist/hooks/onPreload.d.ts +0 -2
  43. package/dist/hooks/onShutdown.d.ts +0 -2
  44. package/dist/hooks/onUpdate.d.ts +0 -2
  45. package/dist/models/configuration/ArcConfiguration.d.ts +0 -4
  46. package/dist/models/configuration/BitmapTextConfiguration.d.ts +0 -16
  47. package/dist/models/configuration/ContainerConfiguration.d.ts +0 -12
  48. package/dist/models/configuration/CurveConfiguration.d.ts +0 -5
  49. package/dist/models/configuration/EllipseConfiguration.d.ts +0 -4
  50. package/dist/models/configuration/GraphicsConfiguration.d.ts +0 -11
  51. package/dist/models/configuration/ImageConfiguration.d.ts +0 -18
  52. package/dist/models/configuration/IsoBoxConfiguration.d.ts +0 -6
  53. package/dist/models/configuration/IsoTriangleConfiguration.d.ts +0 -6
  54. package/dist/models/configuration/LineConfiguration.d.ts +0 -5
  55. package/dist/models/configuration/NinesliceConfiguration.d.ts +0 -15
  56. package/dist/models/configuration/ParticlesConfiguration.d.ts +0 -14
  57. package/dist/models/configuration/PathFollowerConfiguration.d.ts +0 -19
  58. package/dist/models/configuration/PolygonConfiguration.d.ts +0 -5
  59. package/dist/models/configuration/RectangleConfiguration.d.ts +0 -4
  60. package/dist/models/configuration/RenderTextureConfiguration.d.ts +0 -17
  61. package/dist/models/configuration/SpriteConfiguration.d.ts +0 -19
  62. package/dist/models/configuration/StarConfiguration.d.ts +0 -4
  63. package/dist/models/configuration/TextConfiguration.d.ts +0 -18
  64. package/dist/models/configuration/TileSpriteConfiguration.d.ts +0 -18
  65. package/dist/models/configuration/TriangleConfiguration.d.ts +0 -5
  66. package/dist/models/configuration/VideoConfiguration.d.ts +0 -18
  67. package/dist/models/configuration/ZoneConfiguration.d.ts +0 -12
  68. package/dist/models/configuration/components/AlphaConfiguration.d.ts +0 -4
  69. package/dist/models/configuration/components/AlphaSingleConfiguration.d.ts +0 -4
  70. package/dist/models/configuration/components/BaseTextureConfiguration.d.ts +0 -4
  71. package/dist/models/configuration/components/BlendModeConfiguration.d.ts +0 -4
  72. package/dist/models/configuration/components/ComputedSizeConfiguration.d.ts +0 -4
  73. package/dist/models/configuration/components/DepthConfiguration.d.ts +0 -4
  74. package/dist/models/configuration/components/FlipConfiguration.d.ts +0 -4
  75. package/dist/models/configuration/components/MaskConfiguration.d.ts +0 -4
  76. package/dist/models/configuration/components/OriginConfiguration.d.ts +0 -5
  77. package/dist/models/configuration/components/PathFollowerComponentConfiguration.d.ts +0 -4
  78. package/dist/models/configuration/components/RenderNodesConfiguration.d.ts +0 -4
  79. package/dist/models/configuration/components/ScrollFactorConfiguration.d.ts +0 -5
  80. package/dist/models/configuration/components/SizeConfiguration.d.ts +0 -4
  81. package/dist/models/configuration/components/TextureConfiguration.d.ts +0 -6
  82. package/dist/models/configuration/components/TextureCropConfiguration.d.ts +0 -6
  83. package/dist/models/configuration/components/TintConfiguration.d.ts +0 -4
  84. package/dist/models/configuration/components/TransformConfiguration.d.ts +0 -4
  85. package/dist/models/configuration/components/VisibleConfiguration.d.ts +0 -4
  86. package/dist/models/configuration/global/GameObjectConfiguration.d.ts +0 -3
  87. package/dist/models/configuration/global/GlobalConfiguration.d.ts +0 -4
  88. package/dist/models/configuration/global/TweenConfiguration.d.ts +0 -5
  89. package/dist/models/configuration/shared/AnimationConfiguration.d.ts +0 -6
  90. package/dist/models/configuration/shared/ShapeConfiguration.d.ts +0 -19
  91. package/dist/models/configuration/shared/TweenBuilderConfiguration.d.ts +0 -3
  92. package/dist/models/emit/ArcEventEmitsOptions.d.ts +0 -4
  93. package/dist/models/emit/BitmapTextEventEmitsOptions.d.ts +0 -4
  94. package/dist/models/emit/ContainerEventEmitsOptions.d.ts +0 -4
  95. package/dist/models/emit/CurveEventEmitsOptions.d.ts +0 -4
  96. package/dist/models/emit/EllipseEventEmitsOptions.d.ts +0 -4
  97. package/dist/models/emit/GraphicsEventEmitsOptions.d.ts +0 -4
  98. package/dist/models/emit/ImageEventEmitsOptions.d.ts +0 -4
  99. package/dist/models/emit/IsoBoxEventEmitsOptions.d.ts +0 -4
  100. package/dist/models/emit/IsoTriangleEventEmitsOptions.d.ts +0 -4
  101. package/dist/models/emit/LineEventEmitsOptions.d.ts +0 -4
  102. package/dist/models/emit/NinesliceEventEmitsOptions.d.ts +0 -4
  103. package/dist/models/emit/ParticlesEventEmitsOptions.d.ts +0 -4
  104. package/dist/models/emit/PathFollowerEventEmitsOptions.d.ts +0 -4
  105. package/dist/models/emit/PolygonEventEmitsOptions.d.ts +0 -4
  106. package/dist/models/emit/RectangleEventEmitsOptions.d.ts +0 -4
  107. package/dist/models/emit/RenderTextureEventEmitsOptions.d.ts +0 -4
  108. package/dist/models/emit/SpriteEventEmitsOptions.d.ts +0 -4
  109. package/dist/models/emit/StarEventEmitsOptions.d.ts +0 -4
  110. package/dist/models/emit/TextEventEmitsOptions.d.ts +0 -4
  111. package/dist/models/emit/TileSpriteEventEmitsOptions.d.ts +0 -4
  112. package/dist/models/emit/TriangleEventEmitsOptions.d.ts +0 -4
  113. package/dist/models/emit/VideoEventEmitsOptions.d.ts +0 -4
  114. package/dist/models/emit/ZoneEventEmitsOptions.d.ts +0 -4
  115. package/dist/models/emit/components/AlphaEventEmitsOptions.d.ts +0 -3
  116. package/dist/models/emit/components/AlphaSingleEventEmitsOptions.d.ts +0 -3
  117. package/dist/models/emit/components/BaseTextureEventEmitsOptions.d.ts +0 -3
  118. package/dist/models/emit/components/BlendModeEventEmitsOptions.d.ts +0 -3
  119. package/dist/models/emit/components/ComputedSizeEventEmitsOptions.d.ts +0 -3
  120. package/dist/models/emit/components/DepthEventEmitsOptions.d.ts +0 -3
  121. package/dist/models/emit/components/FlipEventEmitsOptions.d.ts +0 -3
  122. package/dist/models/emit/components/MaskEventEmitsOptions.d.ts +0 -3
  123. package/dist/models/emit/components/OriginEventEmitsOptions.d.ts +0 -3
  124. package/dist/models/emit/components/PathFollowerComponentEventEmitsOptions.d.ts +0 -3
  125. package/dist/models/emit/components/RenderNodesEventEmitsOptions.d.ts +0 -3
  126. package/dist/models/emit/components/ScrollFactorEventEmitsOptions.d.ts +0 -3
  127. package/dist/models/emit/components/SizeEventEmitsOptions.d.ts +0 -3
  128. package/dist/models/emit/components/TextureCropEventEmitsOptions.d.ts +0 -3
  129. package/dist/models/emit/components/TextureEventEmitsOptions.d.ts +0 -3
  130. package/dist/models/emit/components/TintEventEmitsOptions.d.ts +0 -3
  131. package/dist/models/emit/components/TransformEventEmitsOptions.d.ts +0 -3
  132. package/dist/models/emit/components/VisibleEventEmitsOptions.d.ts +0 -3
  133. package/dist/models/emit/global/GameObjectEventEmitsOptions.d.ts +0 -4
  134. package/dist/models/emit/global/GlobalEventEmitsOptions.d.ts +0 -4
  135. package/dist/models/emit/global/TweenEventEmitsOptions.d.ts +0 -3
  136. package/dist/models/emit/shared/GameObjectEventMapEmitsOptions.d.ts +0 -5
  137. package/dist/models/emit/shared/ShapeEventEmitsOptions.d.ts +0 -3
  138. package/dist/models/keys/AnimationKey.d.ts +0 -2
  139. package/dist/models/lifecycle/HookArgs.d.ts +0 -2
  140. package/dist/models/lifecycle/Lifecycle.d.ts +0 -8
  141. package/dist/models/lifecycle/ListenersMap.d.ts +0 -2
  142. package/dist/models/plugins/TiledJSONExternalFile.d.ts +0 -11
  143. package/dist/models/plugins/TilemapFile.d.ts +0 -5
  144. package/dist/models/plugins/TilesetFile.d.ts +0 -7
  145. package/dist/models/scene/SceneLifecycleHooks.d.ts +0 -7
  146. package/dist/models/scene/ScenePlugins.d.ts +0 -2
  147. package/dist/models/scene/SceneProps.d.ts +0 -5
  148. package/dist/models/scene/SceneWithPlugins.d.ts +0 -4
  149. package/dist/models/setterMap/SetterMap.d.ts +0 -4
  150. package/dist/models/text/TextProps.d.ts +0 -6
  151. package/dist/plugins/registerTiledJSONExternalLoader.d.ts +0 -1
  152. package/dist/pushGameObject.d.ts +0 -2
  153. package/dist/store/camera.d.ts +0 -6
  154. package/dist/store/index.d.ts +0 -12
  155. package/dist/store/input.d.ts +0 -3
  156. package/dist/store/scene.d.ts +0 -6
  157. package/dist/store/text.d.ts +0 -4
  158. package/dist/test/setup.d.ts +0 -1
  159. package/dist/test/setupCanvas.d.ts +0 -1
  160. package/dist/util/InjectionKeyMap.d.ts +0 -6
  161. package/dist/util/constants.d.ts +0 -1
  162. package/dist/util/createSceneClass.d.ts +0 -3
  163. package/dist/util/emit/GameObjectEventMap.d.ts +0 -42
  164. package/dist/util/emit/constants.d.ts +0 -1
  165. package/dist/util/emit/getEventName.d.ts +0 -1
  166. package/dist/util/emit/getUpdateEvent.d.ts +0 -3
  167. package/dist/util/emit/isEvent.d.ts +0 -1
  168. package/dist/util/getDepthInsertIndex.d.ts +0 -2
  169. package/dist/util/getScene.d.ts +0 -2
  170. package/dist/util/hooks/getInitializeGameObjectLifecycleHook.d.ts +0 -1
  171. package/dist/util/hooks/pushListener.d.ts +0 -3
  172. package/dist/util/hooks/resetLifecycleListeners.d.ts +0 -3
  173. package/dist/util/hooks/runLifecycleListeners.d.ts +0 -3
  174. package/dist/util/setterMap/ArcSetterMap.d.ts +0 -5
  175. package/dist/util/setterMap/BitmapTextSetterMap.d.ts +0 -5
  176. package/dist/util/setterMap/ContainerSetterMap.d.ts +0 -5
  177. package/dist/util/setterMap/CurveSetterMap.d.ts +0 -5
  178. package/dist/util/setterMap/EllipseSetterMap.d.ts +0 -5
  179. package/dist/util/setterMap/GraphicsSetterMap.d.ts +0 -5
  180. package/dist/util/setterMap/ImageSetterMap.d.ts +0 -5
  181. package/dist/util/setterMap/IsoBoxSetterMap.d.ts +0 -5
  182. package/dist/util/setterMap/IsoTriangleSetterMap.d.ts +0 -5
  183. package/dist/util/setterMap/LineSetterMap.d.ts +0 -5
  184. package/dist/util/setterMap/NinesliceSetterMap.d.ts +0 -5
  185. package/dist/util/setterMap/ParticlesSetterMap.d.ts +0 -5
  186. package/dist/util/setterMap/PathFollowerSetterMap.d.ts +0 -5
  187. package/dist/util/setterMap/PolygonSetterMap.d.ts +0 -5
  188. package/dist/util/setterMap/RectangleSetterMap.d.ts +0 -5
  189. package/dist/util/setterMap/RenderTextureSetterMap.d.ts +0 -5
  190. package/dist/util/setterMap/SpriteSetterMap.d.ts +0 -5
  191. package/dist/util/setterMap/StarSetterMap.d.ts +0 -5
  192. package/dist/util/setterMap/TextSetterMap.d.ts +0 -5
  193. package/dist/util/setterMap/TileSpriteSetterMap.d.ts +0 -5
  194. package/dist/util/setterMap/TriangleSetterMap.d.ts +0 -5
  195. package/dist/util/setterMap/VideoSetterMap.d.ts +0 -5
  196. package/dist/util/setterMap/ZoneSetterMap.d.ts +0 -5
  197. package/dist/util/setterMap/components/AlphaSetterMap.d.ts +0 -8
  198. package/dist/util/setterMap/components/AlphaSingleSetterMap.d.ts +0 -4
  199. package/dist/util/setterMap/components/BaseTextureSetterMap.d.ts +0 -5
  200. package/dist/util/setterMap/components/BlendModeSetterMap.d.ts +0 -4
  201. package/dist/util/setterMap/components/ComputedSizeSetterMap.d.ts +0 -15
  202. package/dist/util/setterMap/components/DepthSetterMap.d.ts +0 -4
  203. package/dist/util/setterMap/components/DisplaySizeSetterMap.d.ts +0 -12
  204. package/dist/util/setterMap/components/FlipSetterMap.d.ts +0 -5
  205. package/dist/util/setterMap/components/MaskSetterMap.d.ts +0 -4
  206. package/dist/util/setterMap/components/OriginSetterMap.d.ts +0 -8
  207. package/dist/util/setterMap/components/PathFollowerComponentSetterMap.d.ts +0 -4
  208. package/dist/util/setterMap/components/RenderNodesSetterMap.d.ts +0 -1
  209. package/dist/util/setterMap/components/ScrollFactorSetterMap.d.ts +0 -6
  210. package/dist/util/setterMap/components/SizeSetterMap.d.ts +0 -15
  211. package/dist/util/setterMap/components/TextureCropSetterMap.d.ts +0 -5
  212. package/dist/util/setterMap/components/TextureSetterMap.d.ts +0 -5
  213. package/dist/util/setterMap/components/TintSetterMap.d.ts +0 -8
  214. package/dist/util/setterMap/components/TransformSetterMap.d.ts +0 -12
  215. package/dist/util/setterMap/components/VisibleSetterMap.d.ts +0 -4
  216. package/dist/util/setterMap/global/GameObjectSetterMap.d.ts +0 -4
  217. package/dist/util/setterMap/global/GlobalSetterMap.d.ts +0 -258
  218. package/dist/util/setterMap/global/TweenSetterMap.d.ts +0 -257
  219. package/dist/util/setterMap/shared/AnimationSetterMap.d.ts +0 -89
  220. package/dist/util/setterMap/shared/IsoSetterMap.d.ts +0 -79
  221. package/dist/util/setterMap/shared/ShapeSetterMap.d.ts +0 -39
  222. package/dist/util/sleep.d.ts +0 -2
  223. package/dist/util/types/EmitsOptionsFor.d.ts +0 -5
  224. package/dist/util/types/ExtractUpdateEvent.d.ts +0 -1
  225. package/dist/util/types/UpdateEvent.d.ts +0 -1
package/dist/index.js CHANGED
@@ -1,592 +1,936 @@
1
- import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, getCurrentInstance as o, inject as s, nextTick as c, onMounted as l, onUnmounted as u, openBlock as d, provide as f, ref as p, renderSlot as m, toValue as h, unref as g, useTemplateRef as _, watch as ee } from "vue";
2
- import { ID_SEPARATOR as v, InvalidOperationError as y, NotFoundError as te, NotInitializedError as b, Operation as x, checkIsPlainObject as ne, takeOne as re, toKebabCase as ie } from "@esposter/shared";
3
- import ae from "phaser4-rex-plugins/plugins/clickoutside.js";
4
- import { Animations as oe, Cameras as S, Game as se, Loader as C, Scene as ce, Scenes as le, Tilemaps as ue, Tweens as de, Utils as fe } from "phaser";
5
- import { defineStore as pe, storeToRefs as w } from "pinia";
6
- import { parseTileset as me, parseXmlString as he } from "parse-tmx";
1
+ import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, getCurrentInstance, inject, nextTick, onMounted, onUnmounted, openBlock, provide, ref, renderSlot, toValue, useTemplateRef, watch } from "vue";
2
+ import { ID_SEPARATOR, InvalidOperationError, NotFoundError, NotInitializedError, Operation, checkIsPlainObject, takeOne, toKebabCase } from "@esposter/shared";
3
+ import ClickOutside from "phaser4-rex-plugins/plugins/clickoutside.js";
4
+ import { Animations, Cameras, Game, Loader, Scene, Scenes, Tilemaps, Tweens, Utils } from "phaser";
5
+ import { defineStore, storeToRefs } from "pinia";
6
+ import { parseTileset, parseXmlString } from "parse-tmx";
7
7
  //#region src/util/getDepthInsertIndex.ts
8
- var ge = (e, t) => typeof t == "number" ? e.findIndex((e) => "depth" in e && typeof e.depth == "number" && e.depth > t) : -1, _e = (e, t, n) => {
9
- let r = ge(e.list, "depth" in t ? t.depth : void 0);
10
- r === -1 ? e.add(n) : e.addAt(n, r);
11
- }, ve = {
8
+ const getDepthInsertIndex = (list, depth) => typeof depth === "number" ? list.findIndex((gameObject) => "depth" in gameObject && typeof gameObject.depth === "number" && gameObject.depth > depth) : -1;
9
+ //#endregion
10
+ //#region src/pushGameObject.ts
11
+ const pushGameObject = (parentContainer, configuration, gameObject) => {
12
+ const depthInsertIndex = getDepthInsertIndex(parentContainer.list, "depth" in configuration ? configuration.depth : void 0);
13
+ if (depthInsertIndex === -1) parentContainer.add(gameObject);
14
+ else parentContainer.addAt(gameObject, depthInsertIndex);
15
+ };
16
+ //#endregion
17
+ //#region src/util/emit/constants.ts
18
+ const EVENT_PREFIX = "on";
19
+ //#endregion
20
+ //#region src/util/emit/checkIsEvent.ts
21
+ const checkIsEvent = (property) => property.startsWith("on");
22
+ //#endregion
23
+ //#region src/util/emit/GameObjectEventMap.ts
24
+ const GameObjectEventMap = {
12
25
  clickoutside: {},
13
- drag: { drag: !0 },
14
- dragend: { drag: !0 },
15
- dragenter: { drag: !0 },
16
- dragleave: { drag: !0 },
17
- dragover: { drag: !0 },
18
- dragstart: { drag: !0 },
19
- drop: { drag: !0 },
26
+ drag: { drag: true },
27
+ dragend: { drag: true },
28
+ dragenter: { drag: true },
29
+ dragleave: { drag: true },
30
+ dragover: { drag: true },
31
+ dragstart: { drag: true },
32
+ drop: { drag: true },
20
33
  pointerdown: { eventIndex: 3 },
21
34
  pointermove: { eventIndex: 3 },
22
35
  pointerout: { eventIndex: 1 },
23
36
  pointerover: { eventIndex: 3 },
24
37
  pointerup: { eventIndex: 3 },
25
38
  wheel: { eventIndex: 4 }
26
- }, ye = "on", be = (e) => {
27
- if (!e.startsWith("on") || e.length <= 2) throw new y(x.Read, be.name, e);
28
- return e.slice(2).toLowerCase();
29
- }, xe = (e) => e.startsWith("on"), Se = () => {
30
- let e = o(), t = new Set(Object.keys(e?.attrs ?? {}).filter((e) => xe(e)).map((e) => be(e))), n = Object.keys(ve).filter((e) => t.has(e)), r = [];
31
- return {
32
- eventStopHandles: r,
33
- initializeGameObjectEvents: (e, t, i) => {
34
- if (n.length !== 0) {
35
- e.input || e.setInteractive(), n.some((e) => "drag" in ve[e]) && i.input.setDraggable(e);
36
- for (let i of n) {
37
- let n = ve[i], a = (...e) => {
38
- "eventIndex" in n && (re(e).stopPropagation = re(e, n.eventIndex).stopPropagation), t(i, ...e);
39
- };
40
- if (i === "clickoutside") {
41
- let t = new ae(e);
42
- t.on(i, a), r.push(() => {
43
- t.off(i, a);
44
- });
45
- continue;
46
- }
47
- e.on(i, a), r.push(() => {
48
- e.off(i, a);
49
- });
50
- }
39
+ };
40
+ //#endregion
41
+ //#region src/util/emit/getEventName.ts
42
+ const getEventName = (event) => {
43
+ if (!event.startsWith("on") || event.length <= 2) throw new InvalidOperationError(Operation.Read, getEventName.name, event);
44
+ return event.slice(2).toLowerCase();
45
+ };
46
+ //#endregion
47
+ //#region src/composables/useInitializeGameObjectEvents.ts
48
+ const useInitializeGameObjectEvents = () => {
49
+ const currentInstance = getCurrentInstance();
50
+ const events = new Set(Object.keys(currentInstance?.attrs ?? {}).filter((key) => checkIsEvent(key)).map((key) => getEventName(key)));
51
+ const gameObjectEvents = Object.keys(GameObjectEventMap).filter((key) => events.has(key));
52
+ const eventStopHandles = [];
53
+ const initializeGameObjectEvents = (gameObject, emit, scene) => {
54
+ if (gameObjectEvents.length === 0) return;
55
+ if (!gameObject.input) gameObject.setInteractive();
56
+ if (gameObjectEvents.some((key) => "drag" in GameObjectEventMap[key])) scene.input.setDraggable(gameObject);
57
+ for (const gameObjectEvent of gameObjectEvents) {
58
+ const context = GameObjectEventMap[gameObjectEvent];
59
+ const eventListener = (...args) => {
60
+ if ("eventIndex" in context) takeOne(args).stopPropagation = takeOne(args, context.eventIndex).stopPropagation;
61
+ emit(gameObjectEvent, ...args);
62
+ };
63
+ if (gameObjectEvent === "clickoutside") {
64
+ const clickOutside = new ClickOutside(gameObject);
65
+ clickOutside.on(gameObjectEvent, eventListener);
66
+ eventStopHandles.push(() => {
67
+ clickOutside.off(gameObjectEvent, eventListener);
68
+ });
69
+ continue;
51
70
  }
71
+ gameObject.on(gameObjectEvent, eventListener);
72
+ eventStopHandles.push(() => {
73
+ gameObject.off(gameObjectEvent, eventListener);
74
+ });
52
75
  }
53
76
  };
54
- }, T = {
77
+ return {
78
+ eventStopHandles,
79
+ initializeGameObjectEvents
80
+ };
81
+ };
82
+ //#endregion
83
+ //#region src/util/InjectionKeyMap.ts
84
+ const InjectionKeyMap = {
55
85
  ParentContainer: Symbol("ParentContainer"),
56
86
  SceneKey: Symbol("SceneKey")
57
- }, E = () => {
58
- let e = s(T.SceneKey);
59
- if (!e) throw new b(T.SceneKey.description ?? "");
60
- return e;
61
- }, D = /* @__PURE__ */ function(e) {
62
- return e.Create = "Create", e.Init = "Init", e.NextTick = "NextTick", e.Preload = "Preload", e.Shutdown = "Shutdown", e.Update = "Update", e;
63
- }({}), O = {
87
+ };
88
+ //#endregion
89
+ //#region src/composables/useInjectSceneKey.ts
90
+ const useInjectSceneKey = () => {
91
+ const sceneKey = inject(InjectionKeyMap.SceneKey);
92
+ if (!sceneKey) throw new NotInitializedError(InjectionKeyMap.SceneKey.description ?? "");
93
+ return sceneKey;
94
+ };
95
+ //#endregion
96
+ //#region src/models/lifecycle/Lifecycle.ts
97
+ let Lifecycle = /* @__PURE__ */ function(Lifecycle) {
98
+ Lifecycle["Create"] = "Create";
99
+ Lifecycle["Init"] = "Init";
100
+ Lifecycle["NextTick"] = "NextTick";
101
+ Lifecycle["Preload"] = "Preload";
102
+ Lifecycle["Shutdown"] = "Shutdown";
103
+ Lifecycle["Update"] = "Update";
104
+ return Lifecycle;
105
+ }({});
106
+ //#endregion
107
+ //#region src/store/scene.ts
108
+ const ExternalSceneStore = {
64
109
  lifecycleListenersMap: /* @__PURE__ */ new Map(),
65
110
  sceneReadyMap: /* @__PURE__ */ new Map()
66
- }, k = (e, t, n) => {
67
- let r = n ?? E(), i = O.lifecycleListenersMap.get(e);
68
- if (!i) {
69
- O.lifecycleListenersMap.set(e, /* @__PURE__ */ new Map([[r, [t]]]));
111
+ };
112
+ //#endregion
113
+ //#region src/util/hooks/pushListener.ts
114
+ const pushListener = (lifecycle, listener, key) => {
115
+ const sceneKey = key ?? useInjectSceneKey();
116
+ const listenersMap = ExternalSceneStore.lifecycleListenersMap.get(lifecycle);
117
+ if (!listenersMap) {
118
+ ExternalSceneStore.lifecycleListenersMap.set(lifecycle, /* @__PURE__ */ new Map([[sceneKey, [listener]]]));
70
119
  return;
71
120
  }
72
- let a = i.get(r);
73
- a ? a.push(t) : i.set(r, [t]);
74
- }, A = (...e) => {
75
- k(D.NextTick, ...e);
76
- }, Ce = (e) => `update:${ie(e)}`, we = (e, t, n, r, i) => {
77
- let a = E(), o = [], s = [];
78
- for (let [c, l] of Object.entries(h(t))) {
79
- let u = r[c];
80
- if (!u) continue;
81
- let d = Ce(c);
82
- o.push((e) => {
83
- u(e, n)(l), l === void 0 ? c in e && n(d, e[c]) : n(d, l);
84
- }), s.push(ee(() => h(t)[c], (t) => {
85
- let r = () => {
86
- u(h(e), n)(t), n(d, t);
121
+ const listeners = listenersMap.get(sceneKey);
122
+ if (listeners) listeners.push(listener);
123
+ else listenersMap.set(sceneKey, [listener]);
124
+ };
125
+ //#endregion
126
+ //#region src/hooks/onNextTick.ts
127
+ const onNextTick = (...args) => {
128
+ pushListener("NextTick", ...args);
129
+ };
130
+ //#endregion
131
+ //#region src/util/emit/getUpdateEvent.ts
132
+ const getUpdateEvent = (property) => `update:${toKebabCase(property)}`;
133
+ //#endregion
134
+ //#region src/composables/useInitializeGameObjectSetters.ts
135
+ const useInitializeGameObjectSetters = (gameObject, configuration, emit, setterMap, immediate) => {
136
+ const sceneKey = useInjectSceneKey();
137
+ const setters = [];
138
+ const setterWatchHandles = [];
139
+ for (const [key, value] of Object.entries(toValue(configuration))) {
140
+ const setter = setterMap[key];
141
+ if (!setter) continue;
142
+ const updateEvent = getUpdateEvent(key);
143
+ setters.push((targetGameObject) => {
144
+ setter(targetGameObject, emit)(value);
145
+ if (value !== void 0) emit(updateEvent, value);
146
+ else if (key in targetGameObject) emit(updateEvent, targetGameObject[key]);
147
+ });
148
+ setterWatchHandles.push(watch(() => toValue(configuration)[key], (newValue) => {
149
+ const updater = () => {
150
+ setter(toValue(gameObject), emit)(newValue);
151
+ emit(updateEvent, newValue);
87
152
  };
88
- i ? r() : A(() => {
89
- r();
90
- }, a);
91
- }, { deep: !0 }));
153
+ if (immediate) updater();
154
+ else onNextTick(() => {
155
+ updater();
156
+ }, sceneKey);
157
+ }, { deep: true }));
92
158
  }
159
+ const initializeGameObjectSetters = (targetGameObject) => {
160
+ for (const setter of setters) setter(targetGameObject);
161
+ };
93
162
  return {
94
- initializeGameObjectSetters: (e) => {
95
- for (let t of o) t(e);
96
- },
97
- setterWatchHandles: s
163
+ initializeGameObjectSetters,
164
+ setterWatchHandles
98
165
  };
99
- }, j = pe("phaser", () => {
100
- let e, n = t({
101
- get: () => e,
102
- set: (t) => {
103
- e = t;
166
+ };
167
+ //#endregion
168
+ //#region src/store/index.ts
169
+ const usePhaserStore = defineStore("phaser", () => {
170
+ let baseGame;
171
+ const game = computed({
172
+ get: () => baseGame,
173
+ set: (newGame) => {
174
+ baseGame = newGame;
104
175
  }
105
- }), r = p(), i = r, a = (e) => e === r.value, o = async (e) => {
106
- if (a(e)) return;
107
- let t = n.value;
108
- if (!t) throw new b(se.name);
109
- let i = r.value;
110
- r.value = e, await c(), i && t.scene.isActive(i) && t.scene.stop(i), t.scene.start(e);
111
- }, s = p([]), l = p([]);
176
+ });
177
+ const sceneKey = ref();
178
+ const rootSceneKey = sceneKey;
179
+ const isSameScene = (newSceneKey) => newSceneKey === sceneKey.value;
180
+ const switchToScene = async (newSceneKey) => {
181
+ if (isSameScene(newSceneKey)) return;
182
+ const activeGame = game.value;
183
+ if (!activeGame) throw new NotInitializedError(Game.name);
184
+ const oldSceneKey = sceneKey.value;
185
+ sceneKey.value = newSceneKey;
186
+ await nextTick();
187
+ if (oldSceneKey && activeGame.scene.isActive(oldSceneKey)) activeGame.scene.stop(oldSceneKey);
188
+ activeGame.scene.start(newSceneKey);
189
+ };
190
+ const parallelSceneKeys = ref([]);
191
+ const prioritizedParallelSceneKeys = ref([]);
192
+ const launchParallelScene = (scene, targetSceneKey) => {
193
+ if (parallelSceneKeys.value.includes(targetSceneKey)) return;
194
+ scene.scene.bringToTop(targetSceneKey);
195
+ for (const prioritizedParallelSceneKey of prioritizedParallelSceneKeys.value) if (parallelSceneKeys.value.includes(prioritizedParallelSceneKey)) scene.scene.bringToTop(prioritizedParallelSceneKey);
196
+ scene.scene.launch(targetSceneKey);
197
+ parallelSceneKeys.value.push(targetSceneKey);
198
+ };
199
+ const removeParallelScene = (scene, targetSceneKey) => {
200
+ const index = parallelSceneKeys.value.indexOf(targetSceneKey);
201
+ if (index === -1) return;
202
+ const parallelSceneKey = parallelSceneKeys.value[index];
203
+ parallelSceneKeys.value = parallelSceneKeys.value.toSpliced(index, 1);
204
+ scene.scene.stop(parallelSceneKey);
205
+ };
112
206
  return {
113
- game: n,
114
- isSameScene: a,
115
- launchParallelScene: (e, t) => {
116
- if (!s.value.includes(t)) {
117
- e.scene.bringToTop(t);
118
- for (let t of l.value) s.value.includes(t) && e.scene.bringToTop(t);
119
- e.scene.launch(t), s.value.push(t);
120
- }
121
- },
122
- parallelSceneKeys: s,
123
- prioritizedParallelSceneKeys: l,
124
- removeParallelScene: (e, t) => {
125
- let n = s.value.indexOf(t);
126
- if (n === -1) return;
127
- let r = s.value[n];
128
- s.value = s.value.toSpliced(n, 1), e.scene.stop(r);
129
- },
130
- rootSceneKey: i,
131
- switchToScene: o
207
+ game,
208
+ isSameScene,
209
+ launchParallelScene,
210
+ parallelSceneKeys,
211
+ prioritizedParallelSceneKeys,
212
+ removeParallelScene,
213
+ rootSceneKey,
214
+ switchToScene
132
215
  };
133
- }), M = () => {
134
- let e = j(), { game: t } = w(e);
135
- if (!t.value) throw new b(se.name);
136
- return t.value;
137
- }, N = (e) => M().scene.getScene(e), Te = (...e) => {
138
- k(D.Create, ...e);
139
- }, Ee = (e) => O.sceneReadyMap.get(e) ? A : Te, P = (e, t, n, r, i) => {
140
- let a, { initializeGameObjectSetters: o, setterWatchHandles: c } = we(() => a, t, n, r, i), { eventStopHandles: l, initializeGameObjectEvents: d } = Se(), f = s(T.ParentContainer, void 0), p = E(), m = Ee(p), g = (t) => {
141
- a = e(t), o(a), d(a, n, t);
142
- }, _ = () => {
143
- f?.value && _e(f.value, h(t), a);
216
+ });
217
+ //#endregion
218
+ //#region src/composables/useGame.ts
219
+ const useGame = () => {
220
+ const phaserStore = usePhaserStore();
221
+ const { game } = storeToRefs(phaserStore);
222
+ if (!game.value) throw new NotInitializedError(Game.name);
223
+ return game.value;
224
+ };
225
+ //#endregion
226
+ //#region src/util/getScene.ts
227
+ const getScene = (sceneKey) => {
228
+ return useGame().scene.getScene(sceneKey);
229
+ };
230
+ //#endregion
231
+ //#region src/hooks/onCreate.ts
232
+ const onCreate = (...args) => {
233
+ pushListener("Create", ...args);
234
+ };
235
+ //#endregion
236
+ //#region src/util/hooks/getInitializeGameObjectLifecycleHook.ts
237
+ const getInitializeGameObjectLifecycleHook = (sceneKey) => ExternalSceneStore.sceneReadyMap.get(sceneKey) ? onNextTick : onCreate;
238
+ //#endregion
239
+ //#region src/composables/useInitializeGameObject.ts
240
+ const useInitializeGameObject = (create, configuration, emit, setterMap, immediate) => {
241
+ let gameObject;
242
+ const { initializeGameObjectSetters, setterWatchHandles } = useInitializeGameObjectSetters(() => gameObject, configuration, emit, setterMap, immediate);
243
+ const { eventStopHandles, initializeGameObjectEvents } = useInitializeGameObjectEvents();
244
+ const parentContainer = inject(InjectionKeyMap.ParentContainer, void 0);
245
+ const sceneKey = useInjectSceneKey();
246
+ const lifecycleHook = getInitializeGameObjectLifecycleHook(sceneKey);
247
+ const initializeGameObject = (scene) => {
248
+ gameObject = create(scene);
249
+ initializeGameObjectSetters(gameObject);
250
+ initializeGameObjectEvents(gameObject, emit, scene);
144
251
  };
145
- i ? (g(N(p)), m(() => {
146
- _();
147
- })) : m((e) => {
148
- g(e), _();
149
- }), u(() => {
150
- for (let e of c) e();
151
- for (let e of l) e();
152
- a.destroy();
252
+ const pushToParentContainer = () => {
253
+ if (!parentContainer?.value) return;
254
+ pushGameObject(parentContainer.value, toValue(configuration), gameObject);
255
+ };
256
+ if (immediate) {
257
+ initializeGameObject(getScene(sceneKey));
258
+ lifecycleHook(() => {
259
+ pushToParentContainer();
260
+ });
261
+ } else lifecycleHook((scene) => {
262
+ initializeGameObject(scene);
263
+ pushToParentContainer();
153
264
  });
154
- }, De = {
155
- displayHeight: (e) => (t) => {
156
- t !== void 0 && e.setDisplaySize(e.displayWidth, t);
157
- },
158
- displayWidth: (e) => (t) => {
159
- t !== void 0 && e.setDisplaySize(t, e.displayHeight);
265
+ onUnmounted(() => {
266
+ for (const setterWatchHandle of setterWatchHandles) setterWatchHandle();
267
+ for (const eventStopHandle of eventStopHandles) eventStopHandle();
268
+ gameObject.destroy();
269
+ });
270
+ };
271
+ //#endregion
272
+ //#region src/util/setterMap/components/DisplaySizeSetterMap.ts
273
+ const DisplaySizeSetterMap = {
274
+ displayHeight: (gameObject) => (value) => {
275
+ if (value === void 0) return;
276
+ gameObject.setDisplaySize(gameObject.displayWidth, value);
277
+ },
278
+ displayWidth: (gameObject) => (value) => {
279
+ if (value === void 0) return;
280
+ gameObject.setDisplaySize(value, gameObject.displayHeight);
160
281
  }
161
- }, F = {
162
- ...De,
163
- height: (e) => (t) => {
164
- t !== void 0 && e.setSize(e.width, t);
165
- },
166
- width: (e) => (t) => {
167
- t !== void 0 && e.setSize(t, e.height);
282
+ };
283
+ //#endregion
284
+ //#region src/util/setterMap/components/ComputedSizeSetterMap.ts
285
+ const ComputedSizeSetterMap = {
286
+ ...DisplaySizeSetterMap,
287
+ height: (gameObject) => (value) => {
288
+ if (value === void 0) return;
289
+ gameObject.setSize(gameObject.width, value);
290
+ },
291
+ width: (gameObject) => (value) => {
292
+ if (value === void 0) return;
293
+ gameObject.setSize(value, gameObject.height);
168
294
  }
169
- }, I = { depth: (e) => (t) => {
170
- if (t === void 0 || (e.setDepth(t), !e.parentContainer)) return;
171
- let n = ge(e.parentContainer.list, e.depth);
172
- n === -1 ? e.parentContainer.bringToTop(e) : e.parentContainer.moveTo(e, Math.max(n - 1, 0));
173
- } }, L = {
174
- displayOriginX: (e) => (t) => {
175
- e.setDisplayOrigin(t, e.displayOriginY);
295
+ };
296
+ //#endregion
297
+ //#region src/util/setterMap/components/DepthSetterMap.ts
298
+ const DepthSetterMap = { depth: (gameObject) => (value) => {
299
+ if (value === void 0) return;
300
+ gameObject.setDepth(value);
301
+ if (!gameObject.parentContainer) return;
302
+ const i = getDepthInsertIndex(gameObject.parentContainer.list, gameObject.depth);
303
+ if (i === -1) gameObject.parentContainer.bringToTop(gameObject);
304
+ else gameObject.parentContainer.moveTo(gameObject, Math.max(i - 1, 0));
305
+ } };
306
+ //#endregion
307
+ //#region src/util/setterMap/components/OriginSetterMap.ts
308
+ const OriginSetterMap = {
309
+ displayOriginX: (gameObject) => (value) => {
310
+ gameObject.setDisplayOrigin(value, gameObject.displayOriginY);
176
311
  },
177
- displayOriginY: (e) => (t) => {
178
- e.setDisplayOrigin(e.displayOriginX, t);
312
+ displayOriginY: (gameObject) => (value) => {
313
+ gameObject.setDisplayOrigin(gameObject.displayOriginX, value);
179
314
  },
180
- origin: (e) => (t) => {
181
- e.setOrigin(t, t);
315
+ origin: (gameObject) => (value) => {
316
+ gameObject.setOrigin(value, value);
182
317
  },
183
- originX: (e) => (t) => {
184
- e.setOrigin(t, e.originY);
318
+ originX: (gameObject) => (value) => {
319
+ gameObject.setOrigin(value, gameObject.originY);
185
320
  },
186
- originY: (e) => (t) => {
187
- e.setOrigin(e.originX, t);
321
+ originY: (gameObject) => (value) => {
322
+ gameObject.setOrigin(gameObject.originX, value);
188
323
  }
189
- }, R = {
190
- scrollFactor: (e) => (t) => {
191
- t !== void 0 && e.setScrollFactor(t, t);
192
- },
193
- scrollFactorX: (e) => (t) => {
194
- t !== void 0 && e.setScrollFactor(t, e.scrollFactorY);
195
- },
196
- scrollFactorY: (e) => (t) => {
197
- t !== void 0 && e.setScrollFactor(e.scrollFactorX, t);
324
+ };
325
+ //#endregion
326
+ //#region src/util/setterMap/components/ScrollFactorSetterMap.ts
327
+ const ScrollFactorSetterMap = {
328
+ scrollFactor: (gameObject) => (value) => {
329
+ if (value === void 0) return;
330
+ gameObject.setScrollFactor(value, value);
331
+ },
332
+ scrollFactorX: (gameObject) => (value) => {
333
+ if (value === void 0) return;
334
+ gameObject.setScrollFactor(value, gameObject.scrollFactorY);
335
+ },
336
+ scrollFactorY: (gameObject) => (value) => {
337
+ if (value === void 0) return;
338
+ gameObject.setScrollFactor(gameObject.scrollFactorX, value);
198
339
  }
199
- }, z = {
200
- angle: (e) => (t) => {
201
- e.setAngle(t);
340
+ };
341
+ //#endregion
342
+ //#region src/util/setterMap/components/TransformSetterMap.ts
343
+ const TransformSetterMap = {
344
+ angle: (gameObject) => (value) => {
345
+ gameObject.setAngle(value);
202
346
  },
203
- rotation: (e) => (t) => {
204
- e.setRotation(t);
347
+ rotation: (gameObject) => (value) => {
348
+ gameObject.setRotation(value);
205
349
  },
206
- scale: (e) => (t) => {
207
- e.setScale(t, t);
350
+ scale: (gameObject) => (value) => {
351
+ gameObject.setScale(value, value);
208
352
  },
209
- scaleX: (e) => (t) => {
210
- e.setScale(t, e.scaleY);
353
+ scaleX: (gameObject) => (value) => {
354
+ gameObject.setScale(value, gameObject.scaleY);
211
355
  },
212
- scaleY: (e) => (t) => {
213
- e.setScale(e.scaleX, t);
356
+ scaleY: (gameObject) => (value) => {
357
+ gameObject.setScale(gameObject.scaleX, value);
214
358
  },
215
- w: (e) => (t) => {
216
- e.setW(t);
359
+ w: (gameObject) => (value) => {
360
+ gameObject.setW(value);
217
361
  },
218
- x: (e) => (t) => {
219
- e.setX(t);
362
+ x: (gameObject) => (value) => {
363
+ gameObject.setX(value);
220
364
  },
221
- y: (e) => (t) => {
222
- e.setY(t);
365
+ y: (gameObject) => (value) => {
366
+ gameObject.setY(value);
223
367
  },
224
- z: (e) => (t) => {
225
- e.setZ(t);
368
+ z: (gameObject) => (value) => {
369
+ gameObject.setZ(value);
226
370
  }
227
- }, B = { visible: (e) => (t) => {
228
- t !== void 0 && e.setVisible(t);
229
- } }, Oe = { active: (e) => (t) => {
230
- t !== void 0 && e.setActive(t);
231
- } }, ke = {
232
- tween: (e, t) => (n) => {
233
- n && e.scene.add.tween({
234
- ...n,
235
- targets: e
236
- }).on(de.Events.TWEEN_COMPLETE, () => {
237
- t("update:tween", void 0);
371
+ };
372
+ //#endregion
373
+ //#region src/util/setterMap/components/VisibleSetterMap.ts
374
+ const VisibleSetterMap = { visible: (gameObject) => (value) => {
375
+ if (value === void 0) return;
376
+ gameObject.setVisible(value);
377
+ } };
378
+ //#endregion
379
+ //#region src/util/setterMap/global/GameObjectSetterMap.ts
380
+ const GameObjectSetterMap = { active: (gameObject) => (value) => {
381
+ if (value === void 0) return;
382
+ gameObject.setActive(value);
383
+ } };
384
+ //#endregion
385
+ //#region src/util/setterMap/global/TweenSetterMap.ts
386
+ const TweenSetterMap = {
387
+ tween: (gameObject, emit) => (value) => {
388
+ if (!value) return;
389
+ gameObject.scene.add.tween({
390
+ ...value,
391
+ targets: gameObject
392
+ }).on(Tweens.Events.TWEEN_COMPLETE, () => {
393
+ emit("update:tween", void 0);
238
394
  });
239
395
  },
240
- tweenchain: (e, t) => (n) => {
241
- n && e.scene.add.tweenchain(n.map((t) => ({
242
- ...t,
243
- targets: e
244
- }))).on(de.Events.TWEEN_COMPLETE, () => {
245
- t("update:tweenchain", void 0);
396
+ tweenchain: (gameObject, emit) => (value) => {
397
+ if (!value) return;
398
+ gameObject.scene.add.tweenchain(value.map((c) => ({
399
+ ...c,
400
+ targets: gameObject
401
+ }))).on(Tweens.Events.TWEEN_COMPLETE, () => {
402
+ emit("update:tweenchain", void 0);
246
403
  });
247
404
  }
248
- }, V = {
249
- ...ke,
250
- ...Oe
251
- }, Ae = {
252
- ...F,
253
- ...I,
254
- ...L,
255
- ...z,
256
- ...R,
257
- ...B,
258
- ...V
259
- }, je = /* @__PURE__ */ a({
405
+ };
406
+ //#endregion
407
+ //#region src/util/setterMap/global/GlobalSetterMap.ts
408
+ const GlobalSetterMap = {
409
+ ...TweenSetterMap,
410
+ ...GameObjectSetterMap
411
+ };
412
+ //#endregion
413
+ //#region src/util/setterMap/ZoneSetterMap.ts
414
+ const ZoneSetterMap = {
415
+ ...ComputedSizeSetterMap,
416
+ ...DepthSetterMap,
417
+ ...OriginSetterMap,
418
+ ...TransformSetterMap,
419
+ ...ScrollFactorSetterMap,
420
+ ...VisibleSetterMap,
421
+ ...GlobalSetterMap
422
+ };
423
+ //#endregion
424
+ //#region src/components/Zone.vue
425
+ const _sfc_main$26 = /*@__PURE__*/ defineComponent({
260
426
  __name: "Zone",
261
427
  props: { configuration: {} },
262
- setup(e, { emit: t }) {
263
- return P((t) => {
264
- let { height: n, width: r, x: i, y: a } = e.configuration;
265
- return t.add.zone(i, a, r, n);
266
- }, () => e.configuration, t, Ae), (e, t) => null;
428
+ setup(__props, { emit: __emit }) {
429
+ useInitializeGameObject((scene) => {
430
+ const { height, width, x, y } = __props.configuration;
431
+ return scene.add.zone(x, y, width, height);
432
+ }, () => __props.configuration, __emit, ZoneSetterMap);
433
+ return (_ctx, _cache) => {
434
+ return null;
435
+ };
267
436
  }
268
- }), H = {
269
- alpha: (e) => (t) => {
270
- e.setAlpha(t, t, t, t);
437
+ });
438
+ //#endregion
439
+ //#region src/util/setterMap/components/AlphaSetterMap.ts
440
+ const AlphaSetterMap = {
441
+ alpha: (gameObject) => (value) => {
442
+ gameObject.setAlpha(value, value, value, value);
271
443
  },
272
- alphaBottomLeft: (e) => (t) => {
273
- e.setAlpha(e.alphaTopLeft, e.alphaTopRight, t, e.alphaBottomRight);
444
+ alphaBottomLeft: (gameObject) => (value) => {
445
+ gameObject.setAlpha(gameObject.alphaTopLeft, gameObject.alphaTopRight, value, gameObject.alphaBottomRight);
274
446
  },
275
- alphaBottomRight: (e) => (t) => {
276
- e.setAlpha(e.alphaTopLeft, e.alphaTopRight, e.alphaBottomLeft, t);
447
+ alphaBottomRight: (gameObject) => (value) => {
448
+ gameObject.setAlpha(gameObject.alphaTopLeft, gameObject.alphaTopRight, gameObject.alphaBottomLeft, value);
277
449
  },
278
- alphaTopLeft: (e) => (t) => {
279
- e.setAlpha(t, e.alphaTopRight, e.alphaBottomLeft, e.alphaBottomRight);
450
+ alphaTopLeft: (gameObject) => (value) => {
451
+ gameObject.setAlpha(value, gameObject.alphaTopRight, gameObject.alphaBottomLeft, gameObject.alphaBottomRight);
280
452
  },
281
- alphaTopRight: (e) => (t) => {
282
- e.setAlpha(e.alphaTopLeft, t, e.alphaBottomLeft, e.alphaBottomRight);
453
+ alphaTopRight: (gameObject) => (value) => {
454
+ gameObject.setAlpha(gameObject.alphaTopLeft, value, gameObject.alphaBottomLeft, gameObject.alphaBottomRight);
283
455
  }
284
- }, U = { blendMode: (e) => (t) => {
285
- t !== void 0 && e.setBlendMode(t);
286
- } }, W = {
287
- flipX: (e) => (t) => {
288
- t !== void 0 && e.setFlipX(t);
289
- },
290
- flipY: (e) => (t) => {
291
- t !== void 0 && e.setFlipY(t);
456
+ };
457
+ //#endregion
458
+ //#region src/util/setterMap/components/BlendModeSetterMap.ts
459
+ const BlendModeSetterMap = { blendMode: (gameObject) => (value) => {
460
+ if (value === void 0) return;
461
+ gameObject.setBlendMode(value);
462
+ } };
463
+ //#endregion
464
+ //#region src/util/setterMap/components/FlipSetterMap.ts
465
+ const FlipSetterMap = {
466
+ flipX: (gameObject) => (value) => {
467
+ if (value === void 0) return;
468
+ gameObject.setFlipX(value);
469
+ },
470
+ flipY: (gameObject) => (value) => {
471
+ if (value === void 0) return;
472
+ gameObject.setFlipY(value);
292
473
  }
293
- }, G = { mask: (e) => (t) => {
294
- t && e.setMask(t);
295
- } }, K = {}, Me = {
296
- frame: (e) => (t) => {
297
- t !== void 0 && e.setFrame(t);
298
- },
299
- texture: (e) => (t) => {
300
- t && e.setTexture(t);
474
+ };
475
+ //#endregion
476
+ //#region src/util/setterMap/components/MaskSetterMap.ts
477
+ const MaskSetterMap = { mask: (gameObject) => (value) => {
478
+ if (!value) return;
479
+ gameObject.setMask(value);
480
+ } };
481
+ //#endregion
482
+ //#region src/util/setterMap/components/RenderNodesSetterMap.ts
483
+ const RenderNodesSetterMap = {};
484
+ //#endregion
485
+ //#region src/util/setterMap/components/BaseTextureSetterMap.ts
486
+ const BaseTextureSetterMap = {
487
+ frame: (gameObject) => (value) => {
488
+ if (value === void 0) return;
489
+ gameObject.setFrame(value);
490
+ },
491
+ texture: (gameObject) => (value) => {
492
+ if (!value) return;
493
+ gameObject.setTexture(value);
301
494
  }
302
- }, Ne = { ...Me }, q = {
303
- tint: (e) => (t) => {
304
- e.setTint(t, t, t, t);
495
+ };
496
+ //#endregion
497
+ //#region src/util/setterMap/components/TextureCropSetterMap.ts
498
+ const TextureCropSetterMap = { ...BaseTextureSetterMap };
499
+ //#endregion
500
+ //#region src/util/setterMap/components/TintSetterMap.ts
501
+ const TintSetterMap = {
502
+ tint: (gameObject) => (value) => {
503
+ gameObject.setTint(value, value, value, value);
305
504
  },
306
- tintBottomLeft: (e) => (t) => {
307
- e.setTint(e.tintTopLeft, e.tintTopRight, t, e.tintBottomRight);
505
+ tintBottomLeft: (gameObject) => (value) => {
506
+ gameObject.setTint(gameObject.tintTopLeft, gameObject.tintTopRight, value, gameObject.tintBottomRight);
308
507
  },
309
- tintBottomRight: (e) => (t) => {
310
- e.setTint(e.tintTopLeft, e.tintTopRight, e.tintBottomLeft, t);
508
+ tintBottomRight: (gameObject) => (value) => {
509
+ gameObject.setTint(gameObject.tintTopLeft, gameObject.tintTopRight, gameObject.tintBottomLeft, value);
311
510
  },
312
- tintTopLeft: (e) => (t) => {
313
- e.setTint(t, e.tintTopRight, e.tintBottomLeft, e.tintBottomRight);
511
+ tintTopLeft: (gameObject) => (value) => {
512
+ gameObject.setTint(value, gameObject.tintTopRight, gameObject.tintBottomLeft, gameObject.tintBottomRight);
314
513
  },
315
- tintTopRight: (e) => (t) => {
316
- e.setTint(e.tintTopLeft, t, e.tintBottomLeft, e.tintBottomRight);
514
+ tintTopRight: (gameObject) => (value) => {
515
+ gameObject.setTint(gameObject.tintTopLeft, value, gameObject.tintBottomLeft, gameObject.tintBottomRight);
317
516
  }
318
- }, Pe = {
319
- ...H,
320
- ...U,
321
- ...I,
322
- ...W,
323
- ...G,
324
- ...L,
325
- ...K,
326
- ...R,
327
- ...Ne,
328
- ...q,
329
- ...z,
330
- ...B,
331
- ...V,
332
- key: (e) => (t) => {
333
- t && e.changeSource(t);
334
- },
335
- muted: (e) => (t) => {
336
- e.setMute(t);
337
- },
338
- volume: (e) => (t) => {
339
- e.setVolume(t);
517
+ };
518
+ //#endregion
519
+ //#region src/util/setterMap/VideoSetterMap.ts
520
+ const VideoSetterMap = {
521
+ ...AlphaSetterMap,
522
+ ...BlendModeSetterMap,
523
+ ...DepthSetterMap,
524
+ ...FlipSetterMap,
525
+ ...MaskSetterMap,
526
+ ...OriginSetterMap,
527
+ ...RenderNodesSetterMap,
528
+ ...ScrollFactorSetterMap,
529
+ ...TextureCropSetterMap,
530
+ ...TintSetterMap,
531
+ ...TransformSetterMap,
532
+ ...VisibleSetterMap,
533
+ ...GlobalSetterMap,
534
+ key: (gameObject) => (value) => {
535
+ if (!value) return;
536
+ gameObject.changeSource(value);
537
+ },
538
+ muted: (gameObject) => (value) => {
539
+ gameObject.setMute(value);
540
+ },
541
+ volume: (gameObject) => (value) => {
542
+ gameObject.setVolume(value);
340
543
  }
341
- }, Fe = /* @__PURE__ */ a({
544
+ };
545
+ //#endregion
546
+ //#region src/components/Video.vue
547
+ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
342
548
  __name: "Video",
343
549
  props: {
344
550
  configuration: {},
345
551
  immediate: { type: Boolean },
346
552
  onComplete: { type: Function }
347
553
  },
348
- setup(e, { emit: t }) {
349
- return P((t) => {
350
- let { key: n, x: r, y: i } = e.configuration, a = t.add.video(r ?? 0, i ?? 0, n);
351
- return e.onComplete?.(t, a), a;
352
- }, () => e.configuration, t, Pe, e.immediate), (e, t) => null;
554
+ setup(__props, { emit: __emit }) {
555
+ useInitializeGameObject((scene) => {
556
+ const { key, x, y } = __props.configuration;
557
+ const video = scene.add.video(x ?? 0, y ?? 0, key);
558
+ __props.onComplete?.(scene, video);
559
+ return video;
560
+ }, () => __props.configuration, __emit, VideoSetterMap, __props.immediate);
561
+ return (_ctx, _cache) => {
562
+ return null;
563
+ };
353
564
  }
354
- }), J = { alpha: (e) => (t) => {
355
- e.setAlpha(t);
356
- } }, Y = {
357
- ...J,
358
- ...U,
359
- ...I,
360
- ...De,
361
- ...Oe,
362
- ...G,
363
- ...L,
364
- ...K,
365
- ...R,
366
- ...z,
367
- ...B,
368
- fillAlpha: (e) => (t) => {
369
- e.setFillStyle(e.fillColor, t);
370
- },
371
- fillColor: (e) => (t) => {
372
- e.setFillStyle(t, e.fillAlpha);
373
- },
374
- strokeStyle: (e) => (t) => {
375
- t && e.setStrokeStyle(...t);
565
+ });
566
+ //#endregion
567
+ //#region src/util/setterMap/components/AlphaSingleSetterMap.ts
568
+ const AlphaSingleSetterMap = { alpha: (gameObject) => (value) => {
569
+ gameObject.setAlpha(value);
570
+ } };
571
+ //#endregion
572
+ //#region src/util/setterMap/shared/ShapeSetterMap.ts
573
+ const ShapeSetterMap = {
574
+ ...AlphaSingleSetterMap,
575
+ ...BlendModeSetterMap,
576
+ ...DepthSetterMap,
577
+ ...DisplaySizeSetterMap,
578
+ ...GameObjectSetterMap,
579
+ ...MaskSetterMap,
580
+ ...OriginSetterMap,
581
+ ...RenderNodesSetterMap,
582
+ ...ScrollFactorSetterMap,
583
+ ...TransformSetterMap,
584
+ ...VisibleSetterMap,
585
+ fillAlpha: (gameObject) => (value) => {
586
+ gameObject.setFillStyle(gameObject.fillColor, value);
587
+ },
588
+ fillColor: (gameObject) => (value) => {
589
+ gameObject.setFillStyle(value, gameObject.fillAlpha);
590
+ },
591
+ strokeStyle: (gameObject) => (value) => {
592
+ if (!value) return;
593
+ gameObject.setStrokeStyle(...value);
376
594
  }
377
- }, Ie = {
378
- to: (e) => (t) => {
379
- t && e.setTo(...t);
380
- },
381
- ...Y,
382
- ...V
383
- }, Le = /* @__PURE__ */ a({
595
+ };
596
+ //#endregion
597
+ //#region src/util/setterMap/TriangleSetterMap.ts
598
+ const TriangleSetterMap = {
599
+ to: (gameObject) => (value) => {
600
+ if (!value) return;
601
+ gameObject.setTo(...value);
602
+ },
603
+ ...ShapeSetterMap,
604
+ ...GlobalSetterMap
605
+ };
606
+ //#endregion
607
+ //#region src/components/Triangle.vue
608
+ const _sfc_main$24 = /*@__PURE__*/ defineComponent({
384
609
  __name: "Triangle",
385
610
  props: {
386
611
  configuration: {},
387
612
  immediate: { type: Boolean },
388
613
  onComplete: { type: Function }
389
614
  },
390
- setup(e, { emit: t }) {
391
- return P((t) => {
392
- let { alpha: n, fillColor: r, to: i, x: a, y: o } = e.configuration, s = t.add.triangle(a, o, i?.[0], i?.[1], i?.[2], i?.[3], i?.[4], i?.[5], r, n);
393
- return e.onComplete?.(t, s), s;
394
- }, () => e.configuration, t, Ie, e.immediate), (e, t) => null;
615
+ setup(__props, { emit: __emit }) {
616
+ useInitializeGameObject((scene) => {
617
+ const { alpha, fillColor, to, x, y } = __props.configuration;
618
+ const triangle = scene.add.triangle(x, y, to?.[0], to?.[1], to?.[2], to?.[3], to?.[4], to?.[5], fillColor, alpha);
619
+ __props.onComplete?.(scene, triangle);
620
+ return triangle;
621
+ }, () => __props.configuration, __emit, TriangleSetterMap, __props.immediate);
622
+ return (_ctx, _cache) => {
623
+ return null;
624
+ };
395
625
  }
396
- }), X = { ...Me }, Re = {
397
- ...H,
398
- ...U,
399
- ...F,
400
- ...I,
401
- ...W,
402
- ...G,
403
- ...L,
404
- ...K,
405
- ...R,
406
- ...X,
407
- ...q,
408
- ...z,
409
- ...B,
410
- ...V
411
- }, ze = /* @__PURE__ */ a({
626
+ });
627
+ //#endregion
628
+ //#region src/util/setterMap/components/TextureSetterMap.ts
629
+ const TextureSetterMap = { ...BaseTextureSetterMap };
630
+ //#endregion
631
+ //#region src/util/setterMap/TileSpriteSetterMap.ts
632
+ const TileSpriteSetterMap = {
633
+ ...AlphaSetterMap,
634
+ ...BlendModeSetterMap,
635
+ ...ComputedSizeSetterMap,
636
+ ...DepthSetterMap,
637
+ ...FlipSetterMap,
638
+ ...MaskSetterMap,
639
+ ...OriginSetterMap,
640
+ ...RenderNodesSetterMap,
641
+ ...ScrollFactorSetterMap,
642
+ ...TextureSetterMap,
643
+ ...TintSetterMap,
644
+ ...TransformSetterMap,
645
+ ...VisibleSetterMap,
646
+ ...GlobalSetterMap
647
+ };
648
+ //#endregion
649
+ //#region src/components/TileSprite.vue
650
+ const _sfc_main$22 = /*@__PURE__*/ defineComponent({
412
651
  __name: "TileSprite",
413
652
  props: {
414
653
  configuration: {},
415
654
  immediate: { type: Boolean },
416
655
  onComplete: { type: Function }
417
656
  },
418
- setup(e, { emit: t }) {
419
- return P((t) => {
420
- let { frame: n, height: r, texture: i, width: a, x: o, y: s } = e.configuration, c = t.add.tileSprite(o ?? 0, s ?? 0, a ?? 0, r ?? 0, i, n);
421
- return e.onComplete?.(t, c), c;
422
- }, () => e.configuration, t, Re, e.immediate), (e, t) => null;
657
+ setup(__props, { emit: __emit }) {
658
+ useInitializeGameObject((scene) => {
659
+ const { frame, height, texture, width, x, y } = __props.configuration;
660
+ const tileSprite = scene.add.tileSprite(x ?? 0, y ?? 0, width ?? 0, height ?? 0, texture, frame);
661
+ __props.onComplete?.(scene, tileSprite);
662
+ return tileSprite;
663
+ }, () => __props.configuration, __emit, TileSpriteSetterMap, __props.immediate);
664
+ return (_ctx, _cache) => {
665
+ return null;
666
+ };
423
667
  }
424
- }), Be = /* @__PURE__ */ a({
668
+ });
669
+ //#endregion
670
+ //#region src/components/Tilemap.vue
671
+ const _sfc_main$23 = /*@__PURE__*/ defineComponent({
425
672
  __name: "Tilemap",
426
673
  props: {
427
674
  configuration: {},
428
675
  onComplete: { type: Function }
429
676
  },
430
- setup(e) {
431
- let t = E(), n = p();
432
- return Te((t) => {
433
- n.value = t.make.tilemap(e.configuration), e.onComplete?.(t, n.value);
434
- }), ee(() => e.configuration.key, (r) => {
435
- let i = N(t), a = n.value;
436
- r ? (n.value = i.make.tilemap(e.configuration), e.onComplete?.(i, n.value)) : n.value = void 0, a && a.destroy();
437
- }), u(() => {
438
- n.value && n.value.destroy();
439
- }), (e, t) => m(e.$slots, "default");
677
+ setup(__props) {
678
+ const sceneKey = useInjectSceneKey();
679
+ const tilemap = ref();
680
+ onCreate((newScene) => {
681
+ tilemap.value = newScene.make.tilemap(__props.configuration);
682
+ __props.onComplete?.(newScene, tilemap.value);
683
+ });
684
+ watch(() => __props.configuration.key, (newKey) => {
685
+ const scene = getScene(sceneKey);
686
+ const oldTilemap = tilemap.value;
687
+ if (newKey) {
688
+ tilemap.value = scene.make.tilemap(__props.configuration);
689
+ __props.onComplete?.(scene, tilemap.value);
690
+ } else tilemap.value = void 0;
691
+ if (oldTilemap) oldTilemap.destroy();
692
+ });
693
+ onUnmounted(() => {
694
+ if (!tilemap.value) return;
695
+ tilemap.value.destroy();
696
+ });
697
+ return (_ctx, _cache) => {
698
+ return renderSlot(_ctx.$slots, "default");
699
+ };
440
700
  }
441
- }), Ve = pe("phaser/text", () => ({ defaultTextStyle: p() })), He = {
442
- padding: (e) => (t) => {
443
- t && e.setPadding(t);
444
- },
445
- style: (e) => (t) => {
446
- t && e.setStyle(t);
447
- },
448
- text: (e, t) => (n) => {
449
- n !== void 0 && (e.setText(n), t("update:width", e.width), t("update:displayWidth", e.displayWidth));
450
- },
451
- ...H,
452
- ...U,
453
- ...F,
454
- ...I,
455
- ...W,
456
- ...G,
457
- ...L,
458
- ...K,
459
- ...R,
460
- ...q,
461
- ...z,
462
- ...B,
463
- ...V
464
- }, Ue = /* @__PURE__ */ a({
701
+ });
702
+ //#endregion
703
+ //#region src/store/text.ts
704
+ const useTextStore = defineStore("phaser/text", () => {
705
+ return { defaultTextStyle: ref() };
706
+ });
707
+ //#endregion
708
+ //#region src/util/setterMap/TextSetterMap.ts
709
+ const TextSetterMap = {
710
+ padding: (gameObject) => (value) => {
711
+ if (!value) return;
712
+ gameObject.setPadding(value);
713
+ },
714
+ style: (gameObject) => (value) => {
715
+ if (!value) return;
716
+ gameObject.setStyle(value);
717
+ },
718
+ text: (gameObject, emit) => (value) => {
719
+ if (value === void 0) return;
720
+ gameObject.setText(value);
721
+ emit("update:width", gameObject.width);
722
+ emit("update:displayWidth", gameObject.displayWidth);
723
+ },
724
+ ...AlphaSetterMap,
725
+ ...BlendModeSetterMap,
726
+ ...ComputedSizeSetterMap,
727
+ ...DepthSetterMap,
728
+ ...FlipSetterMap,
729
+ ...MaskSetterMap,
730
+ ...OriginSetterMap,
731
+ ...RenderNodesSetterMap,
732
+ ...ScrollFactorSetterMap,
733
+ ...TintSetterMap,
734
+ ...TransformSetterMap,
735
+ ...VisibleSetterMap,
736
+ ...GlobalSetterMap
737
+ };
738
+ //#endregion
739
+ //#region src/components/Text.vue
740
+ const _sfc_main$21 = /*@__PURE__*/ defineComponent({
465
741
  __name: "Text",
466
742
  props: {
467
743
  configuration: {},
468
744
  immediate: { type: Boolean }
469
745
  },
470
- setup(e, { emit: t }) {
471
- let n = t, r = Ve(), { defaultTextStyle: i } = w(r);
472
- return P((t) => {
473
- let { style: n, text: r, x: a, y: o } = e.configuration;
474
- return t.add.text(a ?? 0, o ?? 0, r, {
475
- ...i.value,
476
- ...n
746
+ setup(__props, { emit: __emit }) {
747
+ const emit = __emit;
748
+ const textStore = useTextStore();
749
+ const { defaultTextStyle } = storeToRefs(textStore);
750
+ useInitializeGameObject((scene) => {
751
+ const { style, text, x, y } = __props.configuration;
752
+ return scene.add.text(x ?? 0, y ?? 0, text, {
753
+ ...defaultTextStyle.value,
754
+ ...style
477
755
  });
478
- }, () => e.configuration, n, He, e.immediate), (e, t) => null;
756
+ }, () => __props.configuration, emit, TextSetterMap, __props.immediate);
757
+ return (_ctx, _cache) => {
758
+ return null;
759
+ };
479
760
  }
480
- }), We = {
481
- innerRadius: (e) => (t) => {
482
- t !== void 0 && e.setInnerRadius(t);
483
- },
484
- outerRadius: (e) => (t) => {
485
- t !== void 0 && e.setOuterRadius(t);
486
- },
487
- points: (e) => (t) => {
488
- t !== void 0 && e.setPoints(t);
489
- },
490
- ...Y,
491
- ...V
492
- }, Ge = /* @__PURE__ */ a({
761
+ });
762
+ //#endregion
763
+ //#region src/util/setterMap/StarSetterMap.ts
764
+ const StarSetterMap = {
765
+ innerRadius: (gameObject) => (value) => {
766
+ if (value === void 0) return;
767
+ gameObject.setInnerRadius(value);
768
+ },
769
+ outerRadius: (gameObject) => (value) => {
770
+ if (value === void 0) return;
771
+ gameObject.setOuterRadius(value);
772
+ },
773
+ points: (gameObject) => (value) => {
774
+ if (value === void 0) return;
775
+ gameObject.setPoints(value);
776
+ },
777
+ ...ShapeSetterMap,
778
+ ...GlobalSetterMap
779
+ };
780
+ //#endregion
781
+ //#region src/components/Star.vue
782
+ const _sfc_main$20 = /*@__PURE__*/ defineComponent({
493
783
  __name: "Star",
494
784
  props: {
495
785
  configuration: {},
496
786
  immediate: { type: Boolean },
497
787
  onComplete: { type: Function }
498
788
  },
499
- setup(e, { emit: t }) {
500
- return P((t) => {
501
- let { alpha: n, fillColor: r, innerRadius: i, outerRadius: a, points: o, x: s, y: c } = e.configuration, l = t.add.star(s, c, o, i, a, r, n);
502
- return e.onComplete?.(t, l), l;
503
- }, () => e.configuration, t, We, e.immediate), (e, t) => null;
789
+ setup(__props, { emit: __emit }) {
790
+ useInitializeGameObject((scene) => {
791
+ const { alpha, fillColor, innerRadius, outerRadius, points, x, y } = __props.configuration;
792
+ const star = scene.add.star(x, y, points, innerRadius, outerRadius, fillColor, alpha);
793
+ __props.onComplete?.(scene, star);
794
+ return star;
795
+ }, () => __props.configuration, __emit, StarSetterMap, __props.immediate);
796
+ return (_ctx, _cache) => {
797
+ return null;
798
+ };
504
799
  }
505
- }), Z = { ...F }, Ke = {
506
- animations: (e, t) => (n) => {
507
- if (n && n.length > 0) for (let r of n) {
508
- if (!r.key) continue;
509
- let n = `${oe.Events.ANIMATION_COMPLETE_KEY}${r.key}`;
510
- if (e.once(n, () => {
511
- t(n);
512
- }), !e.scene.anims.exists(r.key) && !e.scene.anims.create(r)) throw new y(x.Create, "Animation", r.key);
800
+ });
801
+ //#endregion
802
+ //#region src/util/setterMap/components/SizeSetterMap.ts
803
+ const SizeSetterMap = { ...ComputedSizeSetterMap };
804
+ //#endregion
805
+ //#region src/util/setterMap/shared/AnimationSetterMap.ts
806
+ const AnimationSetterMap = {
807
+ animations: (gameObject, emit) => (configurations) => {
808
+ if (!(configurations && configurations.length > 0)) return;
809
+ for (const configuration of configurations) {
810
+ if (!configuration.key) continue;
811
+ const event = `${Animations.Events.ANIMATION_COMPLETE_KEY}${configuration.key}`;
812
+ gameObject.once(event, () => {
813
+ emit(event);
814
+ });
815
+ if (gameObject.scene.anims.exists(configuration.key)) continue;
816
+ else if (!gameObject.scene.anims.create(configuration)) throw new InvalidOperationError(Operation.Create, "Animation", configuration.key);
513
817
  }
514
818
  },
515
- playAnimationKey: (e) => (t) => {
516
- if (t === void 0) {
517
- e.stop();
819
+ playAnimationKey: (gameObject) => (value) => {
820
+ if (value === void 0) {
821
+ gameObject.stop();
518
822
  return;
519
823
  }
520
- e.play(t);
824
+ gameObject.play(value);
521
825
  }
522
- }, qe = {
523
- ...H,
524
- ...U,
525
- ...I,
526
- ...W,
527
- ...G,
528
- ...L,
529
- ...K,
530
- ...R,
531
- ...Z,
532
- ...X,
533
- ...q,
534
- ...z,
535
- ...B,
536
- ...Ke,
537
- ...V
538
- }, Je = /* @__PURE__ */ a({
826
+ };
827
+ //#endregion
828
+ //#region src/util/setterMap/SpriteSetterMap.ts
829
+ const SpriteSetterMap = {
830
+ ...AlphaSetterMap,
831
+ ...BlendModeSetterMap,
832
+ ...DepthSetterMap,
833
+ ...FlipSetterMap,
834
+ ...MaskSetterMap,
835
+ ...OriginSetterMap,
836
+ ...RenderNodesSetterMap,
837
+ ...ScrollFactorSetterMap,
838
+ ...SizeSetterMap,
839
+ ...TextureSetterMap,
840
+ ...TintSetterMap,
841
+ ...TransformSetterMap,
842
+ ...VisibleSetterMap,
843
+ ...AnimationSetterMap,
844
+ ...GlobalSetterMap
845
+ };
846
+ //#endregion
847
+ //#region src/components/Sprite.vue
848
+ const _sfc_main$19 = /*@__PURE__*/ defineComponent({
539
849
  __name: "Sprite",
540
850
  props: {
541
851
  configuration: {},
542
852
  immediate: { type: Boolean },
543
853
  onComplete: { type: Function }
544
854
  },
545
- setup(e, { emit: t }) {
546
- return P((t) => {
547
- let { frame: n, texture: r, x: i, y: a } = e.configuration, o = t.add.sprite(i ?? 0, a ?? 0, r, n);
548
- return e.onComplete?.(t, o), o;
549
- }, () => e.configuration, t, qe, e.immediate), (e, t) => null;
855
+ setup(__props, { emit: __emit }) {
856
+ useInitializeGameObject((scene) => {
857
+ const { frame, texture, x, y } = __props.configuration;
858
+ const sprite = scene.add.sprite(x ?? 0, y ?? 0, texture, frame);
859
+ __props.onComplete?.(scene, sprite);
860
+ return sprite;
861
+ }, () => __props.configuration, __emit, SpriteSetterMap, __props.immediate);
862
+ return (_ctx, _cache) => {
863
+ return null;
864
+ };
550
865
  }
551
- }), Ye = pe("phaser/camera", () => {
552
- let e = p(!1);
866
+ });
867
+ //#endregion
868
+ //#region src/store/camera.ts
869
+ const useCameraStore = defineStore("phaser/camera", () => {
870
+ const isFading = ref(false);
871
+ const fadeIn = (scene, ...args) => {
872
+ isFading.value = true;
873
+ scene.cameras.main.fadeIn(...args);
874
+ };
875
+ const fadeOut = (scene, ...args) => {
876
+ isFading.value = true;
877
+ scene.cameras.main.fadeOut(...args);
878
+ };
553
879
  return {
554
- fadeIn: (t, ...n) => {
555
- e.value = !0, t.cameras.main.fadeIn(...n);
556
- },
557
- fadeOut: (t, ...n) => {
558
- e.value = !0, t.cameras.main.fadeOut(...n);
559
- },
560
- isFading: e
880
+ fadeIn,
881
+ fadeOut,
882
+ isFading
561
883
  };
562
- }), Xe = pe("phaser/input", () => ({ isInputActive: p(!1) })), Ze = (e, t) => {
563
- let n = O.lifecycleListenersMap.get(t);
564
- n?.has(e.scene.key) && n.set(e.scene.key, []);
565
- }, Q = (e, t, n = !0) => {
566
- let r = O.lifecycleListenersMap.get(t);
567
- if (!r) return;
568
- let i = r.get(e.scene.key);
569
- if (i) {
570
- for (let t of i) t(e);
571
- n && Ze(e, t);
572
- }
573
- }, Qe = (e, t = {}) => class extends ce {
884
+ });
885
+ //#endregion
886
+ //#region src/store/input.ts
887
+ const useInputStore = defineStore("phaser/input", () => {
888
+ return { isInputActive: ref(false) };
889
+ });
890
+ //#endregion
891
+ //#region src/util/hooks/resetLifecycleListeners.ts
892
+ const resetLifecycleListeners = (scene, lifecycle) => {
893
+ const listenersMap = ExternalSceneStore.lifecycleListenersMap.get(lifecycle);
894
+ if (!listenersMap?.has(scene.scene.key)) return;
895
+ listenersMap.set(scene.scene.key, []);
896
+ };
897
+ //#endregion
898
+ //#region src/util/hooks/runLifecycleListeners.ts
899
+ const runLifecycleListeners = (scene, lifecycle, isReset = true) => {
900
+ const listenersMap = ExternalSceneStore.lifecycleListenersMap.get(lifecycle);
901
+ if (!listenersMap) return;
902
+ const listeners = listenersMap.get(scene.scene.key);
903
+ if (!listeners) return;
904
+ for (const listener of listeners) listener(scene);
905
+ if (isReset) resetLifecycleListeners(scene, lifecycle);
906
+ };
907
+ //#endregion
908
+ //#region src/util/createSceneClass.ts
909
+ const createSceneClass = (key, hooks = {}) => class extends Scene {
574
910
  constructor() {
575
- super({ key: e });
911
+ super({ key });
576
912
  }
577
913
  create() {
578
- t.onCreate?.(this), Q(this, D.Create);
914
+ hooks.onCreate?.(this);
915
+ runLifecycleListeners(this, "Create");
579
916
  }
580
917
  init() {
581
- t.onInit?.(this), Q(this, D.Init);
918
+ hooks.onInit?.(this);
919
+ runLifecycleListeners(this, "Init");
582
920
  }
583
921
  preload() {
584
- t.onPreload?.(this), Q(this, D.Preload);
922
+ hooks.onPreload?.(this);
923
+ runLifecycleListeners(this, "Preload");
585
924
  }
586
- update(e, n) {
587
- t.onUpdate?.(this, e, n), Q(this, D.Update, !1), Q(this, D.NextTick);
925
+ update(time, delta) {
926
+ hooks.onUpdate?.(this, time, delta);
927
+ runLifecycleListeners(this, "Update", false);
928
+ runLifecycleListeners(this, "NextTick");
588
929
  }
589
- }, $e = /* @__PURE__ */ a({
930
+ };
931
+ //#endregion
932
+ //#region src/components/Scene.vue
933
+ const _sfc_main$18 = /*@__PURE__*/ defineComponent({
590
934
  __name: "Scene",
591
935
  props: {
592
936
  autoStart: { type: Boolean },
@@ -599,581 +943,939 @@ var ge = (e, t) => typeof t == "number" ? e.findIndex((e) => "depth" in e && typ
599
943
  "shutdown",
600
944
  "update"
601
945
  ],
602
- setup(e, { emit: r }) {
603
- let i = r, a = j(), { isSameScene: o, switchToScene: s } = a, c = Ye(), { isFading: d } = w(c), p = Xe(), { isInputActive: h } = w(p), { parallelSceneKeys: _ } = w(a), ee = t(() => o(e.sceneKey) || _.value.includes(e.sceneKey)), v = () => {
604
- h.value = !1;
605
- }, y = () => {
606
- d.value = !1, h.value = !0;
607
- }, te = () => {
608
- d.value = !1;
609
- }, b = Qe(e.sceneKey, {
610
- onCreate: (e) => {
611
- i("create", e), e.cameras.main.on(S.Scene2D.Events.FADE_IN_START, v), e.cameras.main.on(S.Scene2D.Events.FADE_IN_COMPLETE, y), e.cameras.main.on(S.Scene2D.Events.FADE_OUT_START, v), e.cameras.main.on(S.Scene2D.Events.FADE_OUT_COMPLETE, te), h.value = !0;
946
+ setup(__props, { emit: __emit }) {
947
+ const emit = __emit;
948
+ const phaserStore = usePhaserStore();
949
+ const { isSameScene, switchToScene } = phaserStore;
950
+ const cameraStore = useCameraStore();
951
+ const { isFading } = storeToRefs(cameraStore);
952
+ const inputStore = useInputStore();
953
+ const { isInputActive } = storeToRefs(inputStore);
954
+ const { parallelSceneKeys } = storeToRefs(phaserStore);
955
+ const isActive = computed(() => isSameScene(__props.sceneKey) || parallelSceneKeys.value.includes(__props.sceneKey));
956
+ const fadeStartListener = () => {
957
+ isInputActive.value = false;
958
+ };
959
+ const fadeInCompleteListener = () => {
960
+ isFading.value = false;
961
+ isInputActive.value = true;
962
+ };
963
+ const fadeOutCompleteListener = () => {
964
+ isFading.value = false;
965
+ };
966
+ const NewScene = createSceneClass(__props.sceneKey, {
967
+ onCreate: (scene) => {
968
+ emit("create", scene);
969
+ scene.cameras.main.on(Cameras.Scene2D.Events.FADE_IN_START, fadeStartListener);
970
+ scene.cameras.main.on(Cameras.Scene2D.Events.FADE_IN_COMPLETE, fadeInCompleteListener);
971
+ scene.cameras.main.on(Cameras.Scene2D.Events.FADE_OUT_START, fadeStartListener);
972
+ scene.cameras.main.on(Cameras.Scene2D.Events.FADE_OUT_COMPLETE, fadeOutCompleteListener);
973
+ isInputActive.value = true;
612
974
  },
613
- onInit: (e) => i("init", e),
614
- onPreload: (e) => i("preload", e),
615
- onUpdate: (e, t, n) => i("update", e, t, n)
616
- }), x = () => {
617
- O.sceneReadyMap.set(e.sceneKey, !0);
618
- }, ne = () => {
619
- let t = N(e.sceneKey);
620
- Ze(t, D.Update), Ze(t, D.NextTick), Q(t, D.Shutdown), t.cameras.main.off(S.Scene2D.Events.FADE_IN_START, v), t.cameras.main.off(S.Scene2D.Events.FADE_IN_COMPLETE, y), t.cameras.main.off(S.Scene2D.Events.FADE_OUT_START, v), t.cameras.main.off(S.Scene2D.Events.FADE_OUT_COMPLETE, te), O.sceneReadyMap.set(e.sceneKey, !1), i("shutdown", t);
975
+ onInit: (scene) => emit("init", scene),
976
+ onPreload: (scene) => emit("preload", scene),
977
+ onUpdate: (scene, time, delta) => emit("update", scene, time, delta)
978
+ });
979
+ const readyListener = () => {
980
+ ExternalSceneStore.sceneReadyMap.set(__props.sceneKey, true);
621
981
  };
622
- return l(async () => {
623
- let t = M().scene.add(e.sceneKey, b);
624
- if (!t) {
625
- console.error(`Failed to add scene: ${e.sceneKey}`);
982
+ const shutdownListener = () => {
983
+ const scene = getScene(__props.sceneKey);
984
+ resetLifecycleListeners(scene, "Update");
985
+ resetLifecycleListeners(scene, "NextTick");
986
+ runLifecycleListeners(scene, "Shutdown");
987
+ scene.cameras.main.off(Cameras.Scene2D.Events.FADE_IN_START, fadeStartListener);
988
+ scene.cameras.main.off(Cameras.Scene2D.Events.FADE_IN_COMPLETE, fadeInCompleteListener);
989
+ scene.cameras.main.off(Cameras.Scene2D.Events.FADE_OUT_START, fadeStartListener);
990
+ scene.cameras.main.off(Cameras.Scene2D.Events.FADE_OUT_COMPLETE, fadeOutCompleteListener);
991
+ ExternalSceneStore.sceneReadyMap.set(__props.sceneKey, false);
992
+ emit("shutdown", scene);
993
+ };
994
+ onMounted(async () => {
995
+ const scene = useGame().scene.add(__props.sceneKey, NewScene);
996
+ if (!scene) {
997
+ console.error(`Failed to add scene: ${__props.sceneKey}`);
626
998
  return;
627
999
  }
628
- t.events.on(le.Events.READY, x), t.events.on(le.Events.SHUTDOWN, ne), e.autoStart && await s(e.sceneKey);
629
- }), u(() => {
630
- let t = M(), n = N(e.sceneKey);
631
- n.events.off(le.Events.READY, x), n.events.off(le.Events.SHUTDOWN, ne), t.scene.remove(e.sceneKey);
632
- }), f(T.SceneKey, e.sceneKey), (e, t) => g(ee) ? m(e.$slots, "default", {}, void 0, void 0, 0) : n("", !0);
1000
+ scene.events.on(Scenes.Events.READY, readyListener);
1001
+ scene.events.on(Scenes.Events.SHUTDOWN, shutdownListener);
1002
+ if (__props.autoStart) await switchToScene(__props.sceneKey);
1003
+ });
1004
+ onUnmounted(() => {
1005
+ const game = useGame();
1006
+ const scene = getScene(__props.sceneKey);
1007
+ scene.events.off(Scenes.Events.READY, readyListener);
1008
+ scene.events.off(Scenes.Events.SHUTDOWN, shutdownListener);
1009
+ game.scene.remove(__props.sceneKey);
1010
+ });
1011
+ provide(InjectionKeyMap.SceneKey, __props.sceneKey);
1012
+ return (_ctx, _cache) => {
1013
+ return isActive.value ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : createCommentVNode("v-if", true);
1014
+ };
633
1015
  }
634
- }), et = {
635
- ...H,
636
- ...U,
637
- ...I,
638
- ...W,
639
- ...G,
640
- ...L,
641
- ...K,
642
- ...R,
643
- ...Z,
644
- ...q,
645
- ...z,
646
- ...B,
647
- ...V
648
- }, tt = /* @__PURE__ */ a({
1016
+ });
1017
+ //#endregion
1018
+ //#region src/util/setterMap/RenderTextureSetterMap.ts
1019
+ const RenderTextureSetterMap = {
1020
+ ...AlphaSetterMap,
1021
+ ...BlendModeSetterMap,
1022
+ ...DepthSetterMap,
1023
+ ...FlipSetterMap,
1024
+ ...MaskSetterMap,
1025
+ ...OriginSetterMap,
1026
+ ...RenderNodesSetterMap,
1027
+ ...ScrollFactorSetterMap,
1028
+ ...SizeSetterMap,
1029
+ ...TintSetterMap,
1030
+ ...TransformSetterMap,
1031
+ ...VisibleSetterMap,
1032
+ ...GlobalSetterMap
1033
+ };
1034
+ //#endregion
1035
+ //#region src/components/RenderTexture.vue
1036
+ const _sfc_main$17 = /*@__PURE__*/ defineComponent({
649
1037
  __name: "RenderTexture",
650
1038
  props: {
651
1039
  configuration: {},
652
1040
  immediate: { type: Boolean },
653
1041
  onComplete: { type: Function }
654
1042
  },
655
- setup(e, { emit: t }) {
656
- return P((t) => {
657
- let { height: n, width: r, x: i, y: a } = e.configuration, o = t.add.renderTexture(i ?? 0, a ?? 0, r, n);
658
- return e.onComplete?.(t, o), o;
659
- }, () => e.configuration, t, et, e.immediate), (e, t) => null;
1043
+ setup(__props, { emit: __emit }) {
1044
+ useInitializeGameObject((scene) => {
1045
+ const { height, width, x, y } = __props.configuration;
1046
+ const renderTexture = scene.add.renderTexture(x ?? 0, y ?? 0, width, height);
1047
+ __props.onComplete?.(scene, renderTexture);
1048
+ return renderTexture;
1049
+ }, () => __props.configuration, __emit, RenderTextureSetterMap, __props.immediate);
1050
+ return (_ctx, _cache) => {
1051
+ return null;
1052
+ };
660
1053
  }
661
- }), nt = {
662
- height: F.height,
663
- width: F.width,
664
- ...Y,
665
- ...V
666
- }, rt = /* @__PURE__ */ a({
1054
+ });
1055
+ //#endregion
1056
+ //#region src/util/setterMap/RectangleSetterMap.ts
1057
+ const RectangleSetterMap = {
1058
+ height: ComputedSizeSetterMap.height,
1059
+ width: ComputedSizeSetterMap.width,
1060
+ ...ShapeSetterMap,
1061
+ ...GlobalSetterMap
1062
+ };
1063
+ //#endregion
1064
+ //#region src/components/Rectangle.vue
1065
+ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
667
1066
  __name: "Rectangle",
668
1067
  props: {
669
1068
  configuration: {},
670
1069
  immediate: { type: Boolean },
671
1070
  onComplete: { type: Function }
672
1071
  },
673
- setup(e, { emit: t }) {
674
- return P((t) => {
675
- let { alpha: n, fillColor: r, height: i, width: a, x: o, y: s } = e.configuration, c = t.add.rectangle(o, s, a, i, r, n);
676
- return e.onComplete?.(t, c), c;
677
- }, () => e.configuration, t, nt, e.immediate), (e, t) => null;
1072
+ setup(__props, { emit: __emit }) {
1073
+ useInitializeGameObject((scene) => {
1074
+ const { alpha, fillColor, height, width, x, y } = __props.configuration;
1075
+ const rectangle = scene.add.rectangle(x, y, width, height, fillColor, alpha);
1076
+ __props.onComplete?.(scene, rectangle);
1077
+ return rectangle;
1078
+ }, () => __props.configuration, __emit, RectangleSetterMap, __props.immediate);
1079
+ return (_ctx, _cache) => {
1080
+ return null;
1081
+ };
678
1082
  }
679
- }), it = {
680
- points: (e) => (t) => {
681
- t && e.setTo(t);
682
- },
683
- ...Y,
684
- ...V
685
- }, at = /* @__PURE__ */ a({
1083
+ });
1084
+ //#endregion
1085
+ //#region src/util/setterMap/PolygonSetterMap.ts
1086
+ const PolygonSetterMap = {
1087
+ points: (gameObject) => (value) => {
1088
+ if (!value) return;
1089
+ gameObject.setTo(value);
1090
+ },
1091
+ ...ShapeSetterMap,
1092
+ ...GlobalSetterMap
1093
+ };
1094
+ //#endregion
1095
+ //#region src/components/Polygon.vue
1096
+ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
686
1097
  __name: "Polygon",
687
1098
  props: {
688
1099
  configuration: {},
689
1100
  immediate: { type: Boolean },
690
1101
  onComplete: { type: Function }
691
1102
  },
692
- setup(e, { emit: t }) {
693
- return P((t) => {
694
- let { alpha: n, fillColor: r, points: i, x: a, y: o } = e.configuration, s = t.add.polygon(a, o, i, r, n);
695
- return e.onComplete?.(t, s), s;
696
- }, () => e.configuration, t, it, e.immediate), (e, t) => null;
1103
+ setup(__props, { emit: __emit }) {
1104
+ useInitializeGameObject((scene) => {
1105
+ const { alpha, fillColor, points, x, y } = __props.configuration;
1106
+ const polygon = scene.add.polygon(x, y, points, fillColor, alpha);
1107
+ __props.onComplete?.(scene, polygon);
1108
+ return polygon;
1109
+ }, () => __props.configuration, __emit, PolygonSetterMap, __props.immediate);
1110
+ return (_ctx, _cache) => {
1111
+ return null;
1112
+ };
697
1113
  }
698
- }), ot = { path: (e) => (t) => {
699
- t && e.setPath(t);
700
- } }, st = {
701
- ...H,
702
- ...U,
703
- ...I,
704
- ...W,
705
- ...G,
706
- ...L,
707
- ...ot,
708
- ...K,
709
- ...R,
710
- ...Z,
711
- ...X,
712
- ...q,
713
- ...z,
714
- ...B,
715
- ...V
716
- }, ct = /* @__PURE__ */ a({
1114
+ });
1115
+ //#endregion
1116
+ //#region src/util/setterMap/components/PathFollowerComponentSetterMap.ts
1117
+ const PathFollowerComponentSetterMap = { path: (gameObject) => (value) => {
1118
+ if (!value) return;
1119
+ gameObject.setPath(value);
1120
+ } };
1121
+ //#endregion
1122
+ //#region src/util/setterMap/PathFollowerSetterMap.ts
1123
+ const PathFollowerSetterMap = {
1124
+ ...AlphaSetterMap,
1125
+ ...BlendModeSetterMap,
1126
+ ...DepthSetterMap,
1127
+ ...FlipSetterMap,
1128
+ ...MaskSetterMap,
1129
+ ...OriginSetterMap,
1130
+ ...PathFollowerComponentSetterMap,
1131
+ ...RenderNodesSetterMap,
1132
+ ...ScrollFactorSetterMap,
1133
+ ...SizeSetterMap,
1134
+ ...TextureSetterMap,
1135
+ ...TintSetterMap,
1136
+ ...TransformSetterMap,
1137
+ ...VisibleSetterMap,
1138
+ ...GlobalSetterMap
1139
+ };
1140
+ //#endregion
1141
+ //#region src/components/PathFollower.vue
1142
+ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
717
1143
  __name: "PathFollower",
718
1144
  props: {
719
1145
  configuration: {},
720
1146
  onComplete: { type: Function }
721
1147
  },
722
- setup(e, { emit: t }) {
723
- return P((t) => {
724
- let { frame: n, path: r, texture: i, x: a, y: o } = e.configuration, s = t.add.follower(r, a ?? 0, o ?? 0, i, n);
725
- return e.onComplete?.(t, s), s;
726
- }, () => e.configuration, t, st), (e, t) => null;
1148
+ setup(__props, { emit: __emit }) {
1149
+ useInitializeGameObject((scene) => {
1150
+ const { frame, path, texture, x, y } = __props.configuration;
1151
+ const pathFollower = scene.add.follower(path, x ?? 0, y ?? 0, texture, frame);
1152
+ __props.onComplete?.(scene, pathFollower);
1153
+ return pathFollower;
1154
+ }, () => __props.configuration, __emit, PathFollowerSetterMap);
1155
+ return (_ctx, _cache) => {
1156
+ return null;
1157
+ };
727
1158
  }
728
- }), lt = {
729
- ...J,
730
- ...U,
731
- ...I,
732
- ...G,
733
- ...K,
734
- ...R,
735
- ...X,
736
- ...z,
737
- ...B,
738
- ...V,
739
- config: (e) => (t) => {
740
- t && e.setConfig(t);
1159
+ });
1160
+ //#endregion
1161
+ //#region src/util/setterMap/ParticlesSetterMap.ts
1162
+ const ParticlesSetterMap = {
1163
+ ...AlphaSingleSetterMap,
1164
+ ...BlendModeSetterMap,
1165
+ ...DepthSetterMap,
1166
+ ...MaskSetterMap,
1167
+ ...RenderNodesSetterMap,
1168
+ ...ScrollFactorSetterMap,
1169
+ ...TextureSetterMap,
1170
+ ...TransformSetterMap,
1171
+ ...VisibleSetterMap,
1172
+ ...GlobalSetterMap,
1173
+ config: (gameObject) => (value) => {
1174
+ if (!value) return;
1175
+ gameObject.setConfig(value);
741
1176
  }
742
- }, ut = /* @__PURE__ */ a({
1177
+ };
1178
+ //#endregion
1179
+ //#region src/components/Particles.vue
1180
+ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
743
1181
  __name: "Particles",
744
1182
  props: {
745
1183
  configuration: {},
746
1184
  immediate: { type: Boolean },
747
1185
  onComplete: { type: Function }
748
1186
  },
749
- setup(e, { emit: t }) {
750
- return P((t) => {
751
- let { config: n, texture: r, x: i, y: a } = e.configuration, o = t.add.particles(i ?? 0, a ?? 0, r, n);
752
- return e.onComplete?.(t, o), o;
753
- }, () => e.configuration, t, lt, e.immediate), (e, t) => null;
1187
+ setup(__props, { emit: __emit }) {
1188
+ useInitializeGameObject((scene) => {
1189
+ const { config, texture, x, y } = __props.configuration;
1190
+ const particles = scene.add.particles(x ?? 0, y ?? 0, texture, config);
1191
+ __props.onComplete?.(scene, particles);
1192
+ return particles;
1193
+ }, () => __props.configuration, __emit, ParticlesSetterMap, __props.immediate);
1194
+ return (_ctx, _cache) => {
1195
+ return null;
1196
+ };
754
1197
  }
755
- }), dt = {
756
- height: F.height,
757
- width: F.width,
758
- ...J,
759
- ...U,
760
- ...I,
761
- ...G,
762
- ...L,
763
- ...K,
764
- ...R,
765
- ...X,
766
- ...z,
767
- ...B,
768
- ...V
769
- }, ft = /* @__PURE__ */ a({
1198
+ });
1199
+ //#endregion
1200
+ //#region src/util/setterMap/NinesliceSetterMap.ts
1201
+ const NinesliceSetterMap = {
1202
+ height: ComputedSizeSetterMap.height,
1203
+ width: ComputedSizeSetterMap.width,
1204
+ ...AlphaSingleSetterMap,
1205
+ ...BlendModeSetterMap,
1206
+ ...DepthSetterMap,
1207
+ ...MaskSetterMap,
1208
+ ...OriginSetterMap,
1209
+ ...RenderNodesSetterMap,
1210
+ ...ScrollFactorSetterMap,
1211
+ ...TextureSetterMap,
1212
+ ...TransformSetterMap,
1213
+ ...VisibleSetterMap,
1214
+ ...GlobalSetterMap
1215
+ };
1216
+ //#endregion
1217
+ //#region src/components/Nineslice.vue
1218
+ const _sfc_main$12 = /*@__PURE__*/ defineComponent({
770
1219
  __name: "Nineslice",
771
1220
  props: {
772
1221
  configuration: {},
773
1222
  immediate: { type: Boolean },
774
1223
  onComplete: { type: Function }
775
1224
  },
776
- setup(e, { emit: t }) {
777
- return P((t) => {
778
- let { bottomHeight: n, frame: r, height: i, leftWidth: a, rightWidth: o, texture: s, topHeight: c, width: l, x: u, y: d } = e.configuration, f = t.add.nineslice(u ?? 0, d ?? 0, s, r, l, i, a, o, c, n);
779
- return e.onComplete?.(t, f), f;
780
- }, () => e.configuration, t, dt, e.immediate), (e, t) => null;
1225
+ setup(__props, { emit: __emit }) {
1226
+ useInitializeGameObject((scene) => {
1227
+ const { bottomHeight, frame, height, leftWidth, rightWidth, texture, topHeight, width, x, y } = __props.configuration;
1228
+ const nineSlice = scene.add.nineslice(x ?? 0, y ?? 0, texture, frame, width, height, leftWidth, rightWidth, topHeight, bottomHeight);
1229
+ __props.onComplete?.(scene, nineSlice);
1230
+ return nineSlice;
1231
+ }, () => __props.configuration, __emit, NinesliceSetterMap, __props.immediate);
1232
+ return (_ctx, _cache) => {
1233
+ return null;
1234
+ };
781
1235
  }
782
- }), pt = {
783
- lineWidth: (e) => (t) => {
784
- t !== void 0 && e.setLineWidth(t);
785
- },
786
- to: (e) => (t) => {
787
- t && e.setTo(...t);
788
- },
789
- ...Y,
790
- ...V
791
- }, mt = /* @__PURE__ */ a({
1236
+ });
1237
+ //#endregion
1238
+ //#region src/util/setterMap/LineSetterMap.ts
1239
+ const LineSetterMap = {
1240
+ lineWidth: (gameObject) => (value) => {
1241
+ if (value === void 0) return;
1242
+ gameObject.setLineWidth(value);
1243
+ },
1244
+ to: (gameObject) => (value) => {
1245
+ if (!value) return;
1246
+ gameObject.setTo(...value);
1247
+ },
1248
+ ...ShapeSetterMap,
1249
+ ...GlobalSetterMap
1250
+ };
1251
+ //#endregion
1252
+ //#region src/components/Line.vue
1253
+ const _sfc_main$11 = /*@__PURE__*/ defineComponent({
792
1254
  __name: "Line",
793
1255
  props: {
794
1256
  configuration: {},
795
1257
  immediate: { type: Boolean },
796
1258
  onComplete: { type: Function }
797
1259
  },
798
- setup(e, { emit: t }) {
799
- return P((t) => {
800
- let { to: n, x: r, y: i } = e.configuration, a = t.add.line(r, i, n?.[0], n?.[1], n?.[2], n?.[3]);
801
- return e.onComplete?.(t, a), a;
802
- }, () => e.configuration, t, pt, e.immediate), (e, t) => null;
1260
+ setup(__props, { emit: __emit }) {
1261
+ useInitializeGameObject((scene) => {
1262
+ const { to, x, y } = __props.configuration;
1263
+ const line = scene.add.line(x, y, to?.[0], to?.[1], to?.[2], to?.[3]);
1264
+ __props.onComplete?.(scene, line);
1265
+ return line;
1266
+ }, () => __props.configuration, __emit, LineSetterMap, __props.immediate);
1267
+ return (_ctx, _cache) => {
1268
+ return null;
1269
+ };
803
1270
  }
804
- }), ht = {
805
- fillLeft: (e) => (t) => {
806
- t !== void 0 && e.setFillStyle(e.fillTop, t, e.fillRight);
807
- },
808
- fillRight: (e) => (t) => {
809
- t !== void 0 && e.setFillStyle(e.fillTop, e.fillLeft, t);
810
- },
811
- fillTop: (e) => (t) => {
812
- t !== void 0 && e.setFillStyle(t, e.fillLeft, e.fillRight);
813
- },
814
- projection: (e) => (t) => {
815
- t !== void 0 && e.setProjection(t);
816
- },
817
- showLeft: (e) => (t) => {
818
- t !== void 0 && e.setFaces(e.showTop, t, e.showRight);
819
- },
820
- showRight: (e) => (t) => {
821
- t !== void 0 && e.setFaces(e.showTop, e.showLeft, t);
822
- },
823
- showTop: (e) => (t) => {
824
- t !== void 0 && e.setFaces(t, e.showLeft, e.showRight);
1271
+ });
1272
+ //#endregion
1273
+ //#region src/util/setterMap/shared/IsoSetterMap.ts
1274
+ const IsoSetterMap = {
1275
+ fillLeft: (gameObject) => (value) => {
1276
+ if (value === void 0) return;
1277
+ gameObject.setFillStyle(gameObject.fillTop, value, gameObject.fillRight);
1278
+ },
1279
+ fillRight: (gameObject) => (value) => {
1280
+ if (value === void 0) return;
1281
+ gameObject.setFillStyle(gameObject.fillTop, gameObject.fillLeft, value);
1282
+ },
1283
+ fillTop: (gameObject) => (value) => {
1284
+ if (value === void 0) return;
1285
+ gameObject.setFillStyle(value, gameObject.fillLeft, gameObject.fillRight);
1286
+ },
1287
+ projection: (gameObject) => (value) => {
1288
+ if (value === void 0) return;
1289
+ gameObject.setProjection(value);
1290
+ },
1291
+ showLeft: (gameObject) => (value) => {
1292
+ if (value === void 0) return;
1293
+ gameObject.setFaces(gameObject.showTop, value, gameObject.showRight);
1294
+ },
1295
+ showRight: (gameObject) => (value) => {
1296
+ if (value === void 0) return;
1297
+ gameObject.setFaces(gameObject.showTop, gameObject.showLeft, value);
1298
+ },
1299
+ showTop: (gameObject) => (value) => {
1300
+ if (value === void 0) return;
1301
+ gameObject.setFaces(value, gameObject.showLeft, gameObject.showRight);
825
1302
  }
826
- }, gt = {
827
- isReversed: (e) => (t) => {
828
- t !== void 0 && e.setReversed(t);
829
- },
830
- ...ht,
831
- ...Y,
832
- ...V
833
- }, _t = /* @__PURE__ */ a({
1303
+ };
1304
+ //#endregion
1305
+ //#region src/util/setterMap/IsoTriangleSetterMap.ts
1306
+ const IsoTriangleSetterMap = {
1307
+ isReversed: (gameObject) => (value) => {
1308
+ if (value === void 0) return;
1309
+ gameObject.setReversed(value);
1310
+ },
1311
+ ...IsoSetterMap,
1312
+ ...ShapeSetterMap,
1313
+ ...GlobalSetterMap
1314
+ };
1315
+ //#endregion
1316
+ //#region src/components/IsoTriangle.vue
1317
+ const _sfc_main$10 = /*@__PURE__*/ defineComponent({
834
1318
  __name: "IsoTriangle",
835
1319
  props: {
836
1320
  configuration: {},
837
1321
  immediate: { type: Boolean },
838
1322
  onComplete: { type: Function }
839
1323
  },
840
- setup(e, { emit: t }) {
841
- return P((t) => {
842
- let { fillLeft: n, fillRight: r, fillTop: i, height: a, isReversed: o, size: s, x: c, y: l } = e.configuration, u = t.add.isotriangle(c, l, s, a, o, i, n, r);
843
- return e.onComplete?.(t, u), u;
844
- }, () => e.configuration, t, gt, e.immediate), (e, t) => null;
1324
+ setup(__props, { emit: __emit }) {
1325
+ useInitializeGameObject((scene) => {
1326
+ const { fillLeft, fillRight, fillTop, height, isReversed, size, x, y } = __props.configuration;
1327
+ const isoTriangle = scene.add.isotriangle(x, y, size, height, isReversed, fillTop, fillLeft, fillRight);
1328
+ __props.onComplete?.(scene, isoTriangle);
1329
+ return isoTriangle;
1330
+ }, () => __props.configuration, __emit, IsoTriangleSetterMap, __props.immediate);
1331
+ return (_ctx, _cache) => {
1332
+ return null;
1333
+ };
845
1334
  }
846
- }), vt = {
847
- ...ht,
848
- ...Y,
849
- ...V
850
- }, yt = /* @__PURE__ */ a({
1335
+ });
1336
+ //#endregion
1337
+ //#region src/util/setterMap/IsoBoxSetterMap.ts
1338
+ const IsoBoxSetterMap = {
1339
+ ...IsoSetterMap,
1340
+ ...ShapeSetterMap,
1341
+ ...GlobalSetterMap
1342
+ };
1343
+ //#endregion
1344
+ //#region src/components/IsoBox.vue
1345
+ const _sfc_main$9 = /*@__PURE__*/ defineComponent({
851
1346
  __name: "IsoBox",
852
1347
  props: {
853
1348
  configuration: {},
854
1349
  immediate: { type: Boolean },
855
1350
  onComplete: { type: Function }
856
1351
  },
857
- setup(e, { emit: t }) {
858
- return P((t) => {
859
- let { fillLeft: n, fillRight: r, fillTop: i, height: a, size: o, x: s, y: c } = e.configuration, l = t.add.isobox(s, c, o, a, i, n, r);
860
- return e.onComplete?.(t, l), l;
861
- }, () => e.configuration, t, vt, e.immediate), (e, t) => null;
1352
+ setup(__props, { emit: __emit }) {
1353
+ useInitializeGameObject((scene) => {
1354
+ const { fillLeft, fillRight, fillTop, height, size, x, y } = __props.configuration;
1355
+ const isoBox = scene.add.isobox(x, y, size, height, fillTop, fillLeft, fillRight);
1356
+ __props.onComplete?.(scene, isoBox);
1357
+ return isoBox;
1358
+ }, () => __props.configuration, __emit, IsoBoxSetterMap, __props.immediate);
1359
+ return (_ctx, _cache) => {
1360
+ return null;
1361
+ };
862
1362
  }
863
- }), bt = {
864
- ...H,
865
- ...U,
866
- ...I,
867
- ...W,
868
- ...G,
869
- ...L,
870
- ...K,
871
- ...R,
872
- ...Z,
873
- ...Ne,
874
- ...q,
875
- ...z,
876
- ...B,
877
- ...V
878
- }, xt = /* @__PURE__ */ a({
1363
+ });
1364
+ //#endregion
1365
+ //#region src/util/setterMap/ImageSetterMap.ts
1366
+ const ImageSetterMap = {
1367
+ ...AlphaSetterMap,
1368
+ ...BlendModeSetterMap,
1369
+ ...DepthSetterMap,
1370
+ ...FlipSetterMap,
1371
+ ...MaskSetterMap,
1372
+ ...OriginSetterMap,
1373
+ ...RenderNodesSetterMap,
1374
+ ...ScrollFactorSetterMap,
1375
+ ...SizeSetterMap,
1376
+ ...TextureCropSetterMap,
1377
+ ...TintSetterMap,
1378
+ ...TransformSetterMap,
1379
+ ...VisibleSetterMap,
1380
+ ...GlobalSetterMap
1381
+ };
1382
+ //#endregion
1383
+ //#region src/components/Image.vue
1384
+ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
879
1385
  __name: "Image",
880
1386
  props: {
881
1387
  configuration: {},
882
1388
  onComplete: { type: Function }
883
1389
  },
884
- setup(e, { emit: t }) {
885
- return P((t) => {
886
- let { frame: n, texture: r, x: i, y: a } = e.configuration, o = t.add.image(i ?? 0, a ?? 0, r, n);
887
- return e.onComplete?.(t, o), o;
888
- }, () => e.configuration, t, bt), (e, t) => null;
1390
+ setup(__props, { emit: __emit }) {
1391
+ useInitializeGameObject((scene) => {
1392
+ const { frame, texture, x, y } = __props.configuration;
1393
+ const image = scene.add.image(x ?? 0, y ?? 0, texture, frame);
1394
+ __props.onComplete?.(scene, image);
1395
+ return image;
1396
+ }, () => __props.configuration, __emit, ImageSetterMap);
1397
+ return (_ctx, _cache) => {
1398
+ return null;
1399
+ };
889
1400
  }
890
- }), St = {
891
- ...J,
892
- ...U,
893
- ...I,
894
- ...G,
895
- ...K,
896
- ...R,
897
- ...z,
898
- ...B,
899
- ...V
900
- }, Ct = /* @__PURE__ */ a({
1401
+ });
1402
+ //#endregion
1403
+ //#region src/util/setterMap/GraphicsSetterMap.ts
1404
+ const GraphicsSetterMap = {
1405
+ ...AlphaSingleSetterMap,
1406
+ ...BlendModeSetterMap,
1407
+ ...DepthSetterMap,
1408
+ ...MaskSetterMap,
1409
+ ...RenderNodesSetterMap,
1410
+ ...ScrollFactorSetterMap,
1411
+ ...TransformSetterMap,
1412
+ ...VisibleSetterMap,
1413
+ ...GlobalSetterMap
1414
+ };
1415
+ //#endregion
1416
+ //#region src/components/Graphics.vue
1417
+ const _sfc_main$7 = /*@__PURE__*/ defineComponent({
901
1418
  __name: "Graphics",
902
1419
  props: {
903
1420
  configuration: { default: () => ({}) },
904
1421
  immediate: { type: Boolean },
905
1422
  onComplete: { type: Function }
906
1423
  },
907
- setup(e, { emit: t }) {
908
- return P((t) => {
909
- let { x: n, y: r } = e.configuration, i = t.add.graphics({
910
- x: n,
911
- y: r
1424
+ setup(__props, { emit: __emit }) {
1425
+ useInitializeGameObject((scene) => {
1426
+ const { x, y } = __props.configuration;
1427
+ const graphics = scene.add.graphics({
1428
+ x,
1429
+ y
912
1430
  });
913
- return e.onComplete?.(t, i), i;
914
- }, () => e.configuration, t, St, e.immediate), (e, t) => null;
1431
+ __props.onComplete?.(scene, graphics);
1432
+ return graphics;
1433
+ }, () => __props.configuration, __emit, GraphicsSetterMap, __props.immediate);
1434
+ return (_ctx, _cache) => {
1435
+ return null;
1436
+ };
915
1437
  }
916
- }), wt = C.FileTypes.XMLFile, Tt = class extends wt {
1438
+ });
1439
+ //#endregion
1440
+ //#region src/models/plugins/TilesetFile.ts
1441
+ const XMLFile = Loader.FileTypes.XMLFile;
1442
+ var TilesetFile = class extends XMLFile {
917
1443
  tilesetIndex;
918
- constructor(e, ...t) {
919
- super(...t), this.tilesetIndex = e;
1444
+ constructor(tilesetIndex, ...args) {
1445
+ super(...args);
1446
+ this.tilesetIndex = tilesetIndex;
920
1447
  }
921
- }, $ = fe.Objects.GetFastValue, Et = C.FileTypes.JSONFile, Dt = C.MultiFile, Ot = class extends Dt {
922
- constructor(e, t, n, r, i, a, o) {
923
- if (ne(t)) {
924
- let e = t;
925
- t = $(e, "key"), n = $(e, "url"), a = $(e, "xhrSettings"), r = $(e, "path"), i = $(e, "baseURL"), o = $(e, "tilesetXhrSettings");
1448
+ };
1449
+ //#endregion
1450
+ //#region src/models/plugins/TiledJSONExternalFile.ts
1451
+ const GetFastValue = Utils.Objects.GetFastValue;
1452
+ const JSONFile$1 = Loader.FileTypes.JSONFile;
1453
+ const MultiFile = Loader.MultiFile;
1454
+ var TiledJSONExternalFile = class extends MultiFile {
1455
+ constructor(loader, key, tilemapURL, path, baseURL, tilemapXhrSettings, tilesetXhrSettings) {
1456
+ if (checkIsPlainObject(key)) {
1457
+ const configuration = key;
1458
+ key = GetFastValue(configuration, "key");
1459
+ tilemapURL = GetFastValue(configuration, "url");
1460
+ tilemapXhrSettings = GetFastValue(configuration, "xhrSettings");
1461
+ path = GetFastValue(configuration, "path");
1462
+ baseURL = GetFastValue(configuration, "baseURL");
1463
+ tilesetXhrSettings = GetFastValue(configuration, "tilesetXhrSettings");
926
1464
  }
927
- let s = new Et(e, t, n, a);
928
- super(e, "tilemapJSON", t, [s]), this.config.path = r, this.config.baseURL = i, this.config.tilesetXhrSettings = o;
1465
+ const tilemapFile = new JSONFile$1(loader, key, tilemapURL, tilemapXhrSettings);
1466
+ super(loader, "tilemapJSON", key, [tilemapFile]);
1467
+ this.config.path = path;
1468
+ this.config.baseURL = baseURL;
1469
+ this.config.tilesetXhrSettings = tilesetXhrSettings;
929
1470
  }
930
1471
  async addToCache() {
931
1472
  if (!this.isReadyToProcess()) return;
932
- let [e, ...t] = this.files;
933
- if (!(e.type === "json" && Object.hasOwn(e.data, "tilesets"))) return;
934
- let n = e.data, r = e.key, i = this.loader, a = this.files;
935
- this.complete = !0;
936
- for (let e of t) {
937
- let t = e.xhrLoader?.responseText;
938
- if (!t) throw new y(x.Read, this.addToCache.name, e.key);
939
- let r = await he(t), i = me(r.tileset), a = e.tilesetIndex;
940
- Object.assign(n.tilesets[a], i, {
941
- imageheight: i.image.height,
942
- imagewidth: i.image.width,
1473
+ const [tilemapFile, ...tilesetFiles] = this.files;
1474
+ if (!(tilemapFile.type === "json" && Object.hasOwn(tilemapFile.data, "tilesets"))) return;
1475
+ const tilemapData = tilemapFile.data;
1476
+ const tilemapKey = tilemapFile.key;
1477
+ const loader = this.loader;
1478
+ const files = this.files;
1479
+ this.complete = true;
1480
+ for (const tilesetFile of tilesetFiles) {
1481
+ const responseText = tilesetFile.xhrLoader?.responseText;
1482
+ if (!responseText) throw new InvalidOperationError(Operation.Read, this.addToCache.name, tilesetFile.key);
1483
+ const responseData = await parseXmlString(responseText);
1484
+ const tilesetData = parseTileset(responseData.tileset);
1485
+ const index = tilesetFile.tilesetIndex;
1486
+ Object.assign(tilemapData.tilesets[index], tilesetData, {
1487
+ imageheight: tilesetData.image.height,
1488
+ imagewidth: tilesetData.image.width,
943
1489
  source: void 0
944
1490
  });
945
1491
  }
946
- i.cacheManager.tilemap.add(r, {
947
- data: n,
948
- format: ue.Formats.TILED_JSON
1492
+ loader.cacheManager.tilemap.add(tilemapKey, {
1493
+ data: tilemapData,
1494
+ format: Tilemaps.Formats.TILED_JSON
949
1495
  });
950
- for (let e of a) e.pendingDestroy();
1496
+ for (const file of files) file.pendingDestroy();
951
1497
  }
952
- onFileComplete(e) {
953
- if (this.files.indexOf(e) === -1 || (this.pending--, !(e.type === "json" && Object.hasOwn(e.data, "tilesets")))) return;
954
- let t = e.data.tilesets, n = this.config, r = this.loader, i = r.baseURL, a = r.path, o = r.prefix, s = $(n, "baseURL", i), c = $(n, "path", a), l = $(n, "prefix", o), u = $(n, "tilesetXhrSettings");
955
- r.setBaseURL(s), r.setPath(c), r.setPrefix(l);
956
- for (let [n, i] of t.entries()) {
957
- let t = i.source.indexOf("public");
958
- if (t === -1) throw new te(this.onFileComplete.name, i.source);
959
- let a = i.source.slice(t + 6), o = new Tt(n, r, `${e.key}${v}Tileset${v}${a}`, a, u);
960
- this.addToMultiFile(o), r.addFile(o);
1498
+ onFileComplete(file) {
1499
+ if (this.files.indexOf(file) === -1) return;
1500
+ this.pending--;
1501
+ if (!(file.type === "json" && Object.hasOwn(file.data, "tilesets"))) return;
1502
+ const tilesets = file.data.tilesets;
1503
+ const config = this.config;
1504
+ const loader = this.loader;
1505
+ const currentBaseURL = loader.baseURL;
1506
+ const currentPath = loader.path;
1507
+ const currentPrefix = loader.prefix;
1508
+ const baseURL = GetFastValue(config, "baseURL", currentBaseURL);
1509
+ const path = GetFastValue(config, "path", currentPath);
1510
+ const prefix = GetFastValue(config, "prefix", currentPrefix);
1511
+ const tilesetXhrSettings = GetFastValue(config, "tilesetXhrSettings");
1512
+ loader.setBaseURL(baseURL);
1513
+ loader.setPath(path);
1514
+ loader.setPrefix(prefix);
1515
+ for (const [tilesetIndex, tileset] of tilesets.entries()) {
1516
+ const pathIndex = tileset.source.indexOf("public");
1517
+ if (pathIndex === -1) throw new NotFoundError(this.onFileComplete.name, tileset.source);
1518
+ const relativePath = tileset.source.slice(pathIndex + 6);
1519
+ const tilesetFile = new TilesetFile(tilesetIndex, loader, `${file.key}${ID_SEPARATOR}Tileset${ID_SEPARATOR}${relativePath}`, relativePath, tilesetXhrSettings);
1520
+ this.addToMultiFile(tilesetFile);
1521
+ loader.addFile(tilesetFile);
961
1522
  }
962
- r.setBaseURL(i), r.setPath(a), r.setPrefix(o);
1523
+ loader.setBaseURL(currentBaseURL);
1524
+ loader.setPath(currentPath);
1525
+ loader.setPrefix(currentPrefix);
963
1526
  }
964
- }, kt = "tilemapTiledJSONExternal", At = C.FileTypesManager, jt = () => {
965
- At.register(kt, function(...[e, t, n, r, i, a]) {
966
- if (Array.isArray(e)) for (let t of e) {
967
- let e = new Ot(this, t);
968
- this.addFile(e.files);
1527
+ };
1528
+ //#endregion
1529
+ //#region src/util/constants.ts
1530
+ const TILEMAP_TILED_JSON_EXTERNAL_KEY = "tilemapTiledJSONExternal";
1531
+ //#endregion
1532
+ //#region src/plugins/registerTiledJSONExternalLoader.ts
1533
+ const FileTypesManager = Loader.FileTypesManager;
1534
+ const registerTiledJSONExternalLoader = () => {
1535
+ FileTypesManager.register(TILEMAP_TILED_JSON_EXTERNAL_KEY, function(...[key, tilemapURL, path, baseURL, tilemapXhrSettings, tilesetXhrSettings]) {
1536
+ if (Array.isArray(key)) for (const keyElement of key) {
1537
+ const multifile = new TiledJSONExternalFile(this, keyElement);
1538
+ this.addFile(multifile.files);
969
1539
  }
970
1540
  else {
971
- let o = new Ot(this, e, t, n, r, i, a);
972
- this.addFile(o.files);
1541
+ const multifile = new TiledJSONExternalFile(this, key, tilemapURL, path, baseURL, tilemapXhrSettings, tilesetXhrSettings);
1542
+ this.addFile(multifile.files);
973
1543
  }
974
1544
  return this;
975
1545
  });
976
- }, Mt = /* @__PURE__ */ a({
1546
+ };
1547
+ //#endregion
1548
+ //#region src/components/Game.vue
1549
+ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
977
1550
  __name: "Game",
978
1551
  props: { configuration: {} },
979
- setup(t) {
980
- let a = j(), { game: o } = w(a), s = _("canvasRoot"), c = p(!1), f = () => {
981
- c.value = !0;
1552
+ setup(__props) {
1553
+ const phaserStore = usePhaserStore();
1554
+ const { game: storeGame } = storeToRefs(phaserStore);
1555
+ const canvasRoot = useTemplateRef("canvasRoot");
1556
+ const isReady = ref(false);
1557
+ const readyListener = () => {
1558
+ isReady.value = true;
1559
+ };
1560
+ onMounted(() => {
1561
+ registerTiledJSONExternalLoader();
1562
+ storeGame.value = new Game({
1563
+ ...__props.configuration,
1564
+ parent: canvasRoot.value
1565
+ });
1566
+ storeGame.value.events.on("ready", readyListener);
1567
+ });
1568
+ onUnmounted(() => {
1569
+ const game = useGame();
1570
+ game.events.off("ready", readyListener);
1571
+ game.destroy(true);
1572
+ storeGame.value = void 0;
1573
+ });
1574
+ return (_ctx, _cache) => {
1575
+ return openBlock(), createElementBlock(Fragment, null, [createElementVNode("div", {
1576
+ ref_key: "canvasRoot",
1577
+ ref: canvasRoot
1578
+ }, null, 512), isReady.value ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : createCommentVNode("v-if", true)], 64);
982
1579
  };
983
- return l(() => {
984
- jt(), o.value = new se({
985
- ...t.configuration,
986
- parent: s.value
987
- }), o.value.events.on("ready", f);
988
- }), u(() => {
989
- let e = M();
990
- e.events.off("ready", f), e.destroy(!0), o.value = void 0;
991
- }), (t, a) => (d(), r(e, null, [i("div", {
992
- ref_key: "canvasRoot",
993
- ref: s
994
- }, null, 512), g(c) ? m(t.$slots, "default", {}, void 0, void 0, 0) : n("", !0)], 64));
995
1580
  }
996
- }), Nt = {
997
- height: F.height,
998
- smoothness: (e) => (t) => {
999
- t !== void 0 && e.setSmoothness(t);
1000
- },
1001
- width: F.width,
1002
- ...Y,
1003
- ...V
1004
- }, Pt = /* @__PURE__ */ a({
1581
+ });
1582
+ //#endregion
1583
+ //#region src/util/setterMap/EllipseSetterMap.ts
1584
+ const EllipseSetterMap = {
1585
+ height: ComputedSizeSetterMap.height,
1586
+ smoothness: (gameObject) => (value) => {
1587
+ if (value === void 0) return;
1588
+ gameObject.setSmoothness(value);
1589
+ },
1590
+ width: ComputedSizeSetterMap.width,
1591
+ ...ShapeSetterMap,
1592
+ ...GlobalSetterMap
1593
+ };
1594
+ //#endregion
1595
+ //#region src/components/Ellipse.vue
1596
+ const _sfc_main$5 = /*@__PURE__*/ defineComponent({
1005
1597
  __name: "Ellipse",
1006
1598
  props: {
1007
1599
  configuration: {},
1008
1600
  immediate: { type: Boolean },
1009
1601
  onComplete: { type: Function }
1010
1602
  },
1011
- setup(e, { emit: t }) {
1012
- return P((t) => {
1013
- let { alpha: n, fillColor: r, height: i, width: a, x: o, y: s } = e.configuration, c = t.add.ellipse(o, s, a, i, r, n);
1014
- return e.onComplete?.(t, c), c;
1015
- }, () => e.configuration, t, Nt, e.immediate), (e, t) => null;
1603
+ setup(__props, { emit: __emit }) {
1604
+ useInitializeGameObject((scene) => {
1605
+ const { alpha, fillColor, height, width, x, y } = __props.configuration;
1606
+ const ellipse = scene.add.ellipse(x, y, width, height, fillColor, alpha);
1607
+ __props.onComplete?.(scene, ellipse);
1608
+ return ellipse;
1609
+ }, () => __props.configuration, __emit, EllipseSetterMap, __props.immediate);
1610
+ return (_ctx, _cache) => {
1611
+ return null;
1612
+ };
1016
1613
  }
1017
- }), Ft = {
1018
- smoothness: (e) => (t) => {
1019
- t !== void 0 && e.setSmoothness(t);
1020
- },
1021
- ...Y,
1022
- ...V
1023
- }, It = /* @__PURE__ */ a({
1614
+ });
1615
+ //#endregion
1616
+ //#region src/util/setterMap/CurveSetterMap.ts
1617
+ const CurveSetterMap = {
1618
+ smoothness: (gameObject) => (value) => {
1619
+ if (value === void 0) return;
1620
+ gameObject.setSmoothness(value);
1621
+ },
1622
+ ...ShapeSetterMap,
1623
+ ...GlobalSetterMap
1624
+ };
1625
+ //#endregion
1626
+ //#region src/components/Curve.vue
1627
+ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
1024
1628
  __name: "Curve",
1025
1629
  props: {
1026
1630
  configuration: {},
1027
1631
  immediate: { type: Boolean },
1028
1632
  onComplete: { type: Function }
1029
1633
  },
1030
- setup(e, { emit: t }) {
1031
- return P((t) => {
1032
- let { alpha: n, curve: r, fillColor: i, x: a, y: o } = e.configuration, s = t.add.curve(a, o, r, i, n);
1033
- return e.onComplete?.(t, s), s;
1034
- }, () => e.configuration, t, Ft, e.immediate), (e, t) => null;
1634
+ setup(__props, { emit: __emit }) {
1635
+ useInitializeGameObject((scene) => {
1636
+ const { alpha, curve, fillColor, x, y } = __props.configuration;
1637
+ const curveObject = scene.add.curve(x, y, curve, fillColor, alpha);
1638
+ __props.onComplete?.(scene, curveObject);
1639
+ return curveObject;
1640
+ }, () => __props.configuration, __emit, CurveSetterMap, __props.immediate);
1641
+ return (_ctx, _cache) => {
1642
+ return null;
1643
+ };
1035
1644
  }
1036
- }), Lt = {
1037
- ...J,
1038
- ...U,
1039
- ...I,
1040
- ...R,
1041
- ...G,
1042
- ...z,
1043
- ...B,
1044
- ...V
1045
- }, Rt = /* @__PURE__ */ a({
1645
+ });
1646
+ //#endregion
1647
+ //#region src/util/setterMap/ContainerSetterMap.ts
1648
+ const ContainerSetterMap = {
1649
+ ...AlphaSingleSetterMap,
1650
+ ...BlendModeSetterMap,
1651
+ ...DepthSetterMap,
1652
+ ...ScrollFactorSetterMap,
1653
+ ...MaskSetterMap,
1654
+ ...TransformSetterMap,
1655
+ ...VisibleSetterMap,
1656
+ ...GlobalSetterMap
1657
+ };
1658
+ //#endregion
1659
+ //#region src/components/Container.vue
1660
+ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
1046
1661
  __name: "Container",
1047
1662
  props: {
1048
1663
  configuration: { default: () => ({}) },
1049
1664
  onComplete: { type: Function }
1050
1665
  },
1051
- setup(e, { emit: t }) {
1052
- let n = t, r = p();
1053
- return P((t) => {
1054
- let { children: n, x: i, y: a } = e.configuration;
1055
- return r.value = t.add.container(i, a, n), e.onComplete?.(t, r.value), r.value;
1056
- }, () => e.configuration, n, Lt), f(T.ParentContainer, r), (e, t) => m(e.$slots, "default");
1666
+ setup(__props, { emit: __emit }) {
1667
+ const emit = __emit;
1668
+ const container = ref();
1669
+ useInitializeGameObject((scene) => {
1670
+ const { children, x, y } = __props.configuration;
1671
+ container.value = scene.add.container(x, y, children);
1672
+ __props.onComplete?.(scene, container.value);
1673
+ return container.value;
1674
+ }, () => __props.configuration, emit, ContainerSetterMap);
1675
+ provide(InjectionKeyMap.ParentContainer, container);
1676
+ return (_ctx, _cache) => {
1677
+ return renderSlot(_ctx.$slots, "default");
1678
+ };
1057
1679
  }
1058
- }), zt = {
1059
- closePath: (e) => (t) => {
1060
- t !== void 0 && e.setClosePath(t);
1061
- },
1062
- endAngle: (e) => (t) => {
1063
- t !== void 0 && e.setEndAngle(t);
1064
- },
1065
- radius: (e) => (t) => {
1066
- t !== void 0 && e.setRadius(t);
1067
- },
1068
- startAngle: (e) => (t) => {
1069
- t !== void 0 && e.setStartAngle(t);
1070
- },
1071
- ...Y,
1072
- ...V
1073
- }, Bt = /* @__PURE__ */ a({
1680
+ });
1681
+ //#endregion
1682
+ //#region src/util/setterMap/ArcSetterMap.ts
1683
+ const ArcSetterMap = {
1684
+ closePath: (gameObject) => (value) => {
1685
+ if (value === void 0) return;
1686
+ gameObject.setClosePath(value);
1687
+ },
1688
+ endAngle: (gameObject) => (value) => {
1689
+ if (value === void 0) return;
1690
+ gameObject.setEndAngle(value);
1691
+ },
1692
+ radius: (gameObject) => (value) => {
1693
+ if (value === void 0) return;
1694
+ gameObject.setRadius(value);
1695
+ },
1696
+ startAngle: (gameObject) => (value) => {
1697
+ if (value === void 0) return;
1698
+ gameObject.setStartAngle(value);
1699
+ },
1700
+ ...ShapeSetterMap,
1701
+ ...GlobalSetterMap
1702
+ };
1703
+ //#endregion
1704
+ //#region src/components/Circle.vue
1705
+ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
1074
1706
  __name: "Circle",
1075
1707
  props: {
1076
1708
  configuration: {},
1077
1709
  immediate: { type: Boolean },
1078
1710
  onComplete: { type: Function }
1079
1711
  },
1080
- setup(e, { emit: t }) {
1081
- return P((t) => {
1082
- let { alpha: n, fillColor: r, radius: i, x: a, y: o } = e.configuration, s = t.add.circle(a, o, i, r, n);
1083
- return e.onComplete?.(t, s), s;
1084
- }, () => e.configuration, t, zt, e.immediate), (e, t) => null;
1712
+ setup(__props, { emit: __emit }) {
1713
+ useInitializeGameObject((scene) => {
1714
+ const { alpha, fillColor, radius, x, y } = __props.configuration;
1715
+ const circle = scene.add.circle(x, y, radius, fillColor, alpha);
1716
+ __props.onComplete?.(scene, circle);
1717
+ return circle;
1718
+ }, () => __props.configuration, __emit, ArcSetterMap, __props.immediate);
1719
+ return (_ctx, _cache) => {
1720
+ return null;
1721
+ };
1085
1722
  }
1086
- }), Vt = {
1087
- align: (e) => (t) => {
1088
- t !== void 0 && (e.align = t);
1089
- },
1090
- dropShadow: (e) => (t) => {
1091
- t && e.setDropShadow(...t);
1092
- },
1093
- font: (e) => (t) => {
1094
- t && e.setFont(t);
1095
- },
1096
- fontSize: (e) => (t) => {
1097
- t !== void 0 && e.setFontSize(t);
1098
- },
1099
- letterSpacing: (e) => (t) => {
1100
- t !== void 0 && e.setLetterSpacing(t);
1101
- },
1102
- lineSpacing: (e) => (t) => {
1103
- t !== void 0 && e.setLineSpacing(t);
1104
- },
1105
- maxWidth: (e) => (t) => {
1106
- t !== void 0 && e.setMaxWidth(t);
1107
- },
1108
- text: (e) => (t) => {
1109
- t !== void 0 && e.setText(t);
1110
- },
1111
- wordWrapCharCode: (e) => (t) => {
1112
- t !== void 0 && (e.wordWrapCharCode = t);
1113
- },
1114
- ...H,
1115
- ...U,
1116
- ...I,
1117
- ...G,
1118
- ...L,
1119
- ...K,
1120
- ...R,
1121
- ...q,
1122
- ...z,
1123
- ...B,
1124
- ...V
1125
- }, Ht = /* @__PURE__ */ a({
1723
+ });
1724
+ //#endregion
1725
+ //#region src/util/setterMap/BitmapTextSetterMap.ts
1726
+ const BitmapTextSetterMap = {
1727
+ align: (gameObject) => (value) => {
1728
+ if (value === void 0) return;
1729
+ gameObject.align = value;
1730
+ },
1731
+ dropShadow: (gameObject) => (value) => {
1732
+ if (!value) return;
1733
+ gameObject.setDropShadow(...value);
1734
+ },
1735
+ font: (gameObject) => (value) => {
1736
+ if (!value) return;
1737
+ gameObject.setFont(value);
1738
+ },
1739
+ fontSize: (gameObject) => (value) => {
1740
+ if (value === void 0) return;
1741
+ gameObject.setFontSize(value);
1742
+ },
1743
+ letterSpacing: (gameObject) => (value) => {
1744
+ if (value === void 0) return;
1745
+ gameObject.setLetterSpacing(value);
1746
+ },
1747
+ lineSpacing: (gameObject) => (value) => {
1748
+ if (value === void 0) return;
1749
+ gameObject.setLineSpacing(value);
1750
+ },
1751
+ maxWidth: (gameObject) => (value) => {
1752
+ if (value === void 0) return;
1753
+ gameObject.setMaxWidth(value);
1754
+ },
1755
+ text: (gameObject) => (value) => {
1756
+ if (value === void 0) return;
1757
+ gameObject.setText(value);
1758
+ },
1759
+ wordWrapCharCode: (gameObject) => (value) => {
1760
+ if (value === void 0) return;
1761
+ gameObject.wordWrapCharCode = value;
1762
+ },
1763
+ ...AlphaSetterMap,
1764
+ ...BlendModeSetterMap,
1765
+ ...DepthSetterMap,
1766
+ ...MaskSetterMap,
1767
+ ...OriginSetterMap,
1768
+ ...RenderNodesSetterMap,
1769
+ ...ScrollFactorSetterMap,
1770
+ ...TintSetterMap,
1771
+ ...TransformSetterMap,
1772
+ ...VisibleSetterMap,
1773
+ ...GlobalSetterMap
1774
+ };
1775
+ //#endregion
1776
+ //#region src/components/BitmapText.vue
1777
+ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
1126
1778
  __name: "BitmapText",
1127
1779
  props: {
1128
1780
  configuration: {},
1129
1781
  immediate: { type: Boolean },
1130
1782
  onComplete: { type: Function }
1131
1783
  },
1132
- setup(e, { emit: t }) {
1133
- return P((t) => {
1134
- let { align: n, font: r, fontSize: i, text: a, x: o, y: s } = e.configuration, c = t.add.bitmapText(o ?? 0, s ?? 0, r, a, i, n);
1135
- return e.onComplete?.(t, c), c;
1136
- }, () => e.configuration, t, Vt, e.immediate), (e, t) => null;
1784
+ setup(__props, { emit: __emit }) {
1785
+ useInitializeGameObject((scene) => {
1786
+ const { align, font, fontSize, text, x, y } = __props.configuration;
1787
+ const bitmapText = scene.add.bitmapText(x ?? 0, y ?? 0, font, text, fontSize, align);
1788
+ __props.onComplete?.(scene, bitmapText);
1789
+ return bitmapText;
1790
+ }, () => __props.configuration, __emit, BitmapTextSetterMap, __props.immediate);
1791
+ return (_ctx, _cache) => {
1792
+ return null;
1793
+ };
1137
1794
  }
1138
- }), Ut = /* @__PURE__ */ a({
1795
+ });
1796
+ //#endregion
1797
+ //#region src/components/Arc.vue
1798
+ const _sfc_main = /*@__PURE__*/ defineComponent({
1139
1799
  __name: "Arc",
1140
1800
  props: {
1141
1801
  configuration: {},
1142
1802
  immediate: { type: Boolean },
1143
1803
  onComplete: { type: Function }
1144
1804
  },
1145
- setup(e, { emit: t }) {
1146
- return P((t) => {
1147
- let { alpha: n, endAngle: r, fillColor: i, radius: a, startAngle: o, x: s, y: c } = e.configuration, l = t.add.arc(s, c, a, o, r, void 0, i, n);
1148
- return e.onComplete?.(t, l), l;
1149
- }, () => e.configuration, t, zt, e.immediate), (e, t) => null;
1805
+ setup(__props, { emit: __emit }) {
1806
+ useInitializeGameObject((scene) => {
1807
+ const { alpha, endAngle, fillColor, radius, startAngle, x, y } = __props.configuration;
1808
+ const arc = scene.add.arc(x, y, radius, startAngle, endAngle, void 0, fillColor, alpha);
1809
+ __props.onComplete?.(scene, arc);
1810
+ return arc;
1811
+ }, () => __props.configuration, __emit, ArcSetterMap, __props.immediate);
1812
+ return (_ctx, _cache) => {
1813
+ return null;
1814
+ };
1150
1815
  }
1151
- }), Wt = (...e) => {
1152
- k(D.Shutdown, ...e);
1153
- }, Gt = (e, t) => {
1154
- let n = p([]);
1155
- return t ? n.value = e(N(E())) : A((t) => {
1156
- n.value = e(t);
1157
- }), Wt((e) => {
1158
- for (let { key: t } of n.value) t && e.anims.remove(t);
1159
- }), n;
1160
- }, Kt = (e, t) => {
1161
- e.value = {
1162
- ...t,
1163
- onComplete: (...n) => {
1164
- e.value = void 0, t.onComplete?.(...n);
1816
+ });
1817
+ //#endregion
1818
+ //#region src/hooks/onShutdown.ts
1819
+ const onShutdown = (...args) => {
1820
+ pushListener("Shutdown", ...args);
1821
+ };
1822
+ //#endregion
1823
+ //#region src/composables/useAnimations.ts
1824
+ const useAnimations = (createConfigurations, immediate) => {
1825
+ const animations = ref([]);
1826
+ if (immediate) {
1827
+ const sceneKey = useInjectSceneKey();
1828
+ animations.value = createConfigurations(getScene(sceneKey));
1829
+ } else onNextTick((scene) => {
1830
+ animations.value = createConfigurations(scene);
1831
+ });
1832
+ onShutdown((scene) => {
1833
+ for (const { key } of animations.value) {
1834
+ if (!key) continue;
1835
+ scene.anims.remove(key);
1165
1836
  }
1166
- };
1167
- }, qt = (...e) => {
1168
- k(D.Init, ...e);
1169
- }, Jt = (...e) => {
1170
- k(D.Preload, ...e);
1171
- }, Yt = (...e) => {
1172
- k(D.Update, ...e);
1173
- }, Xt = (e, t) => new Promise((n) => {
1174
- e.time.delayedCall(t, () => {
1175
- n();
1176
1837
  });
1177
- }), Zt = C.FileTypes.JSONFile, Qt = class extends Zt {};
1838
+ return animations;
1839
+ };
1840
+ //#endregion
1841
+ //#region src/composables/useTween.ts
1842
+ const useTween = (tween, newTween) => {
1843
+ tween.value = {
1844
+ ...newTween,
1845
+ onComplete: (...args) => {
1846
+ tween.value = void 0;
1847
+ newTween.onComplete?.(...args);
1848
+ }
1849
+ };
1850
+ };
1851
+ //#endregion
1852
+ //#region src/hooks/onInit.ts
1853
+ const onInit = (...args) => {
1854
+ pushListener("Init", ...args);
1855
+ };
1856
+ //#endregion
1857
+ //#region src/hooks/onPreload.ts
1858
+ const onPreload = (...args) => {
1859
+ pushListener("Preload", ...args);
1860
+ };
1861
+ //#endregion
1862
+ //#region src/hooks/onUpdate.ts
1863
+ const onUpdate = (...args) => {
1864
+ pushListener("Update", ...args);
1865
+ };
1866
+ //#endregion
1867
+ //#region src/util/sleepScene.ts
1868
+ const sleepScene = (scene, durationMs) => new Promise((resolve) => {
1869
+ const settle = () => {
1870
+ scene.events.off(Scenes.Events.SHUTDOWN, settle);
1871
+ resolve();
1872
+ };
1873
+ scene.time.delayedCall(durationMs, settle);
1874
+ scene.events.once(Scenes.Events.SHUTDOWN, settle);
1875
+ });
1876
+ //#endregion
1877
+ //#region src/models/plugins/TilemapFile.ts
1878
+ const JSONFile = Loader.FileTypes.JSONFile;
1879
+ var TilemapFile = class extends JSONFile {};
1178
1880
  //#endregion
1179
- export { H as AlphaSetterMap, J as AlphaSingleSetterMap, Ke as AnimationSetterMap, Ut as Arc, zt as ArcSetterMap, Me as BaseTextureSetterMap, Ht as BitmapText, Vt as BitmapTextSetterMap, U as BlendModeSetterMap, Bt as Circle, F as ComputedSizeSetterMap, Rt as Container, Lt as ContainerSetterMap, It as Curve, Ft as CurveSetterMap, I as DepthSetterMap, De as DisplaySizeSetterMap, ye as EVENT_PREFIX, Pt as Ellipse, Nt as EllipseSetterMap, O as ExternalSceneStore, W as FlipSetterMap, Mt as Game, ve as GameObjectEventMap, Oe as GameObjectSetterMap, V as GlobalSetterMap, Ct as Graphics, St as GraphicsSetterMap, xt as Image, bt as ImageSetterMap, T as InjectionKeyMap, yt as IsoBox, vt as IsoBoxSetterMap, ht as IsoSetterMap, _t as IsoTriangle, gt as IsoTriangleSetterMap, D as Lifecycle, mt as Line, pt as LineSetterMap, G as MaskSetterMap, ft as Nineslice, dt as NinesliceSetterMap, L as OriginSetterMap, ut as Particles, lt as ParticlesSetterMap, ct as PathFollower, ot as PathFollowerComponentSetterMap, st as PathFollowerSetterMap, at as Polygon, it as PolygonSetterMap, rt as Rectangle, nt as RectangleSetterMap, K as RenderNodesSetterMap, tt as RenderTexture, et as RenderTextureSetterMap, $e as Scene, R as ScrollFactorSetterMap, Y as ShapeSetterMap, Z as SizeSetterMap, Je as Sprite, qe as SpriteSetterMap, Ge as Star, We as StarSetterMap, kt as TILEMAP_TILED_JSON_EXTERNAL_KEY, Ue as Text, He as TextSetterMap, Ne as TextureCropSetterMap, X as TextureSetterMap, ze as TileSprite, Re as TileSpriteSetterMap, Ot as TiledJSONExternalFile, Be as Tilemap, Qt as TilemapFile, Tt as TilesetFile, q as TintSetterMap, z as TransformSetterMap, Le as Triangle, Ie as TriangleSetterMap, ke as TweenSetterMap, Fe as Video, Pe as VideoSetterMap, B as VisibleSetterMap, je as Zone, Ae as ZoneSetterMap, Qe as createSceneClass, ge as getDepthInsertIndex, be as getEventName, Ee as getInitializeGameObjectLifecycleHook, N as getScene, Ce as getUpdateEvent, xe as isEvent, Te as onCreate, qt as onInit, A as onNextTick, Jt as onPreload, Wt as onShutdown, Yt as onUpdate, _e as pushGameObject, k as pushListener, jt as registerTiledJSONExternalLoader, Ze as resetLifecycleListeners, Q as runLifecycleListeners, Xt as sleep, Gt as useAnimations, Ye as useCameraStore, M as useGame, P as useInitializeGameObject, Se as useInitializeGameObjectEvents, we as useInitializeGameObjectSetters, E as useInjectSceneKey, Xe as useInputStore, j as usePhaserStore, Ve as useTextStore, Kt as useTween };
1881
+ export { AlphaSetterMap, AlphaSingleSetterMap, AnimationSetterMap, _sfc_main as Arc, ArcSetterMap, BaseTextureSetterMap, _sfc_main$1 as BitmapText, BitmapTextSetterMap, BlendModeSetterMap, _sfc_main$2 as Circle, ComputedSizeSetterMap, _sfc_main$3 as Container, ContainerSetterMap, _sfc_main$4 as Curve, CurveSetterMap, DepthSetterMap, DisplaySizeSetterMap, EVENT_PREFIX, _sfc_main$5 as Ellipse, EllipseSetterMap, ExternalSceneStore, FlipSetterMap, _sfc_main$6 as Game, GameObjectEventMap, GameObjectSetterMap, GlobalSetterMap, _sfc_main$7 as Graphics, GraphicsSetterMap, _sfc_main$8 as Image, ImageSetterMap, InjectionKeyMap, _sfc_main$9 as IsoBox, IsoBoxSetterMap, IsoSetterMap, _sfc_main$10 as IsoTriangle, IsoTriangleSetterMap, Lifecycle, _sfc_main$11 as Line, LineSetterMap, MaskSetterMap, _sfc_main$12 as Nineslice, NinesliceSetterMap, OriginSetterMap, _sfc_main$13 as Particles, ParticlesSetterMap, _sfc_main$14 as PathFollower, PathFollowerComponentSetterMap, PathFollowerSetterMap, _sfc_main$15 as Polygon, PolygonSetterMap, _sfc_main$16 as Rectangle, RectangleSetterMap, RenderNodesSetterMap, _sfc_main$17 as RenderTexture, RenderTextureSetterMap, _sfc_main$18 as Scene, ScrollFactorSetterMap, ShapeSetterMap, SizeSetterMap, _sfc_main$19 as Sprite, SpriteSetterMap, _sfc_main$20 as Star, StarSetterMap, TILEMAP_TILED_JSON_EXTERNAL_KEY, _sfc_main$21 as Text, TextSetterMap, TextureCropSetterMap, TextureSetterMap, _sfc_main$22 as TileSprite, TileSpriteSetterMap, TiledJSONExternalFile, _sfc_main$23 as Tilemap, TilemapFile, TilesetFile, TintSetterMap, TransformSetterMap, _sfc_main$24 as Triangle, TriangleSetterMap, TweenSetterMap, _sfc_main$25 as Video, VideoSetterMap, VisibleSetterMap, _sfc_main$26 as Zone, ZoneSetterMap, checkIsEvent, createSceneClass, getDepthInsertIndex, getEventName, getInitializeGameObjectLifecycleHook, getScene, getUpdateEvent, onCreate, onInit, onNextTick, onPreload, onShutdown, onUpdate, pushGameObject, pushListener, registerTiledJSONExternalLoader, resetLifecycleListeners, runLifecycleListeners, sleepScene, useAnimations, useCameraStore, useGame, useInitializeGameObject, useInitializeGameObjectEvents, useInitializeGameObjectSetters, useInjectSceneKey, useInputStore, usePhaserStore, useTextStore, useTween };