Skip to content
GitHub repository
Interface

SilkApp

What createSilkApp returns: the Pixi application, its CSS size and resolution, and helpers to change or destroy it.

Properties#

PropertyModifierTypeDescriptionDefined in
apppublicApplicationThe Pixi application.app.ts:29
heightreadonlynumberCurrent height in CSS pixels.app.ts:33
resolutionreadonlynumberCurrent renderer resolution (device pixels per CSS pixel).app.ts:35
widthreadonlynumberCurrent width in CSS pixels.app.ts:31

Methods#

destroy()#

destroy(): void;

Stops observers, destroys the stage and renderer and removes the canvas. Safe with several apps on a page.

Returns#

void


setResolution()#

setResolution(resolution: number | null): void;

Forces a resolution, for example to compare 1x and 2x. null returns to devicePixelRatio.

Parameters#

ParameterType
resolutionnumber | null

Returns#

void