@unboxy/phaser-sdk 0.2.25 → 0.2.26

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.
@@ -185,29 +185,36 @@ function createTilemapStub(ctx, entity) {
185
185
  const g = ctx.scene.add.graphics();
186
186
  const w = entity.size.width * entity.tileSize.width;
187
187
  const h = entity.size.height * entity.tileSize.height;
188
+ // Draw centered around (0, 0) so the entity's transform.x/y anchors at the
189
+ // tilemap's center — matches sprite / primitive / code-rendered convention.
190
+ // Slice 6's real tilemap renderer can revisit anchor semantics.
191
+ const left = -w / 2;
192
+ const top = -h / 2;
188
193
  g.fillStyle(0xffffff, 0.04);
189
- g.fillRect(0, 0, w, h);
190
- // Outer border
194
+ g.fillRect(left, top, w, h);
191
195
  g.lineStyle(2, 0xaaaaaa, 0.6);
192
- g.strokeRect(0, 0, w, h);
193
- // Cell grid — only draw if cells aren't too tiny (perf cap).
196
+ g.strokeRect(left, top, w, h);
194
197
  if (entity.tileSize.width >= 8 && entity.size.width * entity.size.height < 4000) {
195
198
  g.lineStyle(1, 0xaaaaaa, 0.15);
196
199
  for (let i = 1; i < entity.size.width; i++) {
197
- const x = i * entity.tileSize.width;
200
+ const x = left + i * entity.tileSize.width;
198
201
  g.beginPath();
199
- g.moveTo(x, 0);
200
- g.lineTo(x, h);
202
+ g.moveTo(x, top);
203
+ g.lineTo(x, top + h);
201
204
  g.strokePath();
202
205
  }
203
206
  for (let i = 1; i < entity.size.height; i++) {
204
- const y = i * entity.tileSize.height;
207
+ const y = top + i * entity.tileSize.height;
205
208
  g.beginPath();
206
- g.moveTo(0, y);
207
- g.lineTo(w, y);
209
+ g.moveTo(left, y);
210
+ g.lineTo(left + w, y);
208
211
  g.strokePath();
209
212
  }
210
213
  }
214
+ // Same hit-test stash as code-rendered — Phaser Graphics has no intrinsic
215
+ // bounds, so the editor reads these from data. Slice 6's real tilemap will
216
+ // use Phaser.Tilemap which has its own bounds and won't need this.
217
+ sizeForHitTest(g, w, h);
211
218
  return g;
212
219
  }
213
220
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboxy/phaser-sdk",
3
- "version": "0.2.25",
3
+ "version": "0.2.26",
4
4
  "description": "Unboxy Phaser 3 SDK — game infrastructure for the Unboxy platform",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",