director
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
director
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2emberline.stages.director — the stage service. require("emberline.stages.director") Registers Bus.services.stage and Bus.registry.stages, builds the four painted stages out of parallax layers, slides those layers against the fight camera, drives the props that move on their own, and answers the fight's events — the crowd comes up off the barrier on a knockout. Everything this module spawns is named `el_stage_<n>` and parented under StageRoot, so a teardown is a bounded sweep over names it minted rather than a scan of the scene. That is what makes a hot reload idempotent: the module locals are gone after a reload, but the names are not. A stage is built over THREE frames, not one. Tearing down eleven canvases and spawning eleven more in a single frame runs into the per-frame mutation cap: some spawns are queued and never commit, and every later frame then raises on a handle whose entity is nil. Sweeping on one frame, laying the layers on the next and the props on the one after keeps every frame's mutation count small enough to land.
stageDef(id: string) → any
| arg | type | description |
|---|---|---|
| id | string |
nextName( ) → string
sweep( ) → void
Despawn every name this module can ever mint. Bounded, deterministic, and safe to run when the module's own bookkeeping was thrown away by a reload — it never touches an entity it did not name.
spawnCanvas(spec: any) → any
| arg | type | description |
|---|---|---|
| spec | any |
spawnFrameSet(spec: any) → void
Frame animation is one canvas PER FRAME, shown and hidden, not one canvas flipping its active frame. A mesh-mode canvas whose active frame keeps changing stops rendering entirely, and the texture backend cannot be used instead because its per-frame material carries no alpha cutoff, so every empty cell paints opaque black. Six small canvases and a `setActive` is the one combination that both animates and keeps its transparency.
| arg | type | description |
|---|---|---|
| spec | any |
alive(h: any) → boolean
A handle whose entity never committed, or was despawned under us, must not be driven: every call on it raises once a frame forever.
| arg | type | description |
|---|---|---|
| h | any |
unload( ) → void
load(stageId: string?) → boolean
Ask for a stage. The canvases appear over the next few frames; read `Director.ready()` or `Director.info().stage` to know when they are up.
| arg | type | description |
|---|---|---|
| stageId | string? |
pin(stageId: string?) → void
Hold one stage up regardless of what the game asks for, so it can be looked at and photographed. `Director.pin(nil)` hands control back to the fight.
| arg | type | description |
|---|---|---|
| stageId | string? |
ready( ) → boolean
advanceBuild( ) → void
cameraX( ) → number
cheer(_amount: number, secs: number) → void
Bring the crowd up. A knockout is the full house; a heavy connect is only a ripple through it.
| arg | type | description |
|---|---|---|
| _amount | number | |
| secs | number |
react(event: string, data: any) → void
| arg | type | description |
|---|---|---|
| event | string | |
| data | any |
driveParallax(camX: number) → void
| arg | type | description |
|---|---|---|
| camX | number |
driveProps(dt: number, camX: number) → void
| arg | type | description |
|---|---|---|
| dt | number | |
| camX | number |
update(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
info( ) → any
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.