Initialize
Setup
The setup
function is used to configure and set up a canvas with specific width, height, and other configurations.
When executed a frame should appear on the web browser.
If you dont want the canvas to stick to the sides of the screen add any float to reduce the size but maintaining the pixels resolution (from 0 to 1)
Parameters | Type | Description | Default Value |
---|---|---|---|
width | number |
The width of the canvas. | - |
height | number |
The height of the canvas. | - |
marginMultiplier | number |
The multiplier for adjusting margin. | 1 |
listeners | boolean |
Boolean to determine whether to set up listeners. | true |
Example
Start
The start
function initiates the main loop.
Example