@almadar/ui 5.55.0 → 5.57.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.
@@ -2559,6 +2559,7 @@ var GameCanvas3D = forwardRef(
2559
2559
  attackTargets = [],
2560
2560
  selectedTileIds = [],
2561
2561
  selectedUnitId = null,
2562
+ unitScale = 1,
2562
2563
  children
2563
2564
  }, ref) => {
2564
2565
  const containerRef = useRef(null);
@@ -2775,12 +2776,18 @@ var GameCanvas3D = forwardRef(
2775
2776
  },
2776
2777
  [selectedTileIds, hoveredTile, validMoves, attackTargets, handleTileClick, handleTileHover]
2777
2778
  );
2779
+ const UNIT_BASE_MODEL_SCALE = 0.5;
2780
+ const UNIT_BASE_BILLBOARD_HEIGHT = 1.2;
2781
+ const UNIT_BASE_PRIMITIVE_RADIUS = 0.3;
2778
2782
  const DefaultUnitRenderer = useCallback(
2779
2783
  ({ unit, position }) => {
2780
2784
  const isSelected = selectedUnitId === unit.id;
2781
2785
  const color = unit.faction === "player" ? 4491519 : unit.faction === "enemy" ? 16729156 : 16777028;
2782
2786
  const hasAtlas = unitAtlasUrl(unit) !== null;
2783
2787
  const initialFrame = hasAtlas ? resolveUnitFrame(unit.id) : null;
2788
+ const modelScale = UNIT_BASE_MODEL_SCALE * unitScale;
2789
+ const billboardHeight = UNIT_BASE_BILLBOARD_HEIGHT * unitScale;
2790
+ const primitiveRadius = UNIT_BASE_PRIMITIVE_RADIUS * unitScale;
2784
2791
  return /* @__PURE__ */ jsxs(
2785
2792
  "group",
2786
2793
  {
@@ -2798,7 +2805,8 @@ var GameCanvas3D = forwardRef(
2798
2805
  UnitSpriteBillboard,
2799
2806
  {
2800
2807
  sheetUrl: initialFrame.sheetUrl,
2801
- resolveFrame: () => resolveUnitFrame(unit.id)
2808
+ resolveFrame: () => resolveUnitFrame(unit.id),
2809
+ height: billboardHeight
2802
2810
  }
2803
2811
  ) })
2804
2812
  ) : unit.modelUrl ? (
@@ -2807,22 +2815,22 @@ var GameCanvas3D = forwardRef(
2807
2815
  ModelLoader,
2808
2816
  {
2809
2817
  url: unit.modelUrl,
2810
- scale: 0.5,
2818
+ scale: modelScale,
2811
2819
  fallbackGeometry: "box",
2812
2820
  castShadow: true
2813
2821
  }
2814
2822
  )
2815
2823
  ) : /* @__PURE__ */ jsxs(Fragment, { children: [
2816
- /* @__PURE__ */ jsxs("mesh", { position: [0, 0.3, 0], children: [
2817
- /* @__PURE__ */ jsx("cylinderGeometry", { args: [0.3, 0.3, 0.1, 8] }),
2824
+ /* @__PURE__ */ jsxs("mesh", { position: [0, primitiveRadius, 0], children: [
2825
+ /* @__PURE__ */ jsx("cylinderGeometry", { args: [primitiveRadius, primitiveRadius, primitiveRadius * 0.33, 8] }),
2818
2826
  /* @__PURE__ */ jsx("meshStandardMaterial", { color })
2819
2827
  ] }),
2820
- /* @__PURE__ */ jsxs("mesh", { position: [0, 0.6, 0], children: [
2821
- /* @__PURE__ */ jsx("capsuleGeometry", { args: [0.2, 0.4, 4, 8] }),
2828
+ /* @__PURE__ */ jsxs("mesh", { position: [0, primitiveRadius * 2, 0], children: [
2829
+ /* @__PURE__ */ jsx("capsuleGeometry", { args: [primitiveRadius * 0.67, primitiveRadius * 1.33, 4, 8] }),
2822
2830
  /* @__PURE__ */ jsx("meshStandardMaterial", { color })
2823
2831
  ] }),
2824
- /* @__PURE__ */ jsxs("mesh", { position: [0, 0.9, 0], children: [
2825
- /* @__PURE__ */ jsx("sphereGeometry", { args: [0.12, 8, 8] }),
2832
+ /* @__PURE__ */ jsxs("mesh", { position: [0, primitiveRadius * 3, 0], children: [
2833
+ /* @__PURE__ */ jsx("sphereGeometry", { args: [primitiveRadius * 0.4, 8, 8] }),
2826
2834
  /* @__PURE__ */ jsx("meshStandardMaterial", { color })
2827
2835
  ] })
2828
2836
  ] }),
@@ -2855,7 +2863,7 @@ var GameCanvas3D = forwardRef(
2855
2863
  }
2856
2864
  );
2857
2865
  },
2858
- [selectedUnitId, handleUnitClick, resolveUnitFrame]
2866
+ [selectedUnitId, handleUnitClick, resolveUnitFrame, unitScale]
2859
2867
  );
2860
2868
  const DefaultFeatureRenderer = useCallback(
2861
2869
  ({
@@ -2998,33 +3006,35 @@ var GameCanvas3D = forwardRef(
2998
3006
  fadeStrength: 1
2999
3007
  }
3000
3008
  ),
3001
- tiles.map((tile, index) => {
3002
- const position = gridToWorld2(
3003
- tile.x,
3004
- tile.z ?? tile.y ?? 0,
3005
- tile.elevation ?? 0
3006
- );
3007
- const Renderer = CustomTileRenderer || DefaultTileRenderer;
3008
- return /* @__PURE__ */ jsx(Renderer, { tile, position }, tile.id ?? `tile-${index}`);
3009
- }),
3010
- features.map((feature, index) => {
3011
- const position = gridToWorld2(
3012
- feature.x,
3013
- feature.z ?? feature.y ?? 0,
3014
- (feature.elevation ?? 0) + 0.5
3015
- );
3016
- const Renderer = CustomFeatureRenderer || DefaultFeatureRenderer;
3017
- return /* @__PURE__ */ jsx(Renderer, { feature, position }, feature.id ?? `feature-${index}`);
3018
- }),
3019
- units.map((unit) => {
3020
- const position = gridToWorld2(
3021
- unit.x ?? 0,
3022
- unit.z ?? unit.y ?? 0,
3023
- (unit.elevation ?? 0) + 0.5
3024
- );
3025
- const Renderer = CustomUnitRenderer || DefaultUnitRenderer;
3026
- return /* @__PURE__ */ jsx(Renderer, { unit, position }, unit.id);
3027
- }),
3009
+ /* @__PURE__ */ jsxs("group", { children: [
3010
+ tiles.map((tile, index) => {
3011
+ const position = gridToWorld2(
3012
+ tile.x,
3013
+ tile.z ?? tile.y ?? 0,
3014
+ tile.elevation ?? 0
3015
+ );
3016
+ const Renderer = CustomTileRenderer || DefaultTileRenderer;
3017
+ return /* @__PURE__ */ jsx(Renderer, { tile, position }, tile.id ?? `tile-${index}`);
3018
+ }),
3019
+ features.map((feature, index) => {
3020
+ const position = gridToWorld2(
3021
+ feature.x,
3022
+ feature.z ?? feature.y ?? 0,
3023
+ (feature.elevation ?? 0) + 0.5
3024
+ );
3025
+ const Renderer = CustomFeatureRenderer || DefaultFeatureRenderer;
3026
+ return /* @__PURE__ */ jsx(Renderer, { feature, position }, feature.id ?? `feature-${index}`);
3027
+ }),
3028
+ units.map((unit) => {
3029
+ const position = gridToWorld2(
3030
+ unit.x ?? 0,
3031
+ unit.z ?? unit.y ?? 0,
3032
+ (unit.elevation ?? 0) + 0.5
3033
+ );
3034
+ const Renderer = CustomUnitRenderer || DefaultUnitRenderer;
3035
+ return /* @__PURE__ */ jsx(Renderer, { unit, position }, unit.id);
3036
+ })
3037
+ ] }),
3028
3038
  children,
3029
3039
  /* @__PURE__ */ jsx(
3030
3040
  OrbitControls,
@@ -4212,6 +4222,8 @@ function GameBoard3D({
4212
4222
  features = [],
4213
4223
  cameraMode = "perspective",
4214
4224
  backgroundColor = "#2a1a1a",
4225
+ unitScale = 1,
4226
+ scale = 0.45,
4215
4227
  tileClickEvent,
4216
4228
  unitClickEvent,
4217
4229
  attackEvent,
@@ -4312,6 +4324,8 @@ function GameBoard3D({
4312
4324
  selectedUnitId,
4313
4325
  validMoves,
4314
4326
  attackTargets,
4327
+ unitScale,
4328
+ scale,
4315
4329
  className: "game-board-3d__canvas w-full min-h-[85vh]"
4316
4330
  }
4317
4331
  ),
@@ -4552,32 +4566,36 @@ var Box = React11.forwardRef(
4552
4566
  }
4553
4567
  );
4554
4568
  Box.displayName = "Box";
4569
+ var CDN = "https://almadar-kflow-assets.web.app/shared/3d/dungeon/floor";
4570
+ var FLOOR_WALL = `${CDN}/template-floor-detail-a.glb`;
4571
+ var FLOOR_DIRT = `${CDN}/template-floor-detail.glb`;
4572
+ var FLOOR_OPEN = `${CDN}/template-floor.glb`;
4555
4573
  var DEFAULT_3D_BATTLE_TILES = [
4556
- { id: "t00", x: 0, y: 0, z: 0, type: "stone", passable: false },
4557
- { id: "t10", x: 1, y: 0, z: 0, type: "stone", passable: false },
4558
- { id: "t20", x: 2, y: 0, z: 0, type: "stone", passable: false },
4559
- { id: "t30", x: 3, y: 0, z: 0, type: "stone", passable: false },
4560
- { id: "t40", x: 4, y: 0, z: 0, type: "stone", passable: false },
4561
- { id: "t01", x: 0, y: 1, z: 1, type: "stone", passable: false },
4562
- { id: "t11", x: 1, y: 1, z: 1, type: "dirt", passable: true },
4563
- { id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true },
4564
- { id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true },
4565
- { id: "t41", x: 4, y: 1, z: 1, type: "stone", passable: false },
4566
- { id: "t02", x: 0, y: 2, z: 2, type: "stone", passable: false },
4567
- { id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true },
4568
- { id: "t22", x: 2, y: 2, z: 2, type: "dirt", passable: true },
4569
- { id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true },
4570
- { id: "t42", x: 4, y: 2, z: 2, type: "stone", passable: false },
4571
- { id: "t03", x: 0, y: 3, z: 3, type: "stone", passable: false },
4572
- { id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true },
4573
- { id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true },
4574
- { id: "t33", x: 3, y: 3, z: 3, type: "dirt", passable: true },
4575
- { id: "t43", x: 4, y: 3, z: 3, type: "stone", passable: false },
4576
- { id: "t04", x: 0, y: 4, z: 4, type: "stone", passable: false },
4577
- { id: "t14", x: 1, y: 4, z: 4, type: "stone", passable: false },
4578
- { id: "t24", x: 2, y: 4, z: 4, type: "stone", passable: false },
4579
- { id: "t34", x: 3, y: 4, z: 4, type: "stone", passable: false },
4580
- { id: "t44", x: 4, y: 4, z: 4, type: "stone", passable: false }
4574
+ { id: "t00", x: 0, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4575
+ { id: "t10", x: 1, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4576
+ { id: "t20", x: 2, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4577
+ { id: "t30", x: 3, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4578
+ { id: "t40", x: 4, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4579
+ { id: "t01", x: 0, y: 1, z: 1, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4580
+ { id: "t11", x: 1, y: 1, z: 1, type: "dirt", passable: true, modelUrl: FLOOR_DIRT },
4581
+ { id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
4582
+ { id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
4583
+ { id: "t41", x: 4, y: 1, z: 1, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4584
+ { id: "t02", x: 0, y: 2, z: 2, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4585
+ { id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
4586
+ { id: "t22", x: 2, y: 2, z: 2, type: "dirt", passable: true, modelUrl: FLOOR_DIRT },
4587
+ { id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
4588
+ { id: "t42", x: 4, y: 2, z: 2, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4589
+ { id: "t03", x: 0, y: 3, z: 3, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4590
+ { id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
4591
+ { id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
4592
+ { id: "t33", x: 3, y: 3, z: 3, type: "dirt", passable: true, modelUrl: FLOOR_DIRT },
4593
+ { id: "t43", x: 4, y: 3, z: 3, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4594
+ { id: "t04", x: 0, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4595
+ { id: "t14", x: 1, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4596
+ { id: "t24", x: 2, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4597
+ { id: "t34", x: 3, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL },
4598
+ { id: "t44", x: 4, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL }
4581
4599
  ];
4582
4600
  var DEFAULT_3D_BATTLE_FEATURES = [
4583
4601
  { id: "f1", x: 2, y: 2, z: 2, type: "gold_mine", color: "#f4c542" },
@@ -4596,6 +4614,8 @@ function GameCanvas3DBattleTemplate({
4596
4614
  attackEvent,
4597
4615
  playAgainEvent,
4598
4616
  gameEndEvent,
4617
+ unitScale,
4618
+ scale,
4599
4619
  className
4600
4620
  }) {
4601
4621
  const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
@@ -4616,6 +4636,8 @@ function GameCanvas3DBattleTemplate({
4616
4636
  features,
4617
4637
  cameraMode,
4618
4638
  backgroundColor,
4639
+ unitScale,
4640
+ scale,
4619
4641
  tileClickEvent,
4620
4642
  unitClickEvent,
4621
4643
  endTurnEvent,
@@ -4646,32 +4668,36 @@ function GameCanvas3DBattleTemplate({
4646
4668
  );
4647
4669
  }
4648
4670
  GameCanvas3DBattleTemplate.displayName = "GameCanvas3DBattleTemplate";
4671
+ var CDN2 = "https://almadar-kflow-assets.web.app/shared/3d/dungeon/floor";
4672
+ var FLOOR_WALL2 = `${CDN2}/template-floor-detail-a.glb`;
4673
+ var FLOOR_DIRT2 = `${CDN2}/template-floor-detail.glb`;
4674
+ var FLOOR_OPEN2 = `${CDN2}/template-floor.glb`;
4649
4675
  var DEFAULT_3D_CASTLE_TILES = [
4650
- { id: "t00", x: 0, y: 0, z: 0, type: "wall", passable: false },
4651
- { id: "t10", x: 1, y: 0, z: 0, type: "wall", passable: false },
4652
- { id: "t20", x: 2, y: 0, z: 0, type: "wall", passable: false },
4653
- { id: "t30", x: 3, y: 0, z: 0, type: "wall", passable: false },
4654
- { id: "t40", x: 4, y: 0, z: 0, type: "wall", passable: false },
4655
- { id: "t01", x: 0, y: 1, z: 1, type: "wall", passable: false },
4656
- { id: "t11", x: 1, y: 1, z: 1, type: "floor", passable: true },
4657
- { id: "t21", x: 2, y: 1, z: 1, type: "floor", passable: true },
4658
- { id: "t31", x: 3, y: 1, z: 1, type: "floor", passable: true },
4659
- { id: "t41", x: 4, y: 1, z: 1, type: "wall", passable: false },
4660
- { id: "t02", x: 0, y: 2, z: 2, type: "wall", passable: false },
4661
- { id: "t12", x: 1, y: 2, z: 2, type: "floor", passable: true },
4662
- { id: "t22", x: 2, y: 2, z: 2, type: "floor", passable: true },
4663
- { id: "t32", x: 3, y: 2, z: 2, type: "floor", passable: true },
4664
- { id: "t42", x: 4, y: 2, z: 2, type: "wall", passable: false },
4665
- { id: "t03", x: 0, y: 3, z: 3, type: "wall", passable: false },
4666
- { id: "t13", x: 1, y: 3, z: 3, type: "floor", passable: true },
4667
- { id: "t23", x: 2, y: 3, z: 3, type: "floor", passable: true },
4668
- { id: "t33", x: 3, y: 3, z: 3, type: "floor", passable: true },
4669
- { id: "t43", x: 4, y: 3, z: 3, type: "wall", passable: false },
4670
- { id: "t04", x: 0, y: 4, z: 4, type: "wall", passable: false },
4671
- { id: "t14", x: 1, y: 4, z: 4, type: "wall", passable: false },
4672
- { id: "t24", x: 2, y: 4, z: 4, type: "wall", passable: false },
4673
- { id: "t34", x: 3, y: 4, z: 4, type: "wall", passable: false },
4674
- { id: "t44", x: 4, y: 4, z: 4, type: "wall", passable: false }
4676
+ { id: "t00", x: 0, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4677
+ { id: "t10", x: 1, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4678
+ { id: "t20", x: 2, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4679
+ { id: "t30", x: 3, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4680
+ { id: "t40", x: 4, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4681
+ { id: "t01", x: 0, y: 1, z: 1, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4682
+ { id: "t11", x: 1, y: 1, z: 1, type: "floor", passable: true, modelUrl: FLOOR_DIRT2 },
4683
+ { id: "t21", x: 2, y: 1, z: 1, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
4684
+ { id: "t31", x: 3, y: 1, z: 1, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
4685
+ { id: "t41", x: 4, y: 1, z: 1, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4686
+ { id: "t02", x: 0, y: 2, z: 2, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4687
+ { id: "t12", x: 1, y: 2, z: 2, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
4688
+ { id: "t22", x: 2, y: 2, z: 2, type: "floor", passable: true, modelUrl: FLOOR_DIRT2 },
4689
+ { id: "t32", x: 3, y: 2, z: 2, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
4690
+ { id: "t42", x: 4, y: 2, z: 2, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4691
+ { id: "t03", x: 0, y: 3, z: 3, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4692
+ { id: "t13", x: 1, y: 3, z: 3, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
4693
+ { id: "t23", x: 2, y: 3, z: 3, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
4694
+ { id: "t33", x: 3, y: 3, z: 3, type: "floor", passable: true, modelUrl: FLOOR_DIRT2 },
4695
+ { id: "t43", x: 4, y: 3, z: 3, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4696
+ { id: "t04", x: 0, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4697
+ { id: "t14", x: 1, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4698
+ { id: "t24", x: 2, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4699
+ { id: "t34", x: 3, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
4700
+ { id: "t44", x: 4, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 }
4675
4701
  ];
4676
4702
  var DEFAULT_3D_CASTLE_FEATURES = [
4677
4703
  { id: "f1", x: 2, y: 2, z: 2, type: "chest", color: "#f4c542" },
@@ -4691,6 +4717,8 @@ function GameCanvas3DCastleTemplate({
4691
4717
  playAgainEvent,
4692
4718
  gameEndEvent,
4693
4719
  showHeader = true,
4720
+ unitScale,
4721
+ scale,
4694
4722
  className
4695
4723
  }) {
4696
4724
  const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
@@ -4721,6 +4749,8 @@ function GameCanvas3DCastleTemplate({
4721
4749
  features,
4722
4750
  cameraMode,
4723
4751
  backgroundColor,
4752
+ unitScale,
4753
+ scale,
4724
4754
  tileClickEvent: buildingClickEvent,
4725
4755
  unitClickEvent,
4726
4756
  endTurnEvent,
@@ -4743,32 +4773,36 @@ function GameCanvas3DCastleTemplate({
4743
4773
  );
4744
4774
  }
4745
4775
  GameCanvas3DCastleTemplate.displayName = "GameCanvas3DCastleTemplate";
4776
+ var CDN3 = "https://almadar-kflow-assets.web.app/shared/3d/dungeon/floor";
4777
+ var FLOOR_WALL3 = `${CDN3}/template-floor-detail-a.glb`;
4778
+ var FLOOR_DIRT3 = `${CDN3}/template-floor-detail.glb`;
4779
+ var FLOOR_OPEN3 = `${CDN3}/template-floor.glb`;
4746
4780
  var DEFAULT_3D_WORLDMAP_TILES = [
4747
- { id: "t00", x: 0, y: 0, z: 0, type: "mountain", passable: false },
4748
- { id: "t10", x: 1, y: 0, z: 0, type: "mountain", passable: false },
4749
- { id: "t20", x: 2, y: 0, z: 0, type: "water", passable: false },
4750
- { id: "t30", x: 3, y: 0, z: 0, type: "mountain", passable: false },
4751
- { id: "t40", x: 4, y: 0, z: 0, type: "mountain", passable: false },
4752
- { id: "t01", x: 0, y: 1, z: 1, type: "mountain", passable: false },
4753
- { id: "t11", x: 1, y: 1, z: 1, type: "grass", passable: true },
4754
- { id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true },
4755
- { id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true },
4756
- { id: "t41", x: 4, y: 1, z: 1, type: "water", passable: false },
4757
- { id: "t02", x: 0, y: 2, z: 2, type: "water", passable: false },
4758
- { id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true },
4759
- { id: "t22", x: 2, y: 2, z: 2, type: "road", passable: true },
4760
- { id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true },
4761
- { id: "t42", x: 4, y: 2, z: 2, type: "mountain", passable: false },
4762
- { id: "t03", x: 0, y: 3, z: 3, type: "mountain", passable: false },
4763
- { id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true },
4764
- { id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true },
4765
- { id: "t33", x: 3, y: 3, z: 3, type: "road", passable: true },
4766
- { id: "t43", x: 4, y: 3, z: 3, type: "mountain", passable: false },
4767
- { id: "t04", x: 0, y: 4, z: 4, type: "mountain", passable: false },
4768
- { id: "t14", x: 1, y: 4, z: 4, type: "water", passable: false },
4769
- { id: "t24", x: 2, y: 4, z: 4, type: "grass", passable: true },
4770
- { id: "t34", x: 3, y: 4, z: 4, type: "mountain", passable: false },
4771
- { id: "t44", x: 4, y: 4, z: 4, type: "mountain", passable: false }
4781
+ { id: "t00", x: 0, y: 0, z: 0, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
4782
+ { id: "t10", x: 1, y: 0, z: 0, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
4783
+ { id: "t20", x: 2, y: 0, z: 0, type: "water", passable: false, modelUrl: FLOOR_WALL3 },
4784
+ { id: "t30", x: 3, y: 0, z: 0, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
4785
+ { id: "t40", x: 4, y: 0, z: 0, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
4786
+ { id: "t01", x: 0, y: 1, z: 1, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
4787
+ { id: "t11", x: 1, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
4788
+ { id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
4789
+ { id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
4790
+ { id: "t41", x: 4, y: 1, z: 1, type: "water", passable: false, modelUrl: FLOOR_WALL3 },
4791
+ { id: "t02", x: 0, y: 2, z: 2, type: "water", passable: false, modelUrl: FLOOR_WALL3 },
4792
+ { id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
4793
+ { id: "t22", x: 2, y: 2, z: 2, type: "road", passable: true, modelUrl: FLOOR_DIRT3 },
4794
+ { id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
4795
+ { id: "t42", x: 4, y: 2, z: 2, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
4796
+ { id: "t03", x: 0, y: 3, z: 3, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
4797
+ { id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
4798
+ { id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
4799
+ { id: "t33", x: 3, y: 3, z: 3, type: "road", passable: true, modelUrl: FLOOR_DIRT3 },
4800
+ { id: "t43", x: 4, y: 3, z: 3, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
4801
+ { id: "t04", x: 0, y: 4, z: 4, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
4802
+ { id: "t14", x: 1, y: 4, z: 4, type: "water", passable: false, modelUrl: FLOOR_WALL3 },
4803
+ { id: "t24", x: 2, y: 4, z: 4, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
4804
+ { id: "t34", x: 3, y: 4, z: 4, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
4805
+ { id: "t44", x: 4, y: 4, z: 4, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 }
4772
4806
  ];
4773
4807
  var DEFAULT_3D_WORLDMAP_FEATURES = [
4774
4808
  { id: "f1", x: 2, y: 2, z: 2, type: "capital", color: "#f4c542" },
@@ -4787,6 +4821,8 @@ function GameCanvas3DWorldMapTemplate({
4787
4821
  attackEvent,
4788
4822
  playAgainEvent,
4789
4823
  gameEndEvent,
4824
+ unitScale,
4825
+ scale,
4790
4826
  className
4791
4827
  }) {
4792
4828
  const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
@@ -4802,6 +4838,8 @@ function GameCanvas3DWorldMapTemplate({
4802
4838
  features,
4803
4839
  cameraMode,
4804
4840
  backgroundColor,
4841
+ unitScale,
4842
+ scale,
4805
4843
  tileClickEvent,
4806
4844
  unitClickEvent,
4807
4845
  endTurnEvent,
@@ -69,6 +69,10 @@ export interface BattleBoardProps extends DisplayStateProps {
69
69
  scale?: number;
70
70
  /** Unit draw-size multiplier */
71
71
  unitScale?: number;
72
+ /** Ratio of unit draw height to scaledFloorHeight. Default 1.5. */
73
+ spriteHeightRatio?: number;
74
+ /** Max unit draw width as a ratio of scaledTileWidth. Default 0.6. */
75
+ spriteMaxWidthRatio?: number;
72
76
  /** Header area -- receives battle context */
73
77
  header?: (ctx: BattleSlotContext) => React.ReactNode;
74
78
  /** Sidebar content (combat log, unit roster, etc.) */
@@ -121,7 +125,7 @@ export interface BattleBoardProps extends DisplayStateProps {
121
125
  }>;
122
126
  className?: string;
123
127
  }
124
- export declare function BattleBoard({ entity, tiles: propTiles, units: propUnits, features: propFeatures, assetManifest: propAssetManifest, scale, unitScale, header, sidebar, actions, overlay, gameOverOverlay, onAttack, onGameEnd, onUnitMove, calculateDamage, onDrawEffects, hasActiveEffects, effectSpriteUrls, resolveUnitFrame, tileClickEvent, unitClickEvent, endTurnEvent, cancelEvent, gameEndEvent, playAgainEvent, attackEvent, className, }: BattleBoardProps): React.JSX.Element;
128
+ export declare function BattleBoard({ entity, tiles: propTiles, units: propUnits, features: propFeatures, assetManifest: propAssetManifest, scale, unitScale, spriteHeightRatio, spriteMaxWidthRatio, header, sidebar, actions, overlay, gameOverOverlay, onAttack, onGameEnd, onUnitMove, calculateDamage, onDrawEffects, hasActiveEffects, effectSpriteUrls, resolveUnitFrame, tileClickEvent, unitClickEvent, endTurnEvent, cancelEvent, gameEndEvent, playAgainEvent, attackEvent, className, }: BattleBoardProps): React.JSX.Element;
125
129
  export declare namespace BattleBoard {
126
130
  var displayName: string;
127
131
  }
@@ -24,6 +24,10 @@ export interface GameBoard3DProps {
24
24
  cameraMode?: CameraMode;
25
25
  /** Background color forwarded to GameCanvas3D. */
26
26
  backgroundColor?: string;
27
+ /** Unit draw-size multiplier forwarded to GameCanvas3D. Default 1. */
28
+ unitScale?: number;
29
+ /** Board zoom/group scale forwarded to GameCanvas3D. Default 0.45. */
30
+ scale?: number;
27
31
  /** Declarative tile click event emitted to the model. */
28
32
  tileClickEvent?: EventEmit<{
29
33
  tileId: string;
@@ -55,7 +59,7 @@ export interface GameBoard3DProps {
55
59
  /** Additional CSS class. */
56
60
  className?: string;
57
61
  }
58
- export declare function GameBoard3D({ entity, tiles, features, cameraMode, backgroundColor, tileClickEvent, unitClickEvent, attackEvent, endTurnEvent, cancelEvent, playAgainEvent, gameEndEvent, className, }: GameBoard3DProps): React.JSX.Element | null;
62
+ export declare function GameBoard3D({ entity, tiles, features, cameraMode, backgroundColor, unitScale, scale, tileClickEvent, unitClickEvent, attackEvent, endTurnEvent, cancelEvent, playAgainEvent, gameEndEvent, className, }: GameBoard3DProps): React.JSX.Element | null;
59
63
  export declare namespace GameBoard3D {
60
64
  var displayName: string;
61
65
  }
@@ -42,6 +42,8 @@ export interface RoguelikeBoardProps extends DisplayStateProps {
42
42
  assetManifest?: RoguelikeAssetManifest;
43
43
  scale?: number;
44
44
  unitScale?: number;
45
+ spriteHeightRatio?: number;
46
+ spriteMaxWidthRatio?: number;
45
47
  moveEvent?: EventEmit<{
46
48
  dx: number;
47
49
  dy: number;
@@ -52,7 +54,7 @@ export interface RoguelikeBoardProps extends DisplayStateProps {
52
54
  }>;
53
55
  className?: string;
54
56
  }
55
- export declare function RoguelikeBoard({ entity, tiles: propTiles, enemies: propEnemies, items: propItems, player: propPlayer, playerHp: propPlayerHp, playerMaxHp: propPlayerMaxHp, playerAttack: propPlayerAttack, depth: propDepth, result: propResult, phase: propPhase, stairsX: propStairsX, stairsY: propStairsY, assetManifest: propAssetManifest, scale, unitScale, moveEvent, playAgainEvent, gameEndEvent, className, }: RoguelikeBoardProps): React.JSX.Element;
57
+ export declare function RoguelikeBoard({ entity, tiles: propTiles, enemies: propEnemies, items: propItems, player: propPlayer, playerHp: propPlayerHp, playerMaxHp: propPlayerMaxHp, playerAttack: propPlayerAttack, depth: propDepth, result: propResult, phase: propPhase, stairsX: propStairsX, stairsY: propStairsY, assetManifest: propAssetManifest, scale, unitScale, spriteHeightRatio, spriteMaxWidthRatio, moveEvent, playAgainEvent, gameEndEvent, className, }: RoguelikeBoardProps): React.JSX.Element;
56
58
  export declare namespace RoguelikeBoard {
57
59
  var displayName: string;
58
60
  }
@@ -44,6 +44,9 @@ export interface TowerDefenseBoardProps extends DisplayStateProps {
44
44
  waveActive?: boolean;
45
45
  towerCost?: number;
46
46
  scale?: number;
47
+ unitScale?: number;
48
+ spriteHeightRatio?: number;
49
+ spriteMaxWidthRatio?: number;
47
50
  placeTowerEvent?: EventEmit<{
48
51
  x: number;
49
52
  y: number;
@@ -57,7 +60,7 @@ export interface TowerDefenseBoardProps extends DisplayStateProps {
57
60
  }>;
58
61
  className?: string;
59
62
  }
60
- export declare function TowerDefenseBoard({ entity, tiles: propTiles, path: propPath, towers: propTowers, creeps: propCreeps, gold: propGold, lives: propLives, wave: propWave, maxWaves: propMaxWaves, result: propResult, waveActive: propWaveActive, towerCost, scale, placeTowerEvent, startWaveEvent, playAgainEvent, gameEndEvent, className, }: TowerDefenseBoardProps): React.JSX.Element;
63
+ export declare function TowerDefenseBoard({ entity, tiles: propTiles, path: propPath, towers: propTowers, creeps: propCreeps, gold: propGold, lives: propLives, wave: propWave, maxWaves: propMaxWaves, result: propResult, waveActive: propWaveActive, towerCost, scale, unitScale, spriteHeightRatio, spriteMaxWidthRatio, placeTowerEvent, startWaveEvent, playAgainEvent, gameEndEvent, className, }: TowerDefenseBoardProps): React.JSX.Element;
61
64
  export declare namespace TowerDefenseBoard {
62
65
  var displayName: string;
63
66
  }
@@ -87,6 +87,10 @@ export interface WorldMapBoardProps {
87
87
  scale?: number;
88
88
  /** Unit draw-size multiplier */
89
89
  unitScale?: number;
90
+ /** Ratio of unit draw height to scaledFloorHeight. Default 1.5. */
91
+ spriteHeightRatio?: number;
92
+ /** Max unit draw width as a ratio of scaledTileWidth. Default 0.6. */
93
+ spriteMaxWidthRatio?: number;
90
94
  /** Allow selecting / moving ALL heroes (including enemy). For testing. */
91
95
  allowMoveAllHeroes?: boolean;
92
96
  /** Custom movement range validator */
@@ -144,7 +148,7 @@ export interface WorldMapBoardProps {
144
148
  effectSpriteUrls?: AssetUrl[];
145
149
  resolveUnitFrame?: (unitId: string) => ResolvedFrame | null;
146
150
  }
147
- export declare function WorldMapBoard({ entity, tiles: propTiles, units: propUnits, features: propFeatures, assetManifest: propAssetManifest, isLoading, scale, unitScale, allowMoveAllHeroes, isInRange, heroSelectEvent, heroMoveEvent, battleEncounterEvent, featureEnterEvent, tileClickEvent, header, sidePanel, overlay, footer, onHeroSelect, onHeroMove, onBattleEncounter, onFeatureEnter, diamondTopY, enableCamera, effectSpriteUrls, resolveUnitFrame, className, }: WorldMapBoardProps): React.JSX.Element;
151
+ export declare function WorldMapBoard({ entity, tiles: propTiles, units: propUnits, features: propFeatures, assetManifest: propAssetManifest, isLoading, scale, unitScale, spriteHeightRatio, spriteMaxWidthRatio, allowMoveAllHeroes, isInRange, heroSelectEvent, heroMoveEvent, battleEncounterEvent, featureEnterEvent, tileClickEvent, header, sidePanel, overlay, footer, onHeroSelect, onHeroMove, onBattleEncounter, onFeatureEnter, diamondTopY, enableCamera, effectSpriteUrls, resolveUnitFrame, className, }: WorldMapBoardProps): React.JSX.Element;
148
152
  export declare namespace WorldMapBoard {
149
153
  var displayName: string;
150
154
  }
@@ -51,6 +51,10 @@ export interface GameCanvas3DBattleTemplateProps extends TemplateProps {
51
51
  exitEvent?: string;
52
52
  /** Show turn indicator overlay */
53
53
  showTurnIndicator?: boolean;
54
+ /** Unit draw-size multiplier forwarded to GameBoard3D. Default 1. */
55
+ unitScale?: number;
56
+ /** Board zoom/group scale forwarded to GameBoard3D. Default 0.45. */
57
+ scale?: number;
54
58
  }
55
59
  /**
56
60
  * GameCanvas3DBattleTemplate Component
@@ -68,7 +72,7 @@ export interface GameCanvas3DBattleTemplateProps extends TemplateProps {
68
72
  * />
69
73
  * ```
70
74
  */
71
- export declare function GameCanvas3DBattleTemplate({ entity, tiles: propTiles, features: propFeatures, cameraMode, backgroundColor, tileClickEvent, unitClickEvent, endTurnEvent, cancelEvent, attackEvent, playAgainEvent, gameEndEvent, className, }: GameCanvas3DBattleTemplateProps): React.JSX.Element | null;
75
+ export declare function GameCanvas3DBattleTemplate({ entity, tiles: propTiles, features: propFeatures, cameraMode, backgroundColor, tileClickEvent, unitClickEvent, endTurnEvent, cancelEvent, attackEvent, playAgainEvent, gameEndEvent, unitScale, scale, className, }: GameCanvas3DBattleTemplateProps): React.JSX.Element | null;
72
76
  export declare namespace GameCanvas3DBattleTemplate {
73
77
  var displayName: string;
74
78
  }
@@ -56,6 +56,10 @@ export interface GameCanvas3DCastleTemplateProps extends TemplateProps {
56
56
  exitEvent?: string;
57
57
  /** Show castle name header */
58
58
  showHeader?: boolean;
59
+ /** Unit draw-size multiplier forwarded to GameBoard3D. Default 1. */
60
+ unitScale?: number;
61
+ /** Board zoom/group scale forwarded to GameBoard3D. Default 0.45. */
62
+ scale?: number;
59
63
  }
60
64
  /**
61
65
  * GameCanvas3DCastleTemplate Component
@@ -73,7 +77,7 @@ export interface GameCanvas3DCastleTemplateProps extends TemplateProps {
73
77
  * />
74
78
  * ```
75
79
  */
76
- export declare function GameCanvas3DCastleTemplate({ entity, tiles: propTiles, features: propFeatures, cameraMode, backgroundColor, buildingClickEvent, unitClickEvent, endTurnEvent, cancelEvent, attackEvent, playAgainEvent, gameEndEvent, showHeader, className, }: GameCanvas3DCastleTemplateProps): React.JSX.Element | null;
80
+ export declare function GameCanvas3DCastleTemplate({ entity, tiles: propTiles, features: propFeatures, cameraMode, backgroundColor, buildingClickEvent, unitClickEvent, endTurnEvent, cancelEvent, attackEvent, playAgainEvent, gameEndEvent, showHeader, unitScale, scale, className, }: GameCanvas3DCastleTemplateProps): React.JSX.Element | null;
77
81
  export declare namespace GameCanvas3DCastleTemplate {
78
82
  var displayName: string;
79
83
  }
@@ -63,6 +63,10 @@ export interface GameCanvas3DWorldMapTemplateProps extends TemplateProps {
63
63
  cameraChangeEvent?: string;
64
64
  /** Exit/back event name */
65
65
  exitEvent?: string;
66
+ /** Unit draw-size multiplier forwarded to GameBoard3D. Default 1. */
67
+ unitScale?: number;
68
+ /** Board zoom/group scale forwarded to GameBoard3D. Default 0.45. */
69
+ scale?: number;
66
70
  }
67
71
  /**
68
72
  * GameCanvas3DWorldMapTemplate Component
@@ -81,7 +85,7 @@ export interface GameCanvas3DWorldMapTemplateProps extends TemplateProps {
81
85
  * />
82
86
  * ```
83
87
  */
84
- export declare function GameCanvas3DWorldMapTemplate({ entity, tiles: propTiles, features: propFeatures, cameraMode, backgroundColor, tileClickEvent, unitClickEvent, endTurnEvent, cancelEvent, attackEvent, playAgainEvent, gameEndEvent, className, }: GameCanvas3DWorldMapTemplateProps): React.JSX.Element | null;
88
+ export declare function GameCanvas3DWorldMapTemplate({ entity, tiles: propTiles, features: propFeatures, cameraMode, backgroundColor, tileClickEvent, unitClickEvent, endTurnEvent, cancelEvent, attackEvent, playAgainEvent, gameEndEvent, unitScale, scale, className, }: GameCanvas3DWorldMapTemplateProps): React.JSX.Element | null;
85
89
  export declare namespace GameCanvas3DWorldMapTemplate {
86
90
  var displayName: string;
87
91
  }