-
-
getCanvasHeight get game canvas height
Returns:
Type |
Description |
Number
|
the canvas height |
-
-
getCanvasWidth get game canvas width
Returns:
Type |
Description |
Number
|
the canvas width |
-
-
gets the current scene
Returns:
-
-
Logs and stops the game.
-
-
(internal) Synchronized render loop
-
renderText
(x, y, txt, style, font)
-
renderText renders text to canvas
Name |
Type |
Description |
x |
Number
|
position to render text to |
y |
Number
|
position to render text to |
txt |
String
|
the text to render |
style |
String
|
2d context style, can be also color description (e.g: "#fff") |
font |
String
|
2d context font string |
Returns:
null
-
-
Setup initiate the game object.
Should be called after document body has been loaded.
Returns:
null
-
start
(update, automated)
-
Start - start the game engine
Name |
Type |
Description |
update |
function
|
the update function (called each engine step) |
automated |
Boolean
|
set whether the engine should automate update & render |
-
-
Stop - stops the game engine
Returns:
null
-
-
(internal) fast as possible update loop
-
-
warns if in debug mode
Name |
Type |
Description |
msg |
String
|
warning message |