Torque Valley: Driving, Drift and Crash Sandbox
README.md
GaugeCluster
Puts one car gauge cluster (speed, revs with redline zone, gear) on the local
player's screen in one of ten styles: analog, digital, rally,
retro80s, scifi, minimal, arcade, pixel, hud, truck. style
switches the look live. Attach it to any entity (an empty one is fine); it
needs no sibling components.
It reads the driving contract's values (car.kmh, car.rpm, car.gear,
car.rpmRedline, car.rpmMax, ...) from car, or, with car empty, from the
local player's own car (their avatar or what it sits in, else what the main
camera follows). A plain VehicleController car shows speed, 0 rpm, gear -.
entity.spawn("hud").component.add("GaugeCluster", { style = "rally", units = "mph" })
entity.find("hud").component.get("GaugeCluster"):cycleStyle()
Fields: style, units (kmh|mph), car, anchor (auto, bottomRight,
bottomCenter, bottomLeft, topRight, topCenter, topLeft, hud), size,
maxSpeed, offsetX, offsetY, visible. All NoSync: the cluster is a
personal overlay. Methods: setStyle(id), cycleStyle(dir?), target(),
reading(). The screen it registers (gaugecluster_<entity id>) goes when
the component does.