The delta
Ahead of or behind the best lap, to the thousandth, the predicted lap, and a bar that leans left when you gain time.
- 15 min
- no game needed
- at the end: an Expression driving a shape
Top left, the number the driver watches most in qualifying: the delta to the best lap. Start from your dash from chapter 4, or from its checkpoint.
The bar's frame
Under the number, a bar: first its track, a rectangle X 22, Y 148, W 222, H 6, #23232a, named Delta track. Then the zero mark in the middle, a line X 133, Y 145, W 2, H 12, #f5f5f7, named Delta centre.
The delta and the predicted lap
The label carries the predicted lap: N, lap_time_estimated_s, the best lap plus the delta. Under Format, Prefix DELTA · PRED , Time on m:ss.cc, When empty DELTA and 0 counts as empty: without a delta, the label stands alone. Exo 2, 12, Bold, letter spacing 0.7, #b9b9c2, X 22, Y 78.
The number: N, delta. Time on ±s.ccc: the sign always written, three decimals. When empty -.---, 0 counts as empty. Exo 2, 50, Extra bold, italic, #5cf09a, X 22, Y 89, named Delta value.
The fill, driven by an Expression
The fill: R, X 75, Y 148, W 58, H 6, #5cf09a, named Delta bar. Its place and length will follow the delta.
F frames its node; on its left, Tab, Expression, and this program:
d = clamp(@delta, -0.4, 0.4) ;len = abs(d) / 0.4 * 111 ;$x = d < 0 ? 133 - len : 135 ;$w = len ;red = rgba(255, 115, 99) ;green = rgba(92, 240, 154) ;$color = d > 0 ? red : d < 0 ? green : rgba(245, 245, 247)On the fill’s node, unfold Transform: its place and size sockets. Drag x to x, w to w, color to fillColor. Then color again, to color on the Delta value node, just above: the number takes the bar’s colour.
Put the block away in a group
Delta track, then Shift+click Delta bar, Ctrl+G, Delta.
Reading the Expression
Section titled “Reading the Expression”clamp(@delta, -0.4, 0.4)bounds the delta: beyond four tenths, the bar stays full.lenis the length: 0.4 s fills half the bar, 111 pixels from the centre to the end of the track.- Ahead (
d < 0), the fill runs from the centre to the left: it starts at133 - len. Behind, it starts at the line’s right edge,135. redandgreenare working names for the colours: the last line reads at a glance. Without a delta,dis 0: the number stays white.
The checkpoint
Section titled “The checkpoint”Download first-dash-5.slxd: the dash at the end of this chapter.
If it gets stuck
Section titled “If it gets stuck”The fill’s node has no x socket. The place and size sockets sit under Transform, folded: a click unfolds it.
The label only shows DELTA. No delta yet: it takes a completed lap, and the game has to compute it. In the simulated telemetry node, search for delta_valid and set it to 1.
The dimensions
Section titled “The dimensions”| Layer | Tool | Channel | Format | X | Y | W × H | Size | Colour |
|---|---|---|---|---|---|---|---|---|
Delta track |
Rectangle | 22 | 148 | 222 × 6 | #23232a |
|||
Delta centre |
Rectangle | 133 | 145 | 2 × 12 | #f5f5f7 |
|||
Predicted lap |
Number | lap_time_estimated_s |
DELTA · PRED before, m:ss.cc, DELTA if 0 |
22 | 78 | 12, Bold | #b9b9c2 |
|
Delta value |
Number | delta |
±s.ccc, -.--- if 0 |
22 | 89 | 50, Extra bold, italic | wired | |
Delta bar |
Rectangle | wired | 148 | wired × 6 | wired |
Texts in Exo 2, Vertical on line, top, the label with a letter spacing of 0.7.