react-simple-game-engine 0.3.21 → 0.3.24
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.
@@ -2,7 +2,8 @@ import { ReactElement } from "react";
|
|
2
2
|
declare type ControlContainerProps = {
|
3
3
|
full?: boolean;
|
4
4
|
children: ReactElement | ReactElement[];
|
5
|
+
stack?: boolean;
|
5
6
|
};
|
6
|
-
export declare function ControlContainer({ full, children }: ControlContainerProps): JSX.Element;
|
7
|
+
export declare function ControlContainer({ stack, full, children, }: ControlContainerProps): JSX.Element;
|
7
8
|
export {};
|
8
9
|
//# sourceMappingURL=control-container.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"control-container.d.ts","sourceRoot":"","sources":["../../src/ui-components/control-container.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"control-container.d.ts","sourceRoot":"","sources":["../../src/ui-components/control-container.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAG9C,aAAK,qBAAqB,GAAG;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,YAAY,GAAG,YAAY,EAAE,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAC/B,KAAa,EACb,IAAI,EACJ,QAAQ,GACT,EAAE,qBAAqB,eAsBvB"}
|
@@ -11,8 +11,9 @@ var __assign = (this && this.__assign) || function () {
|
|
11
11
|
};
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
13
|
import { useMemo } from "react";
|
14
|
+
import { getClassName } from "../utils";
|
14
15
|
export function ControlContainer(_a) {
|
15
|
-
var full = _a.full, children = _a.children;
|
16
|
+
var _b = _a.stack, stack = _b === void 0 ? false : _b, full = _a.full, children = _a.children;
|
16
17
|
var _children = useMemo(function () {
|
17
18
|
var _children = Array.isArray(children) ? children : [children];
|
18
19
|
return _children
|
@@ -22,9 +23,7 @@ export function ControlContainer(_a) {
|
|
22
23
|
}, [])
|
23
24
|
.filter(Boolean);
|
24
25
|
}, [children]);
|
25
|
-
return (_jsx("div", __assign({ style: {
|
26
|
-
width: "100%",
|
26
|
+
return (_jsx("div", __assign({ className: getClassName("control-container"), "data-stack": stack, style: {
|
27
27
|
height: full ? "100%" : undefined,
|
28
|
-
position: "relative",
|
29
28
|
} }, { children: _children })));
|
30
29
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"game-bootstrap.d.ts","sourceRoot":"","sources":["../../src/ui-components/game-bootstrap.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAmB,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAG1E,OAAO,EAAe,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAErE,aAAK,cAAc,GAAG,sBAAsB,GAAG;IAC7C,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,
|
1
|
+
{"version":3,"file":"game-bootstrap.d.ts","sourceRoot":"","sources":["../../src/ui-components/game-bootstrap.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAmB,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAG1E,OAAO,EAAe,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAErE,aAAK,cAAc,GAAG,sBAAsB,GAAG;IAC7C,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,eAiN3E"}
|
@@ -55,7 +55,9 @@ export function GameBootstrap(_a) {
|
|
55
55
|
document.head.appendChild(style);
|
56
56
|
var gameRootClass = getClassName("game-root");
|
57
57
|
var gameLoggerClass = getClassName("game-logger");
|
58
|
-
|
58
|
+
var uiControlClass = getClassName("ui-control");
|
59
|
+
var controlContainerClass = getClassName("control-container");
|
60
|
+
style.appendChild(document.createTextNode("\n .".concat(getClassName("assets-fail-view"), "{\n background-color: #f28181a1;\n min-height: 100px;\n padding: 10px;\n color: #000;\n }\n \n .").concat(getClassName("game-modal"), " {\n position: fixed;\n top: 0;\n left: 0;\n }\n\n .").concat(getClassName("scene-modal-stack"), "{\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n z-index: 2;\n }\n \n .").concat(getClassName("modal-content-main"), "{\n position: relative;\n z-index: 1;\n min-width: 200px;\n min-height: 200px;\n }\n\n .").concat(getClassName("modal-content-closer"), "{\n width: 100%;\n height: 100%;\n position: absolute;\n z-index: 0;\n }\n .").concat(getClassName("modal-content-centered"), "{\n width: 100%;\n height: 100%;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .").concat(getClassName("modal-content-wrap"), "{\n width: 100%;\n height: 100%;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n\n .").concat(gameRootClass, ", .").concat(gameRootClass, " *,\n .").concat(gameLoggerClass, ", .").concat(gameLoggerClass, " *\n {\n box-sizing: border-box;\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-size-adjust: none;\n }\n\n .").concat(gameRootClass, " {\n overflow: hidden;\n position: relative;\n }\n\n .").concat(gameLoggerClass, " {\n z-index: 4;\n position: fixed;\n top:0;\n right:0;\n }\n\n .").concat(getClassName("message-stack"), " {\n width: cacl(100vw - 40px);\n max-width: 300px;\n max-height: calc(50vh - 50px);\n min-width: 200px;\n min-height: 150px;\n position: absolute;\n top: 5px;\n right: 5px;\n padding: 5px;\n background-color: #0000007b;\n color: #fff;\n font-size: 0.8rem;\n\n display: flex;\n flex-direction: column;\n }\n\n .").concat(getClassName("message-stack-heading"), "{\n width: 100%;\n display: flex;\n justify-content: flex-end;\n }\n\n .").concat(getClassName("message-stack-content"), "{\n flex: 1;\n width: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n\n .").concat(getClassName("float-container"), " {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n\n .").concat(getClassName("float-container"), " > div {\n position: relative;\n width: 100%;\n height: 100%;\n }\n \n .").concat(uiControlClass, " {\n position: absolute;\n display: inline-flex;\n }\n\n .").concat(controlContainerClass, " {\n width: 100%;\n position: relative;\n }\n\n .").concat(controlContainerClass, "[data-stack=\"true\"] .").concat(uiControlClass, " {\n position: relative;\n display: flex;\n }\n\n .").concat(getClassName("scaler-container"), " {\n width: 100%;\n height: 100%;\n position: relative;\n top: 0;\n left: 0;\n }\n\n .").concat(getClassName("scaler-container"), " > div {\n transform-origin: left top;\n position: relative;\n top: 50%;\n left: 50%;\n }\n ")));
|
59
61
|
}, []);
|
60
62
|
return (_jsxs(_Fragment, { children: [_jsx(SceneRunner, __assign({ current: currentScene }, props), currentScene.sessionId), logPopup && _jsx(Logger, {})] }));
|
61
63
|
}
|