TableTower/ui/card_layer.gd
RobinFiredrake 60c2d03147 Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.

- core/: data model (RollTable, TableEntry, TowerBoard), sample board
  with a d100 table of 100 trinkets and a weighted d100 range table,
  and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
  cards, result tray with earlier rolls, undo toasts, and a Collapse all
  / Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00

23 lines
615 B
GDScript

class_name CardLayer
extends Control
## Holds the table cards and paints their hard drop shadow underneath them.
var _shadow: StyleBoxFlat
func _init() -> void:
mouse_filter = MOUSE_FILTER_IGNORE
# Controls only draw inside their own rect, so cover the whole world.
size = Vector2(BoardView.WORLD_SIZE, BoardView.WORLD_SIZE)
_shadow = Style.box(Color(0, 0, 0, 0.22), 10)
func _process(_delta: float) -> void:
queue_redraw()
func _draw() -> void:
for c in get_children():
var card := c as Control
if card and card.visible:
draw_style_box(_shadow, Rect2(card.position + Vector2(0, 5), card.size))