Skip to content

RendererPlugin

Defined in: renderer/src/RendererPlugin.ts:27

RendererPlugin wraps PixiJS v8 behind the YAGE plugin interface.

  • Plugin

new RendererPlugin(config): RendererPlugin

Defined in: renderer/src/RendererPlugin.ts:40

RendererConfig

RendererPlugin

readonly name: "renderer" = "renderer"

Defined in: renderer/src/RendererPlugin.ts:28

Unique plugin name.

Plugin.name


readonly version: "4.0.0" = "4.0.0"

Defined in: renderer/src/RendererPlugin.ts:29

Semantic version string.

Plugin.version

get application(): Application

Defined in: renderer/src/RendererPlugin.ts:147

The PixiJS Application instance.

Application


get canvas(): HTMLCanvasElement

Defined in: renderer/src/RendererPlugin.ts:152

The canvas element.

HTMLCanvasElement


get canvasSize(): object

Defined in: renderer/src/RendererPlugin.ts:162

Current canvas size in CSS pixels. Changes on host resize under responsive fit.

object

height: number

width: number


get croppedVirtualRects(): readonly VirtualRect[]

Defined in: renderer/src/RendererPlugin.ts:218

Rectangles of virtual space that are currently off-screen — the complement of visibleVirtualRect inside virtualSize. Use these for effects that need to reason about cropped regions (e.g. fog-of-war overlays at the visible boundary).

Empty under letterbox / expand / stretch. Under cover, returns 1–2 strips.

readonly VirtualRect[]


get extendedVirtualRects(): readonly VirtualRect[]

Defined in: renderer/src/RendererPlugin.ts:255

Rectangles of the visible canvas OUTSIDE the declared virtual rect — the letterbox/expand “bars” expressed in virtual-space pixels.

Populated under letterbox and expand whenever aspect mismatches; empty under cover and stretch. Under expand these are the play-adjacent strips the game is expected to draw into (fog, parallax, HUD). Under letterbox they describe where the background-color bars land — so bar-customization can layer on top of a letterbox render.

readonly VirtualRect[]


get fit(): RendererFitOptions

Defined in: renderer/src/RendererPlugin.ts:167

Current fit configuration.

RendererFitOptions


get sceneRenderTrees(): SceneRenderTreeProvider

Defined in: renderer/src/RendererPlugin.ts:260

The per-scene render tree provider.

SceneRenderTreeProvider


get virtualCanvasRect(): VirtualRect

Defined in: renderer/src/RendererPlugin.ts:229

Where the declared virtual rectangle sits on the canvas, in CSS pixels. Use for DOM overlays positioned over the play area, cropping screenshots to gameplay, or mapping CSS-coord hit regions. The rect may extend past the canvas (negative coords, dimensions larger than canvasSize) under cover.

VirtualRect


get virtualSize(): object

Defined in: renderer/src/RendererPlugin.ts:157

Virtual resolution size.

object

height: number

width: number


get visibleCanvasRect(): VirtualRect

Defined in: renderer/src/RendererPlugin.ts:241

Full canvas extent expressed in virtual-space pixels — unlike visibleVirtualRect, not clamped to the declared virtual rect. Under letterbox / expand on an off-aspect host this extends past virtualSize on the unscaled axis (useful for drawing backdrops that fill the bars). Under cover it equals visibleVirtualRect; under stretch it equals the virtual rect.

VirtualRect


get visibleVirtualRect(): VirtualRect

Defined in: renderer/src/RendererPlugin.ts:206

Sub-rectangle of the declared virtual space that is actually on-screen. Use this to anchor HUD / UI that must stay inside the play area; use visibleCanvasRect if your HUD is allowed to live in the bars. Gameplay queries should stay on virtualSize.

Under letterbox / expand / stretch this equals the full virtual rect. Under cover the long axis is cropped by the canvas edges.

VirtualRect

canvasToVirtual(x, y): Vec2

Defined in: renderer/src/RendererPlugin.ts:184

Convert CSS pixels relative to the canvas top-left into virtual-space pixels. Inverts the stage transform currently applied by the fit controller.

number

number

Vec2


createTexture(draw): Texture

Defined in: renderer/src/RendererPlugin.ts:265

Create a texture by drawing into a temporary graphics context.

(graphics) => void

Texture


install(context): Promise<void>

Defined in: renderer/src/RendererPlugin.ts:46

Install services into the engine context. Called in topological order.

EngineContext

Promise<void>

Plugin.install


onDestroy(): void

Defined in: renderer/src/RendererPlugin.ts:134

Called when the engine is destroyed.

void

Plugin.onDestroy


registerSystems(scheduler): void

Defined in: renderer/src/RendererPlugin.ts:130

Register systems with the scheduler. Called after install.

SystemScheduler

void

Plugin.registerSystems


setFit(options): void

Defined in: renderer/src/RendererPlugin.ts:176

Change the fit mode and/or target at runtime.

RendererFitOptions

void


virtualToCanvas(x, y): Vec2

Defined in: renderer/src/RendererPlugin.ts:193

Virtual-space pixels → CSS pixels relative to the canvas top-left. Symmetric with canvasToVirtual; useful when mapping virtual coordinates back out to DOM overlays or pointer regions.

number

number

Vec2