Class cc.MenuItemFont
Extends
cc.MenuItemLabel.
Defined in: CCMenuItem.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Helper class that creates a CCMenuItemLabel class with a Label
|
- Fields borrowed from class cc.MenuItemLabel:
- RGBAProtocol
Method Attributes | Method Name and Description |
---|---|
<static> |
cc.MenuItemFont.create(value, selector, target)
create a menu item from string
|
fontName()
|
|
<static> |
cc.MenuItemFont.fontName()
a shared function to get the font name for menuitem font
|
fontSize()
|
|
<static> |
cc.MenuItemFont.fontSize()
a shared function to get the font size for menuitem font
|
initWithString(value, selector, target)
|
|
<static> |
cc.MenuItemFont.setFontName(name)
a shared function to set the fontsize for menuitem font
|
setFontName(name)
|
|
<static> |
cc.MenuItemFont.setFontSize(fontSize)
a shared function to set the fontSize for menuitem font
|
setFontSize(s)
|
- Methods borrowed from class cc.MenuItemLabel:
- activate, getColor, getDisabledColor, getLabel, getOpacity, initWithLabel, isOpacityModifyRGB, selected, setColor, setDisabledColor, setEnabled, setLabel, setOpacity, setOpacityModifyRGB, setString, unselected
- Methods borrowed from class cc.MenuItem:
- initWithCallback, isEnabled, isSelected, rect, setCallback, setTarget
- Methods borrowed from class cc.Node:
- addChild, cleanup, convertToNodeSpace, convertToNodeSpaceAR, convertTouchToNodeSpace, convertTouchToNodeSpaceAR, convertToWorldSpace, convertToWorldSpaceAR, ctor, description, draw, getActionByTag, getActionManager, getAnchorPoint, getAnchorPointInPoints, getBoundingBox, getBoundingBoxToWorld, getCamera, getChildByTag, getChildren, getChildrenCount, getContentSize, getGLServerState, getGrid, getOrderOfArrival, getParent, getPosition, getPositionX, getPositionY, getRotation, getScale, getScaleX, getScaleY, getScheduler, getShaderProgram, getSkewX, getSkewY, getTag, getUserData, getUserObject, getVertexZ, getZOrder, ignoreAnchorPointForPosition, init, isIgnoreAnchorPointForPosition, isRunning, isVisible, nodeToParentTransform, nodeToWorldTransform, numberOfRunningActions, onEnter, onEnterTransitionDidFinish, onExit, onExitTransitionDidStart, parentToNodeTransform, pauseSchedulerAndActions, release, removeAllChildren, removeAllChildrenWithCleanup, removeChild, removeChildByTag, removeFromParent, removeFromParentAndCleanup, reorderChild, resumeSchedulerAndActions, retain, runAction, schedule, scheduleOnce, scheduleUpdate, scheduleUpdateWithPriority, setActionManager, setAnchorPoint, setContentSize, setGLServerState, setGrid, setNodeDirty, setOrderOfArrival, setParent, setPosition, setPositionX, setPositionY, setRotation, setScale, setScaleX, setScaleY, setScheduler, setShaderProgram, setSkewX, setSkewY, setTag, setUserData, setUserObject, setVertexZ, setVisible, setZOrder, sortAllChildren, stopAction, stopActionByTag, stopAllActions, transform, transformAncestors, unschedule, unscheduleAllCallbacks, unscheduleUpdate, update, updateTransform, visit, worldToNodeTransform
Method Detail
<static>
{cc.MenuItemFont}
cc.MenuItemFont.create(value, selector, target)
create a menu item from string
// Example var item = cc.MenuItemFont.create("Game start", 'start', Game) //creates a menu item from string "Game start", and when clicked, it will run Game.start() var item = cc.MenuItemFont.create("Game start", game.start, Game)//same as above var item = cc.MenuItemFont.create("i do nothing")//create a text menu item that does nothing //you can set font size and name before or after cc.MenuItemFont.setFontName('my Fancy Font'); cc.MenuItemFont.setFontSize(62);
- Parameters:
- {String} value
- the text to display
- {String|function|Null} selector
- the callback to run, either in function name or pass in the actual function
- {cc.Node|Null} target
- the target to run callback
- Returns:
- {cc.MenuItemFont}
{String}
fontName()
- Returns:
- {String}
<static>
{String}
cc.MenuItemFont.fontName()
a shared function to get the font name for menuitem font
- Returns:
- {String}
{Number}
fontSize()
- Returns:
- {Number}
<static>
{Number}
cc.MenuItemFont.fontSize()
a shared function to get the font size for menuitem font
- Returns:
- {Number}
{Boolean}
initWithString(value, selector, target)
- Parameters:
- {String} value
- text for the menu item
- {function|String} selector
- {cc.Node} target
- Returns:
- {Boolean}
<static>
cc.MenuItemFont.setFontName(name)
a shared function to set the fontsize for menuitem font
- Parameters:
- name
setFontName(name)
- Parameters:
- {String} name
<static>
cc.MenuItemFont.setFontSize(fontSize)
a shared function to set the fontSize for menuitem font
- Parameters:
- {Number} fontSize
setFontSize(s)
- Parameters:
- {Number} s