Class: RuntimeGamePixiRenderer


new gdjs.RuntimeGamePixiRenderer(game, forceFullscreen)

The renderer for a gdjs.RuntimeGame using Pixi.js.

Name Type Description
game gdjs.RuntimeGame

The game that is being rendered

forceFullscreen boolean

If fullscreen should be always activated


Add the standard events handler.

Center the window on screen.

Create a standard canvas inside canvasArea.

Get the canvas DOM element.

Get the electron module, if running as a electron renderer process.

Check if the device supports WebGL.

Type Description
boolean true if WebGL is supported

Set if the aspect ratio must be kept when the game canvas is resized to fill the page.

Open the given URL in the system browser (or a new tab)

De/activate fullscreen for the game.

Change the margin that must be preserved around the game canvas.

Update the window size, if possible.

Name Type Description
width number

The new width, in pixels.

height number

The new height, in pixels.

Close the game, if applicable

Update the game renderer size according to the "game resolution". Called when game resolution changes.

Note that if the canvas is fullscreen, it won't be resized, but when going back to non fullscreen mode, the requested size will be used.