setGameSize(width, height)
Set the actual Game size.
Use this instead of directly changing game.width
or game.height
.
The actual physical display (Canvas element size) depends on various settings including
- Scale mode
- Scaling factor
- Size of Canvas's parent element or CSS rules such as min-height/max-height;
- The size of the Window
Parameters
Name | Type | Description |
---|---|---|
width | integer | Game width, in pixels. |
height | integer | Game height, in pixels. |
- Source code: core/ScaleManager.js (Line 881)
Please login to continue.