Constructor
new RuntimeGamePixiRenderer(game, forceFullscreen)
Parameters:
Name | Type | Description |
---|---|---|
game |
The game that is being rendered |
|
forceFullscreen |
If fullscreen should be always activated |
Methods
bindStandardEvents()
Add the standard events handler.
centerWindow()
Center the window on screen.
createStandardCanvas()
Create a standard canvas inside canvasArea.
getCanvas()
Get the canvas DOM element.
getElectron()
Get the electron module, if running as a electron renderer process.
isFullScreen()
Checks if the game is in full screen.
isWebGLSupported()
Check if the device supports WebGL.
Returns:
Type | Description |
---|---|
true if WebGL is supported |
keepAspectRatio()
Set if the aspect ratio must be kept when the game canvas is resized to fill the page.
openURL()
Open the given URL in the system browser (or a new tab)
setFullScreen()
De/activate fullscreen for the game.
setMargins()
Change the margin that must be preserved around the game canvas.
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. |
stopGame()
Close the game, if applicable
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.