Class cc.MenuItemFont

Class Summary
Constructor Attributes Constructor Name and Description
 
cc.MenuItemFont(value, callback, target)
Helper class that creates a CCMenuItemLabel class with a Label

Method Summary

Class Detail

cc.MenuItemFont(value, callback, target)
Helper class that creates a CCMenuItemLabel class with a Label
var menuItem = new cc.MenuItemFont(value, callback, target);
Parameters:
{String} value
text for the menu item
{function|String} callback
{cc.Node} target

Field Detail

{String} fontName
- Font name of font item
{Number} fontSize
- Font size of font item

Method Detail

  • <static> {cc.MenuItemFont} cc.MenuItemFont.create(value, callback, target)
    create a menu item from string
    Parameters:
    {String} value
    the text to display
    {String|function|Null} callback
    the callback to run, either in function name or pass in the actual function
    {cc.Node|Null} target
    the target to run callback
    Deprecated:
    since v3.0, please use new construction instead
    Returns:
    {cc.MenuItemFont}
  • ctor(value, callback, target)
    Constructor of cc.MenuItemFont
    Parameters:
    {String} value
    text for the menu item
    {function|String} callback
    {cc.Node} target
  • <static> {String} cc.MenuItemFont.fontName()
    a shared function to get the font name for menuitem font
    Returns:
    {String}
  • <static> {Number} cc.MenuItemFont.fontSize()
    a shared function to get the font size for menuitem font
    Returns:
    {Number}
  • {String} getFontName()
    return the font name for cc.MenuItemFont
    Returns:
    {String}
  • {Number} getFontSize()
    return the font size of cc.MenuItemFont
    Returns:
    {Number}
  • {Boolean} initWithString(value, callback, target)
    initializes cc.MenuItemFont with string
    Parameters:
    {String} value
    text for the menu item
    {function|String} callback
    {cc.Node} target
    Returns:
    {Boolean}
  • setFontName(name)
    set the font name for cc.MenuItemFont
    Parameters:
    {String} name
  • <static> cc.MenuItemFont.setFontName(name)
    a shared function to set the fontsize for menuitem font
    Parameters:
    name
  • <static> cc.MenuItemFont.setFontSize(fontSize)
    a shared function to set the fontSize for menuitem font
    Parameters:
    {Number} fontSize
  • setFontSize(s)
    set the font size for cc.MenuItemFont
    Parameters:
    {Number} s