@phaserjs/phaser-editor-layout 1.0.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.
@@ -0,0 +1,424 @@
1
+ "use strict";
2
+ var PhaserEditorLayout = (() => {
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __commonJS = (cb, mod) => function __require() {
10
+ try {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ } catch (e) {
13
+ throw mod = 0, e;
14
+ }
15
+ };
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+
38
+ // phaser-global:phaser
39
+ var require_phaser = __commonJS({
40
+ "phaser-global:phaser"(exports, module) {
41
+ module.exports = globalThis.Phaser;
42
+ }
43
+ });
44
+
45
+ // src/index.ts
46
+ var index_exports = {};
47
+ __export(index_exports, {
48
+ LAYOUT_UPDATE_EVENT: () => LAYOUT_UPDATE_EVENT,
49
+ LayoutPlugin: () => LayoutPlugin,
50
+ LayoutZone: () => LayoutZone
51
+ });
52
+
53
+ // src/LayoutPlugin.ts
54
+ var import_phaser2 = __toESM(require_phaser(), 1);
55
+
56
+ // src/LayoutZone.ts
57
+ var import_phaser = __toESM(require_phaser(), 1);
58
+ var LayoutZone = class {
59
+ constructor(scene, provider, marginTop = 0, marginRight = 0, marginBottom = 0, marginLeft = 0) {
60
+ this.scene = scene;
61
+ this.provider = provider;
62
+ this.base = { marginTop, marginRight, marginBottom, marginLeft };
63
+ this.portrait = {};
64
+ this.landscape = {};
65
+ }
66
+ /** Effective value of one margin side under the active variant. */
67
+ _margin(side) {
68
+ const variant = this.provider.variant;
69
+ if (variant !== "base") {
70
+ const override = this[variant][side];
71
+ if (override !== void 0) {
72
+ return override;
73
+ }
74
+ }
75
+ return this.base[side];
76
+ }
77
+ /**
78
+ * The effective rectangle at the current screen size and active variant. Pass an
79
+ * `out` rectangle to avoid allocations.
80
+ */
81
+ getRect(out) {
82
+ var _a;
83
+ const size = (_a = this.provider.designSize) != null ? _a : this.scene.scale.gameSize;
84
+ const x = this._margin("marginLeft");
85
+ const y = this._margin("marginTop");
86
+ const width = size.width - x - this._margin("marginRight");
87
+ const height = size.height - y - this._margin("marginBottom");
88
+ if (out) {
89
+ out.setTo(x, y, width, height);
90
+ return out;
91
+ }
92
+ return new import_phaser.default.Geom.Rectangle(x, y, width, height);
93
+ }
94
+ };
95
+
96
+ // src/LayoutPlugin.ts
97
+ var LAYOUT_UPDATE_EVENT = "layoutupdate";
98
+ var LayoutPlugin = class extends import_phaser2.default.Plugins.ScenePlugin {
99
+ constructor(scene, pluginManager, pluginKey) {
100
+ super(scene, pluginManager, pluginKey);
101
+ /**
102
+ * The active layout variant. `"base"` applies only the baseline; `"portrait"` /
103
+ * `"landscape"` apply their overrides on top of base. Defaults to `"base"`. Change
104
+ * it with {@link setVariant} (manual) or {@link autoVariant} (orientation-driven).
105
+ */
106
+ this.variant = "base";
107
+ // When true, the active variant follows the screen orientation on every resize.
108
+ this._auto = false;
109
+ // Injected design size, or null to use the live scene size (scale.gameSize).
110
+ this._designSize = null;
111
+ this._scene = scene;
112
+ this._objects = /* @__PURE__ */ new Set();
113
+ this.events = new import_phaser2.default.Events.EventEmitter();
114
+ this.safeArea = new LayoutZone(scene, this);
115
+ this.screen = new LayoutZone(scene, this);
116
+ this._rect = new import_phaser2.default.Geom.Rectangle();
117
+ this._mat = new import_phaser2.default.GameObjects.Components.TransformMatrix();
118
+ this._p1 = new import_phaser2.default.Math.Vector2();
119
+ this._p2 = new import_phaser2.default.Math.Vector2();
120
+ }
121
+ boot() {
122
+ const events = this._scene.sys.events;
123
+ events.on(import_phaser2.default.Scenes.Events.CREATE, this.refresh, this);
124
+ events.on(import_phaser2.default.Scenes.Events.SHUTDOWN, this.shutdown, this);
125
+ events.once(import_phaser2.default.Scenes.Events.DESTROY, this.destroy, this);
126
+ this._scene.scale.on(import_phaser2.default.Scale.Events.RESIZE, this._onResize, this);
127
+ }
128
+ // ----- design size -----
129
+ /**
130
+ * The injected design size, or `null` when resolution follows the live scene size
131
+ * (`scale.gameSize`). Read by zones (the plugin is their {@link LayoutZone} provider).
132
+ */
133
+ get designSize() {
134
+ return this._designSize;
135
+ }
136
+ /**
137
+ * Resolve against a fixed design size (e.g. 1080×1920) instead of the live canvas
138
+ * size, then re-resolve. Hosts that author/preview layouts at a target resolution
139
+ * (the editor) use this; games typically leave it unset and follow `scale.gameSize`.
140
+ */
141
+ setDesignSize(width, height) {
142
+ this._designSize = { width, height };
143
+ this.refresh();
144
+ }
145
+ /** Clear the injected design size and fall back to the live scene size, then re-resolve. */
146
+ clearDesignSize() {
147
+ this._designSize = null;
148
+ this.refresh();
149
+ }
150
+ /** The effective size used for resolution: the injected design size, or the live game size. */
151
+ _size() {
152
+ var _a;
153
+ return (_a = this._designSize) != null ? _a : this._scene.scale.gameSize;
154
+ }
155
+ // ----- variants -----
156
+ /** The screen's current orientation, derived from the effective design size. */
157
+ get orientation() {
158
+ const size = this._size();
159
+ return size.height > size.width ? "portrait" : "landscape";
160
+ }
161
+ /**
162
+ * Manually set the active variant and re-resolve. Turns off orientation
163
+ * auto-detection (see {@link autoVariant}).
164
+ */
165
+ setVariant(variant) {
166
+ this._auto = false;
167
+ this.variant = variant;
168
+ this.refresh();
169
+ }
170
+ /**
171
+ * Enable (or disable) orientation-driven variant selection. When enabled, the active
172
+ * variant follows {@link orientation} (`"portrait"` / `"landscape"`) on every resize.
173
+ * Disabling resets the variant to `"base"`.
174
+ */
175
+ autoVariant(enabled = true) {
176
+ this._auto = enabled;
177
+ this.variant = enabled ? this.orientation : "base";
178
+ this.refresh();
179
+ }
180
+ _onResize() {
181
+ if (this._auto) {
182
+ this.variant = this.orientation;
183
+ }
184
+ this.refresh();
185
+ }
186
+ // ----- objects -----
187
+ /**
188
+ * Enable layout for an object: attaches a default {@link AnchorLayoutData} as
189
+ * `obj.layoutData` (if it does not have one yet), registers the object for
190
+ * re-resolution, and returns the data so it can be configured.
191
+ *
192
+ * The `base` defaults are inert: `targetType: "screen"`, both anchors `"none"` and
193
+ * zero offsets, so the object does not move until you choose anchors. `portrait` and
194
+ * `landscape` start empty (they inherit `base`).
195
+ */
196
+ add(obj) {
197
+ let data = obj.layoutData;
198
+ if (!data) {
199
+ data = {
200
+ enabled: true,
201
+ base: {
202
+ targetType: "screen",
203
+ horizontalAnchor: "none",
204
+ horizontalOffset: 0,
205
+ verticalAnchor: "none",
206
+ verticalOffset: 0
207
+ },
208
+ portrait: {},
209
+ landscape: {}
210
+ };
211
+ obj.layoutData = data;
212
+ }
213
+ this._objects.add(obj);
214
+ obj.once(import_phaser2.default.GameObjects.Events.DESTROY, this._onObjectDestroy, this);
215
+ return data;
216
+ }
217
+ /** Stop laying out an object and remove its `layoutData`. */
218
+ remove(obj) {
219
+ this._objects.delete(obj);
220
+ obj.off(import_phaser2.default.GameObjects.Events.DESTROY, this._onObjectDestroy, this);
221
+ obj.layoutData = void 0;
222
+ }
223
+ _onObjectDestroy(obj) {
224
+ this._objects.delete(obj);
225
+ }
226
+ // ----- zones -----
227
+ /**
228
+ * Create a screen-relative zone. A factory only — the returned zone is not stored
229
+ * by the plugin; hold the reference and assign it to `data.targetZone`.
230
+ */
231
+ createZone(marginTop = 0, marginRight = 0, marginBottom = 0, marginLeft = 0) {
232
+ return new LayoutZone(this._scene, this, marginTop, marginRight, marginBottom, marginLeft);
233
+ }
234
+ // ----- resolution -----
235
+ /**
236
+ * Re-resolve every enabled object now. The plugin also runs this automatically on
237
+ * `scale` `resize` and once after the scene is created, so explicit calls are only
238
+ * needed after mutating layout data (or the `safeArea` margins) at run time.
239
+ *
240
+ * Objects are resolved parent → child so a child anchored to its parent's bounds
241
+ * sees the parent's already-resolved rect.
242
+ */
243
+ refresh() {
244
+ const list = [];
245
+ for (const obj of this._objects) {
246
+ const data = obj.layoutData;
247
+ if (data && data.enabled) {
248
+ list.push(obj);
249
+ }
250
+ }
251
+ list.sort((a, b) => this._depth(a) - this._depth(b));
252
+ for (const obj of list) {
253
+ this._resolve(obj);
254
+ }
255
+ this.events.emit(LAYOUT_UPDATE_EVENT);
256
+ }
257
+ /**
258
+ * Resolve a specific list of objects once, against the current variant / design size /
259
+ * zones, **without** registering them for future passes (no {@link add}, no re-resolve
260
+ * on resize). Hosts that drive resolution themselves — e.g. the editor's live preview —
261
+ * set each object's `layoutData`, call this, then read back the resolved `x`/`y`.
262
+ *
263
+ * Objects are still resolved parent → child, and any object whose `layoutData` is
264
+ * missing or disabled is skipped.
265
+ */
266
+ resolveList(objects) {
267
+ const list = objects.filter((obj) => obj.layoutData && obj.layoutData.enabled);
268
+ list.sort((a, b) => this._depth(a) - this._depth(b));
269
+ for (const obj of list) {
270
+ this._resolve(obj);
271
+ }
272
+ this.events.emit(LAYOUT_UPDATE_EVENT);
273
+ }
274
+ _depth(obj) {
275
+ let depth = 0;
276
+ let parent = obj.parentContainer;
277
+ while (parent) {
278
+ depth++;
279
+ parent = parent.parentContainer;
280
+ }
281
+ return depth;
282
+ }
283
+ _resolve(obj) {
284
+ const go = obj;
285
+ const data = obj.layoutData;
286
+ const originX = typeof go.originX === "number" ? go.originX : 0;
287
+ const originY = typeof go.originY === "number" ? go.originY : 0;
288
+ const eff = this._effective(data);
289
+ if (eff.targetType === "parent") {
290
+ this._resolveAgainstParent(go, eff, originX, originY);
291
+ return;
292
+ }
293
+ this._resolveAgainstZone(go, eff, originX, originY);
294
+ }
295
+ /** Merge the active variant's overrides over `base` into concrete anchor properties. */
296
+ _effective(data) {
297
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
298
+ const base = data.base;
299
+ const over = this.variant === "base" ? void 0 : data[this.variant];
300
+ return {
301
+ targetType: (_b = (_a = over == null ? void 0 : over.targetType) != null ? _a : base.targetType) != null ? _b : "screen",
302
+ targetZone: (_c = over == null ? void 0 : over.targetZone) != null ? _c : base.targetZone,
303
+ horizontalAnchor: (_e = (_d = over == null ? void 0 : over.horizontalAnchor) != null ? _d : base.horizontalAnchor) != null ? _e : "none",
304
+ horizontalOffset: (_g = (_f = over == null ? void 0 : over.horizontalOffset) != null ? _f : base.horizontalOffset) != null ? _g : 0,
305
+ verticalAnchor: (_i = (_h = over == null ? void 0 : over.verticalAnchor) != null ? _h : base.verticalAnchor) != null ? _i : "none",
306
+ verticalOffset: (_k = (_j = over == null ? void 0 : over.verticalOffset) != null ? _j : base.verticalOffset) != null ? _k : 0
307
+ };
308
+ }
309
+ /** The zone a non-parent target resolves against. */
310
+ _zoneFor(eff) {
311
+ var _a;
312
+ switch (eff.targetType) {
313
+ case "safeArea":
314
+ return this.safeArea;
315
+ case "custom":
316
+ return (_a = eff.targetZone) != null ? _a : this.screen;
317
+ default:
318
+ return this.screen;
319
+ }
320
+ }
321
+ /** Resolve against a zone's world rect, converting to parent-local space if nested. */
322
+ _resolveAgainstZone(go, eff, originX, originY) {
323
+ var _a;
324
+ const zone = this._zoneFor(eff);
325
+ const t = zone.getRect(this._rect);
326
+ const w = this._sizeX(go);
327
+ const h = this._sizeY(go);
328
+ const parent = (_a = go.parentContainer) != null ? _a : null;
329
+ if (parent) {
330
+ const m = parent.getWorldTransformMatrix(this._mat);
331
+ const cur = m.transformPoint(go.x, go.y, this._p1);
332
+ const wx = this._axis(eff.horizontalAnchor, cur.x, t.left, t.right, eff.horizontalOffset, w, originX);
333
+ const wy = this._axis(eff.verticalAnchor, cur.y, t.top, t.bottom, eff.verticalOffset, h, originY);
334
+ const local = m.applyInverse(wx, wy, this._p2);
335
+ go.x = local.x;
336
+ go.y = local.y;
337
+ return;
338
+ }
339
+ go.x = this._axis(eff.horizontalAnchor, go.x, t.left, t.right, eff.horizontalOffset, w, originX);
340
+ go.y = this._axis(eff.verticalAnchor, go.y, t.top, t.bottom, eff.verticalOffset, h, originY);
341
+ }
342
+ /** Resolve against the object's parent container bounds (local space), or the screen. */
343
+ _resolveAgainstParent(go, eff, originX, originY) {
344
+ var _a;
345
+ const parent = (_a = go.parentContainer) != null ? _a : null;
346
+ if (parent) {
347
+ const right = parent.width || 0;
348
+ const bottom = parent.height || 0;
349
+ const w2 = (go.width || 0) * (typeof go.scaleX === "number" ? go.scaleX : 1);
350
+ const h2 = (go.height || 0) * (typeof go.scaleY === "number" ? go.scaleY : 1);
351
+ go.x = this._axis(eff.horizontalAnchor, go.x, 0, right, eff.horizontalOffset, w2, originX);
352
+ go.y = this._axis(eff.verticalAnchor, go.y, 0, bottom, eff.verticalOffset, h2, originY);
353
+ return;
354
+ }
355
+ const size = this._size();
356
+ const w = this._sizeX(go);
357
+ const h = this._sizeY(go);
358
+ go.x = this._axis(eff.horizontalAnchor, go.x, 0, size.width, eff.horizontalOffset, w, originX);
359
+ go.y = this._axis(eff.verticalAnchor, go.y, 0, size.height, eff.verticalOffset, h, originY);
360
+ }
361
+ /**
362
+ * Resolve one axis. Aligns the object's edge/center to the target edge/center,
363
+ * accounting for the object's origin so `"left"`/`"top"` align the left/top edge,
364
+ * `"center"` the center, and `"right"`/`"bottom"` the right/bottom edge.
365
+ *
366
+ * Reduces to the documented `t.left + offset + size / 2` form for centered-origin
367
+ * objects (`origin = 0.5`).
368
+ */
369
+ _axis(anchor, current, min, max, offset, size, origin) {
370
+ switch (anchor) {
371
+ case "left":
372
+ case "top":
373
+ return min + offset + origin * size;
374
+ case "right":
375
+ case "bottom":
376
+ return max + offset - (1 - origin) * size;
377
+ case "center":
378
+ return (min + max) / 2 + offset + (origin - 0.5) * size;
379
+ default:
380
+ return current;
381
+ }
382
+ }
383
+ _sizeX(go) {
384
+ if (typeof go.displayWidth === "number") {
385
+ return go.displayWidth;
386
+ }
387
+ return typeof go.width === "number" ? go.width : 0;
388
+ }
389
+ _sizeY(go) {
390
+ if (typeof go.displayHeight === "number") {
391
+ return go.displayHeight;
392
+ }
393
+ return typeof go.height === "number" ? go.height : 0;
394
+ }
395
+ // ----- event delegates -----
396
+ on(event, fn, context) {
397
+ this.events.on(event, fn, context);
398
+ return this;
399
+ }
400
+ once(event, fn, context) {
401
+ this.events.once(event, fn, context);
402
+ return this;
403
+ }
404
+ off(event, fn, context, once) {
405
+ this.events.off(event, fn, context, once);
406
+ return this;
407
+ }
408
+ // ----- lifecycle -----
409
+ shutdown() {
410
+ const events = this._scene.sys.events;
411
+ events.off(import_phaser2.default.Scenes.Events.CREATE, this.refresh, this);
412
+ events.off(import_phaser2.default.Scenes.Events.SHUTDOWN, this.shutdown, this);
413
+ this._scene.scale.off(import_phaser2.default.Scale.Events.RESIZE, this._onResize, this);
414
+ this._objects.clear();
415
+ }
416
+ destroy() {
417
+ this.shutdown();
418
+ this.events.destroy();
419
+ super.destroy();
420
+ }
421
+ };
422
+ return __toCommonJS(index_exports);
423
+ })();
424
+ //# sourceMappingURL=phaser-editor-layout.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["phaser-global:phaser", "../src/index.ts", "../src/LayoutPlugin.ts", "../src/LayoutZone.ts"],
4
+ "sourcesContent": ["module.exports = globalThis.Phaser;", "export { LayoutPlugin, LAYOUT_UPDATE_EVENT } from \"./LayoutPlugin\";\nexport { LayoutZone } from \"./LayoutZone\";\nexport type { ZoneMargins, VariantProvider } from \"./LayoutZone\";\nexport type { AnchorLayoutData, AnchorProps, HAnchor, VAnchor, TargetType, VariantName } from \"./types\";\n\n// Side-effect import so the `Phaser.Scene.layout` / `GameObject.layoutData` global\n// augmentations are always part of the public type surface.\nimport \"./types\";\n", "import Phaser from \"phaser\";\nimport { LayoutZone } from \"./LayoutZone\";\nimport type { AnchorLayoutData, HAnchor, TargetType, VAnchor, VariantName } from \"./types\";\n\n/** Event fired by the plugin after each resolution pass. */\nexport const LAYOUT_UPDATE_EVENT = \"layoutupdate\";\n\n/** Fully resolved anchor properties for the active variant (base + overrides). */\ninterface ResolvedAnchor {\n targetType: TargetType;\n targetZone?: LayoutZone;\n horizontalAnchor: HAnchor;\n horizontalOffset: number;\n verticalAnchor: VAnchor;\n verticalOffset: number;\n}\n\n/**\n * Scene plugin that resolves responsive anchors and zones at run time.\n *\n * Reached as `this.layout` (like `this.physics`) once registered with\n * `mapping: \"layout\"`. Per-object layout state lives on the object as\n * `obj.layoutData`; the plugin keeps the set of enabled objects so it can\n * re-resolve them when the screen changes.\n *\n * Register it in the game config:\n *\n * ```ts\n * plugins: {\n * scene: [\n * { key: \"LayoutPlugin\", plugin: LayoutPlugin, mapping: \"layout\" }\n * ]\n * }\n * ```\n */\nexport class LayoutPlugin extends Phaser.Plugins.ScenePlugin {\n\n /** Screen inset by the device safe-area insets. The host sets `safeArea.margin*`. */\n readonly safeArea: LayoutZone;\n\n /** The full screen bounds (0,0 .. width,height). */\n readonly screen: LayoutZone;\n\n /**\n * Event emitter that fires {@link LAYOUT_UPDATE_EVENT} after each resolution pass.\n * Use `this.layout.events.on(\"layoutupdate\", ...)` \u2014 or the `on`/`once`/`off`\n * delegates on the plugin itself.\n */\n readonly events: Phaser.Events.EventEmitter;\n\n /**\n * The active layout variant. `\"base\"` applies only the baseline; `\"portrait\"` /\n * `\"landscape\"` apply their overrides on top of base. Defaults to `\"base\"`. Change\n * it with {@link setVariant} (manual) or {@link autoVariant} (orientation-driven).\n */\n variant: VariantName = \"base\";\n\n // Non-null scene reference captured at construction. `ScenePlugin.scene` /\n // `ScenePlugin.systems` are typed as nullable; this avoids guarding every use.\n private readonly _scene: Phaser.Scene;\n\n // When true, the active variant follows the screen orientation on every resize.\n private _auto = false;\n\n // Injected design size, or null to use the live scene size (scale.gameSize).\n private _designSize: { width: number; height: number } | null = null;\n\n private readonly _objects: Set<Phaser.GameObjects.GameObject>;\n\n // Scratch values reused across a pass to avoid allocations.\n private readonly _rect: Phaser.Geom.Rectangle;\n private readonly _mat: Phaser.GameObjects.Components.TransformMatrix;\n private readonly _p1: Phaser.Math.Vector2;\n private readonly _p2: Phaser.Math.Vector2;\n\n constructor(\n scene: Phaser.Scene,\n pluginManager: Phaser.Plugins.PluginManager,\n pluginKey: string\n ) {\n super(scene, pluginManager, pluginKey);\n\n this._scene = scene;\n this._objects = new Set();\n this.events = new Phaser.Events.EventEmitter();\n\n this.safeArea = new LayoutZone(scene, this);\n this.screen = new LayoutZone(scene, this);\n\n this._rect = new Phaser.Geom.Rectangle();\n this._mat = new Phaser.GameObjects.Components.TransformMatrix();\n this._p1 = new Phaser.Math.Vector2();\n this._p2 = new Phaser.Math.Vector2();\n }\n\n boot(): void {\n\n const events = this._scene.sys.events;\n\n events.on(Phaser.Scenes.Events.CREATE, this.refresh, this);\n events.on(Phaser.Scenes.Events.SHUTDOWN, this.shutdown, this);\n events.once(Phaser.Scenes.Events.DESTROY, this.destroy, this);\n\n this._scene.scale.on(Phaser.Scale.Events.RESIZE, this._onResize, this);\n }\n\n // ----- design size -----\n\n /**\n * The injected design size, or `null` when resolution follows the live scene size\n * (`scale.gameSize`). Read by zones (the plugin is their {@link LayoutZone} provider).\n */\n get designSize(): { width: number; height: number } | null {\n\n return this._designSize;\n }\n\n /**\n * Resolve against a fixed design size (e.g. 1080\u00D71920) instead of the live canvas\n * size, then re-resolve. Hosts that author/preview layouts at a target resolution\n * (the editor) use this; games typically leave it unset and follow `scale.gameSize`.\n */\n setDesignSize(width: number, height: number): void {\n\n this._designSize = { width, height };\n this.refresh();\n }\n\n /** Clear the injected design size and fall back to the live scene size, then re-resolve. */\n clearDesignSize(): void {\n\n this._designSize = null;\n this.refresh();\n }\n\n /** The effective size used for resolution: the injected design size, or the live game size. */\n private _size(): { width: number; height: number } {\n\n return this._designSize ?? this._scene.scale.gameSize;\n }\n\n // ----- variants -----\n\n /** The screen's current orientation, derived from the effective design size. */\n get orientation(): \"portrait\" | \"landscape\" {\n\n const size = this._size();\n\n return size.height > size.width ? \"portrait\" : \"landscape\";\n }\n\n /**\n * Manually set the active variant and re-resolve. Turns off orientation\n * auto-detection (see {@link autoVariant}).\n */\n setVariant(variant: VariantName): void {\n\n this._auto = false;\n this.variant = variant;\n this.refresh();\n }\n\n /**\n * Enable (or disable) orientation-driven variant selection. When enabled, the active\n * variant follows {@link orientation} (`\"portrait\"` / `\"landscape\"`) on every resize.\n * Disabling resets the variant to `\"base\"`.\n */\n autoVariant(enabled = true): void {\n\n this._auto = enabled;\n this.variant = enabled ? this.orientation : \"base\";\n this.refresh();\n }\n\n private _onResize(): void {\n\n if (this._auto) {\n\n this.variant = this.orientation;\n }\n\n this.refresh();\n }\n\n // ----- objects -----\n\n /**\n * Enable layout for an object: attaches a default {@link AnchorLayoutData} as\n * `obj.layoutData` (if it does not have one yet), registers the object for\n * re-resolution, and returns the data so it can be configured.\n *\n * The `base` defaults are inert: `targetType: \"screen\"`, both anchors `\"none\"` and\n * zero offsets, so the object does not move until you choose anchors. `portrait` and\n * `landscape` start empty (they inherit `base`).\n */\n add<T extends Phaser.GameObjects.GameObject>(obj: T): AnchorLayoutData {\n\n let data = obj.layoutData;\n\n if (!data) {\n\n data = {\n enabled: true,\n base: {\n targetType: \"screen\",\n horizontalAnchor: \"none\",\n horizontalOffset: 0,\n verticalAnchor: \"none\",\n verticalOffset: 0,\n },\n portrait: {},\n landscape: {},\n };\n\n obj.layoutData = data;\n }\n\n this._objects.add(obj);\n\n obj.once(Phaser.GameObjects.Events.DESTROY, this._onObjectDestroy, this);\n\n return data;\n }\n\n /** Stop laying out an object and remove its `layoutData`. */\n remove(obj: Phaser.GameObjects.GameObject): void {\n\n this._objects.delete(obj);\n\n obj.off(Phaser.GameObjects.Events.DESTROY, this._onObjectDestroy, this);\n\n obj.layoutData = undefined;\n }\n\n private _onObjectDestroy(obj: Phaser.GameObjects.GameObject): void {\n\n this._objects.delete(obj);\n }\n\n // ----- zones -----\n\n /**\n * Create a screen-relative zone. A factory only \u2014 the returned zone is not stored\n * by the plugin; hold the reference and assign it to `data.targetZone`.\n */\n createZone(\n marginTop = 0,\n marginRight = 0,\n marginBottom = 0,\n marginLeft = 0\n ): LayoutZone {\n\n return new LayoutZone(this._scene, this, marginTop, marginRight, marginBottom, marginLeft);\n }\n\n // ----- resolution -----\n\n /**\n * Re-resolve every enabled object now. The plugin also runs this automatically on\n * `scale` `resize` and once after the scene is created, so explicit calls are only\n * needed after mutating layout data (or the `safeArea` margins) at run time.\n *\n * Objects are resolved parent \u2192 child so a child anchored to its parent's bounds\n * sees the parent's already-resolved rect.\n */\n refresh(): void {\n\n const list: Phaser.GameObjects.GameObject[] = [];\n\n for (const obj of this._objects) {\n\n const data = obj.layoutData;\n\n if (data && data.enabled) {\n\n list.push(obj);\n }\n }\n\n list.sort((a, b) => this._depth(a) - this._depth(b));\n\n for (const obj of list) {\n\n this._resolve(obj);\n }\n\n this.events.emit(LAYOUT_UPDATE_EVENT);\n }\n\n /**\n * Resolve a specific list of objects once, against the current variant / design size /\n * zones, **without** registering them for future passes (no {@link add}, no re-resolve\n * on resize). Hosts that drive resolution themselves \u2014 e.g. the editor's live preview \u2014\n * set each object's `layoutData`, call this, then read back the resolved `x`/`y`.\n *\n * Objects are still resolved parent \u2192 child, and any object whose `layoutData` is\n * missing or disabled is skipped.\n */\n resolveList(objects: Phaser.GameObjects.GameObject[]): void {\n\n const list = objects.filter(obj => obj.layoutData && obj.layoutData.enabled);\n\n list.sort((a, b) => this._depth(a) - this._depth(b));\n\n for (const obj of list) {\n\n this._resolve(obj);\n }\n\n this.events.emit(LAYOUT_UPDATE_EVENT);\n }\n\n private _depth(obj: Phaser.GameObjects.GameObject): number {\n\n let depth = 0;\n let parent = obj.parentContainer;\n\n while (parent) {\n\n depth++;\n parent = parent.parentContainer;\n }\n\n return depth;\n }\n\n private _resolve(obj: Phaser.GameObjects.GameObject): void {\n\n // `x`, `y`, `displayWidth`, origin, etc. live on transform/size/origin\n // components, not on the GameObject base type.\n const go = obj as any;\n const data = obj.layoutData as AnchorLayoutData;\n\n const originX = typeof go.originX === \"number\" ? go.originX : 0;\n const originY = typeof go.originY === \"number\" ? go.originY : 0;\n\n const eff = this._effective(data);\n\n if (eff.targetType === \"parent\") {\n\n this._resolveAgainstParent(go, eff, originX, originY);\n\n return;\n }\n\n this._resolveAgainstZone(go, eff, originX, originY);\n }\n\n /** Merge the active variant's overrides over `base` into concrete anchor properties. */\n private _effective(data: AnchorLayoutData): ResolvedAnchor {\n\n const base = data.base;\n const over = this.variant === \"base\" ? undefined : data[this.variant];\n\n return {\n targetType: over?.targetType ?? base.targetType ?? \"screen\",\n targetZone: over?.targetZone ?? base.targetZone,\n horizontalAnchor: over?.horizontalAnchor ?? base.horizontalAnchor ?? \"none\",\n horizontalOffset: over?.horizontalOffset ?? base.horizontalOffset ?? 0,\n verticalAnchor: over?.verticalAnchor ?? base.verticalAnchor ?? \"none\",\n verticalOffset: over?.verticalOffset ?? base.verticalOffset ?? 0,\n };\n }\n\n /** The zone a non-parent target resolves against. */\n private _zoneFor(eff: ResolvedAnchor): LayoutZone {\n\n switch (eff.targetType) {\n\n case \"safeArea\":\n return this.safeArea;\n\n case \"custom\":\n return eff.targetZone ?? this.screen;\n\n default: // \"screen\"\n return this.screen;\n }\n }\n\n /** Resolve against a zone's world rect, converting to parent-local space if nested. */\n private _resolveAgainstZone(\n go: any,\n eff: ResolvedAnchor,\n originX: number,\n originY: number\n ): void {\n\n const zone = this._zoneFor(eff);\n const t = zone.getRect(this._rect);\n\n const w = this._sizeX(go);\n const h = this._sizeY(go);\n\n const parent: Phaser.GameObjects.Container | null = go.parentContainer ?? null;\n\n if (parent) {\n\n // Work in world space, then convert the result into the parent's local space.\n const m = parent.getWorldTransformMatrix(this._mat);\n const cur = m.transformPoint(go.x, go.y, this._p1) as Phaser.Math.Vector2;\n\n const wx = this._axis(eff.horizontalAnchor, cur.x, t.left, t.right, eff.horizontalOffset, w, originX);\n const wy = this._axis(eff.verticalAnchor, cur.y, t.top, t.bottom, eff.verticalOffset, h, originY);\n\n const local = m.applyInverse(wx, wy, this._p2) as Phaser.Math.Vector2;\n\n go.x = local.x;\n go.y = local.y;\n\n return;\n }\n\n go.x = this._axis(eff.horizontalAnchor, go.x, t.left, t.right, eff.horizontalOffset, w, originX);\n go.y = this._axis(eff.verticalAnchor, go.y, t.top, t.bottom, eff.verticalOffset, h, originY);\n }\n\n /** Resolve against the object's parent container bounds (local space), or the screen. */\n private _resolveAgainstParent(\n go: any,\n eff: ResolvedAnchor,\n originX: number,\n originY: number\n ): void {\n\n const parent: Phaser.GameObjects.Container | null = go.parentContainer ?? null;\n\n if (parent) {\n\n // Children live in the parent's unscaled local space, with (0,0) at the\n // container origin. Use the container's explicit size as the rect, and the\n // child's local (unscaled-by-parent) size for edge alignment.\n const right = (parent as any).width || 0;\n const bottom = (parent as any).height || 0;\n\n const w = (go.width || 0) * (typeof go.scaleX === \"number\" ? go.scaleX : 1);\n const h = (go.height || 0) * (typeof go.scaleY === \"number\" ? go.scaleY : 1);\n\n go.x = this._axis(eff.horizontalAnchor, go.x, 0, right, eff.horizontalOffset, w, originX);\n go.y = this._axis(eff.verticalAnchor, go.y, 0, bottom, eff.verticalOffset, h, originY);\n\n return;\n }\n\n // No parent container: fall back to the screen rect, in world space.\n const size = this._size();\n const w = this._sizeX(go);\n const h = this._sizeY(go);\n\n go.x = this._axis(eff.horizontalAnchor, go.x, 0, size.width, eff.horizontalOffset, w, originX);\n go.y = this._axis(eff.verticalAnchor, go.y, 0, size.height, eff.verticalOffset, h, originY);\n }\n\n /**\n * Resolve one axis. Aligns the object's edge/center to the target edge/center,\n * accounting for the object's origin so `\"left\"`/`\"top\"` align the left/top edge,\n * `\"center\"` the center, and `\"right\"`/`\"bottom\"` the right/bottom edge.\n *\n * Reduces to the documented `t.left + offset + size / 2` form for centered-origin\n * objects (`origin = 0.5`).\n */\n private _axis(\n anchor: string,\n current: number,\n min: number,\n max: number,\n offset: number,\n size: number,\n origin: number\n ): number {\n\n switch (anchor) {\n\n case \"left\":\n case \"top\":\n return min + offset + origin * size;\n\n case \"right\":\n case \"bottom\":\n return max + offset - (1 - origin) * size;\n\n case \"center\":\n return (min + max) / 2 + offset + (origin - 0.5) * size;\n\n default: // \"none\"\n return current;\n }\n }\n\n private _sizeX(go: any): number {\n\n if (typeof go.displayWidth === \"number\") {\n\n return go.displayWidth;\n }\n\n return typeof go.width === \"number\" ? go.width : 0;\n }\n\n private _sizeY(go: any): number {\n\n if (typeof go.displayHeight === \"number\") {\n\n return go.displayHeight;\n }\n\n return typeof go.height === \"number\" ? go.height : 0;\n }\n\n // ----- event delegates -----\n\n on(event: string | symbol, fn: (...args: any[]) => void, context?: any): this {\n\n this.events.on(event, fn, context);\n\n return this;\n }\n\n once(event: string | symbol, fn: (...args: any[]) => void, context?: any): this {\n\n this.events.once(event, fn, context);\n\n return this;\n }\n\n off(event: string | symbol, fn?: (...args: any[]) => void, context?: any, once?: boolean): this {\n\n this.events.off(event, fn, context, once);\n\n return this;\n }\n\n // ----- lifecycle -----\n\n shutdown(): void {\n\n const events = this._scene.sys.events;\n\n events.off(Phaser.Scenes.Events.CREATE, this.refresh, this);\n events.off(Phaser.Scenes.Events.SHUTDOWN, this.shutdown, this);\n\n this._scene.scale.off(Phaser.Scale.Events.RESIZE, this._onResize, this);\n\n this._objects.clear();\n }\n\n destroy(): void {\n\n this.shutdown();\n\n this.events.destroy();\n\n super.destroy();\n }\n}\n", "import Phaser from \"phaser\";\nimport type { VariantName } from \"./types\";\n\n/** The four screen-edge insets that define a zone, in scene/world pixels. */\nexport interface ZoneMargins {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n}\n\n/** Minimal view of the plugin that supplies the active variant and design size. */\nexport interface VariantProvider {\n readonly variant: VariantName;\n\n /**\n * The design size the zones inset from, or `null` to use the live scene size\n * (`scene.scale.gameSize`). A host (e.g. the editor) can inject a fixed design size\n * to resolve against a target resolution instead of the current canvas size.\n */\n readonly designSize: { width: number; height: number } | null;\n}\n\n/**\n * A screen-relative rectangle defined by an inset (margin) from each screen edge.\n *\n * Margins are split into variants: `base` is the baseline (all four sides), and\n * `portrait` / `landscape` are partial overrides \u2014 any side left unset inherits from\n * `base`. The active variant follows the plugin (see {@link VariantProvider}), so a\n * zone's rect can differ per orientation.\n *\n * The rect is computed **lazily** via {@link LayoutZone.getRect} from the current screen\n * size and the effective margins, so the plugin never has to store or iterate zones.\n *\n * The built-in `safeArea` zone is just a `LayoutZone` whose margins are the\n * device-provided insets (notch / home indicator); `screen` is a `LayoutZone` with all\n * margins at 0.\n */\nexport class LayoutZone {\n\n /** Baseline margins (all four sides). */\n base: ZoneMargins;\n\n /** Margin overrides applied when the active variant is `\"portrait\"`. */\n portrait: Partial<ZoneMargins>;\n\n /** Margin overrides applied when the active variant is `\"landscape\"`. */\n landscape: Partial<ZoneMargins>;\n\n private readonly scene: Phaser.Scene;\n private readonly provider: VariantProvider;\n\n constructor(\n scene: Phaser.Scene,\n provider: VariantProvider,\n marginTop = 0,\n marginRight = 0,\n marginBottom = 0,\n marginLeft = 0\n ) {\n this.scene = scene;\n this.provider = provider;\n this.base = { marginTop, marginRight, marginBottom, marginLeft };\n this.portrait = {};\n this.landscape = {};\n }\n\n /** Effective value of one margin side under the active variant. */\n private _margin(side: keyof ZoneMargins): number {\n\n const variant = this.provider.variant;\n\n if (variant !== \"base\") {\n\n const override = (this[variant] as Partial<ZoneMargins>)[side];\n\n if (override !== undefined) {\n\n return override;\n }\n }\n\n return this.base[side];\n }\n\n /**\n * The effective rectangle at the current screen size and active variant. Pass an\n * `out` rectangle to avoid allocations.\n */\n getRect(out?: Phaser.Geom.Rectangle): Phaser.Geom.Rectangle {\n\n const size = this.provider.designSize ?? this.scene.scale.gameSize;\n\n const x = this._margin(\"marginLeft\");\n const y = this._margin(\"marginTop\");\n const width = size.width - x - this._margin(\"marginRight\");\n const height = size.height - y - this._margin(\"marginBottom\");\n\n if (out) {\n\n out.setTo(x, y, width, height);\n\n return out;\n }\n\n return new Phaser.Geom.Rectangle(x, y, width, height);\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,aAAO,UAAU,WAAW;AAAA;AAAA;;;ACA5B;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,MAAAA,iBAAmB;;;ACAnB,sBAAmB;AAsCZ,MAAM,aAAN,MAAiB;AAAA,IAcpB,YACI,OACA,UACA,YAAY,GACZ,cAAc,GACd,eAAe,GACf,aAAa,GACf;AACE,WAAK,QAAQ;AACb,WAAK,WAAW;AAChB,WAAK,OAAO,EAAE,WAAW,aAAa,cAAc,WAAW;AAC/D,WAAK,WAAW,CAAC;AACjB,WAAK,YAAY,CAAC;AAAA,IACtB;AAAA;AAAA,IAGQ,QAAQ,MAAiC;AAE7C,YAAM,UAAU,KAAK,SAAS;AAE9B,UAAI,YAAY,QAAQ;AAEpB,cAAM,WAAY,KAAK,OAAO,EAA2B,IAAI;AAE7D,YAAI,aAAa,QAAW;AAExB,iBAAO;AAAA,QACX;AAAA,MACJ;AAEA,aAAO,KAAK,KAAK,IAAI;AAAA,IACzB;A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"Phaser", "w", "h"]
7
+ }
@@ -0,0 +1 @@
1
+ "use strict";var PhaserEditorLayout=(()=>{var w=Object.create;var f=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var D=(o,s)=>()=>{try{return s||o((s={exports:{}}).exports,s),s.exports}catch(e){throw s=0,e}},R=(o,s)=>{for(var e in s)f(o,e,{get:s[e],enumerable:!0})},z=(o,s,e,t)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of E(s))!G.call(o,r)&&r!==e&&f(o,r,{get:()=>s[r],enumerable:!(t=S(s,r))||t.enumerable});return o};var P=(o,s,e)=>(e=o!=null?w(j(o)):{},z(s||!o||!o.__esModule?f(e,"default",{value:o,enumerable:!0}):e,o)),Z=o=>z(f({},"__esModule",{value:!0}),o);var O=D((M,x)=>{x.exports=globalThis.Phaser});var V={};R(V,{LAYOUT_UPDATE_EVENT:()=>_,LayoutPlugin:()=>g,LayoutZone:()=>m});var h=P(O(),1);var T=P(O(),1),m=class{constructor(s,e,t=0,r=0,n=0,i=0){this.scene=s,this.provider=e,this.base={marginTop:t,marginRight:r,marginBottom:n,marginLeft:i},this.portrait={},this.landscape={}}_margin(s){let e=this.provider.variant;if(e!=="base"){let t=this[e][s];if(t!==void 0)return t}return this.base[s]}getRect(s){var a;let e=(a=this.provider.designSize)!=null?a:this.scene.scale.gameSize,t=this._margin("marginLeft"),r=this._margin("marginTop"),n=e.width-t-this._margin("marginRight"),i=e.height-r-this._margin("marginBottom");return s?(s.setTo(t,r,n,i),s):new T.default.Geom.Rectangle(t,r,n,i)}};var _="layoutupdate",g=class extends h.default.Plugins.ScenePlugin{constructor(e,t,r){super(e,t,r);this.variant="base";this._auto=!1;this._designSize=null;this._scene=e,this._objects=new Set,this.events=new h.default.Events.EventEmitter,this.safeArea=new m(e,this),this.screen=new m(e,this),this._rect=new h.default.Geom.Rectangle,this._mat=new h.default.GameObjects.Components.TransformMatrix,this._p1=new h.default.Math.Vector2,this._p2=new h.default.Math.Vector2}boot(){let e=this._scene.sys.events;e.on(h.default.Scenes.Events.CREATE,this.refresh,this),e.on(h.default.Scenes.Events.SHUTDOWN,this.shutdown,this),e.once(h.default.Scenes.Events.DESTROY,this.destroy,this),this._scene.scale.on(h.default.Scale.Events.RESIZE,this._onResize,this)}get designSize(){return this._designSize}setDesignSize(e,t){this._designSize={width:e,height:t},this.refresh()}clearDesignSize(){this._designSize=null,this.refresh()}_size(){var e;return(e=this._designSize)!=null?e:this._scene.scale.gameSize}get orientation(){let e=this._size();return e.height>e.width?"portrait":"landscape"}setVariant(e){this._auto=!1,this.variant=e,this.refresh()}autoVariant(e=!0){this._auto=e,this.variant=e?this.orientation:"base",this.refresh()}_onResize(){this._auto&&(this.variant=this.orientation),this.refresh()}add(e){let t=e.layoutData;return t||(t={enabled:!0,base:{targetType:"screen",horizontalAnchor:"none",horizontalOffset:0,verticalAnchor:"none",verticalOffset:0},portrait:{},landscape:{}},e.layoutData=t),this._objects.add(e),e.once(h.default.GameObjects.Events.DESTROY,this._onObjectDestroy,this),t}remove(e){this._objects.delete(e),e.off(h.default.GameObjects.Events.DESTROY,this._onObjectDestroy,this),e.layoutData=void 0}_onObjectDestroy(e){this._objects.delete(e)}createZone(e=0,t=0,r=0,n=0){return new m(this._scene,this,e,t,r,n)}refresh(){let e=[];for(let t of this._objects){let r=t.layoutData;r&&r.enabled&&e.push(t)}e.sort((t,r)=>this._depth(t)-this._depth(r));for(let t of e)this._resolve(t);this.events.emit(_)}resolveList(e){let t=e.filter(r=>r.layoutData&&r.layoutData.enabled);t.sort((r,n)=>this._depth(r)-this._depth(n));for(let r of t)this._resolve(r);this.events.emit(_)}_depth(e){let t=0,r=e.parentContainer;for(;r;)t++,r=r.parentContainer;return t}_resolve(e){let t=e,r=e.layoutData,n=typeof t.originX=="number"?t.originX:0,i=typeof t.originY=="number"?t.originY:0,a=this._effective(r);if(a.targetType==="parent"){this._resolveAgainstParent(t,a,n,i);return}this._resolveAgainstZone(t,a,n,i)}_effective(e){var n,i,a,c,u,l,p,d,v,y,b;let t=e.base,r=this.variant==="base"?void 0:e[this.variant];return{targetType:(i=(n=r==null?void 0:r.targetType)!=null?n:t.targetType)!=null?i:"screen",targetZone:(a=r==null?void 0:r.targetZone)!=null?a:t.targetZone,horizontalAnchor:(u=(c=r==null?void 0:r.horizontalAnchor)!=null?c:t.horizontalAnchor)!=null?u:"none",horizontalOffset:(p=(l=r==null?void 0:r.horizontalOffset)!=null?l:t.horizontalOffset)!=null?p:0,verticalAnchor:(v=(d=r==null?void 0:r.verticalAnchor)!=null?d:t.verticalAnchor)!=null?v:"none",verticalOffset:(b=(y=r==null?void 0:r.verticalOffset)!=null?y:t.verticalOffset)!=null?b:0}}_zoneFor(e){var t;switch(e.targetType){case"safeArea":return this.safeArea;case"custom":return(t=e.targetZone)!=null?t:this.screen;default:return this.screen}}_resolveAgainstZone(e,t,r,n){var p;let a=this._zoneFor(t).getRect(this._rect),c=this._sizeX(e),u=this._sizeY(e),l=(p=e.parentContainer)!=null?p:null;if(l){let d=l.getWorldTransformMatrix(this._mat),v=d.transformPoint(e.x,e.y,this._p1),y=this._axis(t.horizontalAnchor,v.x,a.left,a.right,t.horizontalOffset,c,r),b=this._axis(t.verticalAnchor,v.y,a.top,a.bottom,t.verticalOffset,u,n),A=d.applyInverse(y,b,this._p2);e.x=A.x,e.y=A.y;return}e.x=this._axis(t.horizontalAnchor,e.x,a.left,a.right,t.horizontalOffset,c,r),e.y=this._axis(t.verticalAnchor,e.y,a.top,a.bottom,t.verticalOffset,u,n)}_resolveAgainstParent(e,t,r,n){var l;let i=(l=e.parentContainer)!=null?l:null;if(i){let p=i.width||0,d=i.height||0,v=(e.width||0)*(typeof e.scaleX=="number"?e.scaleX:1),y=(e.height||0)*(typeof e.scaleY=="number"?e.scaleY:1);e.x=this._axis(t.horizontalAnchor,e.x,0,p,t.horizontalOffset,v,r),e.y=this._axis(t.verticalAnchor,e.y,0,d,t.verticalOffset,y,n);return}let a=this._size(),c=this._sizeX(e),u=this._sizeY(e);e.x=this._axis(t.horizontalAnchor,e.x,0,a.width,t.horizontalOffset,c,r),e.y=this._axis(t.verticalAnchor,e.y,0,a.height,t.verticalOffset,u,n)}_axis(e,t,r,n,i,a,c){switch(e){case"left":case"top":return r+i+c*a;case"right":case"bottom":return n+i-(1-c)*a;case"center":return(r+n)/2+i+(c-.5)*a;default:return t}}_sizeX(e){return typeof e.displayWidth=="number"?e.displayWidth:typeof e.width=="number"?e.width:0}_sizeY(e){return typeof e.displayHeight=="number"?e.displayHeight:typeof e.height=="number"?e.height:0}on(e,t,r){return this.events.on(e,t,r),this}once(e,t,r){return this.events.once(e,t,r),this}off(e,t,r,n){return this.events.off(e,t,r,n),this}shutdown(){let e=this._scene.sys.events;e.off(h.default.Scenes.Events.CREATE,this.refresh,this),e.off(h.default.Scenes.Events.SHUTDOWN,this.shutdown,this),this._scene.scale.off(h.default.Scale.Events.RESIZE,this._onResize,this),this._objects.clear()}destroy(){this.shutdown(),this.events.destroy(),super.destroy()}};return Z(V);})();
@@ -0,0 +1,79 @@
1
+ import type { LayoutZone } from "./LayoutZone";
2
+ import type { LayoutPlugin } from "./LayoutPlugin";
3
+ /** Horizontal anchor edge. `"none"` leaves that axis as the raw `x`. */
4
+ export type HAnchor = "left" | "center" | "right" | "none";
5
+ /** Vertical anchor edge. `"none"` leaves that axis as the raw `y`. */
6
+ export type VAnchor = "top" | "center" | "bottom" | "none";
7
+ /**
8
+ * What an object anchors to:
9
+ * - `"screen"` — the full screen bounds (the built-in `screen` zone).
10
+ * - `"safeArea"` — the device safe area (the built-in `safeArea` zone).
11
+ * - `"parent"` — the object's own parent container bounds (per-object, not a shared zone).
12
+ * - `"custom"` — a user-defined zone, referenced by `targetZone`.
13
+ *
14
+ * The built-in targets (`"screen"` / `"safeArea"`) name their zone directly, so only
15
+ * `"custom"` needs a `targetZone` reference.
16
+ */
17
+ export type TargetType = "screen" | "safeArea" | "parent" | "custom";
18
+ /**
19
+ * Layout variants. `"base"` is the always-applied baseline; `"portrait"` / `"landscape"`
20
+ * are overrides selected by orientation. See {@link LayoutPlugin.variant}.
21
+ */
22
+ export type VariantName = "base" | "portrait" | "landscape";
23
+ /**
24
+ * The anchor properties for one variant. On `base` these hold the full baseline; on
25
+ * `portrait` / `landscape` only the fields that differ are set — unset fields inherit
26
+ * from `base`.
27
+ */
28
+ export interface AnchorProps {
29
+ targetType?: TargetType;
30
+ /** The zone to anchor to when `targetType === "custom"` (a zone object, never an id). */
31
+ targetZone?: LayoutZone;
32
+ horizontalAnchor?: HAnchor;
33
+ horizontalOffset?: number;
34
+ verticalAnchor?: VAnchor;
35
+ verticalOffset?: number;
36
+ }
37
+ /**
38
+ * Per-object layout state. Created by `this.layout.add(obj)` and stored as
39
+ * `obj.layoutData`. Mutate its fields directly; changes apply on the next layout pass
40
+ * (a `scale` `resize`) or when `this.layout.refresh()` is called.
41
+ *
42
+ * The anchor properties are split into variants: set `base` for the default layout and
43
+ * `portrait` / `landscape` for orientation-specific overrides. The resolver uses
44
+ * `active[prop] ?? base[prop]`, where the active variant follows
45
+ * {@link LayoutPlugin.variant}.
46
+ *
47
+ * ```ts
48
+ * data.base.targetType = "safeArea";
49
+ * data.base.horizontalAnchor = "center";
50
+ * data.portrait.verticalAnchor = "bottom";
51
+ * data.landscape.horizontalAnchor = "right";
52
+ * ```
53
+ */
54
+ export interface AnchorLayoutData {
55
+ /**
56
+ * When false, the object keeps its raw x/y and is skipped by the resolver — this
57
+ * is the "Absolute" mode (no anchoring) for that object.
58
+ */
59
+ enabled: boolean;
60
+ /** Baseline anchor properties; the resolver falls back here for unset variant fields. */
61
+ base: AnchorProps;
62
+ /** Overrides applied when the active variant is `"portrait"`. */
63
+ portrait: AnchorProps;
64
+ /** Overrides applied when the active variant is `"landscape"`. */
65
+ landscape: AnchorProps;
66
+ }
67
+ declare global {
68
+ namespace Phaser {
69
+ interface Scene {
70
+ layout: LayoutPlugin;
71
+ }
72
+ namespace GameObjects {
73
+ interface GameObject {
74
+ layoutData?: AnchorLayoutData;
75
+ }
76
+ }
77
+ }
78
+ }
79
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,wEAAwE;AACxE,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3D,sEAAsE;AACtE,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE3D;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErE;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,yFAAyF;IACzF,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,gBAAgB;IAE7B;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB,yFAAyF;IACzF,IAAI,EAAE,WAAW,CAAC;IAElB,iEAAiE;IACjE,QAAQ,EAAE,WAAW,CAAC;IAEtB,kEAAkE;IAClE,SAAS,EAAE,WAAW,CAAC;CAC1B;AAED,OAAO,CAAC,MAAM,CAAC;IAGX,UAAU,MAAM,CAAC;QAIb,UAAU,KAAK;YACX,MAAM,EAAE,YAAY,CAAC;SACxB;QAGD,UAAU,WAAW,CAAC;YAIlB,UAAU,UAAU;gBAChB,UAAU,CAAC,EAAE,gBAAgB,CAAC;aACjC;SACJ;KACJ;CACJ"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}