-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
33 lines (28 loc) · 1.13 KB
/
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
27
28
29
30
31
32
33
// Needed for HTML5
var cocos2dApp = cc.Application.extend({
config:document['ccConfig'],
ctor:function (scene) {
this._super();
this.startScene = scene;
cc.COCOS2D_DEBUG = this.config['COCOS2D_DEBUG'];
cc.initDebugSetting();
cc.setup(this.config['tag']);
cc.AppController.shareAppController().didFinishLaunchingWithOptions();
},
applicationDidFinishLaunching:function () {
// initialize director
var director = cc.Director.getInstance();
// enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices.
// director->enableRetinaDisplay(true);
// turn on display FPS
director.setDisplayStats(this.config['showFPS']);
// set FPS. the default value is 1.0/60 if you don't call this
director.setAnimationInterval(1.0 / this.config['frameRate']);
//load resources
cc.Loader.preload(ccb_resources, function () {
cc.Director.getInstance().runWithScene(new this.startScene());
}, this);
return true;
}
});
var myApp = new cocos2dApp(CCBMainScene);