Created
February 13, 2016 04:45
-
-
Save kitao/18caa96f797215e8814a to your computer and use it in GitHub Desktop.
Minimal Template for Cocos2d-JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Cocos2d-JS Template</title> | |
<link rel="icon" href="res/favicon.ico"> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="full-screen" content="yes"> | |
<meta name="screen-orientation" content="portrait"> | |
<meta name="x5-fullscreen" content="true"> | |
<meta name="360-fullscreen" content="true"> | |
<style> | |
body, canvas, div { | |
-moz-user-select: none; | |
-webkit-user-select: none; | |
-ms-user-select: none; | |
-khtml-user-select: none; | |
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); | |
} | |
</style> | |
</head> | |
<body style="padding: 0; margin: 0; background: #000;"> | |
<canvas id="gameCanvas"></canvas> | |
<script src="./lib/cocos2d-js-v3.10.js"></script> | |
<script> | |
document.ccConfig = { | |
debugMode: 1, | |
frameRate: 60, | |
id: 'gameCanvas', | |
renderMode: 0, | |
jsList: [ | |
'src/SomeScene.js' // add the JavaScript files here | |
] | |
}; | |
cc.game.onStart = function() { | |
cc.view.enableRetina(false); | |
cc.view.adjustViewPort(true); | |
cc.view.setDesignResolutionSize(640, 480, cc.ResolutionPolicy.SHOW_ALL); // set the screen size here | |
cc.view.resizeWithBrowserSize(true); | |
cc.LoaderScene.preload([ | |
'res/SomeImage.png' // add the preload resource files here | |
], function() { | |
cc.director.runScene(new SomeScene()); // set the initial scene here | |
}, this); | |
}; | |
cc.game.run(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment