@inglorious/renderer-react-dom 0.2.0 → 0.4.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inglorious/renderer-react-dom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A renderer for the Inglorious Engine, using React components.",
|
|
5
5
|
"author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,16 +18,14 @@
|
|
|
18
18
|
"./*": "./src/*"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
-
"src"
|
|
22
|
-
"README.md",
|
|
23
|
-
"LICENSE"
|
|
21
|
+
"src"
|
|
24
22
|
],
|
|
25
23
|
"publishConfig": {
|
|
26
24
|
"access": "public"
|
|
27
25
|
},
|
|
28
26
|
"dependencies": {
|
|
29
|
-
"@inglorious/engine": "0.
|
|
30
|
-
"@inglorious/utils": "
|
|
27
|
+
"@inglorious/engine": "0.10.0",
|
|
28
|
+
"@inglorious/utils": "2.2.0"
|
|
31
29
|
},
|
|
32
30
|
"devDependencies": {
|
|
33
31
|
"eslint": "^9.34.0",
|
package/src/game/scene/index.jsx
CHANGED
|
@@ -7,7 +7,7 @@ import classes from "./scene.module.scss"
|
|
|
7
7
|
export default function Scene({ entities, children }) {
|
|
8
8
|
const dispatch = useDispatch()
|
|
9
9
|
|
|
10
|
-
const [,
|
|
10
|
+
const [gameWidth, gameHeight] = entities.game.size
|
|
11
11
|
|
|
12
12
|
const ref = useRef()
|
|
13
13
|
const mouseHandlers = track(ref.current, {
|
|
@@ -17,7 +17,7 @@ export default function Scene({ entities, children }) {
|
|
|
17
17
|
return (
|
|
18
18
|
<div
|
|
19
19
|
className={classes.scene}
|
|
20
|
-
style={{ "--width": `${
|
|
20
|
+
style={{ "--width": `${gameWidth}px`, "--height": `${gameHeight}px` }}
|
|
21
21
|
ref={ref}
|
|
22
22
|
{...mouseHandlers}
|
|
23
23
|
>
|
|
@@ -4,7 +4,7 @@ import classes from "./with-absolute-position.module.scss"
|
|
|
4
4
|
|
|
5
5
|
export function withAbsolutePosition(Component) {
|
|
6
6
|
return function AbsolutePosition(props) {
|
|
7
|
-
const [,
|
|
7
|
+
const [, gameHeight] = props.entities.game.size
|
|
8
8
|
const { position = zero() } = props.entity
|
|
9
9
|
|
|
10
10
|
const [x, y, z] = position
|
|
@@ -13,7 +13,7 @@ export function withAbsolutePosition(Component) {
|
|
|
13
13
|
<Component
|
|
14
14
|
{...props}
|
|
15
15
|
className={classes.withAbsolutePosition}
|
|
16
|
-
style={{ "--x": `${x}px`, "--y": `${
|
|
16
|
+
style={{ "--x": `${x}px`, "--y": `${gameHeight - y - z}px` }}
|
|
17
17
|
/>
|
|
18
18
|
)
|
|
19
19
|
}
|