@inglorious/renderer-2d 11.0.0 → 12.0.1

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-2d",
3
- "version": "11.0.0",
3
+ "version": "12.0.1",
4
4
  "description": "A renderer for the Inglorious Engine, using the Context2D of the Canvas API.",
5
5
  "author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
6
6
  "license": "MIT",
@@ -25,18 +25,18 @@
25
25
  "access": "public"
26
26
  },
27
27
  "dependencies": {
28
- "@inglorious/engine": "12.0.0",
28
+ "@inglorious/engine": "13.0.1",
29
29
  "@inglorious/utils": "3.7.0"
30
30
  },
31
31
  "peerDependencies": {
32
- "@inglorious/engine": "12.0.0",
32
+ "@inglorious/engine": "13.0.1",
33
33
  "@inglorious/utils": "3.7.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "eslint": "^9.34.0",
37
37
  "prettier": "^3.6.2",
38
38
  "vitest": "^1.6.0",
39
- "@inglorious/eslint-config": "1.0.1"
39
+ "@inglorious/eslint-config": "1.1.0"
40
40
  },
41
41
  "scripts": {
42
42
  "format": "prettier --write '**/*.{js,jsx}'",
@@ -29,7 +29,7 @@ export function renderImage(entity, ctx, api) {
29
29
 
30
30
  ctx.translate(-tileWidth * anchorX, -tileHeight * anchorY)
31
31
 
32
- const { images } = api.getTypes()
32
+ const images = api.getType("images")
33
33
  const img = images.get(id) || document.getElementById(id)
34
34
  if (img) {
35
35
  ctx.drawImage(img, ...imgParams)
@@ -19,7 +19,6 @@ export function renderingSystem(canvas) {
19
19
 
20
20
  return {
21
21
  update(entities, dt, api) {
22
- const types = api.getTypes()
23
22
  const { game, ...worldEntities } = entities
24
23
 
25
24
  // 1. Clear canvas
@@ -60,7 +59,7 @@ export function renderingSystem(canvas) {
60
59
  b.position[Z] - a.position[Z],
61
60
  )
62
61
  .forEach((entity) => {
63
- const type = types[entity.type]
62
+ const type = api.getType(entity.type)
64
63
  const { render } = type
65
64
  if (render) {
66
65
  const augmentedRender = augmentRender(render)