-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
26 lines (25 loc) · 968 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var cocos2dApp = cc.Application.extend({
config:document.querySelector('#cocos2d-html5')['c'],
ctor:function (scene) {
this._super();
this.startScene = scene;
cc.COCOS2D_DEBUG = this.config['COCOS2D_DEBUG'];
cc.setup(this.config['tag']);
cc.Loader.shareLoader().onloading = function () {
cc.LoaderScene.shareLoaderScene().draw();
};
cc.Loader.shareLoader().onload = function () {
cc.AppController.shareAppController().didFinishLaunchingWithOptions();
};
cc.Loader.shareLoader().preload([
]);
},
applicationDidFinishLaunching:function () {
var director = cc.Director.getInstance();
director.setDisplayStats(this.config['showFPS']);
director.setAnimationInterval(1.0 / this.config['frameRate']);
director.runWithScene(new this.startScene());
return true;
}
});
var myApp = new cocos2dApp(MyFirstAppScene);