ctor:function () {
        this._super();
if ('mouse' in cc.sys.capabilities)
            cc.eventManager.addListener({
                event: cc.EventListener.MOUSE,
                onMouseDown: function(event){
                    event.getCurrentTarget().processEvent(event);
                }
            }, this);

        if (cc.sys.capabilities.hasOwnProperty('touches')){
            cc.eventManager.addListener({
                event: cc.EventListener.TOUCH_ALL_AT_ONCE,
                onTouchBegan:function (touches, event) {
                    event.getCurrentTarget().processEvent(touches[0]);
                }
            }, this);
        }

        return true;
    },
    processEvent:function (event) {
        cc.director.runScene(new MainScene());
    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2022-02-11
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案