vue-phaserjs 4.3.3 → 4.5.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.
- package/README.md +35 -26
- package/dist/index.d.ts +1249 -1000
- package/dist/index.js +601 -286
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,29 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ID_SEPARATOR, InvalidOperationError, NotFoundError, NotInitializedError, Operation, getOrCreate, takeOne, toKebabCase } from "@esposter/shared";
|
|
1
|
+
import { ID_SEPARATOR, InvalidOperationError, NotFoundError, NotInitializedError, Operation, getOrCreate, getResult, takeOne, toKebabCase } from "@esposter/shared";
|
|
3
2
|
import ClickOutside from "phaser4-rex-plugins/plugins/clickoutside.js";
|
|
3
|
+
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, getCurrentInstance, getCurrentScope, inject, markRaw, nextTick, onMounted, onScopeDispose, onUnmounted, openBlock, provide, ref, renderSlot, shallowRef, toValue, useTemplateRef, watch } from "vue";
|
|
4
4
|
import { Cameras, Core, Game, Loader, Scene, Scenes, Tilemaps, Tweens, Utils } from "phaser";
|
|
5
5
|
import { defineStore, storeToRefs } from "pinia";
|
|
6
6
|
import { parseTileset } from "parse-tmx";
|
|
7
|
+
// src/models/emit/GameObjectEvent.ts
|
|
8
|
+
let GameObjectEvent = /* @__PURE__ */ function(GameObjectEvent) {
|
|
9
|
+
GameObjectEvent["Clickoutside"] = "clickoutside";
|
|
10
|
+
GameObjectEvent["Drag"] = "drag";
|
|
11
|
+
GameObjectEvent["Dragend"] = "dragend";
|
|
12
|
+
GameObjectEvent["Dragenter"] = "dragenter";
|
|
13
|
+
GameObjectEvent["Dragleave"] = "dragleave";
|
|
14
|
+
GameObjectEvent["Dragover"] = "dragover";
|
|
15
|
+
GameObjectEvent["Dragstart"] = "dragstart";
|
|
16
|
+
GameObjectEvent["Drop"] = "drop";
|
|
17
|
+
GameObjectEvent["Pointerdown"] = "pointerdown";
|
|
18
|
+
GameObjectEvent["Pointermove"] = "pointermove";
|
|
19
|
+
GameObjectEvent["Pointerout"] = "pointerout";
|
|
20
|
+
GameObjectEvent["Pointerover"] = "pointerover";
|
|
21
|
+
GameObjectEvent["Pointerup"] = "pointerup";
|
|
22
|
+
GameObjectEvent["Wheel"] = "wheel";
|
|
23
|
+
return GameObjectEvent;
|
|
24
|
+
}({});
|
|
7
25
|
// src/services/emit/constants.ts
|
|
8
26
|
const EVENT_PREFIX = "on";
|
|
9
27
|
// src/services/emit/checkIsEvent.ts
|
|
10
28
|
const checkIsEvent = (property) => property.startsWith("on");
|
|
11
29
|
// src/services/emit/GameObjectEventMap.ts
|
|
12
30
|
const GameObjectEventMap = {
|
|
13
|
-
clickoutside: {},
|
|
14
|
-
drag: { drag: true },
|
|
15
|
-
dragend: { drag: true },
|
|
16
|
-
dragenter: { drag: true },
|
|
17
|
-
dragleave: { drag: true },
|
|
18
|
-
dragover: { drag: true },
|
|
19
|
-
dragstart: { drag: true },
|
|
20
|
-
drop: { drag: true },
|
|
21
|
-
pointerdown: { eventIndex: 3 },
|
|
22
|
-
pointermove: { eventIndex: 3 },
|
|
23
|
-
pointerout: { eventIndex: 1 },
|
|
24
|
-
pointerover: { eventIndex: 3 },
|
|
25
|
-
pointerup: { eventIndex: 3 },
|
|
26
|
-
wheel: { eventIndex: 4 }
|
|
31
|
+
["clickoutside"]: {},
|
|
32
|
+
["drag"]: { drag: true },
|
|
33
|
+
["dragend"]: { drag: true },
|
|
34
|
+
["dragenter"]: { drag: true },
|
|
35
|
+
["dragleave"]: { drag: true },
|
|
36
|
+
["dragover"]: { drag: true },
|
|
37
|
+
["dragstart"]: { drag: true },
|
|
38
|
+
["drop"]: { drag: true },
|
|
39
|
+
["pointerdown"]: { eventIndex: 3 },
|
|
40
|
+
["pointermove"]: { eventIndex: 3 },
|
|
41
|
+
["pointerout"]: { eventIndex: 1 },
|
|
42
|
+
["pointerover"]: { eventIndex: 3 },
|
|
43
|
+
["pointerup"]: { eventIndex: 3 },
|
|
44
|
+
["wheel"]: { eventIndex: 4 }
|
|
27
45
|
};
|
|
28
46
|
// src/services/emit/getEventName.ts
|
|
29
47
|
const getEventName = (event) => {
|
|
@@ -89,15 +107,18 @@ const pushListener = (lifecycle, listener, key) => {
|
|
|
89
107
|
const sceneKey = key ?? useInjectSceneKey();
|
|
90
108
|
const listenersMap = getOrCreate(ExternalSceneStore.lifecycleListenersMap, lifecycle, () => /* @__PURE__ */ new Map());
|
|
91
109
|
getOrCreate(listenersMap, sceneKey, () => []).push(listener);
|
|
110
|
+
const removeListener = () => {
|
|
111
|
+
listenersMap.set(sceneKey, (listenersMap.get(sceneKey) ?? []).filter((existingListener) => existingListener !== listener));
|
|
112
|
+
};
|
|
113
|
+
if (lifecycle !== "Shutdown" && getCurrentScope()) onScopeDispose(removeListener);
|
|
114
|
+
return removeListener;
|
|
92
115
|
};
|
|
93
116
|
// src/hooks/onNextTick.ts
|
|
94
|
-
const onNextTick = (...args) =>
|
|
95
|
-
pushListener("NextTick", ...args);
|
|
96
|
-
};
|
|
117
|
+
const onNextTick = (...args) => pushListener("NextTick", ...args);
|
|
97
118
|
// src/services/emit/getUpdateEvent.ts
|
|
98
119
|
const getUpdateEvent = (property) => `update:${toKebabCase(property)}`;
|
|
99
120
|
// src/composables/useInitializeGameObjectSetters.ts
|
|
100
|
-
const useInitializeGameObjectSetters = (gameObject, configuration, emit, setterMap, immediate) => {
|
|
121
|
+
const useInitializeGameObjectSetters = (gameObject, configuration, emit, setterMap, checkIsUnmounted, immediate) => {
|
|
101
122
|
const sceneKey = useInjectSceneKey();
|
|
102
123
|
const setters = [];
|
|
103
124
|
const setterWatchHandles = [];
|
|
@@ -105,16 +126,19 @@ const useInitializeGameObjectSetters = (gameObject, configuration, emit, setterM
|
|
|
105
126
|
const setter = setterMap[key];
|
|
106
127
|
if (!setter) continue;
|
|
107
128
|
const updateEvent = getUpdateEvent(key);
|
|
108
|
-
|
|
109
|
-
setter(targetGameObject, emit)(
|
|
110
|
-
if (
|
|
129
|
+
const applyValue = (targetGameObject, nextValue) => {
|
|
130
|
+
setter(targetGameObject, emit)(nextValue);
|
|
131
|
+
if (nextValue !== void 0) emit(updateEvent, nextValue);
|
|
111
132
|
else if (key in targetGameObject) emit(updateEvent, targetGameObject[key]);
|
|
133
|
+
};
|
|
134
|
+
setters.push((targetGameObject) => {
|
|
135
|
+
applyValue(targetGameObject, value);
|
|
112
136
|
});
|
|
113
137
|
setterWatchHandles.push(watch(() => toValue(configuration)[key], (newValue, oldValue) => {
|
|
114
138
|
if (newValue === oldValue && (newValue === null || typeof newValue !== "object")) return;
|
|
115
139
|
const updater = () => {
|
|
116
|
-
|
|
117
|
-
|
|
140
|
+
if (checkIsUnmounted()) return;
|
|
141
|
+
applyValue(toValue(gameObject), newValue);
|
|
118
142
|
};
|
|
119
143
|
if (immediate) updater();
|
|
120
144
|
else onNextTick(() => {
|
|
@@ -131,21 +155,29 @@ const useInitializeGameObjectSetters = (gameObject, configuration, emit, setterM
|
|
|
131
155
|
};
|
|
132
156
|
};
|
|
133
157
|
// src/hooks/onCreate.ts
|
|
134
|
-
const onCreate = (...args) =>
|
|
135
|
-
pushListener("Create", ...args);
|
|
136
|
-
};
|
|
158
|
+
const onCreate = (...args) => pushListener("Create", ...args);
|
|
137
159
|
// src/services/hooks/getInitializeGameObjectLifecycleHook.ts
|
|
138
160
|
const getInitializeGameObjectLifecycleHook = (sceneKey) => ExternalSceneStore.sceneReadyMap.get(sceneKey) ? onNextTick : onCreate;
|
|
161
|
+
// src/services/shared/stopStartedScene.ts
|
|
162
|
+
const stopStartedScene = (game, sceneKey) => {
|
|
163
|
+
const scene = game.scene.getScene(sceneKey);
|
|
164
|
+
if (!scene) return;
|
|
165
|
+
const { status } = scene.sys.settings;
|
|
166
|
+
if (status >= Scenes.START && status < Scenes.SHUTDOWN) game.scene.stop(sceneKey);
|
|
167
|
+
};
|
|
139
168
|
// src/store/index.ts
|
|
140
169
|
const usePhaserStore = defineStore("phaser", () => {
|
|
141
|
-
|
|
170
|
+
const baseGame = ref();
|
|
171
|
+
const sceneKey = ref();
|
|
172
|
+
const parallelSceneKeys = ref([]);
|
|
142
173
|
const game = computed({
|
|
143
|
-
get: () => baseGame,
|
|
174
|
+
get: () => baseGame.value,
|
|
144
175
|
set: (newGame) => {
|
|
145
|
-
baseGame = newGame;
|
|
176
|
+
baseGame.value = newGame && markRaw(newGame);
|
|
177
|
+
sceneKey.value = void 0;
|
|
178
|
+
parallelSceneKeys.value = [];
|
|
146
179
|
}
|
|
147
180
|
});
|
|
148
|
-
const sceneKey = ref();
|
|
149
181
|
const isSameScene = (newSceneKey) => newSceneKey === sceneKey.value;
|
|
150
182
|
const switchToScene = async (newSceneKey) => {
|
|
151
183
|
if (isSameScene(newSceneKey)) return;
|
|
@@ -154,10 +186,9 @@ const usePhaserStore = defineStore("phaser", () => {
|
|
|
154
186
|
const oldSceneKey = sceneKey.value;
|
|
155
187
|
sceneKey.value = newSceneKey;
|
|
156
188
|
await nextTick();
|
|
157
|
-
if (oldSceneKey
|
|
189
|
+
if (oldSceneKey) stopStartedScene(activeGame, oldSceneKey);
|
|
158
190
|
activeGame.scene.start(newSceneKey);
|
|
159
191
|
};
|
|
160
|
-
const parallelSceneKeys = ref([]);
|
|
161
192
|
const prioritizedParallelSceneKeys = ref([]);
|
|
162
193
|
const launchParallelScene = (scene, targetSceneKey) => {
|
|
163
194
|
if (parallelSceneKeys.value.includes(targetSceneKey)) return;
|
|
@@ -205,13 +236,16 @@ const pushGameObject = (parentContainer, configuration, gameObject) => {
|
|
|
205
236
|
// src/composables/useInitializeGameObject.ts
|
|
206
237
|
const useInitializeGameObject = (create, configuration, emit, setterMap, immediate) => {
|
|
207
238
|
let gameObject;
|
|
208
|
-
|
|
239
|
+
let isCreated = false;
|
|
240
|
+
let isUnmounted = false;
|
|
241
|
+
const { initializeGameObjectSetters, setterWatchHandles } = useInitializeGameObjectSetters(() => gameObject, configuration, emit, setterMap, () => isUnmounted, immediate);
|
|
209
242
|
const { eventStopHandles, initializeGameObjectEvents } = useInitializeGameObjectEvents();
|
|
210
243
|
const parentContainer = inject(InjectionKeyMap.ParentContainer, void 0);
|
|
211
244
|
const sceneKey = useInjectSceneKey();
|
|
212
245
|
const lifecycleHook = getInitializeGameObjectLifecycleHook(sceneKey);
|
|
213
246
|
const initializeGameObject = (scene) => {
|
|
214
247
|
gameObject = create(scene);
|
|
248
|
+
isCreated = true;
|
|
215
249
|
initializeGameObjectSetters(gameObject);
|
|
216
250
|
initializeGameObjectEvents(gameObject, emit, scene);
|
|
217
251
|
};
|
|
@@ -229,33 +263,59 @@ const useInitializeGameObject = (create, configuration, emit, setterMap, immedia
|
|
|
229
263
|
pushToParentContainer();
|
|
230
264
|
});
|
|
231
265
|
onUnmounted(() => {
|
|
266
|
+
isUnmounted = true;
|
|
232
267
|
for (const setterWatchHandle of setterWatchHandles) setterWatchHandle();
|
|
233
268
|
for (const eventStopHandle of eventStopHandles) eventStopHandle();
|
|
234
|
-
gameObject.destroy();
|
|
269
|
+
if (isCreated) gameObject.destroy();
|
|
235
270
|
});
|
|
236
271
|
};
|
|
272
|
+
// src/models/setterMap/ArcSetter.ts
|
|
273
|
+
let ArcSetter = /* @__PURE__ */ function(ArcSetter) {
|
|
274
|
+
ArcSetter["ClosePath"] = "closePath";
|
|
275
|
+
ArcSetter["EndAngle"] = "endAngle";
|
|
276
|
+
ArcSetter["Radius"] = "radius";
|
|
277
|
+
ArcSetter["StartAngle"] = "startAngle";
|
|
278
|
+
return ArcSetter;
|
|
279
|
+
}({});
|
|
280
|
+
// src/models/setterMap/global/GameObjectSetter.ts
|
|
281
|
+
let GameObjectSetter = /* @__PURE__ */ function(GameObjectSetter) {
|
|
282
|
+
GameObjectSetter["Active"] = "active";
|
|
283
|
+
return GameObjectSetter;
|
|
284
|
+
}({});
|
|
237
285
|
// src/services/setterMap/global/GameObjectSetterMap.ts
|
|
238
|
-
const GameObjectSetterMap = { active: (gameObject) => (value) => {
|
|
286
|
+
const GameObjectSetterMap = { ["active"]: (gameObject) => (value) => {
|
|
239
287
|
if (value === void 0) return;
|
|
240
288
|
gameObject.setActive(value);
|
|
241
289
|
} };
|
|
290
|
+
// src/models/setterMap/global/TweenSetter.ts
|
|
291
|
+
let TweenSetter = /* @__PURE__ */ function(TweenSetter) {
|
|
292
|
+
TweenSetter["Tween"] = "tween";
|
|
293
|
+
TweenSetter["Tweenchain"] = "tweenchain";
|
|
294
|
+
return TweenSetter;
|
|
295
|
+
}({});
|
|
242
296
|
// src/services/setterMap/global/TweenSetterMap.ts
|
|
297
|
+
const activeTweens = /* @__PURE__ */ new WeakMap();
|
|
298
|
+
const replaceActiveTween = (gameObject, tween, onComplete) => {
|
|
299
|
+
activeTweens.get(gameObject)?.destroy();
|
|
300
|
+
activeTweens.set(gameObject, tween);
|
|
301
|
+
tween.on(Tweens.Events.TWEEN_COMPLETE, onComplete);
|
|
302
|
+
};
|
|
243
303
|
const TweenSetterMap = {
|
|
244
|
-
tween: (gameObject, emit) => (value) => {
|
|
304
|
+
["tween"]: (gameObject, emit) => (value) => {
|
|
245
305
|
if (!value) return;
|
|
246
|
-
gameObject.scene.add.tween({
|
|
306
|
+
replaceActiveTween(gameObject, gameObject.scene.add.tween({
|
|
247
307
|
...value,
|
|
248
308
|
targets: gameObject
|
|
249
|
-
})
|
|
309
|
+
}), () => {
|
|
250
310
|
emit("update:tween", void 0);
|
|
251
311
|
});
|
|
252
312
|
},
|
|
253
|
-
tweenchain: (gameObject, emit) => (value) => {
|
|
313
|
+
["tweenchain"]: (gameObject, emit) => (value) => {
|
|
254
314
|
if (!value) return;
|
|
255
|
-
gameObject.scene.add.tweenchain(value.map((configuration) => ({
|
|
315
|
+
replaceActiveTween(gameObject, gameObject.scene.add.tweenchain(value.map((configuration) => ({
|
|
256
316
|
...configuration,
|
|
257
317
|
targets: gameObject
|
|
258
|
-
})))
|
|
318
|
+
}))), () => {
|
|
259
319
|
emit("update:tweenchain", void 0);
|
|
260
320
|
});
|
|
261
321
|
}
|
|
@@ -265,54 +325,91 @@ const GlobalSetterMap = {
|
|
|
265
325
|
...TweenSetterMap,
|
|
266
326
|
...GameObjectSetterMap
|
|
267
327
|
};
|
|
328
|
+
// src/models/setterMap/shared/ShapeSetter.ts
|
|
329
|
+
let ShapeSetter = /* @__PURE__ */ function(ShapeSetter) {
|
|
330
|
+
ShapeSetter["FillAlpha"] = "fillAlpha";
|
|
331
|
+
ShapeSetter["FillColor"] = "fillColor";
|
|
332
|
+
ShapeSetter["StrokeStyle"] = "strokeStyle";
|
|
333
|
+
return ShapeSetter;
|
|
334
|
+
}({});
|
|
335
|
+
// src/models/setterMap/components/AlphaSingleSetter.ts
|
|
336
|
+
let AlphaSingleSetter = /* @__PURE__ */ function(AlphaSingleSetter) {
|
|
337
|
+
AlphaSingleSetter["Alpha"] = "alpha";
|
|
338
|
+
return AlphaSingleSetter;
|
|
339
|
+
}({});
|
|
268
340
|
// src/services/setterMap/components/AlphaSingleSetterMap.ts
|
|
269
|
-
const AlphaSingleSetterMap = { alpha: (gameObject) => (value) => {
|
|
341
|
+
const AlphaSingleSetterMap = { ["alpha"]: (gameObject) => (value) => {
|
|
270
342
|
if (value === void 0) return;
|
|
271
343
|
gameObject.setAlpha(value);
|
|
272
344
|
} };
|
|
345
|
+
// src/models/setterMap/components/DisplaySizeSetter.ts
|
|
346
|
+
let DisplaySizeSetter = /* @__PURE__ */ function(DisplaySizeSetter) {
|
|
347
|
+
DisplaySizeSetter["DisplayHeight"] = "displayHeight";
|
|
348
|
+
DisplaySizeSetter["DisplayWidth"] = "displayWidth";
|
|
349
|
+
return DisplaySizeSetter;
|
|
350
|
+
}({});
|
|
273
351
|
// src/services/setterMap/components/DisplaySizeSetterMap.ts
|
|
274
352
|
const DisplaySizeSetterMap = {
|
|
275
|
-
displayHeight: (gameObject) => (value) => {
|
|
353
|
+
["displayHeight"]: (gameObject) => (value) => {
|
|
276
354
|
if (value === void 0) return;
|
|
277
355
|
gameObject.setDisplaySize(gameObject.displayWidth, value);
|
|
278
356
|
},
|
|
279
|
-
displayWidth: (gameObject) => (value) => {
|
|
357
|
+
["displayWidth"]: (gameObject) => (value) => {
|
|
280
358
|
if (value === void 0) return;
|
|
281
359
|
gameObject.setDisplaySize(value, gameObject.displayHeight);
|
|
282
360
|
}
|
|
283
361
|
};
|
|
362
|
+
// src/models/setterMap/components/OriginSetter.ts
|
|
363
|
+
let OriginSetter = /* @__PURE__ */ function(OriginSetter) {
|
|
364
|
+
OriginSetter["DisplayOriginX"] = "displayOriginX";
|
|
365
|
+
OriginSetter["DisplayOriginY"] = "displayOriginY";
|
|
366
|
+
OriginSetter["Origin"] = "origin";
|
|
367
|
+
OriginSetter["OriginX"] = "originX";
|
|
368
|
+
OriginSetter["OriginY"] = "originY";
|
|
369
|
+
return OriginSetter;
|
|
370
|
+
}({});
|
|
284
371
|
// src/services/setterMap/components/OriginSetterMap.ts
|
|
285
372
|
const OriginSetterMap = {
|
|
286
|
-
displayOriginX: (gameObject) => (value) => {
|
|
373
|
+
["displayOriginX"]: (gameObject) => (value) => {
|
|
287
374
|
if (value === void 0) return;
|
|
288
375
|
gameObject.setDisplayOrigin(value, gameObject.displayOriginY);
|
|
289
376
|
},
|
|
290
|
-
displayOriginY: (gameObject) => (value) => {
|
|
377
|
+
["displayOriginY"]: (gameObject) => (value) => {
|
|
291
378
|
if (value === void 0) return;
|
|
292
379
|
gameObject.setDisplayOrigin(gameObject.displayOriginX, value);
|
|
293
380
|
},
|
|
294
|
-
origin: (gameObject) => (value) => {
|
|
381
|
+
["origin"]: (gameObject) => (value) => {
|
|
295
382
|
if (value === void 0) return;
|
|
296
383
|
gameObject.setOrigin(value, value);
|
|
297
384
|
},
|
|
298
|
-
originX: (gameObject) => (value) => {
|
|
385
|
+
["originX"]: (gameObject) => (value) => {
|
|
299
386
|
if (value === void 0) return;
|
|
300
387
|
gameObject.setOrigin(value, gameObject.originY);
|
|
301
388
|
},
|
|
302
|
-
originY: (gameObject) => (value) => {
|
|
389
|
+
["originY"]: (gameObject) => (value) => {
|
|
303
390
|
if (value === void 0) return;
|
|
304
391
|
gameObject.setOrigin(gameObject.originX, value);
|
|
305
392
|
}
|
|
306
393
|
};
|
|
307
394
|
// src/services/setterMap/components/RenderNodesSetterMap.ts
|
|
308
395
|
const RenderNodesSetterMap = {};
|
|
396
|
+
// src/models/setterMap/components/BlendModeSetter.ts
|
|
397
|
+
let BlendModeSetter = /* @__PURE__ */ function(BlendModeSetter) {
|
|
398
|
+
BlendModeSetter["BlendMode"] = "blendMode";
|
|
399
|
+
return BlendModeSetter;
|
|
400
|
+
}({});
|
|
309
401
|
// src/services/setterMap/components/BlendModeSetterMap.ts
|
|
310
|
-
const BlendModeSetterMap = { blendMode: (gameObject) => (value) => {
|
|
402
|
+
const BlendModeSetterMap = { ["blendMode"]: (gameObject) => (value) => {
|
|
311
403
|
if (value === void 0) return;
|
|
312
404
|
gameObject.setBlendMode(value);
|
|
313
405
|
} };
|
|
406
|
+
// src/models/setterMap/components/DepthSetter.ts
|
|
407
|
+
let DepthSetter = /* @__PURE__ */ function(DepthSetter) {
|
|
408
|
+
DepthSetter["Depth"] = "depth";
|
|
409
|
+
return DepthSetter;
|
|
410
|
+
}({});
|
|
314
411
|
// src/services/setterMap/components/DepthSetterMap.ts
|
|
315
|
-
const DepthSetterMap = { depth: (gameObject) => (value) => {
|
|
412
|
+
const DepthSetterMap = { ["depth"]: (gameObject) => (value) => {
|
|
316
413
|
if (value === void 0) return;
|
|
317
414
|
gameObject.setDepth(value);
|
|
318
415
|
if (!gameObject.parentContainer) return;
|
|
@@ -324,67 +421,97 @@ const DepthSetterMap = { depth: (gameObject) => (value) => {
|
|
|
324
421
|
gameObject.parentContainer.moveTo(gameObject, currentIndex < depthInsertIndex ? depthInsertIndex - 1 : depthInsertIndex);
|
|
325
422
|
}
|
|
326
423
|
} };
|
|
424
|
+
// src/models/setterMap/components/MaskSetter.ts
|
|
425
|
+
let MaskSetter = /* @__PURE__ */ function(MaskSetter) {
|
|
426
|
+
MaskSetter["Mask"] = "mask";
|
|
427
|
+
return MaskSetter;
|
|
428
|
+
}({});
|
|
327
429
|
// src/services/setterMap/components/MaskSetterMap.ts
|
|
328
|
-
const MaskSetterMap = { mask: (gameObject) => (value) => {
|
|
430
|
+
const MaskSetterMap = { ["mask"]: (gameObject) => (value) => {
|
|
329
431
|
if (!value) return;
|
|
330
432
|
gameObject.setMask(value);
|
|
331
433
|
} };
|
|
434
|
+
// src/models/setterMap/components/ScrollFactorSetter.ts
|
|
435
|
+
let ScrollFactorSetter = /* @__PURE__ */ function(ScrollFactorSetter) {
|
|
436
|
+
ScrollFactorSetter["ScrollFactor"] = "scrollFactor";
|
|
437
|
+
ScrollFactorSetter["ScrollFactorX"] = "scrollFactorX";
|
|
438
|
+
ScrollFactorSetter["ScrollFactorY"] = "scrollFactorY";
|
|
439
|
+
return ScrollFactorSetter;
|
|
440
|
+
}({});
|
|
332
441
|
// src/services/setterMap/components/ScrollFactorSetterMap.ts
|
|
333
442
|
const ScrollFactorSetterMap = {
|
|
334
|
-
scrollFactor: (gameObject) => (value) => {
|
|
443
|
+
["scrollFactor"]: (gameObject) => (value) => {
|
|
335
444
|
if (value === void 0) return;
|
|
336
445
|
gameObject.setScrollFactor(value, value);
|
|
337
446
|
},
|
|
338
|
-
scrollFactorX: (gameObject) => (value) => {
|
|
447
|
+
["scrollFactorX"]: (gameObject) => (value) => {
|
|
339
448
|
if (value === void 0) return;
|
|
340
449
|
gameObject.setScrollFactor(value, gameObject.scrollFactorY);
|
|
341
450
|
},
|
|
342
|
-
scrollFactorY: (gameObject) => (value) => {
|
|
451
|
+
["scrollFactorY"]: (gameObject) => (value) => {
|
|
343
452
|
if (value === void 0) return;
|
|
344
453
|
gameObject.setScrollFactor(gameObject.scrollFactorX, value);
|
|
345
454
|
}
|
|
346
455
|
};
|
|
456
|
+
// src/models/setterMap/components/TransformSetter.ts
|
|
457
|
+
let TransformSetter = /* @__PURE__ */ function(TransformSetter) {
|
|
458
|
+
TransformSetter["Angle"] = "angle";
|
|
459
|
+
TransformSetter["Rotation"] = "rotation";
|
|
460
|
+
TransformSetter["Scale"] = "scale";
|
|
461
|
+
TransformSetter["ScaleX"] = "scaleX";
|
|
462
|
+
TransformSetter["ScaleY"] = "scaleY";
|
|
463
|
+
TransformSetter["W"] = "w";
|
|
464
|
+
TransformSetter["X"] = "x";
|
|
465
|
+
TransformSetter["Y"] = "y";
|
|
466
|
+
TransformSetter["Z"] = "z";
|
|
467
|
+
return TransformSetter;
|
|
468
|
+
}({});
|
|
347
469
|
// src/services/setterMap/components/TransformSetterMap.ts
|
|
348
470
|
const TransformSetterMap = {
|
|
349
|
-
angle: (gameObject) => (value) => {
|
|
471
|
+
["angle"]: (gameObject) => (value) => {
|
|
350
472
|
if (value === void 0) return;
|
|
351
473
|
gameObject.setAngle(value);
|
|
352
474
|
},
|
|
353
|
-
rotation: (gameObject) => (value) => {
|
|
475
|
+
["rotation"]: (gameObject) => (value) => {
|
|
354
476
|
if (value === void 0) return;
|
|
355
477
|
gameObject.setRotation(value);
|
|
356
478
|
},
|
|
357
|
-
scale: (gameObject) => (value) => {
|
|
479
|
+
["scale"]: (gameObject) => (value) => {
|
|
358
480
|
if (value === void 0) return;
|
|
359
481
|
gameObject.setScale(value, value);
|
|
360
482
|
},
|
|
361
|
-
scaleX: (gameObject) => (value) => {
|
|
483
|
+
["scaleX"]: (gameObject) => (value) => {
|
|
362
484
|
if (value === void 0) return;
|
|
363
485
|
gameObject.setScale(value, gameObject.scaleY);
|
|
364
486
|
},
|
|
365
|
-
scaleY: (gameObject) => (value) => {
|
|
487
|
+
["scaleY"]: (gameObject) => (value) => {
|
|
366
488
|
if (value === void 0) return;
|
|
367
489
|
gameObject.setScale(gameObject.scaleX, value);
|
|
368
490
|
},
|
|
369
|
-
w: (gameObject) => (value) => {
|
|
491
|
+
["w"]: (gameObject) => (value) => {
|
|
370
492
|
if (value === void 0) return;
|
|
371
493
|
gameObject.setW(value);
|
|
372
494
|
},
|
|
373
|
-
x: (gameObject) => (value) => {
|
|
495
|
+
["x"]: (gameObject) => (value) => {
|
|
374
496
|
if (value === void 0) return;
|
|
375
497
|
gameObject.setX(value);
|
|
376
498
|
},
|
|
377
|
-
y: (gameObject) => (value) => {
|
|
499
|
+
["y"]: (gameObject) => (value) => {
|
|
378
500
|
if (value === void 0) return;
|
|
379
501
|
gameObject.setY(value);
|
|
380
502
|
},
|
|
381
|
-
z: (gameObject) => (value) => {
|
|
503
|
+
["z"]: (gameObject) => (value) => {
|
|
382
504
|
if (value === void 0) return;
|
|
383
505
|
gameObject.setZ(value);
|
|
384
506
|
}
|
|
385
507
|
};
|
|
508
|
+
// src/models/setterMap/components/VisibleSetter.ts
|
|
509
|
+
let VisibleSetter = /* @__PURE__ */ function(VisibleSetter) {
|
|
510
|
+
VisibleSetter["Visible"] = "visible";
|
|
511
|
+
return VisibleSetter;
|
|
512
|
+
}({});
|
|
386
513
|
// src/services/setterMap/components/VisibleSetterMap.ts
|
|
387
|
-
const VisibleSetterMap = { visible: (gameObject) => (value) => {
|
|
514
|
+
const VisibleSetterMap = { ["visible"]: (gameObject) => (value) => {
|
|
388
515
|
if (value === void 0) return;
|
|
389
516
|
gameObject.setVisible(value);
|
|
390
517
|
} };
|
|
@@ -405,32 +532,33 @@ const ShapeSetterMap = {
|
|
|
405
532
|
...GameObjectSetterMap,
|
|
406
533
|
...OriginSetterMap,
|
|
407
534
|
...RenderNodesSetterMap,
|
|
408
|
-
fillAlpha: (gameObject) => (value) => {
|
|
409
|
-
|
|
535
|
+
["fillAlpha"]: (gameObject) => (value) => {
|
|
536
|
+
if (value === void 0) return;
|
|
537
|
+
gameObject.fillAlpha = value;
|
|
410
538
|
},
|
|
411
|
-
fillColor: (gameObject) => (value) => {
|
|
539
|
+
["fillColor"]: (gameObject) => (value) => {
|
|
412
540
|
gameObject.setFillStyle(value, gameObject.fillAlpha);
|
|
413
541
|
},
|
|
414
|
-
strokeStyle: (gameObject) => (value) => {
|
|
542
|
+
["strokeStyle"]: (gameObject) => (value) => {
|
|
415
543
|
if (!value) return;
|
|
416
544
|
gameObject.setStrokeStyle(...value);
|
|
417
545
|
}
|
|
418
546
|
};
|
|
419
547
|
// src/services/setterMap/ArcSetterMap.ts
|
|
420
548
|
const ArcSetterMap = {
|
|
421
|
-
closePath: (gameObject) => (value) => {
|
|
549
|
+
["closePath"]: (gameObject) => (value) => {
|
|
422
550
|
if (value === void 0) return;
|
|
423
551
|
gameObject.setClosePath(value);
|
|
424
552
|
},
|
|
425
|
-
endAngle: (gameObject) => (value) => {
|
|
553
|
+
["endAngle"]: (gameObject) => (value) => {
|
|
426
554
|
if (value === void 0) return;
|
|
427
555
|
gameObject.setEndAngle(value);
|
|
428
556
|
},
|
|
429
|
-
radius: (gameObject) => (value) => {
|
|
557
|
+
["radius"]: (gameObject) => (value) => {
|
|
430
558
|
if (value === void 0) return;
|
|
431
559
|
gameObject.setRadius(value);
|
|
432
560
|
},
|
|
433
|
-
startAngle: (gameObject) => (value) => {
|
|
561
|
+
["startAngle"]: (gameObject) => (value) => {
|
|
434
562
|
if (value === void 0) return;
|
|
435
563
|
gameObject.setStartAngle(value);
|
|
436
564
|
},
|
|
@@ -438,7 +566,7 @@ const ArcSetterMap = {
|
|
|
438
566
|
...GlobalSetterMap
|
|
439
567
|
};
|
|
440
568
|
// src/components/Arc.vue
|
|
441
|
-
const _sfc_main =
|
|
569
|
+
const _sfc_main = {
|
|
442
570
|
__name: "Arc",
|
|
443
571
|
props: {
|
|
444
572
|
configuration: {},
|
|
@@ -456,49 +584,80 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
456
584
|
return null;
|
|
457
585
|
};
|
|
458
586
|
}
|
|
459
|
-
}
|
|
587
|
+
};
|
|
588
|
+
// src/models/setterMap/BitmapTextSetter.ts
|
|
589
|
+
let BitmapTextSetter = /* @__PURE__ */ function(BitmapTextSetter) {
|
|
590
|
+
BitmapTextSetter["Align"] = "align";
|
|
591
|
+
BitmapTextSetter["DropShadow"] = "dropShadow";
|
|
592
|
+
BitmapTextSetter["Font"] = "font";
|
|
593
|
+
BitmapTextSetter["FontSize"] = "fontSize";
|
|
594
|
+
BitmapTextSetter["LetterSpacing"] = "letterSpacing";
|
|
595
|
+
BitmapTextSetter["LineSpacing"] = "lineSpacing";
|
|
596
|
+
BitmapTextSetter["MaxWidth"] = "maxWidth";
|
|
597
|
+
BitmapTextSetter["Text"] = "text";
|
|
598
|
+
BitmapTextSetter["WordWrapCharCode"] = "wordWrapCharCode";
|
|
599
|
+
return BitmapTextSetter;
|
|
600
|
+
}({});
|
|
601
|
+
// src/models/setterMap/components/AlphaSetter.ts
|
|
602
|
+
let AlphaSetter = /* @__PURE__ */ function(AlphaSetter) {
|
|
603
|
+
AlphaSetter["Alpha"] = "alpha";
|
|
604
|
+
AlphaSetter["AlphaBottomLeft"] = "alphaBottomLeft";
|
|
605
|
+
AlphaSetter["AlphaBottomRight"] = "alphaBottomRight";
|
|
606
|
+
AlphaSetter["AlphaTopLeft"] = "alphaTopLeft";
|
|
607
|
+
AlphaSetter["AlphaTopRight"] = "alphaTopRight";
|
|
608
|
+
return AlphaSetter;
|
|
609
|
+
}({});
|
|
460
610
|
// src/services/setterMap/components/AlphaSetterMap.ts
|
|
461
611
|
const AlphaSetterMap = {
|
|
462
|
-
alpha: (gameObject) => (value) => {
|
|
612
|
+
["alpha"]: (gameObject) => (value) => {
|
|
463
613
|
if (value === void 0) return;
|
|
464
614
|
gameObject.setAlpha(value, value, value, value);
|
|
465
615
|
},
|
|
466
|
-
alphaBottomLeft: (gameObject) => (value) => {
|
|
616
|
+
["alphaBottomLeft"]: (gameObject) => (value) => {
|
|
467
617
|
if (value === void 0) return;
|
|
468
618
|
gameObject.setAlpha(gameObject.alphaTopLeft, gameObject.alphaTopRight, value, gameObject.alphaBottomRight);
|
|
469
619
|
},
|
|
470
|
-
alphaBottomRight: (gameObject) => (value) => {
|
|
620
|
+
["alphaBottomRight"]: (gameObject) => (value) => {
|
|
471
621
|
if (value === void 0) return;
|
|
472
622
|
gameObject.setAlpha(gameObject.alphaTopLeft, gameObject.alphaTopRight, gameObject.alphaBottomLeft, value);
|
|
473
623
|
},
|
|
474
|
-
alphaTopLeft: (gameObject) => (value) => {
|
|
624
|
+
["alphaTopLeft"]: (gameObject) => (value) => {
|
|
475
625
|
if (value === void 0) return;
|
|
476
626
|
gameObject.setAlpha(value, gameObject.alphaTopRight, gameObject.alphaBottomLeft, gameObject.alphaBottomRight);
|
|
477
627
|
},
|
|
478
|
-
alphaTopRight: (gameObject) => (value) => {
|
|
628
|
+
["alphaTopRight"]: (gameObject) => (value) => {
|
|
479
629
|
if (value === void 0) return;
|
|
480
630
|
gameObject.setAlpha(gameObject.alphaTopLeft, value, gameObject.alphaBottomLeft, gameObject.alphaBottomRight);
|
|
481
631
|
}
|
|
482
632
|
};
|
|
633
|
+
// src/models/setterMap/components/TintSetter.ts
|
|
634
|
+
let TintSetter = /* @__PURE__ */ function(TintSetter) {
|
|
635
|
+
TintSetter["Tint"] = "tint";
|
|
636
|
+
TintSetter["TintBottomLeft"] = "tintBottomLeft";
|
|
637
|
+
TintSetter["TintBottomRight"] = "tintBottomRight";
|
|
638
|
+
TintSetter["TintTopLeft"] = "tintTopLeft";
|
|
639
|
+
TintSetter["TintTopRight"] = "tintTopRight";
|
|
640
|
+
return TintSetter;
|
|
641
|
+
}({});
|
|
483
642
|
// src/services/setterMap/components/TintSetterMap.ts
|
|
484
643
|
const TintSetterMap = {
|
|
485
|
-
tint: (gameObject) => (value) => {
|
|
644
|
+
["tint"]: (gameObject) => (value) => {
|
|
486
645
|
if (value === void 0) return;
|
|
487
646
|
gameObject.setTint(value, value, value, value);
|
|
488
647
|
},
|
|
489
|
-
tintBottomLeft: (gameObject) => (value) => {
|
|
648
|
+
["tintBottomLeft"]: (gameObject) => (value) => {
|
|
490
649
|
if (value === void 0) return;
|
|
491
650
|
gameObject.setTint(gameObject.tintTopLeft, gameObject.tintTopRight, value, gameObject.tintBottomRight);
|
|
492
651
|
},
|
|
493
|
-
tintBottomRight: (gameObject) => (value) => {
|
|
652
|
+
["tintBottomRight"]: (gameObject) => (value) => {
|
|
494
653
|
if (value === void 0) return;
|
|
495
654
|
gameObject.setTint(gameObject.tintTopLeft, gameObject.tintTopRight, gameObject.tintBottomLeft, value);
|
|
496
655
|
},
|
|
497
|
-
tintTopLeft: (gameObject) => (value) => {
|
|
656
|
+
["tintTopLeft"]: (gameObject) => (value) => {
|
|
498
657
|
if (value === void 0) return;
|
|
499
658
|
gameObject.setTint(value, gameObject.tintTopRight, gameObject.tintBottomLeft, gameObject.tintBottomRight);
|
|
500
659
|
},
|
|
501
|
-
tintTopRight: (gameObject) => (value) => {
|
|
660
|
+
["tintTopRight"]: (gameObject) => (value) => {
|
|
502
661
|
if (value === void 0) return;
|
|
503
662
|
gameObject.setTint(gameObject.tintTopLeft, value, gameObject.tintBottomLeft, gameObject.tintBottomRight);
|
|
504
663
|
}
|
|
@@ -514,46 +673,46 @@ const RenderableSetterMap = {
|
|
|
514
673
|
};
|
|
515
674
|
// src/services/setterMap/BitmapTextSetterMap.ts
|
|
516
675
|
const BitmapTextSetterMap = {
|
|
517
|
-
align: (gameObject) => (value) => {
|
|
676
|
+
["align"]: (gameObject) => (value) => {
|
|
518
677
|
if (value === void 0) return;
|
|
519
678
|
gameObject.align = value;
|
|
520
679
|
},
|
|
521
|
-
dropShadow: (gameObject) => (value) => {
|
|
680
|
+
["dropShadow"]: (gameObject) => (value) => {
|
|
522
681
|
if (!value) return;
|
|
523
682
|
gameObject.setDropShadow(...value);
|
|
524
683
|
},
|
|
525
|
-
font: (gameObject) => (value) => {
|
|
684
|
+
["font"]: (gameObject) => (value) => {
|
|
526
685
|
if (!value) return;
|
|
527
686
|
gameObject.setFont(value);
|
|
528
687
|
},
|
|
529
|
-
fontSize: (gameObject) => (value) => {
|
|
688
|
+
["fontSize"]: (gameObject) => (value) => {
|
|
530
689
|
if (value === void 0) return;
|
|
531
690
|
gameObject.setFontSize(value);
|
|
532
691
|
},
|
|
533
|
-
letterSpacing: (gameObject) => (value) => {
|
|
692
|
+
["letterSpacing"]: (gameObject) => (value) => {
|
|
534
693
|
if (value === void 0) return;
|
|
535
694
|
gameObject.setLetterSpacing(value);
|
|
536
695
|
},
|
|
537
|
-
lineSpacing: (gameObject) => (value) => {
|
|
696
|
+
["lineSpacing"]: (gameObject) => (value) => {
|
|
538
697
|
if (value === void 0) return;
|
|
539
698
|
gameObject.setLineSpacing(value);
|
|
540
699
|
},
|
|
541
|
-
maxWidth: (gameObject) => (value) => {
|
|
700
|
+
["maxWidth"]: (gameObject) => (value) => {
|
|
542
701
|
if (value === void 0) return;
|
|
543
702
|
gameObject.setMaxWidth(value);
|
|
544
703
|
},
|
|
545
|
-
text: (gameObject) => (value) => {
|
|
704
|
+
["text"]: (gameObject) => (value) => {
|
|
546
705
|
if (value === void 0) return;
|
|
547
706
|
gameObject.setText(value);
|
|
548
707
|
},
|
|
549
|
-
wordWrapCharCode: (gameObject) => (value) => {
|
|
708
|
+
["wordWrapCharCode"]: (gameObject) => (value) => {
|
|
550
709
|
if (value === void 0) return;
|
|
551
710
|
gameObject.wordWrapCharCode = value;
|
|
552
711
|
},
|
|
553
712
|
...RenderableSetterMap
|
|
554
713
|
};
|
|
555
714
|
// src/components/BitmapText.vue
|
|
556
|
-
const _sfc_main$1 =
|
|
715
|
+
const _sfc_main$1 = {
|
|
557
716
|
__name: "BitmapText",
|
|
558
717
|
props: {
|
|
559
718
|
configuration: {},
|
|
@@ -571,9 +730,9 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
571
730
|
return null;
|
|
572
731
|
};
|
|
573
732
|
}
|
|
574
|
-
}
|
|
733
|
+
};
|
|
575
734
|
// src/components/Circle.vue
|
|
576
|
-
const _sfc_main$2 =
|
|
735
|
+
const _sfc_main$2 = {
|
|
577
736
|
__name: "Circle",
|
|
578
737
|
props: {
|
|
579
738
|
configuration: {},
|
|
@@ -591,7 +750,7 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
591
750
|
return null;
|
|
592
751
|
};
|
|
593
752
|
}
|
|
594
|
-
}
|
|
753
|
+
};
|
|
595
754
|
// src/services/setterMap/ContainerSetterMap.ts
|
|
596
755
|
const ContainerSetterMap = {
|
|
597
756
|
...AlphaSingleSetterMap,
|
|
@@ -599,7 +758,7 @@ const ContainerSetterMap = {
|
|
|
599
758
|
...GlobalSetterMap
|
|
600
759
|
};
|
|
601
760
|
// src/components/Container.vue
|
|
602
|
-
const _sfc_main$3 =
|
|
761
|
+
const _sfc_main$3 = {
|
|
603
762
|
__name: "Container",
|
|
604
763
|
props: {
|
|
605
764
|
configuration: { default: () => ({}) },
|
|
@@ -619,10 +778,15 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
|
619
778
|
return renderSlot(_ctx.$slots, "default");
|
|
620
779
|
};
|
|
621
780
|
}
|
|
622
|
-
}
|
|
781
|
+
};
|
|
782
|
+
// src/models/setterMap/CurveSetter.ts
|
|
783
|
+
let CurveSetter = /* @__PURE__ */ function(CurveSetter) {
|
|
784
|
+
CurveSetter["Smoothness"] = "smoothness";
|
|
785
|
+
return CurveSetter;
|
|
786
|
+
}({});
|
|
623
787
|
// src/services/setterMap/CurveSetterMap.ts
|
|
624
788
|
const CurveSetterMap = {
|
|
625
|
-
smoothness: (gameObject) => (value) => {
|
|
789
|
+
["smoothness"]: (gameObject) => (value) => {
|
|
626
790
|
if (value === void 0) return;
|
|
627
791
|
gameObject.setSmoothness(value);
|
|
628
792
|
},
|
|
@@ -630,7 +794,7 @@ const CurveSetterMap = {
|
|
|
630
794
|
...GlobalSetterMap
|
|
631
795
|
};
|
|
632
796
|
// src/components/Curve.vue
|
|
633
|
-
const _sfc_main$4 =
|
|
797
|
+
const _sfc_main$4 = {
|
|
634
798
|
__name: "Curve",
|
|
635
799
|
props: {
|
|
636
800
|
configuration: {},
|
|
@@ -648,32 +812,43 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
|
|
|
648
812
|
return null;
|
|
649
813
|
};
|
|
650
814
|
}
|
|
651
|
-
}
|
|
815
|
+
};
|
|
816
|
+
// src/models/setterMap/components/ComputedSizeSetter.ts
|
|
817
|
+
let ComputedSizeSetter = /* @__PURE__ */ function(ComputedSizeSetter) {
|
|
818
|
+
ComputedSizeSetter["Height"] = "height";
|
|
819
|
+
ComputedSizeSetter["Width"] = "width";
|
|
820
|
+
return ComputedSizeSetter;
|
|
821
|
+
}({});
|
|
822
|
+
// src/models/setterMap/EllipseSetter.ts
|
|
823
|
+
let EllipseSetter = /* @__PURE__ */ function(EllipseSetter) {
|
|
824
|
+
EllipseSetter["Smoothness"] = "smoothness";
|
|
825
|
+
return EllipseSetter;
|
|
826
|
+
}({});
|
|
652
827
|
// src/services/setterMap/components/ComputedSizeSetterMap.ts
|
|
653
828
|
const ComputedSizeSetterMap = {
|
|
654
829
|
...DisplaySizeSetterMap,
|
|
655
|
-
height: (gameObject) => (value) => {
|
|
830
|
+
["height"]: (gameObject) => (value) => {
|
|
656
831
|
if (value === void 0) return;
|
|
657
832
|
gameObject.setSize(gameObject.width, value);
|
|
658
833
|
},
|
|
659
|
-
width: (gameObject) => (value) => {
|
|
834
|
+
["width"]: (gameObject) => (value) => {
|
|
660
835
|
if (value === void 0) return;
|
|
661
836
|
gameObject.setSize(value, gameObject.height);
|
|
662
837
|
}
|
|
663
838
|
};
|
|
664
839
|
// src/services/setterMap/EllipseSetterMap.ts
|
|
665
840
|
const EllipseSetterMap = {
|
|
666
|
-
height: ComputedSizeSetterMap
|
|
667
|
-
|
|
841
|
+
["height"]: ComputedSizeSetterMap["height"],
|
|
842
|
+
["width"]: ComputedSizeSetterMap["width"],
|
|
843
|
+
["smoothness"]: (gameObject) => (value) => {
|
|
668
844
|
if (value === void 0) return;
|
|
669
845
|
gameObject.setSmoothness(value);
|
|
670
846
|
},
|
|
671
|
-
width: ComputedSizeSetterMap.width,
|
|
672
847
|
...ShapeSetterMap,
|
|
673
848
|
...GlobalSetterMap
|
|
674
849
|
};
|
|
675
850
|
// src/components/Ellipse.vue
|
|
676
|
-
const _sfc_main$5 =
|
|
851
|
+
const _sfc_main$5 = {
|
|
677
852
|
__name: "Ellipse",
|
|
678
853
|
props: {
|
|
679
854
|
configuration: {},
|
|
@@ -691,7 +866,7 @@ const _sfc_main$5 = /*@__PURE__*/ defineComponent({
|
|
|
691
866
|
return null;
|
|
692
867
|
};
|
|
693
868
|
}
|
|
694
|
-
}
|
|
869
|
+
};
|
|
695
870
|
// src/models/plugins/TilesetFile.ts
|
|
696
871
|
const XMLFile = Loader.FileTypes.XMLFile;
|
|
697
872
|
var TilesetFile = class extends XMLFile {
|
|
@@ -701,33 +876,31 @@ var TilesetFile = class extends XMLFile {
|
|
|
701
876
|
this.tilesetIndex = tilesetIndex;
|
|
702
877
|
}
|
|
703
878
|
};
|
|
879
|
+
// src/services/shared/omitUndefined.ts
|
|
880
|
+
const omitUndefined = (object) => Object.fromEntries(Object.entries(object).filter(([, value]) => value !== void 0));
|
|
881
|
+
// src/services/shared/getTilesetDefinitionFields.ts
|
|
882
|
+
const getTilesetDefinitionFields = (definition) => omitUndefined({
|
|
883
|
+
...definition,
|
|
884
|
+
firstgid: void 0
|
|
885
|
+
});
|
|
704
886
|
// src/models/plugins/TiledJSONExternalFile.ts
|
|
705
887
|
const GetFastValue = Utils.Objects.GetFastValue;
|
|
706
888
|
const JSONFile$1 = Loader.FileTypes.JSONFile;
|
|
707
889
|
const MultiFile = Loader.MultiFile;
|
|
708
|
-
const PUBLIC_FOLDER = "public";
|
|
709
890
|
var TiledJSONExternalFile = class extends MultiFile {
|
|
710
|
-
constructor(loader,
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
baseURL = GetFastValue(configuration, "baseURL");
|
|
718
|
-
tilesetXhrSettings = GetFastValue(configuration, "tilesetXhrSettings");
|
|
719
|
-
}
|
|
720
|
-
const tilemapFile = new JSONFile$1(loader, key, tilemapURL, tilemapXhrSettings);
|
|
721
|
-
super(loader, "tilemapJSON", key, [tilemapFile]);
|
|
722
|
-
this.config.path = path;
|
|
723
|
-
this.config.baseURL = baseURL;
|
|
724
|
-
this.config.tilesetXhrSettings = tilesetXhrSettings;
|
|
891
|
+
constructor(loader, configuration) {
|
|
892
|
+
const tilemapFile = new JSONFile$1(loader, configuration.key, configuration.url, configuration.xhrSettings);
|
|
893
|
+
super(loader, "tilemapJSON", configuration.key, [tilemapFile]);
|
|
894
|
+
this.config.path = configuration.path;
|
|
895
|
+
this.config.baseURL = configuration.baseURL;
|
|
896
|
+
this.config.tilesetXhrSettings = configuration.tilesetXhrSettings;
|
|
897
|
+
this.config.tilesetURLs = configuration.tilesetURLs;
|
|
725
898
|
}
|
|
726
899
|
addToCache() {
|
|
727
900
|
if (!this.isReadyToProcess()) return;
|
|
728
901
|
const [tilemapFile, ...tilesetFiles] = this.files;
|
|
729
902
|
if (!(tilemapFile.type === "json" && Object.hasOwn(tilemapFile.data, "tilesets"))) return;
|
|
730
|
-
const tilemapData = tilemapFile.data;
|
|
903
|
+
const tilemapData = structuredClone(tilemapFile.data);
|
|
731
904
|
const tilemapKey = tilemapFile.key;
|
|
732
905
|
const loader = this.loader;
|
|
733
906
|
const files = this.files;
|
|
@@ -739,7 +912,7 @@ var TiledJSONExternalFile = class extends MultiFile {
|
|
|
739
912
|
throw error;
|
|
740
913
|
});
|
|
741
914
|
const index = tilesetFile.tilesetIndex;
|
|
742
|
-
Object.assign(tilemapData.tilesets[index], tilesetData, {
|
|
915
|
+
Object.assign(tilemapData.tilesets[index], getTilesetDefinitionFields(tilesetData), {
|
|
743
916
|
imageheight: tilesetData.image?.height,
|
|
744
917
|
imagewidth: tilesetData.image?.width,
|
|
745
918
|
source: void 0
|
|
@@ -765,14 +938,22 @@ var TiledJSONExternalFile = class extends MultiFile {
|
|
|
765
938
|
const path = GetFastValue(config, "path", currentPath);
|
|
766
939
|
const prefix = GetFastValue(config, "prefix", currentPrefix);
|
|
767
940
|
const tilesetXhrSettings = GetFastValue(config, "tilesetXhrSettings");
|
|
941
|
+
const tilesetURLs = GetFastValue(config, "tilesetURLs");
|
|
942
|
+
const tilesetSources = tilesets.map((tileset, tilesetIndex) => {
|
|
943
|
+
const tilesetName = tileset.source.split("/").pop()?.replace(/\.tsx$/u, "") ?? "";
|
|
944
|
+
const tilesetURL = tilesetURLs?.[tilesetName];
|
|
945
|
+
if (!tilesetURL) throw new NotFoundError(this.onFileComplete.name, tileset.source);
|
|
946
|
+
return {
|
|
947
|
+
tilesetIndex,
|
|
948
|
+
tilesetName,
|
|
949
|
+
tilesetURL
|
|
950
|
+
};
|
|
951
|
+
});
|
|
768
952
|
loader.setBaseURL(baseURL);
|
|
769
953
|
loader.setPath(path);
|
|
770
954
|
loader.setPrefix(prefix);
|
|
771
|
-
for (const
|
|
772
|
-
const
|
|
773
|
-
if (pathIndex === -1) throw new NotFoundError(this.onFileComplete.name, tileset.source);
|
|
774
|
-
const relativePath = tileset.source.slice(pathIndex + 6);
|
|
775
|
-
const tilesetFile = new TilesetFile(tilesetIndex, loader, `${file.key}${ID_SEPARATOR}Tileset${ID_SEPARATOR}${relativePath}`, relativePath, tilesetXhrSettings);
|
|
955
|
+
for (const { tilesetIndex, tilesetName, tilesetURL } of tilesetSources) {
|
|
956
|
+
const tilesetFile = new TilesetFile(tilesetIndex, loader, `${file.key}${ID_SEPARATOR}Tileset${ID_SEPARATOR}${tilesetName}`, tilesetURL, tilesetXhrSettings);
|
|
776
957
|
this.addToMultiFile(tilesetFile);
|
|
777
958
|
loader.addFile(tilesetFile);
|
|
778
959
|
}
|
|
@@ -787,20 +968,16 @@ const ANIMATION_COMPLETE_EVENT_PREFIX = "animationcomplete-";
|
|
|
787
968
|
// src/plugins/registerTiledJSONExternalLoader.ts
|
|
788
969
|
const FileTypesManager = Loader.FileTypesManager;
|
|
789
970
|
const registerTiledJSONExternalLoader = () => {
|
|
790
|
-
FileTypesManager.register(TILEMAP_TILED_JSON_EXTERNAL_KEY, function(
|
|
791
|
-
|
|
792
|
-
const multifile = new TiledJSONExternalFile(this,
|
|
793
|
-
this.addFile(multifile.files);
|
|
794
|
-
}
|
|
795
|
-
else {
|
|
796
|
-
const multifile = new TiledJSONExternalFile(this, key, tilemapURL, path, baseURL, tilemapXhrSettings, tilesetXhrSettings);
|
|
971
|
+
FileTypesManager.register(TILEMAP_TILED_JSON_EXTERNAL_KEY, function(configuration) {
|
|
972
|
+
for (const configurationElement of Array.isArray(configuration) ? configuration : [configuration]) {
|
|
973
|
+
const multifile = new TiledJSONExternalFile(this, configurationElement);
|
|
797
974
|
this.addFile(multifile.files);
|
|
798
975
|
}
|
|
799
976
|
return this;
|
|
800
977
|
});
|
|
801
978
|
};
|
|
802
979
|
// src/components/Game.vue
|
|
803
|
-
const _sfc_main$6 =
|
|
980
|
+
const _sfc_main$6 = {
|
|
804
981
|
__name: "Game",
|
|
805
982
|
props: { configuration: {} },
|
|
806
983
|
setup(__props) {
|
|
@@ -829,10 +1006,10 @@ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
|
|
|
829
1006
|
return openBlock(), createElementBlock(Fragment, null, [createElementVNode("div", {
|
|
830
1007
|
ref_key: "canvasRoot",
|
|
831
1008
|
ref: canvasRoot
|
|
832
|
-
}, null, 512), isReady.value ? renderSlot(_ctx.$slots, "default", {
|
|
1009
|
+
}, null, 512), isReady.value ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true)], 64);
|
|
833
1010
|
};
|
|
834
1011
|
}
|
|
835
|
-
}
|
|
1012
|
+
};
|
|
836
1013
|
// src/services/setterMap/GraphicsSetterMap.ts
|
|
837
1014
|
const GraphicsSetterMap = {
|
|
838
1015
|
...AlphaSingleSetterMap,
|
|
@@ -841,7 +1018,7 @@ const GraphicsSetterMap = {
|
|
|
841
1018
|
...GlobalSetterMap
|
|
842
1019
|
};
|
|
843
1020
|
// src/components/Graphics.vue
|
|
844
|
-
const _sfc_main$7 =
|
|
1021
|
+
const _sfc_main$7 = {
|
|
845
1022
|
__name: "Graphics",
|
|
846
1023
|
props: {
|
|
847
1024
|
configuration: { default: () => ({}) },
|
|
@@ -862,27 +1039,39 @@ const _sfc_main$7 = /*@__PURE__*/ defineComponent({
|
|
|
862
1039
|
return null;
|
|
863
1040
|
};
|
|
864
1041
|
}
|
|
865
|
-
}
|
|
1042
|
+
};
|
|
1043
|
+
// src/models/setterMap/components/FlipSetter.ts
|
|
1044
|
+
let FlipSetter = /* @__PURE__ */ function(FlipSetter) {
|
|
1045
|
+
FlipSetter["FlipX"] = "flipX";
|
|
1046
|
+
FlipSetter["FlipY"] = "flipY";
|
|
1047
|
+
return FlipSetter;
|
|
1048
|
+
}({});
|
|
866
1049
|
// src/services/setterMap/components/FlipSetterMap.ts
|
|
867
1050
|
const FlipSetterMap = {
|
|
868
|
-
flipX: (gameObject) => (value) => {
|
|
1051
|
+
["flipX"]: (gameObject) => (value) => {
|
|
869
1052
|
if (value === void 0) return;
|
|
870
1053
|
gameObject.setFlipX(value);
|
|
871
1054
|
},
|
|
872
|
-
flipY: (gameObject) => (value) => {
|
|
1055
|
+
["flipY"]: (gameObject) => (value) => {
|
|
873
1056
|
if (value === void 0) return;
|
|
874
1057
|
gameObject.setFlipY(value);
|
|
875
1058
|
}
|
|
876
1059
|
};
|
|
877
1060
|
// src/services/setterMap/components/SizeSetterMap.ts
|
|
878
1061
|
const SizeSetterMap = { ...ComputedSizeSetterMap };
|
|
1062
|
+
// src/models/setterMap/components/BaseTextureSetter.ts
|
|
1063
|
+
let BaseTextureSetter = /* @__PURE__ */ function(BaseTextureSetter) {
|
|
1064
|
+
BaseTextureSetter["Frame"] = "frame";
|
|
1065
|
+
BaseTextureSetter["Texture"] = "texture";
|
|
1066
|
+
return BaseTextureSetter;
|
|
1067
|
+
}({});
|
|
879
1068
|
// src/services/setterMap/components/BaseTextureSetterMap.ts
|
|
880
1069
|
const BaseTextureSetterMap = {
|
|
881
|
-
frame: (gameObject) => (value) => {
|
|
1070
|
+
["frame"]: (gameObject) => (value) => {
|
|
882
1071
|
if (value === void 0) return;
|
|
883
1072
|
gameObject.setFrame(value);
|
|
884
1073
|
},
|
|
885
|
-
texture: (gameObject) => (value) => {
|
|
1074
|
+
["texture"]: (gameObject) => (value) => {
|
|
886
1075
|
if (!value) return;
|
|
887
1076
|
gameObject.setTexture(value);
|
|
888
1077
|
}
|
|
@@ -897,10 +1086,10 @@ const ImageSetterMap = {
|
|
|
897
1086
|
...TextureCropSetterMap
|
|
898
1087
|
};
|
|
899
1088
|
// src/components/Image.vue
|
|
900
|
-
const _sfc_main$8 =
|
|
1089
|
+
const _sfc_main$8 = {
|
|
901
1090
|
__name: "Image",
|
|
902
1091
|
props: {
|
|
903
|
-
configuration: {},
|
|
1092
|
+
configuration: { type: Function },
|
|
904
1093
|
onComplete: { type: Function }
|
|
905
1094
|
},
|
|
906
1095
|
setup(__props, { emit: __emit }) {
|
|
@@ -914,36 +1103,59 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
914
1103
|
return null;
|
|
915
1104
|
};
|
|
916
1105
|
}
|
|
917
|
-
}
|
|
1106
|
+
};
|
|
1107
|
+
// src/models/setterMap/shared/IsoSetter.ts
|
|
1108
|
+
let IsoSetter = /* @__PURE__ */ function(IsoSetter) {
|
|
1109
|
+
IsoSetter["FillLeft"] = "fillLeft";
|
|
1110
|
+
IsoSetter["FillRight"] = "fillRight";
|
|
1111
|
+
IsoSetter["FillTop"] = "fillTop";
|
|
1112
|
+
IsoSetter["Height"] = "height";
|
|
1113
|
+
IsoSetter["Projection"] = "projection";
|
|
1114
|
+
IsoSetter["ShowLeft"] = "showLeft";
|
|
1115
|
+
IsoSetter["ShowRight"] = "showRight";
|
|
1116
|
+
IsoSetter["ShowTop"] = "showTop";
|
|
1117
|
+
IsoSetter["Size"] = "size";
|
|
1118
|
+
return IsoSetter;
|
|
1119
|
+
}({});
|
|
918
1120
|
// src/services/setterMap/shared/IsoSetterMap.ts
|
|
919
1121
|
const IsoSetterMap = {
|
|
920
|
-
fillLeft: (gameObject) => (value) => {
|
|
1122
|
+
["fillLeft"]: (gameObject) => (value) => {
|
|
921
1123
|
if (value === void 0) return;
|
|
922
1124
|
gameObject.setFillStyle(gameObject.fillTop, value, gameObject.fillRight);
|
|
923
1125
|
},
|
|
924
|
-
fillRight: (gameObject) => (value) => {
|
|
1126
|
+
["fillRight"]: (gameObject) => (value) => {
|
|
925
1127
|
if (value === void 0) return;
|
|
926
1128
|
gameObject.setFillStyle(gameObject.fillTop, gameObject.fillLeft, value);
|
|
927
1129
|
},
|
|
928
|
-
fillTop: (gameObject) => (value) => {
|
|
1130
|
+
["fillTop"]: (gameObject) => (value) => {
|
|
929
1131
|
if (value === void 0) return;
|
|
930
1132
|
gameObject.setFillStyle(value, gameObject.fillLeft, gameObject.fillRight);
|
|
931
1133
|
},
|
|
932
|
-
|
|
1134
|
+
["height"]: (gameObject) => (value) => {
|
|
1135
|
+
if (value === void 0) return;
|
|
1136
|
+
gameObject.height = value;
|
|
1137
|
+
gameObject.updateDisplayOrigin();
|
|
1138
|
+
},
|
|
1139
|
+
["projection"]: (gameObject) => (value) => {
|
|
933
1140
|
if (value === void 0) return;
|
|
934
1141
|
gameObject.setProjection(value);
|
|
935
1142
|
},
|
|
936
|
-
showLeft: (gameObject) => (value) => {
|
|
1143
|
+
["showLeft"]: (gameObject) => (value) => {
|
|
937
1144
|
if (value === void 0) return;
|
|
938
1145
|
gameObject.setFaces(gameObject.showTop, value, gameObject.showRight);
|
|
939
1146
|
},
|
|
940
|
-
showRight: (gameObject) => (value) => {
|
|
1147
|
+
["showRight"]: (gameObject) => (value) => {
|
|
941
1148
|
if (value === void 0) return;
|
|
942
1149
|
gameObject.setFaces(gameObject.showTop, gameObject.showLeft, value);
|
|
943
1150
|
},
|
|
944
|
-
showTop: (gameObject) => (value) => {
|
|
1151
|
+
["showTop"]: (gameObject) => (value) => {
|
|
945
1152
|
if (value === void 0) return;
|
|
946
1153
|
gameObject.setFaces(value, gameObject.showLeft, gameObject.showRight);
|
|
1154
|
+
},
|
|
1155
|
+
["size"]: (gameObject) => (value) => {
|
|
1156
|
+
if (value === void 0) return;
|
|
1157
|
+
gameObject.width = value;
|
|
1158
|
+
gameObject.updateDisplayOrigin();
|
|
947
1159
|
}
|
|
948
1160
|
};
|
|
949
1161
|
// src/services/setterMap/IsoBoxSetterMap.ts
|
|
@@ -953,7 +1165,7 @@ const IsoBoxSetterMap = {
|
|
|
953
1165
|
...GlobalSetterMap
|
|
954
1166
|
};
|
|
955
1167
|
// src/components/IsoBox.vue
|
|
956
|
-
const _sfc_main$9 =
|
|
1168
|
+
const _sfc_main$9 = {
|
|
957
1169
|
__name: "IsoBox",
|
|
958
1170
|
props: {
|
|
959
1171
|
configuration: {},
|
|
@@ -971,10 +1183,15 @@ const _sfc_main$9 = /*@__PURE__*/ defineComponent({
|
|
|
971
1183
|
return null;
|
|
972
1184
|
};
|
|
973
1185
|
}
|
|
974
|
-
}
|
|
1186
|
+
};
|
|
1187
|
+
// src/models/setterMap/IsoTriangleSetter.ts
|
|
1188
|
+
let IsoTriangleSetter = /* @__PURE__ */ function(IsoTriangleSetter) {
|
|
1189
|
+
IsoTriangleSetter["IsReversed"] = "isReversed";
|
|
1190
|
+
return IsoTriangleSetter;
|
|
1191
|
+
}({});
|
|
975
1192
|
// src/services/setterMap/IsoTriangleSetterMap.ts
|
|
976
1193
|
const IsoTriangleSetterMap = {
|
|
977
|
-
isReversed: (gameObject) => (value) => {
|
|
1194
|
+
["isReversed"]: (gameObject) => (value) => {
|
|
978
1195
|
if (value === void 0) return;
|
|
979
1196
|
gameObject.setReversed(value);
|
|
980
1197
|
},
|
|
@@ -983,7 +1200,7 @@ const IsoTriangleSetterMap = {
|
|
|
983
1200
|
...GlobalSetterMap
|
|
984
1201
|
};
|
|
985
1202
|
// src/components/IsoTriangle.vue
|
|
986
|
-
const _sfc_main$10 =
|
|
1203
|
+
const _sfc_main$10 = {
|
|
987
1204
|
__name: "IsoTriangle",
|
|
988
1205
|
props: {
|
|
989
1206
|
configuration: {},
|
|
@@ -1001,14 +1218,20 @@ const _sfc_main$10 = /*@__PURE__*/ defineComponent({
|
|
|
1001
1218
|
return null;
|
|
1002
1219
|
};
|
|
1003
1220
|
}
|
|
1004
|
-
}
|
|
1221
|
+
};
|
|
1222
|
+
// src/models/setterMap/LineSetter.ts
|
|
1223
|
+
let LineSetter = /* @__PURE__ */ function(LineSetter) {
|
|
1224
|
+
LineSetter["LineWidth"] = "lineWidth";
|
|
1225
|
+
LineSetter["To"] = "to";
|
|
1226
|
+
return LineSetter;
|
|
1227
|
+
}({});
|
|
1005
1228
|
// src/services/setterMap/LineSetterMap.ts
|
|
1006
1229
|
const LineSetterMap = {
|
|
1007
|
-
lineWidth: (gameObject) => (value) => {
|
|
1230
|
+
["lineWidth"]: (gameObject) => (value) => {
|
|
1008
1231
|
if (value === void 0) return;
|
|
1009
1232
|
gameObject.setLineWidth(value);
|
|
1010
1233
|
},
|
|
1011
|
-
to: (gameObject) => (value) => {
|
|
1234
|
+
["to"]: (gameObject) => (value) => {
|
|
1012
1235
|
if (!value) return;
|
|
1013
1236
|
gameObject.setTo(...value);
|
|
1014
1237
|
},
|
|
@@ -1016,7 +1239,7 @@ const LineSetterMap = {
|
|
|
1016
1239
|
...GlobalSetterMap
|
|
1017
1240
|
};
|
|
1018
1241
|
// src/components/Line.vue
|
|
1019
|
-
const _sfc_main$11 =
|
|
1242
|
+
const _sfc_main$11 = {
|
|
1020
1243
|
__name: "Line",
|
|
1021
1244
|
props: {
|
|
1022
1245
|
configuration: {},
|
|
@@ -1034,13 +1257,37 @@ const _sfc_main$11 = /*@__PURE__*/ defineComponent({
|
|
|
1034
1257
|
return null;
|
|
1035
1258
|
};
|
|
1036
1259
|
}
|
|
1037
|
-
}
|
|
1260
|
+
};
|
|
1261
|
+
// src/models/setterMap/NinesliceSetter.ts
|
|
1262
|
+
let NinesliceSetter = /* @__PURE__ */ function(NinesliceSetter) {
|
|
1263
|
+
NinesliceSetter["BottomHeight"] = "bottomHeight";
|
|
1264
|
+
NinesliceSetter["LeftWidth"] = "leftWidth";
|
|
1265
|
+
NinesliceSetter["RightWidth"] = "rightWidth";
|
|
1266
|
+
NinesliceSetter["TopHeight"] = "topHeight";
|
|
1267
|
+
return NinesliceSetter;
|
|
1268
|
+
}({});
|
|
1038
1269
|
// src/services/setterMap/components/TextureSetterMap.ts
|
|
1039
1270
|
const TextureSetterMap = { ...BaseTextureSetterMap };
|
|
1040
1271
|
// src/services/setterMap/NinesliceSetterMap.ts
|
|
1041
1272
|
const NinesliceSetterMap = {
|
|
1042
|
-
height: ComputedSizeSetterMap
|
|
1043
|
-
width: ComputedSizeSetterMap
|
|
1273
|
+
["height"]: ComputedSizeSetterMap["height"],
|
|
1274
|
+
["width"]: ComputedSizeSetterMap["width"],
|
|
1275
|
+
["bottomHeight"]: (gameObject) => (value) => {
|
|
1276
|
+
if (value === void 0) return;
|
|
1277
|
+
gameObject.setSlices(gameObject.width, gameObject.height, gameObject.leftWidth, gameObject.rightWidth, gameObject.topHeight, value);
|
|
1278
|
+
},
|
|
1279
|
+
["leftWidth"]: (gameObject) => (value) => {
|
|
1280
|
+
if (value === void 0) return;
|
|
1281
|
+
gameObject.setSlices(gameObject.width, gameObject.height, value, gameObject.rightWidth, gameObject.topHeight, gameObject.bottomHeight);
|
|
1282
|
+
},
|
|
1283
|
+
["rightWidth"]: (gameObject) => (value) => {
|
|
1284
|
+
if (value === void 0) return;
|
|
1285
|
+
gameObject.setSlices(gameObject.width, gameObject.height, gameObject.leftWidth, value, gameObject.topHeight, gameObject.bottomHeight);
|
|
1286
|
+
},
|
|
1287
|
+
["topHeight"]: (gameObject) => (value) => {
|
|
1288
|
+
if (value === void 0) return;
|
|
1289
|
+
gameObject.setSlices(gameObject.width, gameObject.height, gameObject.leftWidth, gameObject.rightWidth, value, gameObject.bottomHeight);
|
|
1290
|
+
},
|
|
1044
1291
|
...AlphaSingleSetterMap,
|
|
1045
1292
|
...SceneObjectSetterMap,
|
|
1046
1293
|
...OriginSetterMap,
|
|
@@ -1049,10 +1296,10 @@ const NinesliceSetterMap = {
|
|
|
1049
1296
|
...GlobalSetterMap
|
|
1050
1297
|
};
|
|
1051
1298
|
// src/components/Nineslice.vue
|
|
1052
|
-
const _sfc_main$12 =
|
|
1299
|
+
const _sfc_main$12 = {
|
|
1053
1300
|
__name: "Nineslice",
|
|
1054
1301
|
props: {
|
|
1055
|
-
configuration: {},
|
|
1302
|
+
configuration: { type: Function },
|
|
1056
1303
|
immediate: { type: Boolean },
|
|
1057
1304
|
onComplete: { type: Function }
|
|
1058
1305
|
},
|
|
@@ -1067,10 +1314,15 @@ const _sfc_main$12 = /*@__PURE__*/ defineComponent({
|
|
|
1067
1314
|
return null;
|
|
1068
1315
|
};
|
|
1069
1316
|
}
|
|
1070
|
-
}
|
|
1317
|
+
};
|
|
1318
|
+
// src/models/setterMap/ParticlesSetter.ts
|
|
1319
|
+
let ParticlesSetter = /* @__PURE__ */ function(ParticlesSetter) {
|
|
1320
|
+
ParticlesSetter["Configuration"] = "config";
|
|
1321
|
+
return ParticlesSetter;
|
|
1322
|
+
}({});
|
|
1071
1323
|
// src/services/setterMap/ParticlesSetterMap.ts
|
|
1072
1324
|
const ParticlesSetterMap = {
|
|
1073
|
-
config: (gameObject) => (value) => {
|
|
1325
|
+
["config"]: (gameObject) => (value) => {
|
|
1074
1326
|
if (!value) return;
|
|
1075
1327
|
gameObject.setConfig(value);
|
|
1076
1328
|
},
|
|
@@ -1081,7 +1333,7 @@ const ParticlesSetterMap = {
|
|
|
1081
1333
|
...GlobalSetterMap
|
|
1082
1334
|
};
|
|
1083
1335
|
// src/components/Particles.vue
|
|
1084
|
-
const _sfc_main$13 =
|
|
1336
|
+
const _sfc_main$13 = {
|
|
1085
1337
|
__name: "Particles",
|
|
1086
1338
|
props: {
|
|
1087
1339
|
configuration: {},
|
|
@@ -1099,9 +1351,14 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
1099
1351
|
return null;
|
|
1100
1352
|
};
|
|
1101
1353
|
}
|
|
1102
|
-
}
|
|
1354
|
+
};
|
|
1355
|
+
// src/models/setterMap/components/PathFollowerComponentSetter.ts
|
|
1356
|
+
let PathFollowerComponentSetter = /* @__PURE__ */ function(PathFollowerComponentSetter) {
|
|
1357
|
+
PathFollowerComponentSetter["Path"] = "path";
|
|
1358
|
+
return PathFollowerComponentSetter;
|
|
1359
|
+
}({});
|
|
1103
1360
|
// src/services/setterMap/components/PathFollowerComponentSetterMap.ts
|
|
1104
|
-
const PathFollowerComponentSetterMap = { path: (gameObject) => (value) => {
|
|
1361
|
+
const PathFollowerComponentSetterMap = { ["path"]: (gameObject) => (value) => {
|
|
1105
1362
|
if (!value) return;
|
|
1106
1363
|
gameObject.setPath(value);
|
|
1107
1364
|
} };
|
|
@@ -1114,10 +1371,10 @@ const PathFollowerSetterMap = {
|
|
|
1114
1371
|
...TextureSetterMap
|
|
1115
1372
|
};
|
|
1116
1373
|
// src/components/PathFollower.vue
|
|
1117
|
-
const _sfc_main$14 =
|
|
1374
|
+
const _sfc_main$14 = {
|
|
1118
1375
|
__name: "PathFollower",
|
|
1119
1376
|
props: {
|
|
1120
|
-
configuration: {},
|
|
1377
|
+
configuration: { type: Function },
|
|
1121
1378
|
onComplete: { type: Function }
|
|
1122
1379
|
},
|
|
1123
1380
|
setup(__props, { emit: __emit }) {
|
|
@@ -1131,10 +1388,15 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
|
|
|
1131
1388
|
return null;
|
|
1132
1389
|
};
|
|
1133
1390
|
}
|
|
1134
|
-
}
|
|
1391
|
+
};
|
|
1392
|
+
// src/models/setterMap/PolygonSetter.ts
|
|
1393
|
+
let PolygonSetter = /* @__PURE__ */ function(PolygonSetter) {
|
|
1394
|
+
PolygonSetter["Points"] = "points";
|
|
1395
|
+
return PolygonSetter;
|
|
1396
|
+
}({});
|
|
1135
1397
|
// src/services/setterMap/PolygonSetterMap.ts
|
|
1136
1398
|
const PolygonSetterMap = {
|
|
1137
|
-
points: (gameObject) => (value) => {
|
|
1399
|
+
["points"]: (gameObject) => (value) => {
|
|
1138
1400
|
if (!value) return;
|
|
1139
1401
|
gameObject.setTo(value);
|
|
1140
1402
|
},
|
|
@@ -1142,7 +1404,7 @@ const PolygonSetterMap = {
|
|
|
1142
1404
|
...GlobalSetterMap
|
|
1143
1405
|
};
|
|
1144
1406
|
// src/components/Polygon.vue
|
|
1145
|
-
const _sfc_main$15 =
|
|
1407
|
+
const _sfc_main$15 = {
|
|
1146
1408
|
__name: "Polygon",
|
|
1147
1409
|
props: {
|
|
1148
1410
|
configuration: {},
|
|
@@ -1160,16 +1422,16 @@ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
|
|
|
1160
1422
|
return null;
|
|
1161
1423
|
};
|
|
1162
1424
|
}
|
|
1163
|
-
}
|
|
1425
|
+
};
|
|
1164
1426
|
// src/services/setterMap/RectangleSetterMap.ts
|
|
1165
1427
|
const RectangleSetterMap = {
|
|
1166
|
-
height: ComputedSizeSetterMap
|
|
1167
|
-
width: ComputedSizeSetterMap
|
|
1428
|
+
["height"]: ComputedSizeSetterMap["height"],
|
|
1429
|
+
["width"]: ComputedSizeSetterMap["width"],
|
|
1168
1430
|
...ShapeSetterMap,
|
|
1169
1431
|
...GlobalSetterMap
|
|
1170
1432
|
};
|
|
1171
1433
|
// src/components/Rectangle.vue
|
|
1172
|
-
const _sfc_main$16 =
|
|
1434
|
+
const _sfc_main$16 = {
|
|
1173
1435
|
__name: "Rectangle",
|
|
1174
1436
|
props: {
|
|
1175
1437
|
configuration: {},
|
|
@@ -1187,7 +1449,7 @@ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
|
|
|
1187
1449
|
return null;
|
|
1188
1450
|
};
|
|
1189
1451
|
}
|
|
1190
|
-
}
|
|
1452
|
+
};
|
|
1191
1453
|
// src/services/setterMap/RenderTextureSetterMap.ts
|
|
1192
1454
|
const RenderTextureSetterMap = {
|
|
1193
1455
|
...AlphaSetterMap,
|
|
@@ -1200,7 +1462,7 @@ const RenderTextureSetterMap = {
|
|
|
1200
1462
|
...GlobalSetterMap
|
|
1201
1463
|
};
|
|
1202
1464
|
// src/components/RenderTexture.vue
|
|
1203
|
-
const _sfc_main$17 =
|
|
1465
|
+
const _sfc_main$17 = {
|
|
1204
1466
|
__name: "RenderTexture",
|
|
1205
1467
|
props: {
|
|
1206
1468
|
configuration: {},
|
|
@@ -1218,7 +1480,7 @@ const _sfc_main$17 = /*@__PURE__*/ defineComponent({
|
|
|
1218
1480
|
return null;
|
|
1219
1481
|
};
|
|
1220
1482
|
}
|
|
1221
|
-
}
|
|
1483
|
+
};
|
|
1222
1484
|
// src/services/hooks/resetLifecycleListeners.ts
|
|
1223
1485
|
const resetLifecycleListeners = (scene, lifecycle) => {
|
|
1224
1486
|
const listenersMap = ExternalSceneStore.lifecycleListenersMap.get(lifecycle);
|
|
@@ -1286,7 +1548,7 @@ const useInputStore = defineStore("phaser/input", () => {
|
|
|
1286
1548
|
return { isInputActive: ref(false) };
|
|
1287
1549
|
});
|
|
1288
1550
|
// src/components/Scene.vue
|
|
1289
|
-
const _sfc_main$18 =
|
|
1551
|
+
const _sfc_main$18 = {
|
|
1290
1552
|
__name: "Scene",
|
|
1291
1553
|
props: {
|
|
1292
1554
|
autoStart: { type: Boolean },
|
|
@@ -1344,18 +1606,23 @@ const _sfc_main$18 = /*@__PURE__*/ defineComponent({
|
|
|
1344
1606
|
for (const [event, listener] of cameraFadeListeners) scene.cameras.main.off(event, listener);
|
|
1345
1607
|
emit("shutdown", scene);
|
|
1346
1608
|
};
|
|
1609
|
+
let isSceneAdded = false;
|
|
1347
1610
|
onMounted(async () => {
|
|
1348
|
-
const
|
|
1349
|
-
|
|
1350
|
-
console.error(`Failed to add scene: ${__props.sceneKey}
|
|
1351
|
-
return;
|
|
1352
|
-
}
|
|
1611
|
+
const game = useGame();
|
|
1612
|
+
const scene = getResult(() => game.scene.add(__props.sceneKey, NewScene)).match((addedScene) => addedScene, (error) => {
|
|
1613
|
+
console.error(`Failed to add scene: ${__props.sceneKey}`, error);
|
|
1614
|
+
return null;
|
|
1615
|
+
});
|
|
1616
|
+
if (!scene) return;
|
|
1617
|
+
isSceneAdded = true;
|
|
1353
1618
|
scene.events.on(Scenes.Events.READY, readyListener);
|
|
1354
1619
|
scene.events.on(Scenes.Events.SHUTDOWN, shutdownListener);
|
|
1355
1620
|
if (__props.autoStart) await switchToScene(__props.sceneKey);
|
|
1356
1621
|
});
|
|
1357
1622
|
onUnmounted(() => {
|
|
1623
|
+
if (!isSceneAdded) return;
|
|
1358
1624
|
const game = useGame();
|
|
1625
|
+
stopStartedScene(game, __props.sceneKey);
|
|
1359
1626
|
const scene = getScene(__props.sceneKey);
|
|
1360
1627
|
scene.events.off(Scenes.Events.READY, readyListener);
|
|
1361
1628
|
scene.events.off(Scenes.Events.SHUTDOWN, shutdownListener);
|
|
@@ -1363,14 +1630,20 @@ const _sfc_main$18 = /*@__PURE__*/ defineComponent({
|
|
|
1363
1630
|
});
|
|
1364
1631
|
provide(InjectionKeyMap.SceneKey, __props.sceneKey);
|
|
1365
1632
|
return (_ctx, _cache) => {
|
|
1366
|
-
return isActive.value ? renderSlot(_ctx.$slots, "default", {
|
|
1633
|
+
return isActive.value ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true);
|
|
1367
1634
|
};
|
|
1368
1635
|
}
|
|
1369
|
-
}
|
|
1636
|
+
};
|
|
1637
|
+
// src/models/setterMap/shared/AnimationSetter.ts
|
|
1638
|
+
let AnimationSetter = /* @__PURE__ */ function(AnimationSetter) {
|
|
1639
|
+
AnimationSetter["Animations"] = "animations";
|
|
1640
|
+
AnimationSetter["PlayAnimationKey"] = "playAnimationKey";
|
|
1641
|
+
return AnimationSetter;
|
|
1642
|
+
}({});
|
|
1370
1643
|
// src/services/setterMap/shared/AnimationSetterMap.ts
|
|
1371
1644
|
const completionListeners = /* @__PURE__ */ new WeakMap();
|
|
1372
1645
|
const AnimationSetterMap = {
|
|
1373
|
-
animations: (gameObject, emit) => (configurations) => {
|
|
1646
|
+
["animations"]: (gameObject, emit) => (configurations) => {
|
|
1374
1647
|
if (!(configurations && configurations.length > 0)) return;
|
|
1375
1648
|
const listeners = completionListeners.get(gameObject) ?? /* @__PURE__ */ new Map();
|
|
1376
1649
|
completionListeners.set(gameObject, listeners);
|
|
@@ -1388,7 +1661,7 @@ const AnimationSetterMap = {
|
|
|
1388
1661
|
if (!gameObject.scene.anims.create(configuration)) throw new InvalidOperationError(Operation.Create, "Animation", configuration.key);
|
|
1389
1662
|
}
|
|
1390
1663
|
},
|
|
1391
|
-
playAnimationKey: (gameObject) => (value) => {
|
|
1664
|
+
["playAnimationKey"]: (gameObject) => (value) => {
|
|
1392
1665
|
if (value === void 0) {
|
|
1393
1666
|
gameObject.stop();
|
|
1394
1667
|
return;
|
|
@@ -1410,10 +1683,10 @@ const SpriteSetterMap = {
|
|
|
1410
1683
|
...GlobalSetterMap
|
|
1411
1684
|
};
|
|
1412
1685
|
// src/components/Sprite.vue
|
|
1413
|
-
const _sfc_main$19 =
|
|
1686
|
+
const _sfc_main$19 = {
|
|
1414
1687
|
__name: "Sprite",
|
|
1415
1688
|
props: {
|
|
1416
|
-
configuration: {},
|
|
1689
|
+
configuration: { type: Function },
|
|
1417
1690
|
immediate: { type: Boolean },
|
|
1418
1691
|
onComplete: { type: Function }
|
|
1419
1692
|
},
|
|
@@ -1428,18 +1701,25 @@ const _sfc_main$19 = /*@__PURE__*/ defineComponent({
|
|
|
1428
1701
|
return null;
|
|
1429
1702
|
};
|
|
1430
1703
|
}
|
|
1431
|
-
}
|
|
1704
|
+
};
|
|
1705
|
+
// src/models/setterMap/StarSetter.ts
|
|
1706
|
+
let StarSetter = /* @__PURE__ */ function(StarSetter) {
|
|
1707
|
+
StarSetter["InnerRadius"] = "innerRadius";
|
|
1708
|
+
StarSetter["OuterRadius"] = "outerRadius";
|
|
1709
|
+
StarSetter["Points"] = "points";
|
|
1710
|
+
return StarSetter;
|
|
1711
|
+
}({});
|
|
1432
1712
|
// src/services/setterMap/StarSetterMap.ts
|
|
1433
1713
|
const StarSetterMap = {
|
|
1434
|
-
innerRadius: (gameObject) => (value) => {
|
|
1714
|
+
["innerRadius"]: (gameObject) => (value) => {
|
|
1435
1715
|
if (value === void 0) return;
|
|
1436
1716
|
gameObject.setInnerRadius(value);
|
|
1437
1717
|
},
|
|
1438
|
-
outerRadius: (gameObject) => (value) => {
|
|
1718
|
+
["outerRadius"]: (gameObject) => (value) => {
|
|
1439
1719
|
if (value === void 0) return;
|
|
1440
1720
|
gameObject.setOuterRadius(value);
|
|
1441
1721
|
},
|
|
1442
|
-
points: (gameObject) => (value) => {
|
|
1722
|
+
["points"]: (gameObject) => (value) => {
|
|
1443
1723
|
if (value === void 0) return;
|
|
1444
1724
|
gameObject.setPoints(value);
|
|
1445
1725
|
},
|
|
@@ -1447,7 +1727,7 @@ const StarSetterMap = {
|
|
|
1447
1727
|
...GlobalSetterMap
|
|
1448
1728
|
};
|
|
1449
1729
|
// src/components/Star.vue
|
|
1450
|
-
const _sfc_main$20 =
|
|
1730
|
+
const _sfc_main$20 = {
|
|
1451
1731
|
__name: "Star",
|
|
1452
1732
|
props: {
|
|
1453
1733
|
configuration: {},
|
|
@@ -1465,18 +1745,25 @@ const _sfc_main$20 = /*@__PURE__*/ defineComponent({
|
|
|
1465
1745
|
return null;
|
|
1466
1746
|
};
|
|
1467
1747
|
}
|
|
1468
|
-
}
|
|
1748
|
+
};
|
|
1749
|
+
// src/models/setterMap/TextSetter.ts
|
|
1750
|
+
let TextSetter = /* @__PURE__ */ function(TextSetter) {
|
|
1751
|
+
TextSetter["Padding"] = "padding";
|
|
1752
|
+
TextSetter["Style"] = "style";
|
|
1753
|
+
TextSetter["Text"] = "text";
|
|
1754
|
+
return TextSetter;
|
|
1755
|
+
}({});
|
|
1469
1756
|
// src/services/setterMap/TextSetterMap.ts
|
|
1470
1757
|
const TextSetterMap = {
|
|
1471
|
-
padding: (gameObject) => (value) => {
|
|
1758
|
+
["padding"]: (gameObject) => (value) => {
|
|
1472
1759
|
if (!value) return;
|
|
1473
1760
|
gameObject.setPadding(value);
|
|
1474
1761
|
},
|
|
1475
|
-
style: (gameObject) => (value) => {
|
|
1762
|
+
["style"]: (gameObject) => (value) => {
|
|
1476
1763
|
if (!value) return;
|
|
1477
|
-
gameObject.setStyle(value);
|
|
1764
|
+
gameObject.setStyle(omitUndefined(value));
|
|
1478
1765
|
},
|
|
1479
|
-
text: (gameObject, emit) => (value) => {
|
|
1766
|
+
["text"]: (gameObject, emit) => (value) => {
|
|
1480
1767
|
if (value === void 0) return;
|
|
1481
1768
|
gameObject.setText(value);
|
|
1482
1769
|
emit("update:width", gameObject.width);
|
|
@@ -1491,10 +1778,10 @@ const useTextStore = defineStore("phaser/text", () => {
|
|
|
1491
1778
|
return { defaultTextStyle: ref() };
|
|
1492
1779
|
});
|
|
1493
1780
|
// src/components/Text.vue
|
|
1494
|
-
const _sfc_main$21 =
|
|
1781
|
+
const _sfc_main$21 = {
|
|
1495
1782
|
__name: "Text",
|
|
1496
1783
|
props: {
|
|
1497
|
-
configuration: {},
|
|
1784
|
+
configuration: { type: Function },
|
|
1498
1785
|
immediate: { type: Boolean }
|
|
1499
1786
|
},
|
|
1500
1787
|
setup(__props, { emit: __emit }) {
|
|
@@ -1505,14 +1792,47 @@ const _sfc_main$21 = /*@__PURE__*/ defineComponent({
|
|
|
1505
1792
|
const { style, text, x, y } = __props.configuration;
|
|
1506
1793
|
return scene.add.text(x ?? 0, y ?? 0, text, {
|
|
1507
1794
|
...defaultTextStyle.value,
|
|
1508
|
-
...style
|
|
1795
|
+
...omitUndefined(style ?? {})
|
|
1509
1796
|
});
|
|
1510
1797
|
}, () => __props.configuration, emit, TextSetterMap, __props.immediate);
|
|
1511
1798
|
return (_ctx, _cache) => {
|
|
1512
1799
|
return null;
|
|
1513
1800
|
};
|
|
1514
1801
|
}
|
|
1515
|
-
}
|
|
1802
|
+
};
|
|
1803
|
+
// src/components/Tilemap.vue
|
|
1804
|
+
const _sfc_main$23 = {
|
|
1805
|
+
__name: "Tilemap",
|
|
1806
|
+
props: {
|
|
1807
|
+
configuration: {},
|
|
1808
|
+
onComplete: { type: Function }
|
|
1809
|
+
},
|
|
1810
|
+
setup(__props) {
|
|
1811
|
+
const sceneKey = useInjectSceneKey();
|
|
1812
|
+
const tilemap = shallowRef();
|
|
1813
|
+
const lifecycleHook = getInitializeGameObjectLifecycleHook(sceneKey);
|
|
1814
|
+
const createTilemap = (scene) => {
|
|
1815
|
+
tilemap.value?.destroy();
|
|
1816
|
+
tilemap.value = scene.make.tilemap(__props.configuration);
|
|
1817
|
+
__props.onComplete?.(scene, tilemap.value);
|
|
1818
|
+
};
|
|
1819
|
+
lifecycleHook(createTilemap);
|
|
1820
|
+
watch(() => __props.configuration.key, (newKey) => {
|
|
1821
|
+
if (newKey) createTilemap(getScene(sceneKey));
|
|
1822
|
+
else {
|
|
1823
|
+
tilemap.value?.destroy();
|
|
1824
|
+
tilemap.value = void 0;
|
|
1825
|
+
}
|
|
1826
|
+
});
|
|
1827
|
+
onUnmounted(() => {
|
|
1828
|
+
if (!tilemap.value) return;
|
|
1829
|
+
tilemap.value.destroy();
|
|
1830
|
+
});
|
|
1831
|
+
return (_ctx, _cache) => {
|
|
1832
|
+
return renderSlot(_ctx.$slots, "default");
|
|
1833
|
+
};
|
|
1834
|
+
}
|
|
1835
|
+
};
|
|
1516
1836
|
// src/services/setterMap/TileSpriteSetterMap.ts
|
|
1517
1837
|
const TileSpriteSetterMap = {
|
|
1518
1838
|
...RenderableSetterMap,
|
|
@@ -1521,10 +1841,10 @@ const TileSpriteSetterMap = {
|
|
|
1521
1841
|
...TextureSetterMap
|
|
1522
1842
|
};
|
|
1523
1843
|
// src/components/TileSprite.vue
|
|
1524
|
-
const _sfc_main$22 =
|
|
1844
|
+
const _sfc_main$22 = {
|
|
1525
1845
|
__name: "TileSprite",
|
|
1526
1846
|
props: {
|
|
1527
|
-
configuration: {},
|
|
1847
|
+
configuration: { type: Function },
|
|
1528
1848
|
immediate: { type: Boolean },
|
|
1529
1849
|
onComplete: { type: Function }
|
|
1530
1850
|
},
|
|
@@ -1539,42 +1859,15 @@ const _sfc_main$22 = /*@__PURE__*/ defineComponent({
|
|
|
1539
1859
|
return null;
|
|
1540
1860
|
};
|
|
1541
1861
|
}
|
|
1542
|
-
}
|
|
1543
|
-
// src/
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
onComplete: { type: Function }
|
|
1549
|
-
},
|
|
1550
|
-
setup(__props) {
|
|
1551
|
-
const sceneKey = useInjectSceneKey();
|
|
1552
|
-
const tilemap = shallowRef();
|
|
1553
|
-
onCreate((newScene) => {
|
|
1554
|
-
tilemap.value = newScene.make.tilemap(__props.configuration);
|
|
1555
|
-
__props.onComplete?.(newScene, tilemap.value);
|
|
1556
|
-
});
|
|
1557
|
-
watch(() => __props.configuration.key, (newKey) => {
|
|
1558
|
-
const scene = getScene(sceneKey);
|
|
1559
|
-
const oldTilemap = tilemap.value;
|
|
1560
|
-
if (newKey) {
|
|
1561
|
-
tilemap.value = scene.make.tilemap(__props.configuration);
|
|
1562
|
-
__props.onComplete?.(scene, tilemap.value);
|
|
1563
|
-
} else tilemap.value = void 0;
|
|
1564
|
-
if (oldTilemap) oldTilemap.destroy();
|
|
1565
|
-
});
|
|
1566
|
-
onUnmounted(() => {
|
|
1567
|
-
if (!tilemap.value) return;
|
|
1568
|
-
tilemap.value.destroy();
|
|
1569
|
-
});
|
|
1570
|
-
return (_ctx, _cache) => {
|
|
1571
|
-
return renderSlot(_ctx.$slots, "default");
|
|
1572
|
-
};
|
|
1573
|
-
}
|
|
1574
|
-
});
|
|
1862
|
+
};
|
|
1863
|
+
// src/models/setterMap/TriangleSetter.ts
|
|
1864
|
+
let TriangleSetter = /* @__PURE__ */ function(TriangleSetter) {
|
|
1865
|
+
TriangleSetter["To"] = "to";
|
|
1866
|
+
return TriangleSetter;
|
|
1867
|
+
}({});
|
|
1575
1868
|
// src/services/setterMap/TriangleSetterMap.ts
|
|
1576
1869
|
const TriangleSetterMap = {
|
|
1577
|
-
to: (gameObject) => (value) => {
|
|
1870
|
+
["to"]: (gameObject) => (value) => {
|
|
1578
1871
|
if (!value) return;
|
|
1579
1872
|
gameObject.setTo(...value);
|
|
1580
1873
|
},
|
|
@@ -1582,7 +1875,7 @@ const TriangleSetterMap = {
|
|
|
1582
1875
|
...GlobalSetterMap
|
|
1583
1876
|
};
|
|
1584
1877
|
// src/components/Triangle.vue
|
|
1585
|
-
const _sfc_main$24 =
|
|
1878
|
+
const _sfc_main$24 = {
|
|
1586
1879
|
__name: "Triangle",
|
|
1587
1880
|
props: {
|
|
1588
1881
|
configuration: {},
|
|
@@ -1600,17 +1893,26 @@ const _sfc_main$24 = /*@__PURE__*/ defineComponent({
|
|
|
1600
1893
|
return null;
|
|
1601
1894
|
};
|
|
1602
1895
|
}
|
|
1603
|
-
}
|
|
1896
|
+
};
|
|
1897
|
+
// src/models/setterMap/VideoSetter.ts
|
|
1898
|
+
let VideoSetter = /* @__PURE__ */ function(VideoSetter) {
|
|
1899
|
+
VideoSetter["Key"] = "key";
|
|
1900
|
+
VideoSetter["Muted"] = "muted";
|
|
1901
|
+
VideoSetter["Volume"] = "volume";
|
|
1902
|
+
return VideoSetter;
|
|
1903
|
+
}({});
|
|
1604
1904
|
// src/services/setterMap/VideoSetterMap.ts
|
|
1605
1905
|
const VideoSetterMap = {
|
|
1606
|
-
key: (gameObject) => (value) => {
|
|
1906
|
+
["key"]: (gameObject) => (value) => {
|
|
1607
1907
|
if (!value) return;
|
|
1608
1908
|
gameObject.changeSource(value);
|
|
1609
1909
|
},
|
|
1610
|
-
muted: (gameObject) => (value) => {
|
|
1910
|
+
["muted"]: (gameObject) => (value) => {
|
|
1911
|
+
if (value === void 0) return;
|
|
1611
1912
|
gameObject.setMute(value);
|
|
1612
1913
|
},
|
|
1613
|
-
volume: (gameObject) => (value) => {
|
|
1914
|
+
["volume"]: (gameObject) => (value) => {
|
|
1915
|
+
if (value === void 0) return;
|
|
1614
1916
|
gameObject.setVolume(value);
|
|
1615
1917
|
},
|
|
1616
1918
|
...AlphaSetterMap,
|
|
@@ -1623,7 +1925,7 @@ const VideoSetterMap = {
|
|
|
1623
1925
|
...GlobalSetterMap
|
|
1624
1926
|
};
|
|
1625
1927
|
// src/components/Video.vue
|
|
1626
|
-
const _sfc_main$25 =
|
|
1928
|
+
const _sfc_main$25 = {
|
|
1627
1929
|
__name: "Video",
|
|
1628
1930
|
props: {
|
|
1629
1931
|
configuration: {},
|
|
@@ -1641,7 +1943,7 @@ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
|
|
|
1641
1943
|
return null;
|
|
1642
1944
|
};
|
|
1643
1945
|
}
|
|
1644
|
-
}
|
|
1946
|
+
};
|
|
1645
1947
|
// src/services/setterMap/ZoneSetterMap.ts
|
|
1646
1948
|
const ZoneSetterMap = {
|
|
1647
1949
|
...ComputedSizeSetterMap,
|
|
@@ -1653,9 +1955,9 @@ const ZoneSetterMap = {
|
|
|
1653
1955
|
...GlobalSetterMap
|
|
1654
1956
|
};
|
|
1655
1957
|
// src/components/Zone.vue
|
|
1656
|
-
const _sfc_main$26 =
|
|
1958
|
+
const _sfc_main$26 = {
|
|
1657
1959
|
__name: "Zone",
|
|
1658
|
-
props: { configuration: {} },
|
|
1960
|
+
props: { configuration: { type: Function } },
|
|
1659
1961
|
setup(__props, { emit: __emit }) {
|
|
1660
1962
|
useInitializeGameObject((scene) => {
|
|
1661
1963
|
const { height, width, x, y } = __props.configuration;
|
|
@@ -1665,25 +1967,32 @@ const _sfc_main$26 = /*@__PURE__*/ defineComponent({
|
|
|
1665
1967
|
return null;
|
|
1666
1968
|
};
|
|
1667
1969
|
}
|
|
1668
|
-
});
|
|
1669
|
-
// src/hooks/onShutdown.ts
|
|
1670
|
-
const onShutdown = (...args) => {
|
|
1671
|
-
pushListener("Shutdown", ...args);
|
|
1672
1970
|
};
|
|
1971
|
+
// src/hooks/onShutdown.ts
|
|
1972
|
+
const onShutdown = (...args) => pushListener("Shutdown", ...args);
|
|
1673
1973
|
// src/composables/useAnimations.ts
|
|
1674
1974
|
const useAnimations = (createConfigurations, immediate) => {
|
|
1675
1975
|
const animations = ref([]);
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
} else onNextTick((scene) => {
|
|
1976
|
+
let animationScene;
|
|
1977
|
+
const createAnimations = (scene) => {
|
|
1978
|
+
animationScene = scene;
|
|
1680
1979
|
animations.value = createConfigurations(scene);
|
|
1681
|
-
}
|
|
1682
|
-
|
|
1980
|
+
};
|
|
1981
|
+
const removeAnimations = () => {
|
|
1982
|
+
if (!animationScene) return;
|
|
1683
1983
|
for (const { key } of animations.value) {
|
|
1684
1984
|
if (!key) continue;
|
|
1685
|
-
|
|
1985
|
+
animationScene.anims.remove(key);
|
|
1686
1986
|
}
|
|
1987
|
+
};
|
|
1988
|
+
if (immediate) {
|
|
1989
|
+
const sceneKey = useInjectSceneKey();
|
|
1990
|
+
createAnimations(getScene(sceneKey));
|
|
1991
|
+
} else onNextTick(createAnimations);
|
|
1992
|
+
const removeShutdownListener = onShutdown(removeAnimations);
|
|
1993
|
+
onUnmounted(() => {
|
|
1994
|
+
removeShutdownListener();
|
|
1995
|
+
removeAnimations();
|
|
1687
1996
|
});
|
|
1688
1997
|
return animations;
|
|
1689
1998
|
};
|
|
@@ -1698,27 +2007,33 @@ const useTween = (tween, newTween) => {
|
|
|
1698
2007
|
};
|
|
1699
2008
|
};
|
|
1700
2009
|
// src/hooks/onInit.ts
|
|
1701
|
-
const onInit = (...args) =>
|
|
1702
|
-
pushListener("Init", ...args);
|
|
1703
|
-
};
|
|
2010
|
+
const onInit = (...args) => pushListener("Init", ...args);
|
|
1704
2011
|
// src/hooks/onPreload.ts
|
|
1705
|
-
const onPreload = (...args) =>
|
|
1706
|
-
pushListener("Preload", ...args);
|
|
1707
|
-
};
|
|
2012
|
+
const onPreload = (...args) => pushListener("Preload", ...args);
|
|
1708
2013
|
// src/hooks/onUpdate.ts
|
|
1709
|
-
const onUpdate = (...args) =>
|
|
1710
|
-
pushListener("Update", ...args);
|
|
1711
|
-
};
|
|
2014
|
+
const onUpdate = (...args) => pushListener("Update", ...args);
|
|
1712
2015
|
// src/models/plugins/TilemapFile.ts
|
|
1713
2016
|
const JSONFile = Loader.FileTypes.JSONFile;
|
|
1714
2017
|
var TilemapFile = class extends JSONFile {};
|
|
1715
|
-
// src/services/shared/
|
|
1716
|
-
const
|
|
2018
|
+
// src/services/shared/settleOnShutdown.ts
|
|
2019
|
+
const settleOnShutdown = (scene, schedule) => new Promise((resolve) => {
|
|
2020
|
+
if (scene.sys.settings.status >= Scenes.SHUTDOWN) {
|
|
2021
|
+
resolve();
|
|
2022
|
+
return;
|
|
2023
|
+
}
|
|
1717
2024
|
const settle = () => {
|
|
1718
2025
|
scene.events.off(Scenes.Events.SHUTDOWN, settle);
|
|
1719
2026
|
resolve();
|
|
1720
2027
|
};
|
|
1721
|
-
|
|
2028
|
+
schedule(settle);
|
|
1722
2029
|
scene.events.once(Scenes.Events.SHUTDOWN, settle);
|
|
1723
2030
|
});
|
|
1724
|
-
|
|
2031
|
+
// src/services/shared/sleepScene.ts
|
|
2032
|
+
const sleepScene = (scene, durationMs) => settleOnShutdown(scene, (settle) => {
|
|
2033
|
+
scene.time.delayedCall(durationMs, settle);
|
|
2034
|
+
});
|
|
2035
|
+
// src/services/shared/waitForNextTick.ts
|
|
2036
|
+
const waitForNextTick = (scene) => settleOnShutdown(scene, (settle) => {
|
|
2037
|
+
onNextTick(settle, scene.scene.key);
|
|
2038
|
+
});
|
|
2039
|
+
export { ANIMATION_COMPLETE_EVENT_PREFIX, AlphaSetter, AlphaSetterMap, AlphaSingleSetter, AlphaSingleSetterMap, AnimationSetter, AnimationSetterMap, _sfc_main as Arc, ArcSetter, ArcSetterMap, BaseTextureSetter, BaseTextureSetterMap, _sfc_main$1 as BitmapText, BitmapTextSetter, BitmapTextSetterMap, BlendModeSetter, BlendModeSetterMap, _sfc_main$2 as Circle, ComputedSizeSetter, ComputedSizeSetterMap, _sfc_main$3 as Container, ContainerSetterMap, _sfc_main$4 as Curve, CurveSetter, CurveSetterMap, DepthSetter, DepthSetterMap, DisplaySizeSetter, DisplaySizeSetterMap, EVENT_PREFIX, _sfc_main$5 as Ellipse, EllipseSetter, EllipseSetterMap, ExternalSceneStore, FlipSetter, FlipSetterMap, _sfc_main$6 as Game, GameObjectEvent, GameObjectEventMap, GameObjectSetter, GameObjectSetterMap, GlobalSetterMap, _sfc_main$7 as Graphics, GraphicsSetterMap, _sfc_main$8 as Image, ImageSetterMap, InjectionKeyMap, _sfc_main$9 as IsoBox, IsoBoxSetterMap, IsoSetter, IsoSetterMap, _sfc_main$10 as IsoTriangle, IsoTriangleSetter, IsoTriangleSetterMap, Lifecycle, _sfc_main$11 as Line, LineSetter, LineSetterMap, MaskSetter, MaskSetterMap, _sfc_main$12 as Nineslice, NinesliceSetter, NinesliceSetterMap, OriginSetter, OriginSetterMap, _sfc_main$13 as Particles, ParticlesSetter, ParticlesSetterMap, _sfc_main$14 as PathFollower, PathFollowerComponentSetter, PathFollowerComponentSetterMap, PathFollowerSetterMap, _sfc_main$15 as Polygon, PolygonSetter, PolygonSetterMap, _sfc_main$16 as Rectangle, RectangleSetterMap, RenderNodesSetterMap, _sfc_main$17 as RenderTexture, RenderTextureSetterMap, RenderableSetterMap, _sfc_main$18 as Scene, SceneObjectSetterMap, ScrollFactorSetter, ScrollFactorSetterMap, ShapeSetter, ShapeSetterMap, SizeSetterMap, _sfc_main$19 as Sprite, SpriteSetterMap, _sfc_main$20 as Star, StarSetter, StarSetterMap, TILEMAP_TILED_JSON_EXTERNAL_KEY, _sfc_main$21 as Text, TextSetter, TextSetterMap, TextureCropSetterMap, TextureSetterMap, _sfc_main$22 as TileSprite, TileSpriteSetterMap, TiledJSONExternalFile, _sfc_main$23 as Tilemap, TilemapFile, TilesetFile, TintSetter, TintSetterMap, TransformSetter, TransformSetterMap, _sfc_main$24 as Triangle, TriangleSetter, TriangleSetterMap, TweenSetter, TweenSetterMap, _sfc_main$25 as Video, VideoSetter, VideoSetterMap, VisibleSetter, VisibleSetterMap, _sfc_main$26 as Zone, ZoneSetterMap, checkIsEvent, createSceneClass, getDepthInsertIndex, getEventName, getInitializeGameObjectLifecycleHook, getScene, getTilesetDefinitionFields, getUpdateEvent, omitUndefined, onCreate, onInit, onNextTick, onPreload, onShutdown, onUpdate, pushGameObject, pushListener, registerTiledJSONExternalLoader, resetLifecycleListeners, runLifecycleListeners, runSceneShutdown, settleOnShutdown, sleepScene, stopStartedScene, useAnimations, useCameraStore, useGame, useInitializeGameObject, useInitializeGameObjectEvents, useInitializeGameObjectSetters, useInjectSceneKey, useInputStore, usePhaserStore, useTextStore, useTween, waitForNextTick };
|