GameOptions
Options for createGame.
Properties
Section titled “Properties”canvas
Section titled “canvas”canvas:
HTMLCanvasElement
capacity?
Section titled “capacity?”
optionalcapacity?:number
Initial entity capacity; the world doubles it when full. Default 16,384.
fixedDt?
Section titled “fixedDt?”
optionalfixedDt?:number
Seconds per fixed step. Default 1/60.
plugins?
Section titled “plugins?”
optionalplugins?:Plugin[]
optionalsize?:"auto"| {height:number;width:number; }
The game’s size in screen pixels: what the camera shows at zoom 1, and the unit of screen layers, clip rectangles
and the pointer. Size the canvas on the page with CSS (width: 100%; height: 100% for the whole window).
'auto': follows the canvas’s size on the page, in CSS pixels.{ width: 1280, height: 720 }: a fixed size, scaled to fit the canvas and centered, with bars in the background color, so the game looks the same on every screen.
Either way the canvas renders at the screen’s full resolution (sharp on HiDPI screens and phones) and follows
resizes and rotations. Leave it out to draw the canvas’s own width x height as they are and size it yourself.
