针对微信小游戏平台
关于怎么去掉cocosCreator的加载界面(就是一开始带有Cocos的log和加载进度条的那个界面)
点击项目->创建项目构建模板->微信小游戏
然后去该项目工程的根目录下的\build-templates\wechatgame\game.ejs
可以用记事本或者NotePad++打开该文件
替换成以下内容
如果在微信开发者工具中启动报错,去详情->本地设置->调试基础库,把版本改成2.19.6以上
function __initApp() {
// init app
require('./libs/wrapper/builtin/index');
//const firstScreen = require('./first-screen');
window.DOMParser = require('./libs/common/xmldom/dom-parser').DOMParser;
window.__globalAdapter = {
};
require('./libs/wrapper/unify');
require('./libs/wrapper/fs-utils');
// Polyfills bundle.
require("src/polyfills.bundle.43263.js");
// SystemJS support.
require("src/system.bundle.3f3f2.js");
// Adapt for IOS, swap if opposite
if (canvas) {
var _w = canvas.width;
var _h = canvas.height;
if (screen.width < screen.height) {
if (canvas.width > canvas.height) {
_w = canvas.height;
_h = canvas.width;
}
} else {
if (canvas.width < canvas.height) {
_w = canvas.height;
_h