王育民 %!s(int64=4) %!d(string=hai) anos
pai
achega
4413ac842d
Modificáronse 4 ficheiros con 13 adicións e 45 borrados
  1. 1 1
      README.md
  2. 3 4
      index.html
  3. 7 38
      main.js
  4. 2 2
      style-mobile.css

+ 1 - 1
README.md

@@ -1,2 +1,2 @@
 ## 合成大西瓜
-未改动版本源码
+源码

+ 3 - 4
index.html

@@ -63,18 +63,18 @@
 </head>
 
 <body style="margin: 0; background: #ddd;" align="center">
-<div style="align:center;display: none"><img src="res/share.jpg" width="10%"/></div>
+<div style="align: center; display: none"><img src="res/share.jpg" width="10%" alt=""/></div>
 
 <div id="canvasDiv" style="width:100%;height:100%;">
     <canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0"></canvas>
-    <video id="contentElement" style="display:none;position: absolute;top:0px;left: 0px;">
+    <video id="contentElement" style="display:none;position: absolute;top: 0; left: 0;">
         <source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.mp4"/>
         <source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.webm"/>
     </video>
     <div id="block-Box" style="display:block;width:100%;height:100%;"></div>
 </div>
 
-<div id="adContainer" style="display:none;position: absolute;top:0px;left: 0px;width:100%;height:100%;z-index:999;"></div>
+<div id="adContainer" style="display: none; position: absolute; top:0; left: 0; width:100%; height:100%; z-index: 999;"></div>
 <div id="loadingText" style="width:100%;display: none;text-align:center;position:absolute;top:45%;z-index:2;font-size:20px;color:#f99f0a">
     loading......0%
 </div>
@@ -241,7 +241,6 @@
 function ShowBannerAD(){
     (adsbygoogle = window.adsbygoogle || []).push({});
 }
-
 </script> -->
 
 <script async data-ad-client="ca-pub-3932234672445376" data-ad-channel="7171445254" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

+ 7 - 38
main.js

@@ -5,14 +5,11 @@ if (false) {
 
 var loadingBool = true;
 var loadingNum = 0;
-window.boot = function() {
-
+window.boot = function () {
     var settings = window._CCSettings;
     window._CCSettings = undefined;
-
     if (!settings.debug) {
         var uuids = settings.uuids;
-
         var rawAssets = settings.rawAssets;
         var assetTypes = settings.assetTypes;
         var realRawAssets = settings.rawAssets = {};
@@ -66,14 +63,9 @@ window.boot = function() {
         // Loading splash scene
         var splash = document.getElementById('splash');
         // var progressBar = splash.querySelector('.progress-bar span');
-
-
-
-        cc.loader.onProgress = function(completedCount, totalCount, item) {
-
+        cc.loader.onProgress = function (completedCount, totalCount, item) {
             loadData.completedCount = completedCount;
             loadData.totalCount = totalCount;
-
             if (loadingBool) {
                 var loadintT = document.getElementById("loadingText")
             }
@@ -81,7 +73,7 @@ window.boot = function() {
             if (loadingBool && loadingNum >= 1 && totalCount > 1) {
                 if (percent.toFixed(0) >= 100) {
                     loadintT.innerHTML = 'loading......100' + '%';
-                    setTimeout(function() {
+                    setTimeout(function () {
                         loadingBool = false;
                         loadintT.remove();
                     }, 0.1 * 1000);
@@ -108,30 +100,22 @@ window.boot = function() {
             // if (progressBar) {
             // progressBar.style.width = percent.toFixed(2) + '%';
             // }
-
-
         };
         splash.style.display = 'block';
         // progressBar.style.width = '0%';
-
-        cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function() {
+        cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function () {
             splash.style.display = 'none';
         });
     }
 
-    var onStart = function() {
-
+    var onStart = function () {
         cc.loader.downloader._subpackages = settings.subpackages;
-
         cc.view.enableRetina(true);
         cc.view.resizeWithBrowserSize(true);
-
         if (!false && !false) {
-
             if (cc.sys.isBrowser) {
                 setLoadingDisplay();
             }
-
             if (cc.sys.isMobile) {
                 if (settings.orientation === 'landscape') {
                     cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE);
@@ -146,7 +130,6 @@ window.boot = function() {
                 // ].indexOf(cc.sys.browserType) < 0);
                 cc.view.enableAutoFullScreen(false);
             }
-
             // Limit downloading max concurrent task to 2,
             // more tasks simultaneously may cause performance draw back on some android system / browsers.
             // You can adjust the number based on your own test result, you have to set it before any loading process to take effect.
@@ -171,16 +154,13 @@ window.boot = function() {
         // console.log('Success to load scene: ' + launchScene);
         // }
         // );
-
         // }
 
         var launchScene = settings.launchScene;
 
         // load scene
         // loadScene(launchScene);
-
         var canvas;
-
         if (cc.sys.isBrowser) {
             canvas = document.getElementById('GameCanvas');
         }
@@ -188,12 +168,6 @@ window.boot = function() {
         console.log("landscape,", launchScene);
         var MainManger = __require("MainManage");
         MainManger.init(launchScene, cc.sys.isBrowser, canvas.style.visibility);
-
-
-
-
-
-
     };
 
     // jsList
@@ -204,7 +178,7 @@ window.boot = function() {
     } else {
         var bundledScript = settings.debug ? 'src/project.dev.js' : 'src/project.js';
         if (jsList) {
-            jsList = jsList.map(function(x) {
+            jsList = jsList.map(function (x) {
                 return 'src/' + x;
             });
             jsList.push(bundledScript);
@@ -242,7 +216,6 @@ if (false) {
     BK.Script.loadlib('GameRes://src/settings.js');
     BK.Script.loadlib();
     BK.Script.loadlib('GameRes://libs/qqplay-downloader.js');
-
     var ORIENTATIONS = {
         'portrait': 1,
         'landscape left': 2,
@@ -250,17 +223,14 @@ if (false) {
     };
     BK.Director.screenMode = ORIENTATIONS[window._CCSettings.orientation];
     initAdapter();
-    cc.game.once(cc.game.EVENT_ENGINE_INITED, function() {
+    cc.game.once(cc.game.EVENT_ENGINE_INITED, function () {
         initRendererAdapter();
     });
-
     qqPlayDownloader.REMOTE_SERVER_ROOT = "";
     var prevPipe = cc.loader.md5Pipe || cc.loader.assetLoader;
     cc.loader.insertPipeAfter(prevPipe, qqPlayDownloader);
-
     window.boot();
 } else if (window.jsb) {
-
     var isRuntime = (typeof loadRuntime === 'function');
     if (isRuntime) {
         require('src/settings.js');
@@ -271,7 +241,6 @@ if (false) {
         require('src/cocos2d-jsb.js');
         require('jsb-adapter/jsb-engine.js');
     }
-
     cc.macro.CLEANUP_IMAGE_CACHE = true;
     window.boot();
 }

+ 2 - 2
style-mobile.css

@@ -47,8 +47,8 @@ body {
 #Cocos2dGameContainer {
     position: absolute;
     margin: 0;
-    left: 0px;
-    top: 0px;
+    left: 0;
+    top: 0;
     display: -webkit-box;
     -webkit-box-orient: horizontal;
     -webkit-box-align: center;