gamvas.event

Functions for event handling

Summary
gamvas.eventFunctions for event handling
Functions
addOnLoadAdd a function to be called when the HTML document is loaded
addOnReadyAdd a function to be called when gamvas is ready and right before rendering the first frame.
stopBubble

Functions

addOnLoad

addOnLoad: function(fnc)

Description

Add a function to be called when the HTML document is loaded

Example

This function is usually used for initializing gamvas like following

gamvas.event.addOnLoad(function() {
   gamvas.state.addState(myState);
   gamvas.start('myCanvas', true);
}

addOnReady

addOnReady: function(fnc)

Description

Add a function to be called when gamvas is ready and right before rendering the first frame.

Example

gamvas.event.addOnReady(function() {
    alert('Everything is up, we're ready to roll!');
}

stopBubble

stopBubble: function(e)

Parameters

eThe event object

Description

Do not transfer events to underlying elements (aka bubbling)

Example

gamvas.event.addOnReady(function() {
    alert('Everything is up, we're ready to roll!');
}
addOnLoad: function(fnc)
Add a function to be called when the HTML document is loaded
addOnReady: function(fnc)
Add a function to be called when gamvas is ready and right before rendering the first frame.
stopBubble: function(e)
Close