RuntimeGamePixiRenderer

RuntimeGamePixiRenderer

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

Constructor

new RuntimeGamePixiRenderer(game, forceFullscreen)

Parameters:
Name Type Description
game

The game that is being rendered

forceFullscreen

If fullscreen should be always activated

Source:

Methods

bindStandardEvents()

Add the standard events handler.

Source:

centerWindow()

Center the window on screen.

Source:

createStandardCanvas()

Create a standard canvas inside canvasArea.

Source:

getCanvas()

Get the canvas DOM element.

Source:

getElectron()

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

Source:

isFullScreen()

Checks if the game is in full screen.

Source:

isWebGLSupported()

Check if the device supports WebGL.

Returns:
Type Description

true if WebGL is supported

Source:

keepAspectRatio()

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

Source:

openURL()

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

Source:

setFullScreen()

De/activate fullscreen for the game.

Source:

setMargins()

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

Source:

setWindowSize(width, height)

Update the window size, if possible.

Parameters:
Name Type Description
width

The new width, in pixels.

height

The new height, in pixels.

Source:

stopGame()

Close the game, if applicable

Source:

updateRendererSize()

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.

Source: