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());
    }

 

posted on 2014-05-06 09:29  凌度  阅读(2757)  评论(0编辑  收藏  举报