SceneRenderTree
Defined in: renderer/src/SceneRenderTree.ts:26
Scene-owned render tree. Created by SceneRenderTreeProvider when a scene
enters. Scoped DI: components resolve via this.use(SceneRenderTreeKey).
Properties
Section titled “Properties”defaultLayer
Section titled “defaultLayer”
readonlydefaultLayer:RenderLayer
Defined in: renderer/src/SceneRenderTree.ts:38
The auto-created “default” layer (order 0).
readonlyfx:EffectsHost
Defined in: renderer/src/SceneRenderTree.ts:57
Scene-scope effects host — .fx.addEffect(...) attaches a filter to the
entire per-scene root container, after layer-scope effects have composited.
Common use: scene-wide CRT, color grade, vignette. Survives until the
scene exits or the handle is .remove()d.
.fx.findEffect(definition) finds an attached effect when the caller no
longer has its original handle.
readonlyroot:DisplayContainer
Defined in: renderer/src/SceneRenderTree.ts:30
The single root container for the scene. Lives under the renderer’s
world-root container (which sits under app.stage and holds the fit
transform).
Methods
Section titled “Methods”addLayerEffect()
Section titled “addLayerEffect()”addLayerEffect<
H>(factory,layers):H
Defined in: renderer/src/SceneRenderTree.ts:78
Attach one effect to several layers and control it through one handle.
The factory is called once per layer, so this is one filter pass per
listed layer: N fullscreen layers cost N fullscreen passes per frame. For
a single layer prefer tree.get(name).fx.addEffect(...).
Handle methods fan out to every layer; values (enabled, return values
of extras such as trigger) come from the first listed layer. Layers
with different camera bindings receive the same layer-local arguments.
Throws when layers is empty or names a layer the scene does not have.
const grade = tree.addLayerEffect(colorGrade({ preset: "night" }), [ "background", "world", "props",]);grade.fadeOut(1); // fades on all threeType Parameters
Section titled “Type Parameters”H extends EffectHandle
Parameters
Section titled “Parameters”factory
Section titled “factory”layers
Section titled “layers”readonly string[]
Returns
Section titled “Returns”H
clearMask()
Section titled “clearMask()”clearMask():
void
Defined in: renderer/src/SceneRenderTree.ts:88
Detach and destroy the scene-scope mask, if any.
Returns
Section titled “Returns”void
ensureLayer()
Section titled “ensureLayer()”ensureLayer(
def,opts?):RenderLayer
Defined in: renderer/src/SceneRenderTree.ts:47
Get an existing layer or create it from the given definition. Used by
plugins like UI that auto-provision a layer if the game didn’t declare
one explicitly. Pass { space: "screen" } so a default camera leaves
the layer fixed to the viewport (e.g. screen-space HUD).
Existing layers keep their settings. A differing requested order warns in
development once per tree, layer name, and expected order.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”get(
name):RenderLayer
Defined in: renderer/src/SceneRenderTree.ts:32
Get a layer by name. Throws if not found.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”getAll()
Section titled “getAll()”getAll(): readonly
RenderLayer[]
Defined in: renderer/src/SceneRenderTree.ts:36
All layers, sorted by draw order.
Returns
Section titled “Returns”readonly RenderLayer[]
renderAboveEffects()
Section titled “renderAboveEffects()”renderAboveEffects(
node):void
Defined in: renderer/src/SceneRenderTree.ts:100
Draw node after this scene’s layers, outside every layer- and
scene-scope effect and mask, while it keeps its logical parent (position,
alpha, visibility, camera). Screen-scope effects still cover it. Draw
order among nodes attached this way is attach order. node must be in
this scene’s tree.
Visual components expose the same thing as
VisualComponentOptions.renderAboveEffects; use this for a display
object the game parents into the tree itself.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
renderWithEffects()
Section titled “renderWithEffects()”renderWithEffects(
node):void
Defined in: renderer/src/SceneRenderTree.ts:102
Undo renderAboveEffects. No-op when node is not attached.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
setMask()
Section titled “setMask()”setMask(
factory):MaskHandle
Defined in: renderer/src/SceneRenderTree.ts:86
Attach a scene-scope mask, replacing any existing one. Clips the entire per-scene root. Torn down on scene exit.
Parameters
Section titled “Parameters”factory
Section titled “factory”Returns
Section titled “Returns”tryGet()
Section titled “tryGet()”tryGet(
name):RenderLayer|undefined
Defined in: renderer/src/SceneRenderTree.ts:34
Get a layer by name, or undefined if not found.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”RenderLayer | undefined
Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/renderer.md.