Description

Main class to use Canvas Engine

var canvas = CE.defines("canvas_id"); // CanvasEngine object

canvas.ready(function(ctx) {
    canvas.Scene.call("MyScene");
});

Methods

defines

Initialize CanvasEngine by setting the canvas. Note two ways to declare a canvas in HTML : 1. 2.

In case you use the div tag to add a layer of DOM elements is possible. For example, to add forms. In `ready` method, you can use jQuery (Do not forget to include the library in the header before) : var el = $('
'); stage.append(el); > Valid for version >= 1.3.1

ready

Calls the function when DOM is ready. The method uses "window.load" or SoundManager callback if it is present. If the DOM is already loaded (with jquery by example). Do not put the callback function

clone

Clone an object

Discussion

Back to top

Canvas Engine is a framework to facilitate the use of HTML5 Canvas, particularly in the creation of 2D video games

License : MIT. Free for commercial use

2013 Web Creative5