rogeriolino/mangame — Issue #2: Loader
Author: rogeriolino
Created: 2011-11-11 16:35:04+00:00
State: open

Add to core class Loader.

features:

Loader.require(libs, args)

Include and load internal managame JS files to project. Add callbacks support.
Ex:
Loader.require(["ui", "geom", "sound"], { oncomplete: function() { alert("Engine is loaded") } });

Loader.load(url, args)

Single/multiple external file(s) loader. Add callbacks support.
Ex:
Loader.load("img/chars.png", { onstart: showLoader, oncomplete: hideLoader });
Loader.load(["img/chars.png", "img/bg.png", "sounds/intro.mp3"]);

* Both methods should generate a Resource class (#1)