react-simple-game-engine 0.1.81 → 0.1.82
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/lib/classes/scaler.js
CHANGED
@@ -85,7 +85,7 @@ var Scaler = /** @class */ (function () {
|
|
85
85
|
});
|
86
86
|
Scaler.prototype.update = function () {
|
87
87
|
if (this._layoutMode === LayoutMode.LANDSCAPE) {
|
88
|
-
if (this._canvasSize.width >= this.
|
88
|
+
if (this._canvasSize.width >= this._canvasSize.height) {
|
89
89
|
this._value = this._canvasSize.height / this._gameSize.height;
|
90
90
|
}
|
91
91
|
else {
|
@@ -93,7 +93,7 @@ var Scaler = /** @class */ (function () {
|
|
93
93
|
}
|
94
94
|
}
|
95
95
|
else {
|
96
|
-
if (this._canvasSize.height >= this.
|
96
|
+
if (this._canvasSize.height >= this._canvasSize.width) {
|
97
97
|
this._value = this._canvasSize.width / this._gameSize.width;
|
98
98
|
}
|
99
99
|
else {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scene-runner.d.ts","sourceRoot":"","sources":["../../src/ui-components/scene-runner.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,SAAS,EAKV,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAKzC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,oBAAY,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,aAAK,gBAAgB,GAAG,sBAAsB,GAAG;IAC/C,OAAO,EAAE,KAAK,CAAC;CAChB,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAC1B,WAAW,EACX,OAAO,EACP,KAAK,EACL,MAAM,EACN,YAAY,EAAE,YAAY,EAC1B,UAAiC,GAClC,EAAE,gBAAgB,
|
1
|
+
{"version":3,"file":"scene-runner.d.ts","sourceRoot":"","sources":["../../src/ui-components/scene-runner.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,SAAS,EAKV,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAKzC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,oBAAY,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,aAAK,gBAAgB,GAAG,sBAAsB,GAAG;IAC/C,OAAO,EAAE,KAAK,CAAC;CAChB,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAC1B,WAAW,EACX,OAAO,EACP,KAAK,EACL,MAAM,EACN,YAAY,EAAE,YAAY,EAC1B,UAAiC,GAClC,EAAE,gBAAgB,eAgHlB"}
|
@@ -67,15 +67,10 @@ export function SceneRunner(_a) {
|
|
67
67
|
height: "100%",
|
68
68
|
userSelect: "none",
|
69
69
|
zIndex: 2,
|
70
|
-
} }, { children: _jsx("div", __assign({ style: {
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
var deltaToCenter = refScaler.current.deltaToCenterForUI;
|
75
|
-
return "translate(".concat(deltaToCenter.x, "px,").concat(deltaToCenter.y, "px)");
|
76
|
-
})()),
|
77
|
-
transformOrigin: "left top",
|
78
|
-
} }, { children: isBootDone ? (_jsx("div", __assign({ style: {
|
70
|
+
} }, { children: _jsx("div", __assign({ style: __assign({ width: width, height: height, transform: "scale(".concat(refScaler.current.value, ")"), transformOrigin: "left top", position: "relative" }, (function () {
|
71
|
+
var deltaToCenter = refScaler.current.deltaToCenterForUI;
|
72
|
+
return { left: deltaToCenter.x, top: deltaToCenter.y };
|
73
|
+
})()) }, { children: isBootDone ? (_jsx("div", __assign({ style: {
|
79
74
|
width: "100%",
|
80
75
|
height: "100%",
|
81
76
|
} }, { children: _jsx(current.UI, __assign({ scene: current }, current.UIProps)) }))) : (_jsx("div", {})) })) }))] })) : (_jsx("div", __assign({ style: {
|