Members
_app
App for holding game data
_cookies
Global cookie manager
_input
Global input manager
_reg
Registry holder
_spaces
Global space manager
_tasks
Global task manager
app
Get the root application.
colors
Colors to be used throughout the engine.
cookies
Get the global cookie manager.
debug
Global debugging flags. Can be enabled to display debugging information.
flags
Global flags.
fonts
Fonts to be used throughout the engine in drawing on the canvas.
height
Height of the canvas being used.
input
Get the global input handler.
mousePos
The current mouse position relative to the canvas.
reg
Get the registries for holding assets and more.
spaces
Get the global space manager.
tasks
Get the global task manager.
width
Width of the canvas being used.
Methods
createImage(func, onDone, width, height)
Generate an image using a custom function on an offscreen canvas.
Parameters:
Name | Type | Description |
---|---|---|
func | function | Function to run (passes in context) |
onDone | function | Function to run when complete (passes in image) |
width | number | Width of image (starts at x = 0) |
height | number | Height of image (starts at y = 0) |
createImageData(func, width, height) → {ImageData}
Generate image data using a custom function on an offscreen canvas.
Parameters:
Name | Type | Description |
---|---|---|
func | function | Function to run (passes in context) |
width | number | Width of data (starts at x = 0) |
height | number | Height of data (starts at y = 0) |
Returns:
Generated image data
- Type:
- ImageData
init(canvasID, onload, preload)
Initialize the engine.
Parameters:
Name | Type | Description |
---|---|---|
canvasID | string | The ID of the canvas to draw on |
onload | function | Function to call once all assets are loaded |
preload | function | Function for loading assets |
loadDec()
Decrement the amount of assets loading, and start the application if it reaches 0.
loadInc()
Increment the amount of assets loading.