Class: RuntimeGameCocosRenderer


new gdjs.RuntimeGameCocosRenderer(game, forceFullscreen)

The renderer for a gdjs.RuntimeGame using Cocos2D-JS.

Name Type Description
game gdjs.RuntimeGame
forceFullscreen boolean


Center the window on screen.

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 rendering area is resized.

As Cocos2d is managing the game loop, the Cocos scenes need to call this function to step the game engine. See gdjs.RuntimeSceneCocosRenderer.

Open the given URL in the system browser

De/activate fullscreen for the game.

Change the margin that must be preserved around the game.

Update the window size, if possible.

Name Type Description
width number

The new width, in pixels.

height number

The new height, in pixels.