Class Index | File Index

Classes


Class cc.MenuItem


Extends cc.Node.

Defined in: CCMenuItem.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Subclass cc.MenuItem (or any subclass) to create your custom cc.MenuItem objects.
Method Summary
Method Attributes Method Name and Description
 
call the selector with target
<static>  
cc.MenuItem.create(selector, rec)
creates an empty menu item with target and callback
Not recommended to use the base class, should use more defined menu item classes
 
initWithCallback(selector, rec)
 
MenuItem is Enabled
 
MenuItem is selected
 
rect()
return rect value of cc.MenuItem
 
same as setIsSelected(true)
 
setCallback(selector, rec)
 
setEnabled(enable)
set enable value of MenuItem
 
setTarget(selector, rec)
set the target/selector of the menu item
 
same as setIsSelected(false)
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
Class Detail
cc.MenuItem()
Subclass cc.MenuItem (or any subclass) to create your custom cc.MenuItem objects.
Method Detail
activate()
call the selector with target

<static> {cc.MenuItem} cc.MenuItem.create(selector, rec)
creates an empty menu item with target and callback
Not recommended to use the base class, should use more defined menu item classes
Parameters:
{function|String} selector
callback
{cc.Node} rec
target
Returns:
{cc.MenuItem}

{Boolean} initWithCallback(selector, rec)
Parameters:
{function|String} selector
{cc.Node} rec
Returns:
{Boolean}

{Boolean} isEnabled()
MenuItem is Enabled
Returns:
{Boolean}

{Boolean} isSelected()
MenuItem is selected
Returns:
{Boolean}

{cc.Rect} rect()
return rect value of cc.MenuItem
Returns:
{cc.Rect}

selected()
same as setIsSelected(true)

setCallback(selector, rec)
Parameters:
{function|String} selector
{cc.Node} rec

setEnabled(enable)
set enable value of MenuItem
Parameters:
{Boolean} enable

setTarget(selector, rec)
set the target/selector of the menu item
Parameters:
{function|String} selector
{cc.Node} rec

unselected()
same as setIsSelected(false)

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Jan 09 2013 07:51:52 GMT-0800 (PST)