react-simple-game-engine 0.1.74 → 0.1.77

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 CHANGED
@@ -1 +1,2 @@
1
- Document cumming soon...
1
+ [WIP] not able to use in currently.
2
+ <!-- Document cumming soon... -->
@@ -1 +1 @@
1
- {"version":3,"file":"scaler.d.ts","sourceRoot":"","sources":["../../src/classes/scaler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGvC,qBAAa,MAAM;IAGf,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,WAAW;IAJrB,OAAO,CAAC,MAAM,CAAS;gBAEJ,WAAW,EAAE,IAAI,EACjB,SAAS,EAAE,IAAI,EACxB,WAAW,EAAE,UAAU;IAKjC,IAAI,KAAK,WAER;IAED,IAAI,QAAQ,IA2BY,IAAI,CAzB3B;IAED,IAAI,UAAU,IA4Bc,IAAI,CA1B/B;IAED,IAAI,UAAU,IA6Bc,UAAU,CA3BrC;IAED,IAAI,UAAU;;;MAKb;IAED,IAAI,aAAa;;;MAMhB;IAED,IAAI,QAAQ,CAAC,SAAS,EAAE,IAAI,EAG3B;IAED,IAAI,UAAU,CAAC,WAAW,EAAE,IAAI,EAG/B;IAED,IAAI,UAAU,CAAC,WAAW,EAAE,UAAU,EAGrC;IAED,OAAO,CAAC,MAAM;CAOf"}
1
+ {"version":3,"file":"scaler.d.ts","sourceRoot":"","sources":["../../src/classes/scaler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGvC,qBAAa,MAAM;IAGf,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,WAAW;IAJrB,OAAO,CAAC,MAAM,CAAS;gBAEJ,WAAW,EAAE,IAAI,EACjB,SAAS,EAAE,IAAI,EACxB,WAAW,EAAE,UAAU;IAKjC,IAAI,KAAK,WAER;IAED,IAAI,QAAQ,IA6BY,IAAI,CA3B3B;IAED,IAAI,UAAU,IA8Bc,IAAI,CA5B/B;IAED,IAAI,UAAU,IA+Bc,UAAU,CA7BrC;IAED,IAAI,UAAU;;;MAKb;IAED,IAAI,aAAa;;;MAQhB;IAED,IAAI,QAAQ,CAAC,SAAS,EAAE,IAAI,EAG3B;IAED,IAAI,UAAU,CAAC,WAAW,EAAE,IAAI,EAG/B;IAED,IAAI,UAAU,CAAC,WAAW,EAAE,UAAU,EAGrC;IAED,OAAO,CAAC,MAAM;CAOf"}
@@ -60,9 +60,11 @@ var Scaler = /** @class */ (function () {
60
60
  Object.defineProperty(Scaler.prototype, "deltaToCenter", {
61
61
  get: function () {
62
62
  var _scaleSize = this.scaledSize;
63
+ var deltaW = Math.abs(this._canvasSize.width - _scaleSize.width);
64
+ var deltaH = Math.abs(this._canvasSize.height - _scaleSize.height);
63
65
  return {
64
- x: Math.abs(this._canvasSize.width - _scaleSize.width) / 2,
65
- y: Math.abs(this._canvasSize.height - _scaleSize.height) / 2,
66
+ x: deltaW / this._value / 2,
67
+ y: deltaH / this._value / 2,
66
68
  };
67
69
  },
68
70
  enumerable: false,
@@ -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,eAkGlB"}
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,eA2GlB"}
@@ -57,20 +57,25 @@ export function SceneRunner(_a) {
57
57
  return (_jsx("div", __assign({ style: {
58
58
  width: windowSize.width,
59
59
  height: windowSize.height,
60
+ overflow: "hidden",
60
61
  position: "relative",
61
62
  } }, { children: current.loadedAssets ? (_jsxs(_Fragment, { children: [_jsx(Sketch, { onSetup: setup, onDraw: draw, scaler: refScaler.current }), _jsx("div", __assign({ style: {
62
63
  position: "absolute",
63
64
  top: 0,
64
65
  left: 0,
65
- width: width,
66
- height: height,
66
+ width: "100%",
67
+ height: "100%",
67
68
  userSelect: "none",
68
69
  zIndex: 2,
69
- transform: "scale(".concat(refScaler.current.value, ")"),
70
- } }, { children: isBootDone ? (_jsx("div", __assign({ style: {
71
- width: "100%",
72
- height: "100%",
73
- } }, { children: _jsx(current.UI, __assign({ scene: current }, current.UIProps)) }))) : (_jsx("div", {})) }))] })) : (_jsx("div", __assign({ style: {
70
+ } }, { children: _jsx("div", __assign({ style: {
71
+ width: width,
72
+ height: height,
73
+ transform: "scale(".concat(refScaler.current.value, ")"),
74
+ transformOrigin: "left top",
75
+ } }, { children: isBootDone ? (_jsx("div", __assign({ style: {
76
+ width: "100%",
77
+ height: "100%",
78
+ } }, { children: _jsx(current.UI, __assign({ scene: current }, current.UIProps)) }))) : (_jsx("div", {})) })) }))] })) : (_jsx("div", __assign({ style: {
74
79
  width: "100%",
75
80
  height: "100%",
76
81
  transform: "scale(".concat(refScaler.current.value, ")"),
@@ -1 +1 @@
1
- {"version":3,"file":"sketch.d.ts","sourceRoot":"","sources":["../../src/ui-components/sketch.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,aAAK,WAAW,GAAG;IACjB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,WAAW,eAyCzE"}
1
+ {"version":3,"file":"sketch.d.ts","sourceRoot":"","sources":["../../src/ui-components/sketch.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,aAAK,WAAW,GAAG;IACjB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,WAAW,eA8CzE"}
@@ -34,5 +34,5 @@ export function Sketch(_a) {
34
34
  };
35
35
  // eslint-disable-next-line
36
36
  }, []);
37
- return _jsx("div", { style: { backgroundColor: "#000" }, ref: refContainer });
37
+ return (_jsx("div", { style: { backgroundColor: "#000", height: "100%" }, ref: refContainer }));
38
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-simple-game-engine",
3
- "version": "0.1.74",
3
+ "version": "0.1.77",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib",