phaser-wind 0.7.0 → 0.9.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 +24 -0
- package/dist/components/column/column.d.ts +88 -0
- package/dist/components/column/column.d.ts.map +1 -0
- package/dist/components/column/column.js +143 -0
- package/dist/components/column/column.js.map +1 -0
- package/dist/components/column/column.spec.d.ts +2 -0
- package/dist/components/column/column.spec.d.ts.map +1 -0
- package/dist/components/column/column.spec.js +114 -0
- package/dist/components/column/column.spec.js.map +1 -0
- package/dist/components/column/index.d.ts +2 -0
- package/dist/components/column/index.d.ts.map +1 -0
- package/dist/components/column/index.js +2 -0
- package/dist/components/column/index.js.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/index.d.ts.map +1 -0
- package/dist/components/layout/index.js +2 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/layout/layout-utils.d.ts +13 -0
- package/dist/components/layout/layout-utils.d.ts.map +1 -0
- package/dist/components/layout/layout-utils.js +96 -0
- package/dist/components/layout/layout-utils.js.map +1 -0
- package/dist/components/layout/layout-utils.spec.d.ts +2 -0
- package/dist/components/layout/layout-utils.spec.d.ts.map +1 -0
- package/dist/components/layout/layout-utils.spec.js +70 -0
- package/dist/components/layout/layout-utils.spec.js.map +1 -0
- package/dist/components/row/index.d.ts +2 -0
- package/dist/components/row/index.d.ts.map +1 -0
- package/dist/components/row/index.js +2 -0
- package/dist/components/row/index.js.map +1 -0
- package/dist/components/row/row.d.ts +87 -0
- package/dist/components/row/row.d.ts.map +1 -0
- package/dist/components/row/row.js +146 -0
- package/dist/components/row/row.js.map +1 -0
- package/dist/components/row/row.spec.d.ts +2 -0
- package/dist/components/row/row.spec.d.ts.map +1 -0
- package/dist/components/row/row.spec.js +114 -0
- package/dist/components/row/row.spec.js.map +1 -0
- package/dist/core/color.d.ts +2 -0
- package/dist/core/color.d.ts.map +1 -1
- package/dist/core/color.js +15 -2
- package/dist/core/color.js.map +1 -1
- package/dist/core/color.spec.js +19 -2
- package/dist/core/color.spec.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/phaser-wind.js +410 -6
- package/dist/phaser-wind.min.js +1 -1
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +35 -0
- package/dist/test-setup.js.map +1 -0
- package/package.json +1 -1
- package/dist/components/column.d.ts +0 -2
- package/dist/components/column.d.ts.map +0 -1
- package/dist/components/column.js +0 -2
- package/dist/components/column.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.spec.js","sourceRoot":"","sources":["../../src/core/color.spec.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,2CAA2C;AAC3C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EACL,WAAW,EACX,KAAK,IAAI,YAAY,GAGtB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,GAAG,kBAAkB,CAAC;AACvC,MAAM,YAAY,GAAG,oBAAoB,CAAC;AAC1C,MAAM,aAAa,GAAG,SAAkB,CAAC;AACzC,MAAM,cAAc,GAAG,IAAa,CAAC;AACrC,MAAM,cAAc,GAAG,KAAc,CAAC;AAEtC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAI,KAMF,CAAC;IAEH,UAAU,CAAC,GAAG,EAAE;QACd,MAAM,SAAS,GAAG,WAAW,CAAC;YAC5B,MAAM,EAAE;gBACN,OAAO,EAAE,SAAS;gBAClB,SAAS,EAAE,UAAU;gBACr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,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC/C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;YAC5C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC5C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAgC,CAAC,CAAC,CAAC,OAAO,CAC/D,0CAA0C,CAC3C,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
package/dist/phaser-wind.js
CHANGED
|
@@ -61,6 +61,391 @@
|
|
|
61
61
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
+
/** Default gap between elements in pixels */
|
|
65
|
+
var DEFAULT_GAP = 8;
|
|
66
|
+
/** Measures the display width of a game object, with fallbacks */
|
|
67
|
+
var getDisplayWidthOf = function (child) {
|
|
68
|
+
var _a;
|
|
69
|
+
var childTyped = child;
|
|
70
|
+
// Check if it's a Container-like object (has list property and width/height)
|
|
71
|
+
if (child && typeof child === 'object' && 'list' in child && Array.isArray(child.list)) {
|
|
72
|
+
if (typeof childTyped.displayWidth === 'number' && childTyped.displayWidth > 0) {
|
|
73
|
+
return childTyped.displayWidth;
|
|
74
|
+
}
|
|
75
|
+
if (typeof childTyped.width === 'number' && childTyped.width > 0) {
|
|
76
|
+
return childTyped.width;
|
|
77
|
+
}
|
|
78
|
+
var container = child;
|
|
79
|
+
if (typeof container.displayWidth === 'number' && container.displayWidth > 0) {
|
|
80
|
+
return container.displayWidth;
|
|
81
|
+
}
|
|
82
|
+
if (typeof container.width === 'number' && container.width > 0) {
|
|
83
|
+
if (typeof container.scale === 'number' && container.scale > 0) {
|
|
84
|
+
return container.width / container.scale;
|
|
85
|
+
}
|
|
86
|
+
return container.width;
|
|
87
|
+
}
|
|
88
|
+
var w = 0;
|
|
89
|
+
for (var _i = 0, _b = container.list; _i < _b.length; _i++) {
|
|
90
|
+
var sub = _b[_i];
|
|
91
|
+
var size = getDisplayWidthOf(sub);
|
|
92
|
+
w = Math.max(w, size);
|
|
93
|
+
}
|
|
94
|
+
return w;
|
|
95
|
+
}
|
|
96
|
+
if (typeof childTyped.displayWidth === 'number') {
|
|
97
|
+
return childTyped.displayWidth;
|
|
98
|
+
}
|
|
99
|
+
if (typeof childTyped.width === 'number') {
|
|
100
|
+
return childTyped.width;
|
|
101
|
+
}
|
|
102
|
+
var bounds = (_a = childTyped.getBounds) === null || _a === void 0 ? void 0 : _a.call(childTyped);
|
|
103
|
+
return bounds ? bounds.width : 0;
|
|
104
|
+
};
|
|
105
|
+
/** Measures the display height of a game object, with fallbacks */
|
|
106
|
+
var getDisplayHeightOf = function (child) {
|
|
107
|
+
var _a;
|
|
108
|
+
var childTyped = child;
|
|
109
|
+
// Check if it's a Container-like object (has list property and width/height)
|
|
110
|
+
if (child && typeof child === 'object' && 'list' in child && Array.isArray(child.list)) {
|
|
111
|
+
if (typeof childTyped.displayHeight === 'number' && childTyped.displayHeight > 0) {
|
|
112
|
+
return childTyped.displayHeight;
|
|
113
|
+
}
|
|
114
|
+
if (typeof childTyped.height === 'number' && childTyped.height > 0) {
|
|
115
|
+
return childTyped.height;
|
|
116
|
+
}
|
|
117
|
+
var container = child;
|
|
118
|
+
if (typeof container.displayHeight === 'number' && container.displayHeight > 0) {
|
|
119
|
+
return container.displayHeight;
|
|
120
|
+
}
|
|
121
|
+
if (typeof container.height === 'number' && container.height > 0) {
|
|
122
|
+
if (typeof container.scale === 'number' && container.scale > 0) {
|
|
123
|
+
return container.height / container.scale;
|
|
124
|
+
}
|
|
125
|
+
return container.height;
|
|
126
|
+
}
|
|
127
|
+
var h = 0;
|
|
128
|
+
for (var _i = 0, _b = container.list; _i < _b.length; _i++) {
|
|
129
|
+
var sub = _b[_i];
|
|
130
|
+
var size = getDisplayHeightOf(sub);
|
|
131
|
+
h = Math.max(h, size);
|
|
132
|
+
}
|
|
133
|
+
return h;
|
|
134
|
+
}
|
|
135
|
+
if (typeof childTyped.displayHeight === 'number') {
|
|
136
|
+
return childTyped.displayHeight;
|
|
137
|
+
}
|
|
138
|
+
if (typeof childTyped.height === 'number') {
|
|
139
|
+
return childTyped.height;
|
|
140
|
+
}
|
|
141
|
+
var bounds = (_a = childTyped.getBounds) === null || _a === void 0 ? void 0 : _a.call(childTyped);
|
|
142
|
+
return bounds ? bounds.height : 0;
|
|
143
|
+
};
|
|
144
|
+
/** Returns normalized origin (0..1) for a game object */
|
|
145
|
+
var getNormalizedOriginOf = function (child) {
|
|
146
|
+
var width = getDisplayWidthOf(child);
|
|
147
|
+
var height = getDisplayHeightOf(child);
|
|
148
|
+
var childTyped = child;
|
|
149
|
+
var ox = typeof childTyped.originX === 'number' ? childTyped.originX : undefined;
|
|
150
|
+
var oy = typeof childTyped.originY === 'number' ? childTyped.originY : undefined;
|
|
151
|
+
if (ox === undefined &&
|
|
152
|
+
typeof childTyped.displayOriginX === 'number' &&
|
|
153
|
+
width > 0) {
|
|
154
|
+
ox = childTyped.displayOriginX / width;
|
|
155
|
+
}
|
|
156
|
+
if (oy === undefined &&
|
|
157
|
+
typeof childTyped.displayOriginY === 'number' &&
|
|
158
|
+
height > 0) {
|
|
159
|
+
oy = childTyped.displayOriginY / height;
|
|
160
|
+
}
|
|
161
|
+
return { x: ox !== null && ox !== void 0 ? ox : 0.5, y: oy !== null && oy !== void 0 ? oy : 0.5 };
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Column is a layout container that stacks children vertically with a gap.
|
|
166
|
+
* The container position (x, y) represents the center of the whole column.
|
|
167
|
+
*/
|
|
168
|
+
var Column = /** @class */ (function (_super) {
|
|
169
|
+
__extends(Column, _super);
|
|
170
|
+
/**
|
|
171
|
+
* Creates a new Column container
|
|
172
|
+
* @param params Configuration parameters for the column
|
|
173
|
+
*/
|
|
174
|
+
function Column(_a) {
|
|
175
|
+
var scene = _a.scene, x = _a.x, y = _a.y, _b = _a.gap, gap = _b === void 0 ? DEFAULT_GAP : _b, _c = _a.align, align = _c === void 0 ? 'center' : _c, _d = _a.children, children = _d === void 0 ? [] : _d, _e = _a.verticalOrigin, verticalOrigin = _e === void 0 ? 'center' : _e;
|
|
176
|
+
var _this = _super.call(this, scene, x, y) || this;
|
|
177
|
+
_this.gap = gap;
|
|
178
|
+
_this.align = align;
|
|
179
|
+
_this.verticalOrigin = verticalOrigin;
|
|
180
|
+
if (children.length > 0) {
|
|
181
|
+
_this.add(children);
|
|
182
|
+
}
|
|
183
|
+
_this.layout();
|
|
184
|
+
return _this;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Sets the spacing between children and relayouts
|
|
188
|
+
* @param gap Gap in pixels between elements
|
|
189
|
+
*/
|
|
190
|
+
Column.prototype.setGap = function (gap) {
|
|
191
|
+
this.gap = gap;
|
|
192
|
+
this.layout();
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Sets the horizontal alignment and relayouts
|
|
196
|
+
* @param align New horizontal alignment
|
|
197
|
+
*/
|
|
198
|
+
Column.prototype.setAlign = function (align) {
|
|
199
|
+
this.align = align;
|
|
200
|
+
this.layout();
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Adds a child game object to the column
|
|
204
|
+
* @param child Game object to add
|
|
205
|
+
* @param relayout Whether to relayout after adding (default: true)
|
|
206
|
+
* @returns This column instance for chaining
|
|
207
|
+
*/
|
|
208
|
+
Column.prototype.addChild = function (child, relayout) {
|
|
209
|
+
if (relayout === void 0) { relayout = true; }
|
|
210
|
+
this.add(child);
|
|
211
|
+
if (relayout)
|
|
212
|
+
this.layout();
|
|
213
|
+
return this;
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* Adds multiple children to the column
|
|
217
|
+
* @param children Array of game objects to add
|
|
218
|
+
* @param relayout Whether to relayout after adding (default: true)
|
|
219
|
+
* @returns This column instance for chaining
|
|
220
|
+
*/
|
|
221
|
+
Column.prototype.addChildren = function (children, relayout) {
|
|
222
|
+
if (relayout === void 0) { relayout = true; }
|
|
223
|
+
if (children.length > 0)
|
|
224
|
+
this.add(children);
|
|
225
|
+
if (relayout)
|
|
226
|
+
this.layout();
|
|
227
|
+
return this;
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* Recomputes children's positions and updates this container size
|
|
231
|
+
* Positions are calculated based on alignment, origins and gaps
|
|
232
|
+
*/
|
|
233
|
+
Column.prototype.layout = function () {
|
|
234
|
+
var _this = this;
|
|
235
|
+
var children = this.list;
|
|
236
|
+
if (children.length === 0) {
|
|
237
|
+
// Reset size when empty
|
|
238
|
+
this.setSize(0, 0);
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
// Measure sizes and origins
|
|
242
|
+
var entries = children.map(function (child) { return ({
|
|
243
|
+
child: child,
|
|
244
|
+
width: _this.getDisplayWidth(child),
|
|
245
|
+
height: _this.getDisplayHeight(child),
|
|
246
|
+
origin: _this.getNormalizedOrigin(child),
|
|
247
|
+
}); });
|
|
248
|
+
var maxWidth = entries.reduce(function (m, s) { return Math.max(m, s.width); }, 0);
|
|
249
|
+
var totalHeight = entries.reduce(function (sum, s) { return sum + s.height; }, 0) + this.gap * (entries.length - 1);
|
|
250
|
+
// Determine top of content based on verticalOrigin
|
|
251
|
+
var contentTopY = this.verticalOrigin === 'top' ? 0 : this.verticalOrigin === 'center' ? -totalHeight / 2 : -totalHeight;
|
|
252
|
+
// Walk from top to bottom, aligning considering each child's origin
|
|
253
|
+
var cursorTopY = contentTopY;
|
|
254
|
+
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
|
255
|
+
var _a = entries_1[_i], child = _a.child, width = _a.width, height = _a.height, origin_1 = _a.origin;
|
|
256
|
+
// Horizontal alignment: align left/right edges or centers correctly using origin
|
|
257
|
+
var x = 0;
|
|
258
|
+
if (this.align === 'left') {
|
|
259
|
+
// place child's left edge at content left
|
|
260
|
+
x = -maxWidth / 2 + origin_1.x * width;
|
|
261
|
+
}
|
|
262
|
+
else if (this.align === 'right') {
|
|
263
|
+
// place child's right edge at content right
|
|
264
|
+
x = maxWidth / 2 - (1 - origin_1.x) * width;
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
// center alignment: center of child at 0 accounting for origin
|
|
268
|
+
x = (origin_1.x - 0.5) * width;
|
|
269
|
+
}
|
|
270
|
+
// Vertical position so that child's top is at cursorTopY
|
|
271
|
+
var y = cursorTopY + origin_1.y * height;
|
|
272
|
+
child.setPosition(x, y);
|
|
273
|
+
cursorTopY += height + this.gap;
|
|
274
|
+
}
|
|
275
|
+
// Update this container size to match content bounds
|
|
276
|
+
this.setSize(maxWidth, totalHeight);
|
|
277
|
+
};
|
|
278
|
+
/**
|
|
279
|
+
* Gets the display width of a game object
|
|
280
|
+
* @param child GameObject to measure
|
|
281
|
+
* @returns Display width in pixels
|
|
282
|
+
*/
|
|
283
|
+
Column.prototype.getDisplayWidth = function (child) {
|
|
284
|
+
return getDisplayWidthOf(child);
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* Gets the display height of a game object
|
|
288
|
+
* @param child GameObject to measure
|
|
289
|
+
* @returns Display height in pixels
|
|
290
|
+
*/
|
|
291
|
+
Column.prototype.getDisplayHeight = function (child) {
|
|
292
|
+
return getDisplayHeightOf(child);
|
|
293
|
+
};
|
|
294
|
+
/**
|
|
295
|
+
* Gets the normalized origin point of a game object
|
|
296
|
+
* @param child GameObject to get origin from
|
|
297
|
+
* @returns Object with normalized x,y coordinates of the origin point
|
|
298
|
+
*/
|
|
299
|
+
Column.prototype.getNormalizedOrigin = function (child) {
|
|
300
|
+
return getNormalizedOriginOf(child);
|
|
301
|
+
};
|
|
302
|
+
return Column;
|
|
303
|
+
}(phaser.GameObjects.Container));
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Row is a layout container that arranges children horizontally with a gap.
|
|
307
|
+
* The container position (x, y) represents the center of the whole row.
|
|
308
|
+
*/
|
|
309
|
+
var Row = /** @class */ (function (_super) {
|
|
310
|
+
__extends(Row, _super);
|
|
311
|
+
/**
|
|
312
|
+
* Creates a new Row container
|
|
313
|
+
* @param params Configuration parameters for the row
|
|
314
|
+
*/
|
|
315
|
+
function Row(_a) {
|
|
316
|
+
var scene = _a.scene, x = _a.x, y = _a.y, _b = _a.gap, gap = _b === void 0 ? DEFAULT_GAP : _b, _c = _a.align, align = _c === void 0 ? 'center' : _c, _d = _a.children, children = _d === void 0 ? [] : _d, _e = _a.horizontalOrigin, horizontalOrigin = _e === void 0 ? 'center' : _e;
|
|
317
|
+
var _this = _super.call(this, scene, x, y) || this;
|
|
318
|
+
_this.gap = gap;
|
|
319
|
+
_this.align = align;
|
|
320
|
+
_this.horizontalOrigin = horizontalOrigin;
|
|
321
|
+
if (children.length > 0) {
|
|
322
|
+
_this.add(children);
|
|
323
|
+
}
|
|
324
|
+
_this.layout();
|
|
325
|
+
return _this;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Sets the gap between elements and updates layout
|
|
329
|
+
* @param gap Gap size in pixels
|
|
330
|
+
*/
|
|
331
|
+
Row.prototype.setGap = function (gap) {
|
|
332
|
+
this.gap = gap;
|
|
333
|
+
this.layout();
|
|
334
|
+
};
|
|
335
|
+
/**
|
|
336
|
+
* Sets the vertical alignment and updates layout
|
|
337
|
+
* @param align New vertical alignment
|
|
338
|
+
*/
|
|
339
|
+
Row.prototype.setAlign = function (align) {
|
|
340
|
+
this.align = align;
|
|
341
|
+
this.layout();
|
|
342
|
+
};
|
|
343
|
+
/**
|
|
344
|
+
* Adds a single child to the row
|
|
345
|
+
* @param child GameObject to add
|
|
346
|
+
* @param relayout Whether to update layout after adding
|
|
347
|
+
* @returns This row instance for chaining
|
|
348
|
+
*/
|
|
349
|
+
Row.prototype.addChild = function (child, relayout) {
|
|
350
|
+
if (relayout === void 0) { relayout = true; }
|
|
351
|
+
this.add(child);
|
|
352
|
+
if (relayout) {
|
|
353
|
+
this.layout();
|
|
354
|
+
}
|
|
355
|
+
return this;
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* Adds multiple children to the row
|
|
359
|
+
* @param children Array of GameObjects to add
|
|
360
|
+
* @param relayout Whether to update layout after adding
|
|
361
|
+
* @returns This row instance for chaining
|
|
362
|
+
*/
|
|
363
|
+
Row.prototype.addChildren = function (children, relayout) {
|
|
364
|
+
if (relayout === void 0) { relayout = true; }
|
|
365
|
+
if (children.length > 0)
|
|
366
|
+
this.add(children);
|
|
367
|
+
if (relayout)
|
|
368
|
+
this.layout();
|
|
369
|
+
return this;
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* Recomputes children's positions and updates this container size
|
|
373
|
+
*/
|
|
374
|
+
Row.prototype.layout = function () {
|
|
375
|
+
var _this = this;
|
|
376
|
+
var children = this.list;
|
|
377
|
+
if (children.length === 0) {
|
|
378
|
+
this.setSize(0, 0);
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
// Measure sizes and origins
|
|
382
|
+
var entries = children.map(function (child) { return ({
|
|
383
|
+
child: child,
|
|
384
|
+
width: _this.getDisplayWidth(child),
|
|
385
|
+
height: _this.getDisplayHeight(child),
|
|
386
|
+
origin: _this.getNormalizedOrigin(child),
|
|
387
|
+
}); });
|
|
388
|
+
var maxHeight = entries.reduce(function (m, s) { return Math.max(m, s.height); }, 0);
|
|
389
|
+
var totalWidth = entries.reduce(function (sum, s) { return sum + s.width; }, 0) +
|
|
390
|
+
this.gap * (entries.length - 1);
|
|
391
|
+
// Determine left of content based on horizontalOrigin
|
|
392
|
+
var contentLeftX = this.horizontalOrigin === 'left'
|
|
393
|
+
? 0
|
|
394
|
+
: this.horizontalOrigin === 'center'
|
|
395
|
+
? -totalWidth / 2
|
|
396
|
+
: -totalWidth;
|
|
397
|
+
// Walk left to right, aligning considering each child's origin
|
|
398
|
+
var cursorLeftX = contentLeftX;
|
|
399
|
+
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
|
400
|
+
var _a = entries_1[_i], child = _a.child, width = _a.width, height = _a.height, origin_1 = _a.origin;
|
|
401
|
+
// Vertical alignment: align top/bottom edges or centers correctly using origin
|
|
402
|
+
var y = 0;
|
|
403
|
+
if (this.align === 'top') {
|
|
404
|
+
// place child's top edge at content top
|
|
405
|
+
y = -maxHeight / 2 + origin_1.y * height;
|
|
406
|
+
}
|
|
407
|
+
else if (this.align === 'bottom') {
|
|
408
|
+
// place child's bottom edge at content bottom
|
|
409
|
+
y = maxHeight / 2 - (1 - origin_1.y) * height;
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
// center alignment
|
|
413
|
+
y = (origin_1.y - 0.5) * height;
|
|
414
|
+
}
|
|
415
|
+
// Horizontal position so that child's left is at cursorLeftX
|
|
416
|
+
var x = cursorLeftX + origin_1.x * width;
|
|
417
|
+
child.setPosition(x, y);
|
|
418
|
+
cursorLeftX += width + this.gap;
|
|
419
|
+
}
|
|
420
|
+
this.setSize(totalWidth, maxHeight);
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* Gets the display width of a game object
|
|
424
|
+
* @param child GameObject to measure
|
|
425
|
+
* @returns Display width in pixels
|
|
426
|
+
*/
|
|
427
|
+
Row.prototype.getDisplayWidth = function (child) {
|
|
428
|
+
return getDisplayWidthOf(child);
|
|
429
|
+
};
|
|
430
|
+
/**
|
|
431
|
+
* Gets the display height of a game object
|
|
432
|
+
* @param child GameObject to measure
|
|
433
|
+
* @returns Display height in pixels
|
|
434
|
+
*/
|
|
435
|
+
Row.prototype.getDisplayHeight = function (child) {
|
|
436
|
+
return getDisplayHeightOf(child);
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* Gets the normalized origin point of a game object
|
|
440
|
+
* @param child GameObject to get origin from
|
|
441
|
+
* @returns Object with normalized x,y coordinates of the origin point
|
|
442
|
+
*/
|
|
443
|
+
Row.prototype.getNormalizedOrigin = function (child) {
|
|
444
|
+
return getNormalizedOriginOf(child);
|
|
445
|
+
};
|
|
446
|
+
return Row;
|
|
447
|
+
}(phaser.GameObjects.Container));
|
|
448
|
+
|
|
64
449
|
/**
|
|
65
450
|
* Deep merge utility function that recursively merges objects
|
|
66
451
|
* Similar to lodash.merge but implemented natively
|
|
@@ -551,7 +936,7 @@
|
|
|
551
936
|
* @throws {Error} If color token is not found
|
|
552
937
|
*/
|
|
553
938
|
var rgb = function (color) {
|
|
554
|
-
var _a;
|
|
939
|
+
var _a, _b;
|
|
555
940
|
// Runtime supports direct CSS strings for flexibility, but
|
|
556
941
|
// the public type restricts to palette tokens or theme keys.
|
|
557
942
|
if (typeof color === 'string' && isValidColor(color)) {
|
|
@@ -561,11 +946,11 @@
|
|
|
561
946
|
if (colorFromTheme) {
|
|
562
947
|
return rgb(colorFromTheme);
|
|
563
948
|
}
|
|
564
|
-
var parts = color.split('-');
|
|
949
|
+
var parts = (_a = color === null || color === void 0 ? void 0 : color.split('-')) !== null && _a !== void 0 ? _a : [];
|
|
565
950
|
if (parts.length === 2) {
|
|
566
951
|
var colorKey = parts[0];
|
|
567
952
|
var shade = parts[1];
|
|
568
|
-
var colorValue_1 = (
|
|
953
|
+
var colorValue_1 = (_b = palette[colorKey]) === null || _b === void 0 ? void 0 : _b[shade];
|
|
569
954
|
if (!colorValue_1) {
|
|
570
955
|
if (isValidColor(color)) {
|
|
571
956
|
return color;
|
|
@@ -583,6 +968,18 @@
|
|
|
583
968
|
}
|
|
584
969
|
return colorValue;
|
|
585
970
|
};
|
|
971
|
+
var isValidColorToken = function (color) {
|
|
972
|
+
if (color === 'black' || color === 'white') {
|
|
973
|
+
return true;
|
|
974
|
+
}
|
|
975
|
+
var parts = color.split('-');
|
|
976
|
+
if (parts.length === 2) {
|
|
977
|
+
var colorKey = parts[0];
|
|
978
|
+
var shade = parts[1];
|
|
979
|
+
return colorKey in palette && shade in palette[colorKey];
|
|
980
|
+
}
|
|
981
|
+
return false;
|
|
982
|
+
};
|
|
586
983
|
/**
|
|
587
984
|
* Get hex number representation of a color
|
|
588
985
|
* @param color - Color token, theme color key or valid color string
|
|
@@ -590,7 +987,7 @@
|
|
|
590
987
|
* @throws {Error} If color token is not found
|
|
591
988
|
*/
|
|
592
989
|
var hex = function (color) {
|
|
593
|
-
var _a;
|
|
990
|
+
var _a, _b;
|
|
594
991
|
// See note in rgb()
|
|
595
992
|
if (typeof color === 'string' && isValidColor(color)) {
|
|
596
993
|
return convertColorValueToNumber(color);
|
|
@@ -599,11 +996,11 @@
|
|
|
599
996
|
if (colorFromTheme) {
|
|
600
997
|
return hex(colorFromTheme);
|
|
601
998
|
}
|
|
602
|
-
var parts = color.split('-');
|
|
999
|
+
var parts = (_a = color === null || color === void 0 ? void 0 : color.split('-')) !== null && _a !== void 0 ? _a : [];
|
|
603
1000
|
if (parts.length === 2) {
|
|
604
1001
|
var colorKey = parts[0];
|
|
605
1002
|
var shade = parts[1];
|
|
606
|
-
var colorValue = (
|
|
1003
|
+
var colorValue = (_b = palette[colorKey]) === null || _b === void 0 ? void 0 : _b[shade];
|
|
607
1004
|
if (!colorValue) {
|
|
608
1005
|
if (isValidColor(color)) {
|
|
609
1006
|
return convertColorValueToNumber(color);
|
|
@@ -621,6 +1018,7 @@
|
|
|
621
1018
|
var api = {
|
|
622
1019
|
rgb: rgb,
|
|
623
1020
|
hex: hex,
|
|
1021
|
+
isValidColorToken: isValidColorToken,
|
|
624
1022
|
black: function () { return rgb('black'); },
|
|
625
1023
|
white: function () { return rgb('white'); },
|
|
626
1024
|
slate: function (shade) { return rgb("slate-".concat(shade)); },
|
|
@@ -1199,10 +1597,13 @@
|
|
|
1199
1597
|
}(Phaser.Scene));
|
|
1200
1598
|
|
|
1201
1599
|
exports.Color = Color;
|
|
1600
|
+
exports.Column = Column;
|
|
1601
|
+
exports.DEFAULT_GAP = DEFAULT_GAP;
|
|
1202
1602
|
exports.FontSize = FontSize;
|
|
1203
1603
|
exports.PHASER_WIND_KEY = PHASER_WIND_KEY;
|
|
1204
1604
|
exports.PhaserWindPlugin = PhaserWindPlugin;
|
|
1205
1605
|
exports.Radius = Radius;
|
|
1606
|
+
exports.Row = Row;
|
|
1206
1607
|
exports.SceneWithPhaserWind = SceneWithPhaserWind;
|
|
1207
1608
|
exports.Shadow = Shadow;
|
|
1208
1609
|
exports.Spacing = Spacing;
|
|
@@ -1218,6 +1619,9 @@
|
|
|
1218
1619
|
exports.defaultShadowMap = defaultShadowMap;
|
|
1219
1620
|
exports.fontMap = fontMap;
|
|
1220
1621
|
exports.fontSizeMap = fontSizeMap;
|
|
1622
|
+
exports.getDisplayHeightOf = getDisplayHeightOf;
|
|
1623
|
+
exports.getDisplayWidthOf = getDisplayWidthOf;
|
|
1624
|
+
exports.getNormalizedOriginOf = getNormalizedOriginOf;
|
|
1221
1625
|
exports.isValidColor = isValidColor;
|
|
1222
1626
|
exports.merge = merge;
|
|
1223
1627
|
exports.mergeDeep = mergeDeep;
|