TVScrollParameter.js 2.33 KB
cc.Class({
    extends: cc.Component,

    properties: {
        // foo: {
        //    default: null,      // The default value will be used only when the component attaching
        //                           to a node for the first time
        //    url: cc.Texture2D,  // optional, default is typeof default
        //    serializable: true, // optional, default is true
        //    visible: true,      // optional, default is true
        //    displayName: 'Foo', // optional
        //    readonly: false,    // optional, default is false
        // },
        // ...


        _fStep:1,
        _bHasRelation:true,
        _oNode:null, //deprecated
        _iDirection:0,
        _fTargetPosition:0,
    },

    //ctor: function (fStep,bHasRelation,iDirection) {
    ctor: function () {
        this._fStep=arguments[0];
        this._bHasRelation=arguments[1];
        //this._oNode=arguments[2];
        this._iDirection=arguments[2];

        //this._fStep=fStep;
        //this._bHasRelation=bHasRelation;
        //this._oNode=oNode;
        //this._iDirection=iDirection;

    },
    init: function (fStep,bHasRelation,iDirection) {
        this._fStep=fStep;
        this._bHasRelation=bHasRelation;
        //this._oNode=oNode;
        this._iDirection=iDirection;

    },

    getStep:function(){
        return this._fStep;
    },
    setStep:function(fStep){
        this._fStep=fStep;
    },

    getHasRelation:function(){
        return this._bHasRelation;
    },
    setHasRelation:function(bHasRelation){
        this._bHasRelation=bHasRelation;
    },
    /*
    getNode:function(){
        return this._oNode;
    },

    setNode:function(oNode){
        this._oNode=oNode;
    },*/
    getDirection:function(){
        return this._iDirection;
    },
    setDirection:function(iDirection){
        this._iDirection=iDirection;
    },
    getTargetNode:function(){
        return this._oTargetNode;
    },
    setTargetNode:function(oTargetNode){
        this._oTargetNode=oTargetNode;
    },


    //明确目标位置 比设置Step更为有效
    getTargetPosition:function(){
        return this._fTargetPosition;
    },
    setTargetPosition:function(fTargetPosition){
        this._fTargetPosition=fTargetPosition;
    }

    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {

    // },

});