Backdrop
The parallax driver of Ashcross. The camera is orthographic, so a quad parked thirty units behind the street tracks the camera exactly and reads as glued to it: every bit of depth in this game is scripted, and this is where.
Backdrop (component)
The parallax driver of Ashcross. The camera is orthographic, so a quad parked thirty units behind the street tracks the camera exactly and reads as glued to it: every bit of depth in this game is scripted, and this is where.
Modes
mode = "band" — the entity is a full-frame quad locked to the camera, and
the district it shows lives inside its material as a procedural pattern. The
component writes scroll_x / scroll_y on that material every frame at
spanX / worldWidth * parallax * cameraX (and the same in y). Nothing
recycles because the pattern never ends.
mode = "anchor" — the entity stands at a fixed district point
(anchorX, anchorY) and is drawn at cam + (anchor - cam) * parallax.
Lanterns, braziers, shafts and hanging props ride a band this way, so a lamp on
the mid band slides past at exactly the rate the wall behind it does.
parallax is the whole vocabulary: 0 is infinitely far (locked to the eye), 1
moves exactly with the street, above 1 is the foreground band that overtakes it.
Transient lights
Set lifetime above zero and the entity swells to peakW x peakH over
attack seconds, shrinks away over the rest, drifts up at rise, and despawns
itself. The fade is carried by the entity's SCALE, not by its material, because
a material is shared by every puff wearing it and they have to be able to die
at different moments.
Notes
- The material is taken from the entity's own
Model, never resolved by name: a component may not resolve an asset from a computed string, and two entities that share a band should share its scroll. Call:rebind()after swapping theModel's material. - Culling (
cullMargin) collapses the quad to zero scale rather than deactivating the entity. An inactive entity stops running its components, and a component that has stopped running can never decide to come back. editorUpdateruns the same driver asupdate, so the bands line up in edit mode as well as in play — every screenshot of this game is taken from a scene camera either way.
Fields
mode parallax bandZ · band: worldWidth worldHeight spanX spanY
phaseX phaseY · anchor: anchorX anchorY bob bobSpeed · transient:
lifetime attack peakW peakH rise · both: cullMargin.
Methods
:rebind() — re-read the material from the Model.
:setAnchor(x, y) — move a prop to a new district point immediately.
Scoped to this part · feeds back into the world's score.