Log inGet started
World

First Light: Goura

Branchmain
Branchesmain
Commite917faa950

README.md

Focus

Menu focus navigation for the cards of First Light: Goura. 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.

local Focus = require("game.screens.Focus")

  • Focus.open(ids, prefer?) — open a card: the ordered focusable ids, and which starts lit.
  • Focus.axis(v, dt) — feed the navigate axis every frame; one step per press, repeating while held.
  • Focus.id() — the id that is lit, which is what confirm fires.
  • Focus.point(id) — move the focus to an item the pointer crossed, so mouse, pad, keyboard and finger never disagree about what is selected.

Consumed by Screens.component, which draws the lit item with a visible focus ring and activates console.inputMap while a card is up.