Class ccui.CheckBox
- Defined in: UICheckBox.js
- Extends ccui.Widget
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Base class for ccui.CheckBox
|
Method Summary
Class Detail
ccui.CheckBox()
Base class for ccui.CheckBox
Field Detail
{Boolean}
selected
- Indicate whether the check box has been selected
Method Detail
-
addEventListener(callback)add a call back function would called when checkbox is selected or unselected.
- Parameters:
- {function} callback
-
addEventListenerCheckBox(selector, target)add event listener
- Parameters:
- {Function} selector
- {Object} target
-
<static> {ccui.CheckBox} ccui.CheckBox.create(backGround, backGroundSeleted, cross, backGroundDisabled, frontCrossDisabled, texType)allocates and initializes a UICheckBox.
// example var uiCheckBox = ccui.CheckBox.create();
- Parameters:
- {string} backGround Optional
- backGround texture.
- {string} backGroundSeleted Optional
- backGround selected state texture.
- {string} cross Optional
- cross texture.
- {string} backGroundDisabled Optional
- cross dark state texture.
- {string} frontCrossDisabled Optional
- cross dark state texture.
- {Number} texType Optional
- Returns:
- {ccui.CheckBox}
-
{string} getDescription()Returns the "class name" of widget.
- Returns:
- {string}
-
{cc.Node} getVirtualRenderer()override "getVirtualRenderer" method of widget.
- Returns:
- {cc.Node}
-
loadTextureBackGround(backGround, texType)Load backGround texture for checkbox.
- Parameters:
- {String} backGround
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
loadTextureBackGroundDisabled(backGroundDisabled, texType)Load backGroundDisabled texture for checkbox.
- Parameters:
- {String} backGroundDisabled
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
loadTextureBackGroundSelected(backGroundSelected, texType)Load backGroundSelected texture for checkbox.
- Parameters:
- {String} backGroundSelected
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
loadTextureFrontCross(cross, texType)Load cross texture for checkbox.
- Parameters:
- {String} cross
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
loadTextureFrontCrossDisabled(frontCrossDisabled, texType)Load frontCrossDisabled texture for checkbox.
- Parameters:
- {String} frontCrossDisabled
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
loadTextures(backGround, backGroundSelected, cross, backGroundDisabled, frontCrossDisabled, texType)Load textures for checkbox.
- Parameters:
- {String} backGround
- {String} backGroundSelected
- {String} cross
- {String} backGroundDisabled
- {String} frontCrossDisabled
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType