@energy8platform/game-engine 0.14.9 → 0.15.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/dist/audio.cjs.js +6 -1
- package/dist/audio.cjs.js.map +1 -1
- package/dist/audio.esm.js +6 -1
- package/dist/audio.esm.js.map +1 -1
- package/dist/core.cjs.js +6 -1
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.esm.js +6 -1
- package/dist/core.esm.js.map +1 -1
- package/dist/index.cjs.js +23 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +24 -5
- package/dist/index.esm.js +23 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/lua.cjs.js +2 -2
- package/dist/lua.cjs.js.map +1 -1
- package/dist/lua.esm.js +1 -1
- package/dist/lua.esm.js.map +1 -1
- package/dist/react-jsx.cjs.js +3 -0
- package/dist/react-jsx.cjs.js.map +1 -0
- package/dist/react-jsx.d.ts +582 -0
- package/dist/react-jsx.esm.js +2 -0
- package/dist/react-jsx.esm.js.map +1 -0
- package/dist/react.cjs.js +141 -11
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.esm.js +141 -11
- package/dist/react.esm.js.map +1 -1
- package/dist/ui.cjs.js +109 -8
- package/dist/ui.cjs.js.map +1 -1
- package/dist/ui.d.ts +82 -7
- package/dist/ui.esm.js +109 -9
- package/dist/ui.esm.js.map +1 -1
- package/package.json +6 -1
- package/src/audio/AudioManager.ts +6 -1
- package/src/lua/NativeSimulationRunner.ts +2 -2
- package/src/react/applyProps.ts +32 -1
- package/src/react/extendAll.ts +2 -2
- package/src/react/{jsx.d.ts → jsx-runtime.ts} +48 -8
- package/src/react/reconciler.ts +1 -1
- package/src/ui/FlexContainer.ts +39 -11
- package/src/ui/LabelValue.ts +122 -0
- package/src/ui/index.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -1278,16 +1278,35 @@ interface FlexItemConfig {
|
|
|
1278
1278
|
layoutHeight?: number | string;
|
|
1279
1279
|
/** Override parent's alignItems for this child */
|
|
1280
1280
|
alignSelf?: AlignSelf;
|
|
1281
|
-
/**
|
|
1281
|
+
/**
|
|
1282
|
+
* Exclude from flex layout (acts like position: absolute).
|
|
1283
|
+
*
|
|
1284
|
+
* Positioning props (`top`/`right`/`bottom`/`left`/`centerX`/`centerY`) describe
|
|
1285
|
+
* the **visual bounding rectangle**, so children with a centered internal
|
|
1286
|
+
* origin (Button, Label — `anchor = 0.5`) are positioned intuitively.
|
|
1287
|
+
* `left: 100` places the visible left edge at 100px, regardless of origin.
|
|
1288
|
+
*/
|
|
1282
1289
|
flexExclude?: boolean;
|
|
1283
|
-
/**
|
|
1290
|
+
/** Distance from top edge of parent content area to the child's visual top */
|
|
1284
1291
|
top?: number;
|
|
1285
|
-
/**
|
|
1292
|
+
/** Distance from right edge of parent content area to the child's visual right */
|
|
1286
1293
|
right?: number;
|
|
1287
|
-
/**
|
|
1294
|
+
/** Distance from bottom edge of parent content area to the child's visual bottom */
|
|
1288
1295
|
bottom?: number;
|
|
1289
|
-
/**
|
|
1296
|
+
/** Distance from left edge of parent content area to the child's visual left */
|
|
1290
1297
|
left?: number;
|
|
1298
|
+
/**
|
|
1299
|
+
* X coordinate of the child's visual center within parent content area.
|
|
1300
|
+
* Accepts pixels (`200`) or a percentage of parent content width (`'50%'`).
|
|
1301
|
+
* Takes precedence over `left`/`right`.
|
|
1302
|
+
*/
|
|
1303
|
+
centerX?: number | string;
|
|
1304
|
+
/**
|
|
1305
|
+
* Y coordinate of the child's visual center within parent content area.
|
|
1306
|
+
* Accepts pixels or a percentage of parent content height (`'50%'`).
|
|
1307
|
+
* Takes precedence over `top`/`bottom`.
|
|
1308
|
+
*/
|
|
1309
|
+
centerY?: number | string;
|
|
1291
1310
|
}
|
|
1292
1311
|
interface FlexContainerConfig {
|
|
1293
1312
|
/** Layout direction (default: 'row') */
|
package/dist/index.esm.js
CHANGED
|
@@ -768,6 +768,9 @@ class AudioManager {
|
|
|
768
768
|
this._soundModule = await import('@pixi/sound');
|
|
769
769
|
this._initialized = true;
|
|
770
770
|
this.applyVolumes();
|
|
771
|
+
if (this._globalMuted) {
|
|
772
|
+
this._soundModule.sound.muteAll();
|
|
773
|
+
}
|
|
771
774
|
this.setupMobileUnlock();
|
|
772
775
|
}
|
|
773
776
|
catch {
|
|
@@ -1025,7 +1028,9 @@ class AudioManager {
|
|
|
1025
1028
|
if (!this._soundModule)
|
|
1026
1029
|
return;
|
|
1027
1030
|
const { sound } = this._soundModule;
|
|
1028
|
-
|
|
1031
|
+
// Global mute is owned by sound.muteAll()/unmuteAll() (context.muted),
|
|
1032
|
+
// not by volumeAll — mixing both leaves mute un-undoable after reload.
|
|
1033
|
+
sound.volumeAll = 1;
|
|
1029
1034
|
}
|
|
1030
1035
|
setupMobileUnlock() {
|
|
1031
1036
|
if (this._unlocked)
|
|
@@ -3444,22 +3449,31 @@ class FlexContainer extends Container {
|
|
|
3444
3449
|
this._computedWidth = this._explicitWidth > 0 ? this._explicitWidth : (pl + totalCrossNatural + pr);
|
|
3445
3450
|
this._computedHeight = this._explicitHeight > 0 ? this._explicitHeight : (pt + naturalMainSize + pb);
|
|
3446
3451
|
}
|
|
3447
|
-
// Position flexExclude children (absolute positioning)
|
|
3452
|
+
// Position flexExclude children (absolute positioning).
|
|
3453
|
+
// All position props describe the visual (bounds) rectangle, so we subtract
|
|
3454
|
+
// `ox/oy` to compensate for children with a centered origin (Button, Label).
|
|
3455
|
+
// `centerX/centerY` take precedence over `left/right` / `top/bottom` on each axis.
|
|
3448
3456
|
for (const child of this._layoutChildren) {
|
|
3449
3457
|
if (!child._flexConfig?.flexExclude)
|
|
3450
3458
|
continue;
|
|
3451
3459
|
const cfg = child._flexConfig;
|
|
3452
|
-
const { w, h } = measureChild(child, pctRefW, pctRefH);
|
|
3460
|
+
const { w, h, ox, oy } = measureChild(child, pctRefW, pctRefH);
|
|
3453
3461
|
const cw = this._computedWidth;
|
|
3454
3462
|
const ch = this._computedHeight;
|
|
3455
|
-
|
|
3456
|
-
|
|
3463
|
+
const centerX = resolveDimension(cfg.centerX, pctRefW);
|
|
3464
|
+
if (centerX !== undefined)
|
|
3465
|
+
child.x = centerX - w / 2 - ox;
|
|
3466
|
+
else if (cfg.left !== undefined)
|
|
3467
|
+
child.x = cfg.left - ox;
|
|
3457
3468
|
else if (cfg.right !== undefined)
|
|
3458
|
-
child.x = cw - w - cfg.right;
|
|
3459
|
-
|
|
3460
|
-
|
|
3469
|
+
child.x = cw - w - cfg.right - ox;
|
|
3470
|
+
const centerY = resolveDimension(cfg.centerY, pctRefH);
|
|
3471
|
+
if (centerY !== undefined)
|
|
3472
|
+
child.y = centerY - h / 2 - oy;
|
|
3473
|
+
else if (cfg.top !== undefined)
|
|
3474
|
+
child.y = cfg.top - oy;
|
|
3461
3475
|
else if (cfg.bottom !== undefined)
|
|
3462
|
-
child.y = ch - h - cfg.bottom;
|
|
3476
|
+
child.y = ch - h - cfg.bottom - oy;
|
|
3463
3477
|
}
|
|
3464
3478
|
}
|
|
3465
3479
|
/** Computed content size (after layout) */
|