Class cc.MenuItemToggle#ctor

Class Summary
Constructor Attributes Constructor Name and Description
 

Class Detail

cc.MenuItemToggle#ctor()
// Example
//create a toggle item with 2 menu items (which you can then toggle between them later)
var toggler = new cc.MenuItemToggle( cc.MenuItemFont.create("On"), cc.MenuItemFont.create("Off"), this.callback, this)
//Note: the first param is the target, the second is the callback function, afterwards, you can pass in any number of menuitems

//if you pass only 1 variable, then it must be a cc.MenuItem
var notYetToggler = new cc.MenuItemToggle(cc.MenuItemFont.create("On"));//it is useless right now, until you add more stuff to it
notYetToggler.addSubItem(cc.MenuItemFont.create("Off"));
//this is useful for constructing a toggler without a callback function (you wish to control the behavior from somewhere else)