LogoPixi’VN
pixi-jsClasses

Class: ViewSystem

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:61

The view system manages the main canvas that is attached to the DOM. This main role is to deal with how the holding the view reference and dealing with how it is resized.

Advanced

Implements

Constructors

Constructor

> new ViewSystem(): ViewSystem

Returns

ViewSystem

Properties

antialias

> antialias: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:82

Whether to enable anti-aliasing. This may affect performance.


canvas

> canvas: ICanvas

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:71

The canvas element that everything is drawn to.


renderTarget

> renderTarget: RenderTarget

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:90

The render target that the view is drawn to.


screen

> screen: Rectangle

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:88

Measurements of the screen. (0, 0, screenWidth, screenHeight).

Its safe to use as filterArea or hitArea for the whole stage.


texture

> texture: Texture<CanvasSource>

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:73

The texture that is used to draw the canvas to the screen.


defaultOptions

> static defaultOptions: ViewSystemOptions

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:69

The default options for the view system.

Accessors

autoDensity

Get Signature

> get autoDensity(): boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:79

Whether CSS dimensions of canvas view should be resized to screen dimensions automatically. This is only supported for HTMLCanvasElement and will be ignored if the canvas is an OffscreenCanvas.

Returns

boolean

Set Signature

> set autoDensity(value): void

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:80

Parameters
value

boolean

Returns

void


resolution

Get Signature

> get resolution(): number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:92

The resolution / device pixel ratio of the renderer.

Returns

number

Set Signature

> set resolution(value): void

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:93

Parameters
value

number

Returns

void

Methods

destroy()

> destroy(options?): void

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:114

Destroys this System and optionally removes the canvas from the dom.

Parameters

options?

TypeOrBool<ViewSystemDestroyOptions>

The options for destroying the view, or "false".

Returns

void

Example

viewSystem.destroy();
viewSystem.destroy(true);
viewSystem.destroy({ removeView: true });

Implementation of

System.destroy


init()

> init(options): void

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:98

initiates the view system

Parameters

options

ViewSystemOptions

the options for the view

Returns

void

Implementation of

System.init


resize()

> resize(desiredScreenWidth, desiredScreenHeight, resolution): void

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:105

Resizes the screen and canvas to the specified dimensions.

Parameters

desiredScreenWidth

number

The new width of the screen.

desiredScreenHeight

number

The new height of the screen.

resolution

number

Returns

void