forked from cocos2d/cocos2d-html5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
21 lines (18 loc) · 752 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
cc.game.onStart = function(){
if(!cc.sys.isNative && document.getElementById("cocosLoading")) //If referenced loading.js, please remove it
document.body.removeChild(document.getElementById("cocosLoading"));
var designSize = cc.size(480, 800);
var screenSize = cc.view.getFrameSize();
if(!cc.sys.isNative && screenSize.height < 800){
designSize = cc.size(320, 480);
cc.loader.resPath = "res/Normal";
}else{
cc.loader.resPath = "res/HD";
}
cc.view.setDesignResolutionSize(designSize.width, designSize.height, cc.ResolutionPolicy.SHOW_ALL);
//load resources
cc.LoaderScene.preload(g_resources, function () {
cc.director.runScene(new MyScene());
}, this);
};
cc.game.run();