wxSetContextAttributes不支持求解?
发布于 5 年前 作者 lichao 13504 次浏览 来自 问答

  [‘touchstart’, ‘touchmove’, ‘touchcancel’, ‘touchend’].forEach((type) => {

      document.addEventListener(type, (e) => {

        const {

          type

        } = e

        const listener = global.EventHandler[‘on’ + type]

        if (typeof listener === ‘function’) {

          const eventObj = {

            changedTouches: e.changedTouches,

            currentTarget: e.currentTarget,

            target: e.target,

            targetTouches: e.targetTouches,

            touches: e.touches,

            type

          }

          listener.call(canvas, eventObj)

        }

      })

    })

    window.NativeGlobal = global

    window.WebGLRenderingContext.prototype.wxSetContextAttributes = function() {

      console.warn(‘开发者工具不支持 wxSetContextAttributes()’)

    }

测试小游戏,调试输出的网页最后显示这个,但是也没发现哪里出来的,有没有办法解决呢?

回到顶部