File tree Expand file tree Collapse file tree 8 files changed +86
-12
lines changed Expand file tree Collapse file tree 8 files changed +86
-12
lines changed Original file line number Diff line number Diff line change 3333 frameRate :60 ,
3434 tag :'gameCanvas' , //the dom element to run cocos2d on
3535 engineDir :'../../cocos2d/' ,
36+ //SingleEngineFile:'',
3637 appFiles :[ 'src/myApp.js' ]
3738 } ;
3839 window . addEventListener ( 'DOMContentLoaded' , function ( ) {
3940 //first load engine file if specified
4041 var s = d . createElement ( 'script' ) ;
41- s . src = c . engineDir + 'platform/jsloader.js' ;
42+ /*********Delete this section if you have packed all files into one*******/
43+ if ( c . SingleEngineFile && ! c . engineDir ) {
44+ s . src = c . SingleEngineFile ;
45+ }
46+ else if ( c . engineDir && ! c . SingleEngineFile ) {
47+ s . src = c . engineDir + 'platform/jsloader.js' ;
48+ }
49+ else {
50+ alert ( 'You must specify either the single engine file OR the engine directory in "cocos2d.js"' ) ;
51+ }
52+ /*********Delete this section if you have packed all files into one*******/
53+
54+ //s.src = 'Packed_Release_File.js'; //IMPORTANT: Un-comment this line if you have packed all files into one
55+
4256 d . body . appendChild ( s ) ;
4357 s . c = c ;
4458 s . id = 'cocos2d-html5' ;
Original file line number Diff line number Diff line change 3434 frameRate :60 ,
3535 tag :'gameCanvas' , //the dom element to run cocos2d on
3636 engineDir :'../../cocos2d/' ,
37+ //SingleEngineFile:'',
3738 appFiles :[ 'src/NativeClient.js' ]
3839 } ;
3940 window . addEventListener ( 'DOMContentLoaded' , function ( ) {
4041 //first load engine file if specified
4142 var s = d . createElement ( 'script' ) ;
42- s . src = c . engineDir + 'platform/jsloader.js' ;
43+ /*********Delete this section if you have packed all files into one*******/
44+ if ( c . SingleEngineFile && ! c . engineDir ) {
45+ s . src = c . SingleEngineFile ;
46+ }
47+ else if ( c . engineDir && ! c . SingleEngineFile ) {
48+ s . src = c . engineDir + 'platform/jsloader.js' ;
49+ }
50+ else {
51+ alert ( 'You must specify either the single engine file OR the engine directory in "cocos2d.js"' ) ;
52+ }
53+ /*********Delete this section if you have packed all files into one*******/
54+
55+ //s.src = 'Packed_Release_File.js'; //IMPORTANT: Un-comment this line if you have packed all files into one
56+
4357 d . body . appendChild ( s ) ;
4458 s . c = c ;
4559 s . id = 'cocos2d-html5' ;
Original file line number Diff line number Diff line change 3333 frameRate :60 ,
3434 tag :'gameCanvas' , //the dom element to run cocos2d on
3535 engineDir :'../cocos2d/' ,
36+ //SingleEngineFile:'',
3637 appFiles :[
3738 'src/resource.js' ,
3839 'src/myApp.js' //add your own files in order here
4142 window . addEventListener ( 'DOMContentLoaded' , function ( ) {
4243 //first load engine file if specified
4344 var s = d . createElement ( 'script' ) ;
44- s . src = c . engineDir + 'platform/jsloader.js' ;
45+ /*********Delete this section if you have packed all files into one*******/
46+ if ( c . SingleEngineFile && ! c . engineDir ) {
47+ s . src = c . SingleEngineFile ;
48+ }
49+ else if ( c . engineDir && ! c . SingleEngineFile ) {
50+ s . src = c . engineDir + 'platform/jsloader.js' ;
51+ }
52+ else {
53+ alert ( 'You must specify either the single engine file OR the engine directory in "cocos2d.js"' ) ;
54+ }
55+ /*********Delete this section if you have packed all files into one*******/
56+
57+ //s.src = 'Packed_Release_File.js'; //IMPORTANT: Un-comment this line if you have packed all files into one
58+
4559 d . body . appendChild ( s ) ;
4660 s . c = c ;
4761 s . id = 'cocos2d-html5' ;
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ cc.DOM.addMethods = function (x) {
3333} ;
3434cc . DOM . methods = {
3535 setPosition :function ( x , y ) {
36- if ( y != 0 ) {
36+ if ( y != null ) {
3737 this . _position . x = x ;
3838 this . _position . y = y ;
3939 //this._position = cc.p(newPosOrxValue,yValue);
Original file line number Diff line number Diff line change 8787 <file name =" tileMap_parallax_nodes/CCTMXObjectGroup.js" />
8888 <file name =" tileMap_parallax_nodes/CCTMXLayer.js" />
8989 <file name =" tileMap_parallax_nodes/CCParallaxNode.js" />
90+ <file name =" platform/jsloader.js" />
9091 </sources >
9192 <sources dir =" ${ basedir } /../CocosDenshion" >
9293 <file name =" SimpleAudioEngine.js" />
Original file line number Diff line number Diff line change 2424 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2525 THE SOFTWARE.
2626 ****************************************************************************/
27- var cc = cc || cc || { } ;
2827( function ( ) {
2928 var engine = [
30- 'platform/miniFramework.js' ,
3129 'platform/CCClass.js' ,
30+ 'platform/miniFramework.js' ,
3231 'platform/CCCommon.js' ,
3332 'platform/platform.js' ,
3433 'platform/ZipUtils.js' ,
@@ -109,12 +108,17 @@ var cc = cc || cc || {};
109108 ] ;
110109 var d = document ;
111110 var c = d . querySelector ( '#cocos2d-html5' ) . c ;
111+ if ( ! c . engineDir ) {
112+ engine = [ ] ;
113+ }
114+ else {
115+ engine . forEach ( function ( e , i ) {
116+ engine [ i ] = c . engineDir + e ;
117+ } ) ;
118+ }
112119 if ( c . box2d )
113120 engine . push ( '../box2d/box2d.js' ) ;
114121 var loaded = 0 ;
115- engine . forEach ( function ( e , i ) {
116- engine [ i ] = c . engineDir + e ;
117- } ) ;
118122 var que = engine . concat ( c . appFiles ) ;
119123 que . push ( 'main.js' ) ;
120124 if ( navigator . userAgent . indexOf ( "Trident/5" ) > - 1 ) {
Original file line number Diff line number Diff line change 2727( function ( ) {
2828 var d = document ;
2929 var c = {
30- menuType :'canvas' , //whether to use canvas mode menu or dom menu
3130 COCOS2D_DEBUG :2 , //0 to turn debug off, 1 for basic debug, and 2 for full debug
3231 box2d :false ,
3332 showFPS :true ,
3433 frameRate :60 ,
3534 tag :'gameCanvas' , //the dom element to run cocos2d on
3635 engineDir :'../cocos2d/' ,
36+ //SingleEngineFile:'',
3737 appFiles :[
3838 'src/resource.js' ,
3939 'src/myApp.js' //add your own files in order here
4242 window . addEventListener ( 'DOMContentLoaded' , function ( ) {
4343 //first load engine file if specified
4444 var s = d . createElement ( 'script' ) ;
45- s . src = c . engineDir + 'platform/jsloader.js' ;
45+ /*********Delete this section if you have packed all files into one*******/
46+ if ( c . SingleEngineFile && ! c . engineDir ) {
47+ s . src = c . SingleEngineFile ;
48+ }
49+ else if ( c . engineDir && ! c . SingleEngineFile ) {
50+ s . src = c . engineDir + 'platform/jsloader.js' ;
51+ }
52+ else {
53+ alert ( 'You must specify either the single engine file OR the engine directory in "cocos2d.js"' ) ;
54+ }
55+ /*********Delete this section if you have packed all files into one*******/
56+
57+ //s.src = 'Packed_Release_File.js'; //IMPORTANT: Un-comment this line if you have packed all files into one
58+
4659 d . body . appendChild ( s ) ;
4760 s . c = c ;
4861 s . id = 'cocos2d-html5' ;
Original file line number Diff line number Diff line change 3434 frameRate :60 ,
3535 tag :'gameCanvas' , //the dom element to run cocos2d on
3636 engineDir :'../cocos2d/' ,
37+ //SingleEngineFile:'',
3738 appFiles :[ //'src/AppDelegate.js',
3839 'src/testbasic.js' ,
3940 'src/testResource.js' ,
7677 window . addEventListener ( 'DOMContentLoaded' , function ( ) {
7778 //first load engine file if specified
7879 var s = d . createElement ( 'script' ) ;
79- s . src = c . engineDir + 'platform/jsloader.js' ;
80+ /*********Delete this section if you have packed all files into one*******/
81+ if ( c . SingleEngineFile && ! c . engineDir ) {
82+ s . src = c . SingleEngineFile ;
83+ }
84+ else if ( c . engineDir && ! c . SingleEngineFile ) {
85+ s . src = c . engineDir + 'platform/jsloader.js' ;
86+ }
87+ else {
88+ alert ( 'You must specify either the single engine file OR the engine directory in "cocos2d.js"' ) ;
89+ }
90+ /*********Delete this section if you have packed all files into one*******/
91+
92+ //s.src = 'Packed_Release_File.js'; //IMPORTANT: Un-comment this line if you have packed all files into one
93+
8094 d . body . appendChild ( s ) ;
8195 s . c = c ;
8296 s . id = 'cocos2d-html5' ;
You can’t perform that action at this time.
0 commit comments