-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
37 lines (28 loc) · 1.1 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
34
35
36
37
var screenWidth = 800;
var screenHeight = 600;
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();
//cc.EGLView.getInstance()._adjustSizeToBrowser();
// 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' ] );
cc.LoaderScene.preload(g_resources, function () {
director.replaceScene( new this.startScene() );
}, this );
//director.runWithScene( new this.startScene() );
return true;
}
});
var myApp = new cocos2dApp( menuScene );