zoukankan      html  css  js  c++  java
  • 2019年7月

    layabox

    全局点击事件拦截处理

    laya.core.js
    
    MouseManager    12333
    
    
    __proto.initEvent
    
    
            if (e.type) {
                if (e.type == "mousedown") {
                    console.log(e.type);
                    console.log(evt.target);
                    
                    evt.target.width *= 2;
                    evt.target.height *= 2;
    
                    console.log(evt.target.pivotX);
                    console.log(evt.target.pivotY);
    
                    evt.target.pivotX = evt.target.width / 4;
                    evt.target.pivotY = evt.target.height / 4;
    
                } else if (e.type == "mouseup") {
                    evt.target.width *= 0.5;
                    evt.target.height *= 0.5;
    
                    evt.target.pivotX = 0;
                    evt.target.pivotY = 0;
                }
            }
    
    
    TouchManager    10997
    
    
    __proto.onMouseDown
    
                if (ele.name.indexOf("_") != -1) {
                console.log("TM onMouseDown");
                console.log(ele);
        
    
                ele.scaleX = 1.2;
                ele.scaleY = 1.2;
    
                for (var i = 0; i < ele._children.length; i++) {
                    ele.scaleX = 1.2;
                    ele.scaleY = 1.2;
                }
    
                ele.pivotX = ele.width * ele.scaleX / 4;
                ele.pivotY = ele.width * ele.scaleY / 4;
        
                // ele.pivotX = ele.width / 4;
                // ele.pivotY = ele.height / 4;
            }
    
    __proto.onMouseUp
    
            if (ele.name.indexOf("_") != -1) {
                console.log("TM onMouseUp");
                console.log(ele);
        
                ele.scaleX = 1;
                ele.scaleY = 1;
    
                // ele.width *= 0.5;
                // ele.height *= 0.5;
        
                ele.pivotX = 0;
                ele.pivotY = 0;
            }
    
    __proto.checkMouseOutAndOverOfMove
    
    
                arrs=this.getEles(elePre,eleNew,TouchManager._tEleArr);
    
                if (elePre.name.indexOf("_") != -1) {
                    console.log("TM onMouseOut");
                    console.log(elePre);
                    console.log(eleNew);
            
                    elePre.width *= 0.5;
                    elePre.height *= 0.5;
            
                    elePre.pivotX = 0;
                    elePre.pivotY = 0;
                }
    
    
    
    
                this.sendEvents(arrs,/*laya.events.Event.MOUSE_OUT*/"mouseout");
    View Code

    微信小游戏开发版和正式版共存 有可能会导致资源错位

    微信版本

    version "7.0.5"   SDKVersion "2.7.4"

    version "7.0.4"   SDKVersion "2.7.4"

    version "7.0.3"   SDKVersion "2.6.6"

    version "7.0"    SDKVersion "2.5.2"

    version ”6.7.3”   SDKVersion "2.4.4"

    version "6.7.2"   SDKVersion "2.3.2"

    version "6.6.7"         SDKVersion "2.2.4"

    -------------------------------------------------------------------------------------------------------------------------------------------------------------

    微信 6.6.7 以下客户端开发版/体验版因历史兼容问题无法打开分包小游戏,正式发布版不受影响。如果不打算兼容老版本,开发者可以通过 mp 小程序后台配置端屏蔽 2.1.0 以下基础版的用户

    version "6.6.6" SDKVersion "2.0.9"

    https://developers.weixin.qq.com/minigame/dev/guide/runtime/client-lib/version.html

  • 相关阅读:
    原创frame-relay配置
    iptables详解和练习
    nfs-rpcbind-portmap挂载nfs-network file system
    linux-user-group添加与删除
    cgi-fastcgi-fpm
    lamp介绍
    子签CA以及给别人发CA
    正则表达式
    字符集和字符编码
    C++11新特性
  • 原文地址:https://www.cnblogs.com/revoid/p/11112151.html
Copyright © 2011-2022 走看看