Class ccs.Button

Class Summary
Constructor Attributes Constructor Name and Description
 
Base class for ccs.Button

Method Summary

Class Detail

ccs.Button()
Base class for ccs.Button

Method Detail

  • <static> {ccs.Button} ccs.Button.create()
    allocates and initializes a UIButton.
    // example
    var uiButton = ccs.Button.create();
    Returns:
    {ccs.Button}
  • {cc.Size} getContentSize()
    override "getContentSize" method of widget.
    Returns:
    {cc.Size}
  • {string} getDescription()
    Returns the "class name" of widget.
    Returns:
    {string}
  • {cc.c3b} getTitleColor()
    get title color
    Returns:
    {cc.c3b}
  • {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} isFlippedX()
    override "isFlippedX" of widget.
    Returns:
    {Boolean}
  • {Boolean} isFlippedY()
    override "isFlippedY" of widget.
    Returns:
    {Boolean}
  • loadTextureDisabled(disabled, texType)
    Load dark state texture for button.
    Parameters:
    {String} disabled
    {ccs.TextureResType} texType
  • loadTextureNormal(normal, texType)
    Load normal state texture for button.
    Parameters:
    {String} normal
    {ccs.TextureResType} texType
  • loadTexturePressed(selected, texType)
    Load selected state texture for button.
    Parameters:
    {String} selected
    {ccs.TextureResType} texType
  • loadTextures(normal, selected, disabled, texType)
    Load textures for button.
    Parameters:
    {String} normal
    {String} selected
    {String} disabled
    {ccs.TextureResType} 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
  • setColor(color)
    Sets color to widget It default change the color of widget's children.
    Parameters:
    color
  • setFlippedX(flipX)
    override "setFlippedX" of widget.
    Parameters:
    {Boolean} flipX
  • setFlippedY(flipY)
    override "setFlippedY" of widget.
    Parameters:
    {Boolean} flipY
  • 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.c3b} 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