How to remove the loading animation before the first scene?

页面见附件


360截图20140227110934906.jpg (1.0 KB)

对这个问题也一直想知道。。。不只是一个移走等待的小图标的问题

Hi, @ying1248 @olddog

To do that you need to hack Cocos2d-html5, the loading file is in cocos2d/jsloader.js, you can find this section:

var loadJsImg = document.getElementById("cocos2d_loadJsImg");
if(!loadJsImg){
    loadJsImg = document.createElement('img');
    loadJsImg.src = "data:image/gif;base64,R0lGODlhEAAQALMNAD8/P...";

    var canvasNode = document.getElementById(c.tag);
    canvasNode.style.backgroundColor = "black";
    canvasNode.parentNode.appendChild(loadJsImg);
    
    var canvasStyle = getComputedStyle?getComputedStyle(canvasNode):canvasNode.currentStyle;
    loadJsImg.style.left = canvasNode.offsetLeft + (parseFloat(canvasStyle.width) - loadJsImg.width)/2 + "px";
    loadJsImg.style.top = canvasNode.offsetTop + (parseFloat(canvasStyle.height) - loadJsImg.height)/2 + "px";
    loadJsImg.style.position = "absolute";
}
1 Like

thank you.