2019年6月

wx.setKeepScreenOn

ios 需要在重新进入小游戏的时候 重新设置 android没有这个问题

wx.setStorageSync

同步版本有可能引发性能问题, requestAnimationFrame

 

微信小游戏 hello world

import './js/libs/weapp-adapter'

let ctx = canvas.getContext('2d')
ctx.font = "20px Courier New";
ctx.fillText("hello world", 100, 200)
View Code

 

微信空包 测试10分钟 (值以实际运行为准)

三星 S6-Edge  进入内存/业务内存 113M  最低99m 最高120m  CPU 3%

vivo x9 puls  进入内存/业务内存 153M  最低144m 最高155m  CPU 1%

华为荣耀8青春版  进入内存/业务内存 119M  最低111M 最高123M  CPU 0%(读不出来)

魅族魅蓝note3  进入内存/业务内存 150M  最低134M 最高148M  CPU 3%~7%

OPPO R9    进入内存/业务内存147M  最低138M 最高149M  CPU 2% ~ 3%

小米8 SE  进入内存/业务内存167M  最低163M 最高175M  CPU 0%(读不出来)

内存从最低涨到最高又回到最低

 

LayaBox空包 测试5分钟 (值以实际运行为准)

三星 S6-Edge  进入内存/业务内存 169M  最低165m 最高183m  CPU 14%

vivo x9 puls  进入内存/业务内存 219M  最低194m 最高204m  CPU 9%

华为荣耀8青春版  进入内存/业务内存 171M  最低167M 最高179M  CPU 0%(读不出来)

魅族魅蓝note3  进入内存/业务内存 241M  最低228M 最高231M  CPU 12~14%

OPPO R9    进入内存/业务内存241M  最低237M 最高241M  CPU 33%

小米8 SE  进入内存/业务内存261M  最低216M 最高226M  CPU 0%(读不出来)

内存从最低涨到最高又回到最低

 

sprite加载图片的影响 (值以实际运行为准)

  图片大小18.9K,分辨率 359 x 360 8位深度 png

 

 

 

 

LayaBox

            case "touchmove":;
                var touchemoves=evt.changedTouches;
                for (i=0,n=touchemoves.length;i < n;i++){
                    touch=touchemoves[i];
                    if (MouseManager.multiTouchEnabled || touch.identifier==this._curTouchID){
                        this.initEvent(touch,evt);
                        this._checkAllBaseUI(this.mouseX,this.mouseY,this.onMouseMove);
                    } 
                    // 修改
                    else if (MouseManager.multiTouchEnabled == false) {
                        this.initEvent(touch,evt);
                    }
                }
                break ;
View Code
MouseManager    12333

    canvas.addEventListener("touchstart",function(e){
            if (MouseManager.enabled){
                if(e.touches.length > 1){
                    return;
                }
                if (!MouseManager._isFirstTouch&&!Input.isInputting)e.preventDefault();
                _this.mouseDownTime=Browser.now();
                _$this.runEvent(e);
            }
        });
        canvas.addEventListener("touchend",function(e){
            if (MouseManager.enabled){
                if(e.touches.length >= 1){
                    return;
                }
                if (!MouseManager._isFirstTouch&&!Input.isInputting)e.preventDefault();
                MouseManager._isFirstTouch=false;
                _this.mouseDownTime=-Browser.now();
                _$this.runEvent(e);
                }else {
                _$this._curTouchID=NaN;
            }
        },true);
        canvas.addEventListener("touchmove",function(e){
            if (MouseManager.enabled){
                if(e.touches.length > 1){
                    return;
                }
                e.preventDefault();
                _$this.runEvent(e);
            }
        },true);
        canvas.addEventListener("touchcancel",function(e){
            if (MouseManager.enabled){
                if(e.touches.length >= 1){
                    return;
                }
                e.preventDefault();
                _$this.runEvent(e);
                }else {
                _$this._curTouchID=NaN;
            }
        },true);    
View Code

 

posted on 2019-06-03 08:00  void87  阅读(201)  评论(0编辑  收藏  举报

导航