RendererPlugin
Defined in: renderer/src/RendererPlugin.ts:27
RendererPlugin wraps PixiJS v8 behind the YAGE plugin interface.
Implements
Section titled “Implements”Plugin
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RendererPlugin(
config):RendererPlugin
Defined in: renderer/src/RendererPlugin.ts:40
Parameters
Section titled “Parameters”config
Section titled “config”Returns
Section titled “Returns”RendererPlugin
Properties
Section titled “Properties”
readonlyname:"renderer"="renderer"
Defined in: renderer/src/RendererPlugin.ts:28
Unique plugin name.
Implementation of
Section titled “Implementation of”Plugin.name
version
Section titled “version”
readonlyversion:"4.0.0"="4.0.0"
Defined in: renderer/src/RendererPlugin.ts:29
Semantic version string.
Implementation of
Section titled “Implementation of”Plugin.version
Accessors
Section titled “Accessors”application
Section titled “application”Get Signature
Section titled “Get Signature”get application():
Application
Defined in: renderer/src/RendererPlugin.ts:147
The PixiJS Application instance.
Returns
Section titled “Returns”Application
canvas
Section titled “canvas”Get Signature
Section titled “Get Signature”get canvas():
HTMLCanvasElement
Defined in: renderer/src/RendererPlugin.ts:152
The canvas element.
Returns
Section titled “Returns”HTMLCanvasElement
canvasSize
Section titled “canvasSize”Get Signature
Section titled “Get Signature”get canvasSize():
object
Defined in: renderer/src/RendererPlugin.ts:162
Current canvas size in CSS pixels. Changes on host resize under responsive fit.
Returns
Section titled “Returns”object
height
Section titled “height”height:
number
width:
number
croppedVirtualRects
Section titled “croppedVirtualRects”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”readonly VirtualRect[]
extendedVirtualRects
Section titled “extendedVirtualRects”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”readonly VirtualRect[]
Get Signature
Section titled “Get Signature”get fit():
RendererFitOptions
Defined in: renderer/src/RendererPlugin.ts:167
Current fit configuration.
Returns
Section titled “Returns”sceneRenderTrees
Section titled “sceneRenderTrees”Get Signature
Section titled “Get Signature”get sceneRenderTrees():
SceneRenderTreeProvider
Defined in: renderer/src/RendererPlugin.ts:260
The per-scene render tree provider.
Returns
Section titled “Returns”virtualCanvasRect
Section titled “virtualCanvasRect”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”virtualSize
Section titled “virtualSize”Get Signature
Section titled “Get Signature”get virtualSize():
object
Defined in: renderer/src/RendererPlugin.ts:157
Virtual resolution size.
Returns
Section titled “Returns”object
height
Section titled “height”height:
number
width:
number
visibleCanvasRect
Section titled “visibleCanvasRect”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”visibleVirtualRect
Section titled “visibleVirtualRect”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”Methods
Section titled “Methods”canvasToVirtual()
Section titled “canvasToVirtual()”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.
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”Vec2
createTexture()
Section titled “createTexture()”createTexture(
draw):Texture
Defined in: renderer/src/RendererPlugin.ts:265
Create a texture by drawing into a temporary graphics context.
Parameters
Section titled “Parameters”(graphics) => void
Returns
Section titled “Returns”Texture
install()
Section titled “install()”install(
context):Promise<void>
Defined in: renderer/src/RendererPlugin.ts:46
Install services into the engine context. Called in topological order.
Parameters
Section titled “Parameters”context
Section titled “context”EngineContext
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”Plugin.install
onDestroy()
Section titled “onDestroy()”onDestroy():
void
Defined in: renderer/src/RendererPlugin.ts:134
Called when the engine is destroyed.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Plugin.onDestroy
registerSystems()
Section titled “registerSystems()”registerSystems(
scheduler):void
Defined in: renderer/src/RendererPlugin.ts:130
Register systems with the scheduler. Called after install.
Parameters
Section titled “Parameters”scheduler
Section titled “scheduler”SystemScheduler
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Plugin.registerSystems
setFit()
Section titled “setFit()”setFit(
options):void
Defined in: renderer/src/RendererPlugin.ts:176
Change the fit mode and/or target at runtime.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”void
virtualToCanvas()
Section titled “virtualToCanvas()”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.
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”Vec2