Holographic HUD¶
Still scrolling? Then you are the kind of developer who reads the source of the docs site too. The last hidden console is for you, and it floats.
hologram is a hidden pack: an original homage to the translucent cyan heads-up displays of
modern science-fiction films. Thin 1px line-work on a deep navy ground, chamfered panels with
corner brackets, radial gauges and segmented rings, hexagon accents, tiny spaced capitals and a soft
glow on everything; amber warns, red is critical. Every label, number and place below is invented.
Select it with import Hologram (also HUD, HoloHUD) or pack="hologram" on the fence. The dark
appearance is the canonical projection; the light appearance is a daylight AR variant — dark cyan
line-work on a pale, translucent ground, for when the visor is pointed at the sky.
HUDFrame (alias Panel) is the chamfered panel: cut corners, drawn edges, corner brackets, a
hexagon bullet before the title, code: in an outlined tag and a footer: strip;
.variant(.alert) turns it amber. DataPanel is its small sibling with a filled title strip. The
rest: Reticle and TargetLock, RadialGauge, Ring, SegmentBar, Scanner (a radar sweep),
Alert (amber by default; severity: .error is critical red), Critical (the full-width banner),
Readout, HexBadge, Telemetry, Waveform, DataTable (bracketed rows), HUDButton
(chamfered outline; .solid, .ghost), Header, Caption and Rule. Charts, tables, buttons,
toggles and sliders from the core are restyled to match.
The reusable pieces (HUDFooter, SystemMeter, SystemPanel) live in
mockups/hologram/hud.mockitdown and are imported with import "hologram/hud".
Flight display¶
The main display: a targeting reticle between two radial gauges, readouts along the bottom and the mode buttons.
Source
import "hologram/hud"
HUDFrame("FLIGHT", subtitle: "VECTOR ASSIST", code: "MK-07") {
HStack(alignment: .center, spacing: 28) {
VStack(spacing: 18) {
RadialGauge("THRUST", value: 0.72)
Ring(0.45, label: "SHIELD", showValue: true)
}
.frame(width: 160)
ZStack {
Reticle().frame(width: 220, height: 220)
}
.frame(maxWidth: .infinity)
VStack(spacing: 18) {
RadialGauge("ENERGY", value: 0.38)
Ring(0.86, label: "COOLANT", showValue: true)
}
.frame(width: 160)
}
HStack(spacing: 14) {
Readout("ALTITUDE", value: "12 480", change: "+120", unit: "M")
Readout("AIRSPEED", value: "0.84", unit: "MACH")
Readout("HEADING", value: "117°", change: "-2")
Readout("RANGE", value: "41.0", unit: "KM").color(.orange)
}
HStack(spacing: 10) {
HUDButton("ASSIST", variant: .solid)
HUDButton("HOVER")
HUDButton("CRUISE")
Spacer()
Toggle("STABILISER", isOn: true)
Toggle("NIGHT", isOn: false)
}
} footer: {
HUDFooter()
}Systems diagnostic¶
A grid of SystemPanels, a telemetry trace and a bar chart, and the module table with bracketed
rows (one in warning).
| MODULE | STATE | LOAD | TEMP | UPTIME |
|---|---|---|---|---|
| PWR-01 | ONLINE | 82% | 41° | 212:04 |
| ARM-04 | STRAIN | 97% | 88° | 011:52 |
| OPT-02 | ONLINE | 35% | 29° | 212:04 |
Scanner¶
The sweep: a Scanner with three contacts and the planned track, a TargetLock on the nearest
contact, the contact list and a waveform of the return signal.
| ID | BRG | RNG | CLOSURE |
|---|---|---|---|
| CONTACT 1 | 312° | 2.4 KM | -0.8 |
| CONTACT 2 | 128° | 5.1 KM | +0.2 |
| BEACON | 041° | 7.9 KM | 0.0 |
| ID | BRG | RNG | CLOSURE |
|---|---|---|---|
| CONTACT 1 | 312° | 2.4 KM | -0.8 |
| CONTACT 2 | 128° | 5.1 KM | +0.2 |
| BEACON | 041° | 7.9 KM | 0.0 |
Proximity warning¶
The alarm state: a red Critical banner, the frame in its amber .alert variant, warnings and a
critical Alert, and the abort controls.
Anatomy of a display¶
The parts of a HUD panel, numbered. The chamfered frame 1 has its edges drawn along the cut
corners and brackets on the square ones; the hexagon before the title 2 is the panel's bullet,
and the code tag 3 sits at the right. A RadialGauge 4 puts its value inside a tick ring; a
Ring 5 is segmented; a Readout 6 is a bracketed number; HUDButtons 7 are chamfered
outlines; and the footer 8 carries a HexBadge and the clock.
The other hidden consoles: the starship console, the phosphor terminal and this one, the holographic HUD. And from before anything floated, the Retro packs.