您的位置:首页 > Web前端 > JavaScript

JavaScript 基础笔记三

2016-07-19 18:55 507 查看
测试文本显示内容是否成功

this._resultLad.setString("Hello world")

_____________________________________________________________________

ccui.widget.TOUCH_BEGAN=0      //按下

ccui.widget.TOUCH_MOVED=1      //移动 

ccui.widget.TOUCH_ENDED=2      //提起

ccui.widget.TOUCH_CANCELED=3   //取消

____________________________________________________________________

查找文本框内容

var a = "btn_8";

var b = a.split("btn_");

a=b[1];

//a=8

value = (vlaue == 10)?"0":value;

var str = this._getLabString();

var( str.id)

_getResultLab:function(){

return this._resultLab.getString();

}

_setResultLab:function(){

this._resultLab.getString();

this._

}

-------------------------------------------------------------------

//保存输入的数据

_tempInput:null,

//清除临时输入的数值

_initTempString:function(){

this._tempInput="";

}

//清除显示

_clearShow:function(){

this._initTempString()

}

//运算类型

_tempType:null,

//第一个数值

_first:null,

//第二个数值

_secend:null

____________________________________________________________________

变量

1:不希望被别人访问的以 _ 开头

2:每一个字母小写 有多层寒意的命名时 以大写区分开来

3:变量不要在开始赋值 需在初始化函数赋值

4:变量的注释

常量

1:所有的字母以大写命名

2:常量不能被改变

3:可以在初始的时候赋值

4:常量的注释

函数

1:不希望被别人访问的 以 _ 开头

2:首字母以动词开头 有多层含义的命名时 以大写飞隔开

3:希别人访问的函数 写在类的下面

4:回调方法以handler结尾  

5:事件方法用on开头

6:函数的注释

//清除渲染数据

onExit:function (){

this.removeAllChildren(true)

}

____________________________________________________________________

cc.class.extend 最底层的类

cc.scene.extend 类

cc.Layer.extend 场景

不加下划线就可以访问到

    getSister: function(){

        return this._s;

    },

});

____________________________________________________________________

var( baseSp = new cc.Sprite [])

var texture =

sp = new Cell(texture, new cc.Rect(i*wid,j*hei,wid,hei),

                    cc.p(textureBasePoint.x + i*wid+10, textureBasePoint.y - j*hei+10),

                    this._checkAllFinish.bind(this));
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: