@umicat/phaser-sdk 1.0.19 → 1.0.20

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.
@@ -38,6 +38,10 @@ const WORLD_BOUNDS_ALPHA = 0.7;
38
38
  const CAMERA_VIEWPORT_COLOR = 0x4488ee;
39
39
  const CAMERA_VIEWPORT_ALPHA = 0.9;
40
40
  const CAMERA_VIEWPORT_LINE_WIDTH = 2;
41
+ // HUD edit mode — the PLAYER'S SCREEN frame (full game-intrinsic resolution).
42
+ // Brighter/distinct from the world-camera rect: it's the fixed boundary HUD
43
+ // widgets anchor to (Godot's UI viewport rect), not the movable camera view.
44
+ const HUD_SCREEN_COLOR = 0x5bc0ff;
41
45
  // FB.10 polish — CSS cursor name per tilemap resize handle. Corner handles
42
46
  // get the diagonal arrows (`nwse-resize` ↖↘ for NW/SE, `nesw-resize` ↗↙ for
43
47
  // NE/SW). Edge handles get the axis arrows (ns / ew). Same conventions as
@@ -1774,10 +1778,28 @@ export class EditorOverlayScene extends Phaser.Scene {
1774
1778
  const snap = this.game['__unboxyEditorScaleSnapshot'];
1775
1779
  const intrinsicW = snap?.gameWidth ?? this.game.scale.width;
1776
1780
  const intrinsicH = snap?.gameHeight ?? this.game.scale.height;
1777
- const camW = intrinsicW / worldSceneCam.zoom;
1778
- const camH = intrinsicH / worldSceneCam.zoom;
1779
- this.graphics.lineStyle(CAMERA_VIEWPORT_LINE_WIDTH, CAMERA_VIEWPORT_COLOR, CAMERA_VIEWPORT_ALPHA);
1780
- this.graphics.strokeRect(camX, camY, camW, camH);
1781
+ if (getEditorMode(this.game) === 'hud') {
1782
+ // HUD mode draw the PLAYER'S SCREEN frame at FULL intrinsic size
1783
+ // (1280×720), NOT intrinsic/zoom. HUD widgets are screen-anchored:
1784
+ // `syncHudCameraToEditorCam` maps HUD-intrinsic (0..1280, 0..720) onto
1785
+ // the full-intrinsic span at (gameCam.scroll). The world-camera zoom
1786
+ // shrinks how much WORLD fits, NOT the screen — so drawing the frame at
1787
+ // intrinsic/zoom (the world-camera viewport, as world mode does) made
1788
+ // the frame 3× smaller than the HUD, and widgets sprawled OUTSIDE it
1789
+ // (the "I can't tell where to place HUD" bug). At full intrinsic the
1790
+ // frame is exactly the HUD's bounds → a stable boundary to anchor to.
1791
+ this.graphics.lineStyle(CAMERA_VIEWPORT_LINE_WIDTH + 1, HUD_SCREEN_COLOR, 1);
1792
+ this.graphics.strokeRect(camX, camY, intrinsicW, intrinsicH);
1793
+ }
1794
+ else {
1795
+ // World mode → the camera viewport rect: where the runtime camera
1796
+ // looks + how much it sees (intrinsic/zoom). Small inside a larger
1797
+ // world for farming/RPG; coincides with world bounds for Tetris etc.
1798
+ const camW = intrinsicW / worldSceneCam.zoom;
1799
+ const camH = intrinsicH / worldSceneCam.zoom;
1800
+ this.graphics.lineStyle(CAMERA_VIEWPORT_LINE_WIDTH, CAMERA_VIEWPORT_COLOR, CAMERA_VIEWPORT_ALPHA);
1801
+ this.graphics.strokeRect(camX, camY, camW, camH);
1802
+ }
1781
1803
  }
1782
1804
  const selectedId = getSelection(this.game);
1783
1805
  if (selectedId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umicat/phaser-sdk",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "Umicat Phaser 3 SDK — game infrastructure for the Umicat platform",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",