@blorkfield/overlay-core 0.5.6 → 0.5.7

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/dist/index.d.cts CHANGED
@@ -31,11 +31,22 @@ interface FloorConfig {
31
31
  */
32
32
  threshold?: number | number[];
33
33
  /**
34
- * Thickness of floor segments in pixels:
34
+ * Thickness of floor segments in pixels (collision body height):
35
35
  * - number: Same thickness for all segments (default: 50)
36
36
  * - number[]: Per-segment thickness (segment 0 uses value[0], etc.)
37
37
  */
38
38
  thickness?: number | number[];
39
+ /**
40
+ * Visible thickness of floor segments in pixels.
41
+ * When set, only this many pixels are visible above the canvas bottom,
42
+ * while the remaining (thickness - visibleThickness) extends below as hidden collision.
43
+ * - number: Same visible thickness for all segments (default: same as thickness)
44
+ * - number[]: Per-segment visible thickness (segment 0 uses value[0], etc.)
45
+ *
46
+ * Example: thickness=15, visibleThickness=2 creates a 15px collision body
47
+ * but only shows 2px, with 13px of hidden collision below the canvas.
48
+ */
49
+ visibleThickness?: number | number[];
39
50
  /**
40
51
  * Color of floor segments (visible when set):
41
52
  * - string: Same color for all segments
package/dist/index.d.ts CHANGED
@@ -31,11 +31,22 @@ interface FloorConfig {
31
31
  */
32
32
  threshold?: number | number[];
33
33
  /**
34
- * Thickness of floor segments in pixels:
34
+ * Thickness of floor segments in pixels (collision body height):
35
35
  * - number: Same thickness for all segments (default: 50)
36
36
  * - number[]: Per-segment thickness (segment 0 uses value[0], etc.)
37
37
  */
38
38
  thickness?: number | number[];
39
+ /**
40
+ * Visible thickness of floor segments in pixels.
41
+ * When set, only this many pixels are visible above the canvas bottom,
42
+ * while the remaining (thickness - visibleThickness) extends below as hidden collision.
43
+ * - number: Same visible thickness for all segments (default: same as thickness)
44
+ * - number[]: Per-segment visible thickness (segment 0 uses value[0], etc.)
45
+ *
46
+ * Example: thickness=15, visibleThickness=2 creates a 15px collision body
47
+ * but only shows 2px, with 13px of hidden collision below the canvas.
48
+ */
49
+ visibleThickness?: number | number[];
39
50
  /**
40
51
  * Color of floor segments (visible when set):
41
52
  * - string: Same color for all segments
package/dist/index.js CHANGED
@@ -497,9 +497,10 @@ function createBoundariesWithFloorConfig(bounds, floorConfig) {
497
497
  for (let i = 0; i < segmentCount; i++) {
498
498
  const segmentWidth = segmentWidths[i];
499
499
  const thickness = floorConfig?.thickness !== void 0 ? Array.isArray(floorConfig.thickness) ? floorConfig.thickness[i] ?? BOUNDARY_THICKNESS : floorConfig.thickness : BOUNDARY_THICKNESS;
500
+ const visibleThickness = floorConfig?.visibleThickness !== void 0 ? Array.isArray(floorConfig.visibleThickness) ? floorConfig.visibleThickness[i] ?? thickness : floorConfig.visibleThickness : thickness;
500
501
  const color = floorConfig?.color !== void 0 ? Array.isArray(floorConfig.color) ? floorConfig.color[i] : floorConfig.color : void 0;
501
502
  const segmentX = currentX + segmentWidth / 2;
502
- const segmentY = bounds.bottom - thickness / 2;
503
+ const segmentY = bounds.bottom - visibleThickness + thickness / 2;
503
504
  const segmentOptions = {
504
505
  isStatic: true,
505
506
  label: `floor-segment-${i}`,