Class ccui.Button
- Defined in: UIButton.js
- Extends ccui.Widget
Constructor Attributes | Constructor Name and Description |
---|---|
Base class for ccui.Button
|
Method Summary
Class Detail
ccui.Button()
Base class for ccui.Button
Field Detail
{Boolean}
pressedActionEnabled
- Indicate whether button has zoom effect when clicked
{String}
titleFont
- The content string font of the button title
{cc.Color}
titleFontColor
- The content string font color of the button title
{String}
titleFontName
- The content string font name of the button title
{Number}
titleFontSize
- The content string font size of the button title
{String}
titleText
- The content string of the button title
Method Detail
-
allocates and initializes a UIButton.
// example var uiButton = ccui.Button.create();
- Returns:
- {ccui.Button}
-
{cc.Rect} getCapInsetDisabledRenderer()Get disable renderer cap insets .
- Returns:
- {cc.Rect}
-
{cc.Rect} getCapInsetNormalRenderer()Get normal renderer cap insets .
- Returns:
- {cc.Rect}
-
{cc.Rect} getCapInsetPressedRenderer()Get pressed renderer cap insets .
- Returns:
- {cc.Rect}
-
{cc.Size} getContentSize()override "getContentSize" method of widget.
- Returns:
- {cc.Size}
-
{string} getDescription()Returns the "class name" of widget.
- Returns:
- {string}
-
{cc.Color} getTitleColor()get title color
- Returns:
- {cc.Color}
-
{String} getTitleFontName()get title fontName
- Returns:
- {String}
-
{cc.Size} getTitleFontSize()get title fontSize
- Returns:
- {cc.Size}
-
{String} getTitleText()get title text
- Returns:
- {String} text
-
{cc.Node} getVirtualRenderer()Gets the Virtual Renderer of widget.
- Returns:
- {cc.Node}
-
ignoreContentAdaptWithSize(ignore)ignoreContentAdaptWithSize
- Parameters:
- {Boolean} ignore
-
{Boolean} isScale9Enabled()Get button is using scale9 renderer or not.
- Returns:
- {Boolean}
-
loadTextureDisabled(disabled, texType)Load dark state texture for button.
- Parameters:
- {String} disabled
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
loadTextureNormal(normal, texType)Load normal state texture for button.
- Parameters:
- {String} normal
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
loadTexturePressed(selected, texType)Load selected state texture for button.
- Parameters:
- {String} selected
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
loadTextures(normal, selected, disabled, texType)Load textures for button.
- Parameters:
- {String} normal
- {String} selected
- {String} disabled
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
setAnchorPoint(point, y)override "setAnchorPoint" of widget.
- Parameters:
- {cc.Point|Number} point
- The anchor point of UIButton or The anchor point.x of UIButton.
- {Number} y Optional
- The anchor point.y of UIButton.
-
setCapInsets(capInsets)Sets capinsets for button, if button is using scale9 renderer.
- Parameters:
- {cc.Rect} capInsets
-
setCapInsetsDisabledRenderer(capInsets)Sets capinsets for button, if button is using scale9 renderer.
- Parameters:
- {cc.Rect} capInsets
-
setCapInsetsNormalRenderer(capInsets)Sets capinsets for button, if button is using scale9 renderer.
- Parameters:
- {cc.Rect} capInsets
-
setCapInsetsPressedRenderer(capInsets)Sets capinsets for button, if button is using scale9 renderer.
- Parameters:
- {cc.Rect} capInsets
-
setPressedActionEnabled(enabled)Changes if button can be clicked zoom effect.
- Parameters:
- {Boolean} enabled
-
setScale9Enabled(able)Sets if button is using scale9 renderer.
- Parameters:
- {Boolean} able
-
setTitleColor(color)set title color
- Parameters:
- {cc.Color} color
-
setTitleFontName(fontName)set title fontName
- Parameters:
- {String} fontName
-
setTitleFontSize(size)set title fontSize
- Parameters:
- {cc.Size} size
-
setTitleText(text)set title text
- Parameters:
- {String} text