@inglorious/renderer-react-dom 0.3.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.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,14 +18,14 @@
18
18
  "./*": "./src/*"
19
19
  },
20
20
  "files": [
21
- "src/*"
21
+ "src"
22
22
  ],
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@inglorious/engine": "0.8.0",
28
- "@inglorious/utils": "2.0.0"
27
+ "@inglorious/engine": "0.10.0",
28
+ "@inglorious/utils": "2.2.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "eslint": "^9.34.0",
@@ -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 [, , width, height] = entities.game.bounds
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": `${width}px`, "--height": `${height}px` }}
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 [, , , screenHeight] = props.entities.game.bounds
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": `${screenHeight - y - z}px` }}
16
+ style={{ "--x": `${x}px`, "--y": `${gameHeight - y - z}px` }}
17
17
  />
18
18
  )
19
19
  }