Skip to content
pixi-silk
GitHub repository
Interface

SilkApp

import type { SilkApp } from 'pixi-silk';

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:37
heightreadonlynumberCurrent height in CSS pixels.app.ts:41
resolutionreadonlynumberCurrent renderer resolution, in device pixels per CSS pixel.app.ts:43
widthreadonlynumberCurrent width in CSS pixels.app.ts:39

Methods#

destroy()#

destroy(): void;

Stops observers and listeners, 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, and resizes at once. null returns to devicePixelRatio.

Parameters#

ParameterType
resolutionnumber | null

Returns#

void