Skip to content
Armen edited this page Jun 2, 2012 · 76 revisions

extends a2d.Events

Defined in a2d.js

Summary

a2d
A happy namespace for all game engine stuffs.

Method Summary

<static>

Audio
A convenience wrapper for html5 audio
<static> load (loadData)
Load resources.

Property Summary

**[canvas](#canvas)** Get or set the canvas.
**[dimension](#dimension)** The canvas size.
<static> **[requestFrame](#requestFrame)** (function) Request animation frame.
**[root](#root)** The root sceneNode.
<static> **[version](#version)** a2d engine version
### Event Summary
**[draw](#draw)** fired when a frame is drawn.
**[load](#load)** fired when all resources have been loaded.
**[progress](#progress)** (eventObject) fired when progress is made loading resources.
#### Methods inherited from a2d.Events: addEventListener, emit, fireEvent, hasEvent, on, removeEventListener

Detail

a2d
A happy namespace for all game engine stuffs.


Method Detail

<static> a2d.Audio
A convenience wrapper for html5 audio

-- <static> a2d.load (loadData)
Load resources.

Parameters:

{object} loadData


Property Detail

canvas
Get or set the canvas. Assigning a string to this property will attempt to find the canvas with the given string as an ID. If no canvas is set, an attempt is made to "auto-detect" a canvas in the DOM. If not found, one will be created and added to the DOM.

-- dimension
The canvas size. You can resize the canvas by setting this.

-- <static> a2d.requestFrame (function)
Request animation frame. Browser-specific animation frame, or 60fps timeout callback.

Parameters:

{Function} function

-- root
The root sceneNode. Attach nodes you want displayed to this.

-- <static> a2d.version
a2d engine version


Event Detail

draw
fired when a frame is drawn.

-- load
fired when all resources have been loaded.

-- progress (eventObject)
fired when progress is made loading resources.

Parameters:

{object} eventObject
{number} eventObject.loaded
{number} eventObject.total


Clone this wiki locally