Add the standard events handler.
Center the window on screen.
Convert a point from the canvas coordinates to the dom element container coordinates.
The point in the canvas coordinates.
The point to return.
The point in the dom element container coordinates.
Create the canvas on which the game will be rendered, inside the specified DOM element, and
setup the rendering of the game.
If you want to use your own canvas, use initializeForCanvas
instead.
The parent element to which the canvas will be added.
Dispose the renderers (PixiJS and/or Three.js) as well as DOM elements used for the game (the canvas, if specified, and the additional DOM container created on top of it to allow display HTML elements, for example for text inputs).
If true, the canvas will be removed from the DOM.
Get the canvas DOM element.
Return the scale factor between the renderer height and the actual canvas height, which is also the height of the container for DOM elements to be superimposed on top of it.
Useful to scale font sizes of DOM elements so that they follow the size of the game.
Get the DOM element used as a container for HTML elements to display on top of the game.
Get the electron module, if running as a electron renderer process.
Helper to get the electron remote module, if running on Electron. Note that is not guaranteed to be supported in the future - avoid if possible.
Get the Three.js renderer for the game - if any.
Setup the rendering of the game to use a canvas that was already created.
The canvas to use.
Checks if the game is in full screen.
Check if the device supports WebGL.
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.
The new width, in pixels.
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.
The game that is being rendered
If fullscreen should be always activated
Generated using TypeDoc
The renderer for a gdjs.RuntimeGame using Pixi.js.