Log inGet started
World

First Light: Betocsin

Branchmain
Branchesmain
Commit065ea629bf

README.md

Focus

Menu focus navigation for the cards of First Light: Betocsin. A controller has no pointer, so every card carries an ordered ring of focusable ids and exactly one of them is lit; this module walks that ring.

  • Focus.open(list, prefer) — open a menu: the ids in stick order, and which starts lit.
  • Focus.axis(v, dt) — feed the navigate axis; one flick is one step, a held stick repeats.
  • Focus.point(id) — a mouse crossing a row or a finger tapping it moves the focus there.
  • Focus.id() / Focus.isFocused(id) / Focus.items() / Focus.generation() — read it.
  • Focus.step(delta) / Focus.close() / Focus.release().

Fed by game/screens/console.inputMap; consumed by game.screens.Screens, which asks it which row to draw lit. Installed from ZeroMind; owned by the presentation slice.

local Focus = require("game.screens.Focus")
Focus.open({ "start", "howto" }, "start")
Focus.axis({ x = 0, y = -1 }, dt)
print(Focus.id())