Class cc.MenuItemLabel

Class Summary
Constructor Attributes Constructor Name and Description
 
Any cc.Node that supports the cc.LabelProtocol protocol can be added.

Method Summary

Class Detail

cc.MenuItemLabel()
Any cc.Node that supports the cc.LabelProtocol protocol can be added.
Supported nodes:
- cc.BitmapFontAtlas
- cc.LabelAtlas
- cc.LabelTTF

Method Detail

  • activate()
    activate the menu item
  • <static> {cc.MenuItemLabel} cc.MenuItemLabel.create(label, selector, target)
    Parameters:
    {cc.Node} label
    {function|String|Null} selector
    {cc.Node|Null} target
    Returns:
    {cc.MenuItemLabel}
  • {cc.Color3B} getColor()
    Returns:
    {cc.Color3B}
  • {cc.Color3B} getDisabledColor()
    Returns:
    {cc.Color3B}
  • {cc.Node} getLabel()
    return label of MenuItemLabel
    Returns:
    {cc.Node}
  • {Number} getOpacity()
    Returns:
    {Number}
  • {Boolean} initWithLabel(label, selector, target)
    Parameters:
    {cc.Node} label
    {function|String} selector
    {cc.Node} target
    Returns:
    {Boolean}
  • selected()
    menu item is selected (runs callback)
  • setColor(color)
    Parameters:
    {cc.Color3B} color
  • setDisabledColor(color)
    Parameters:
    {cc.Color3B} color
  • setEnabled(enabled)
    Parameters:
    {Boolean} enabled
  • setLabel(label)
    Parameters:
    {cc.Node} label
  • setOpacity(opacity)
    Parameters:
    {Number} opacity
    from 0-255
  • setString(label)
    Parameters:
    {String} label
  • unselected()
    menu item goes back to unselected state