Skip to content

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.

  • InspectorFacetContributor

new RenderFacetContributor(): RenderFacetContributor

RenderFacetContributor

readonly namespace: "render" = "render"

Defined in: packages/renderer/src/RenderFacetContributor.ts:32

Stable key the facet is attached under (e.g. "render").

InspectorFacetContributor.namespace

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.

Component

{ bounds: { height: number; width: number; x: number; y: number; } | null; visible: boolean; }

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: 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

InspectorFacetContributor.inspectComponent


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).

readonly unknown[]

{ bounds: { height: number; width: number; x: number; y: number; } | null; visible: boolean; }

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: 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

InspectorFacetContributor.inspectEntity