@@ -138,6 +138,9 @@ <h2><a id="settings">Game Configuration</a></h2>
138
138
// global functions: window.init(), window.update(dt), window.draw()
139
139
settings.loop = { init: function, update: function, draw: function}
140
140
141
+ // the canvas (by default a new canvas is created)
142
+ settings.canvas = null
143
+
141
144
// make the game screen fill the entire screen
142
145
settings.fullscreen = true
143
146
@@ -147,9 +150,6 @@ <h2><a id="settings">Game Configuration</a></h2>
147
150
// scale the canvas
148
151
settings.autoscale = true
149
152
150
- // the canvas wrapper
151
- settings.parent = document.body
152
-
153
153
// target FPS
154
154
settings.fps = 60
155
155
@@ -182,6 +182,7 @@ <h2><a id="drawing">Functions for Drawing</a></h2>
182
182
183
183
// clear the canvas
184
184
// all color argument is a integer (a color from 0 to 7)
185
+ // alias: cls(...)
185
186
clear(color: null|number): void
186
187
187
188
// draw a color-filled rectangle
@@ -215,6 +216,7 @@ <h2><a id="drawing">Functions for Drawing</a></h2>
215
216
*/
216
217
217
218
// draw a text
219
+ // alias: print(...)
218
220
text(x, y, text: string, color = 0, size: number|null, font = 'monospace'): void
219
221
220
222
// set the text alignment and baseline
@@ -365,9 +367,6 @@ <h2><a id="globals">Globals Variables</a></h2>
365
367
// see: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D
366
368
CANVAS.ctx
367
369
368
- // the game canvas wrapper
369
- PARENT: HTMLElement
370
-
371
370
// the game screen width
372
371
WIDTH: number
373
372
@@ -397,6 +396,10 @@ <h2><a id="globals">Globals Variables</a></h2>
397
396
398
397
// the tap/click Y position
399
398
TAPY: number
399
+
400
+ // The ratio of the circumference of a circle to its diameter,
401
+ // approximately 3.14159
402
+ PI: number
400
403
</ code > </ pre >
401
404
402
405
< h2 > < a id ="advanced "> Advanced Features</ a > </ h2 >
0 commit comments