这个问题问过官方技术猿了,他们表示如果微信小游戏有问题,可以联系他们,也就是明显不支持的渠道,他们不会...那个明白就好。

没有太好的解决方法,怎么不能绿屏跳转到loading界面,还不如黑屏跳转过去呢。

first-screen.js这个文件是闪屏有关的。

function start(alpha, antialias, useWebgl2) {
    options.alpha = alpha === 'true' ? true : false;
    options.antialias = antialias === 'false' ? false : true;
    if (useWebgl2 === 'true') {
        gl = window.canvas.getContext("webgl2", options);
    }
    // TODO: this is a hack method to detect whether WebGL2RenderingContext is supported
    if (gl) {
        window.WebGL2RenderingContext = true;
    } else {
        window.WebGL2RenderingContext = false;
        gl = window.canvas.getContext("webgl", options);
    }
    /**initVertexBuffer();
    useCustomBg && initBgVertexBuffer();
    useLogo && useDefaultLogo && initSloganVertexBuffer();
    initProgressVertexBuffer();

    initLogoTexture();
    useCustomBg && initBgTexture();
    useLogo && useDefaultLogo && initSloganTexture();

    if (useLogo) {
        program = initShaders(VS_LOGO, FS_LOGO);
    }
    if (useCustomBg) {
        programBg = initShaders(VS_BG, FS_BG);
    }*/
    //if (fitWidth && !fitHeight) {
    // let canvas = ks.createCanvas();
    if (window.ks) {
        ks.showLoading({
            title: '资源加载中,请稍等...',
        })
    }
    programProgress = initShaders(VS_PROGRESSBAR, FS_PROGRESSBAR);
    tick();

    return Promise.all([
        //logo should be loaded earlier than slogan
        /**useLogo && loadImage(logoName).then(() => {
            updateVertexBuffer();
            updateLogoTexture();
        }).then(() => {
            return useLogo && useDefaultLogo && loadSlogan('slogan.png').then(() => {
                updateSloganVertexBuffer();
                updateSloganTexture();
            });
        }),
        useCustomBg && loadBackground(bgName).then(() => {
            updateBgVertexBuffer();
            updateBgTexture();
        })*/
    ]).then(() => {
        setTimeout(() => {
            if (window.ks) { ks.hideLoading(); }
        }, 2000)
        return setProgress(0);
    });
}

直接屏蔽掉闪屏的logo与背景显示,既然渲染不出来,那就直接来一个弹窗提示得了。

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐