Class cc.MenuItemSprite#ctor
- Defined in: CCMenuItem.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
cc.MenuItemSprite#ctor(normalSprite, selectedSprite, three, four, five)
|
Class Detail
cc.MenuItemSprite#ctor(normalSprite, selectedSprite, three, four, five)
// Example var item = new cc.MenuItemSprite(normalImage)//create a menu item from a sprite with no functionality var item = new cc.MenuItemSprite(normalImage, selectedImage)//create a menu Item, nothing will happen when clicked var item = new cc.MenuItemSprite(normalImage, SelectedImage, disabledImage)//same above, but with disabled state image var item = new cc.MenuItemSprite(normalImage, SelectedImage, 'callback', targetNode)//create a menu item, when clicked runs targetNode.callback() var item = new cc.MenuItemSprite(normalImage, SelectedImage, disabledImage, targetNode.callback, targetNode) //same as above, but with disabled image, and passing in callback function
- Parameters:
- {Image|Null} normalSprite
- normal state image
- {Image|Null} selectedSprite
- selected state image
- {Image|cc.Node|Null} three
- disabled state image OR target node
- {String|function|cc.Node|Null} four
- callback function name in string or actual function, OR target Node
- {String|function|Null} five
- callback function name in string or actual function