mirror of https://github.com/axmolengine/axmol.git
Added compatible functions for HTML5 multi resources preloading.
This commit is contained in:
parent
b06380432b
commit
d60ba89b36
|
@ -537,3 +537,22 @@ cc.ScrollView.extend = cc.Class.extend;
|
|||
cc.TableView.extend = cc.Class.extend;
|
||||
cc.TableViewCell.extend = cc.Class.extend;
|
||||
|
||||
// Cocos2d-html5 supports multi scene resources preloading.
|
||||
// This is a compatible function for JSB.
|
||||
cc.Loader = cc.Class.extend({
|
||||
initWith:function (resources, selector, target) {
|
||||
if (selector) {
|
||||
this._selector = selector;
|
||||
this._target = target;
|
||||
}
|
||||
this._selector.call(this._target);
|
||||
}
|
||||
});
|
||||
|
||||
cc.Loader.preload = function (resources, selector, target) {
|
||||
if (!this._instance) {
|
||||
this._instance = new cc.Loader();
|
||||
}
|
||||
this._instance.initWith(resources, selector, target);
|
||||
return this._instance;
|
||||
};
|
Loading…
Reference in New Issue