
cc.Class({
    extends: cc.Component,

    properties: {
        touchNode: {
            default: null, 
            type: cc.Node,
        },
        typingNode: {
            default: null,
            type: cc.Node,
        },
        // bar: {
        //     get () {
        //         return this._bar;
        //     },
        //     set (value) {
        //         this._bar = value;
        //     }
        // },
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {
        let self = this;
        self.touchEvent();
    },

    onClickStart(){
      
    },

    _onTouchBegan(){

    },
    _onTouchMove(){

    },
    _onTouchEnded(){
        let self = this;
    },
    _onTouchCancel(){

    },
    touchEvent () {
        let self = this;
        self.touchNode.on(cc.Node.EventType.TOUCH_START, this._onTouchBegan, this);
        self.touchNode.on(cc.Node.EventType.TOUCH_MOVE, this._onTouchMove, this);
        self.touchNode.on(cc.Node.EventType.TOUCH_END, this._onTouchEnded, this);
        self.touchNode.on(cc.Node.EventType.TOUCH_CANCEL, this._onTouchCancel, this);
    },

    untouchEvent () {
        let self = this;
        self.touchNode.off(cc.Node.EventType.TOUCH_START, this._onTouchBegan, this);
        self.touchNode.off(cc.Node.EventType.TOUCH_MOVE, this._onTouchMove, this);
        self.touchNode.off(cc.Node.EventType.TOUCH_END, this._onTouchEnded, this);
        self.touchNode.off(cc.Node.EventType.TOUCH_CANCEL, this._onTouchCancel, this);
    },
    // update (dt) {},
});
