RenderFacetContributor
Defined in: packages/renderer/src/RenderFacetContributor.ts:31
Publishes each graphical component’s RenderFacetSnapshot into the
Inspector snapshot via the generic facet-contributor seam. Registered by
import(”./RendererPlugin.js”).RendererPlugin on install and removed on
teardown — the renderer owns the “render” namespace and the policy for which
component represents an entity, keeping @yagejs/core free of any rendering
concept.
Implements
Section titled “Implements”InspectorFacetContributor
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RenderFacetContributor():
RenderFacetContributor
Returns
Section titled “Returns”RenderFacetContributor
Properties
Section titled “Properties”namespace
Section titled “namespace”
readonlynamespace:"render"="render"
Defined in: packages/renderer/src/RenderFacetContributor.ts:32
Stable key the facet is attached under (e.g. "render").
Implementation of
Section titled “Implementation of”InspectorFacetContributor.namespace
Methods
Section titled “Methods”inspectComponent()
Section titled “inspectComponent()”inspectComponent(
component): {bounds: {height:number;width:number;x:number;y:number; } |null;visible:boolean; } |undefined
Defined in: packages/renderer/src/RenderFacetContributor.ts:39
Duck-type the renderer-internal inspectRender() contract off a component.
Returns undefined for components that don’t paint (no hook). A hook that
throws is caught by the Inspector, which omits the facet.
Parameters
Section titled “Parameters”component
Section titled “component”Component
Returns
Section titled “Returns”Type Literal
Section titled “Type Literal”{ bounds: { height: number; width: number; x: number; y: number; } | null; visible: boolean; }
bounds
Section titled “bounds”bounds: {
height:number;width:number;x:number;y:number; } |null
Axis-aligned bounding box of the component’s geometry, in world space (the
same coordinate space the Inspector reports for entity.transform — pixels,
before camera/viewport projection). Measured from the geometry itself, so a
sized-but-hidden object still reports its real box; null means there is no
measurable geometry at all (an empty Graphics, a zero-area object), NOT
that the object is hidden. Read RenderFacetSnapshot.visible for the
hidden/shown state.
visible
Section titled “visible”visible:
boolean
The component’s own (local, non-inherited) visibility flag at snapshot time. A hidden ancestor (e.g. a parent/layer container set invisible) is NOT folded in — read the relevant parent separately if you need the fully resolved on-screen state.
undefined
Implementation of
Section titled “Implementation of”InspectorFacetContributor.inspectComponent
inspectEntity()
Section titled “inspectEntity()”inspectEntity(
componentFacets): {bounds: {height:number;width:number;x:number;y:number; } |null;visible:boolean; } |undefined
Defined in: packages/renderer/src/RenderFacetContributor.ts:49
Surface the first painted component’s facet at the entity level — the
common single-sprite/text case. componentFacets arrives in component
insertion order (with undefined gaps for non-graphical components).
Parameters
Section titled “Parameters”componentFacets
Section titled “componentFacets”readonly unknown[]
Returns
Section titled “Returns”Type Literal
Section titled “Type Literal”{ bounds: { height: number; width: number; x: number; y: number; } | null; visible: boolean; }
bounds
Section titled “bounds”bounds: {
height:number;width:number;x:number;y:number; } |null
Axis-aligned bounding box of the component’s geometry, in world space (the
same coordinate space the Inspector reports for entity.transform — pixels,
before camera/viewport projection). Measured from the geometry itself, so a
sized-but-hidden object still reports its real box; null means there is no
measurable geometry at all (an empty Graphics, a zero-area object), NOT
that the object is hidden. Read RenderFacetSnapshot.visible for the
hidden/shown state.
visible
Section titled “visible”visible:
boolean
The component’s own (local, non-inherited) visibility flag at snapshot time. A hidden ancestor (e.g. a parent/layer container set invisible) is NOT folded in — read the relevant parent separately if you need the fully resolved on-screen state.
undefined
Implementation of
Section titled “Implementation of”InspectorFacetContributor.inspectEntity