MCPcopy Create free account
hub / github.com/axmolengine/axmol / initWithItem

Method initWithItem

core/2d/MenuItem.cpp:787–802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

785}
786
787bool MenuItemToggle::initWithItem(MenuItem* item)
788{
789 MenuItem::initWithCallback((const ccMenuCallback&)nullptr);
790
791 if (item)
792 {
793 addSubItem(item);
794 }
795 _selectedIndex = UINT_MAX;
796 this->setSelectedIndex(0);
797
798 setCascadeColorEnabled(true);
799 setCascadeOpacityEnabled(true);
800
801 return true;
802}
803
804void MenuItemToggle::addSubItem(MenuItem* item)
805{

Callers 1

createMethod · 0.80

Calls 1

setSelectedIndexMethod · 0.95

Tested by

no test coverage detected