TableTower/ui/icons.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

20 lines
963 B
GDScript

class_name Icons
extends RefCounted
## Small vector icons drawn with CanvasItem calls.
## The TableTower mark: a tower outline with a brass doorway. Drawn in a 22x26 box.
static func draw_tower(ci: CanvasItem, origin: Vector2, scale: float, color: Color, accent: Color) -> void:
var pts := PackedVector2Array([
Vector2(3, 25), Vector2(3, 8), Vector2(6, 6), Vector2(6, 2), Vector2(9, 2), Vector2(9, 5),
Vector2(13, 5), Vector2(13, 2), Vector2(16, 2), Vector2(16, 6), Vector2(19, 8), Vector2(19, 25), Vector2(3, 25),
])
for i in pts.size():
pts[i] = origin + pts[i] * scale
ci.draw_polyline(pts, color, 1.7 * scale, true)
var door := PackedVector2Array([origin + Vector2(7, 25) * scale, origin + Vector2(7, 19) * scale])
for k in range(17):
var a := PI + PI * k / 16.0
door.append(origin + (Vector2(11, 19) + Vector2(cos(a), sin(a)) * 4.0) * scale)
door.append(origin + Vector2(15, 25) * scale)
ci.draw_polyline(door, accent, 1.7 * scale, true)