hud library

Heads-up display pieces for a game on flutter3d: the panel and its lines, tallies and banners, a speedometer, a minimap of a course, the automap of what a player has walked, hints said at the moment they are true, a beacon that makes an objective findable in the dark, and the same HUD on a stereo surface.

Widgets over the picture, not geometry in it. The engine hands back a texture and Flutter composites over it, so a HUD costs no draw calls and gets text layout, scaling and accessibility for nothing. Every piece here takes values and draws them; none steps a simulation.

MiniMap and AutomapView are two maps for two jobs: the first fits a course's outline into a corner with a dot for everything on it, the second draws the cells an Automap has revealed, centred on the player and turned the way they face.

No plugin. Nothing here is installed into a loop: a HUD is a widget a game puts in its tree, and the beacon is one call when a level is built.

Classes

AutomapPainter
The painting, public so a test can ask it what it would draw.
AutomapView
The automap, drawn: floor where the player has walked, walls where it stopped, an arrow where they stand.
HudBanner
A sentence across the middle of the screen, on a GameUiTheme.panel: what the game is waiting for, or what just happened.
HudLine
One labelled value in a HudPanel: a short label in a fixed column, and the value beside it in tabular figures.
HudPanel
A dark, rounded panel that stacks a few HudLines.
HudTally
A big number with a small label under it — 12 over COINS — read by a screen reader as one thing, "coins 12", rather than as two unrelated numbers in a row of numbers.
HudTallyStyle
How a HudTally is drawn: the colour, and the size of its two lines.
MiniMap
A course flattened to a line, with a dot for everything on it.
MiniMapPainter
What MiniMap paints, public so a HUD that lays out its own frame can paint the map into it, and so a test can read where a point lands.
MomentHint<E>
A sentence a player is told once, at the moment it is useful: the first time a step's events hold one that when accepts.
MomentHints<E>
Several MomentHints, each said once, and which of them have been.
Speedometer
A speed in kilometres an hour, large, from metres a second.
StereoHudPanel<T extends Object>
A HUD built once and redrawn from a ValueListenable, for a surface in front of a stereo camera.

Constants

beaconGlow → const double
How brightly a beacon glows, linear, on its brightest channel.

Functions

lightBeacon(List<MeshNode> meshes, {double brightness = beaconGlow}) → void
Makes what already glows in meshes glow at brightness: an objective a player can find in the dark.