本文整理汇总了C++中MenuItemToggle::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ MenuItemToggle::getName方法的具体用法?C++ MenuItemToggle::getName怎么用?C++ MenuItemToggle::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuItemToggle
的用法示例。
在下文中一共展示了MenuItemToggle::getName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toggleButton
//属性,图鉴,技能 开关
void HeroInformationMenuLayer::toggleButton(Ref * sender){
MenuItemToggle * t = (MenuItemToggle *)sender;
if (t->getName() == "character") {
if (t->getSelectedIndex() == 1 && illustratedHhandbookToggle->getSelectedIndex() == 0 && skillToggle->getSelectedIndex() == 0) {
auto characterMove = MoveBy::create(0.5, Vec2(-vSize.width / 4.8, 0));
character->setVisible(true);
character->runAction(characterMove);
auto menuMove = MoveBy::create(0.5, Vec2(vSize.width / 5, 0));
menuBG->runAction(menuMove);
}
if (t->getSelectedIndex() == 1 && (illustratedHhandbookToggle->getSelectedIndex() == 1 || skillToggle->getSelectedIndex() == 1)) {
if (illustratedHhandbookToggle->getSelectedIndex() == 1) {
illustratedHhandbookToggle->setSelectedIndex(0);
auto illustratedHhandebookMove = MoveBy::create(0.5, Vec2(vSize.width / 5, 0));
auto callVisibile = CallFunc::create([=](){
illustratedHhandbook->setVisible(false);
});
auto seqAction = Sequence::create(illustratedHhandebookMove, callVisibile, NULL);
illustratedHhandbook->runAction(seqAction);
auto characterMove = MoveBy::create(0.5, Vec2(-vSize.width / 4.8, 0));
character->setVisible(true);
character->runAction(characterMove);
}
if (skillToggle->getSelectedIndex() == 1) {
skillToggle->setSelectedIndex(0);
auto skillMove = MoveBy::create(0.5, Vec2(vSize.width / 4.8, 0));
auto callVisibile = CallFunc::create([=](){
skill->setVisible(false);
});
auto seqAction = Sequence::create(skillMove, callVisibile, NULL);
skill->runAction(seqAction);
auto characterMove = MoveBy::create(0.5, Vec2(-vSize.width / 4.8, 0));
character->setVisible(true);
character->runAction(characterMove);
}
}
if (t->getSelectedIndex() == 0) {
auto characterMove = MoveBy::create(0.5, Vec2(vSize.width / 4.8, 0));
auto callVisibile = CallFunc::create([=](){
character->setVisible(false);
});
auto seqAction = Sequence::create(characterMove, callVisibile, NULL);
character->runAction(seqAction);
auto menuMove = MoveBy::create(0.5, Vec2(-vSize.width / 5, 0));
menuBG->runAction(menuMove);
}
}
if (t->getName() == "illustratedHhandbook") {
if (t->getSelectedIndex() == 1 && characterToggle->getSelectedIndex() == 0 && skillToggle->getSelectedIndex() == 0) {
auto illustratedMove = MoveBy::create(0.5, Vec2(-vSize.width / 5, 0));
illustratedHhandbook->setVisible(true);
illustratedHhandbook->runAction(illustratedMove);
auto menuMove = MoveBy::create(0.5, Vec2(vSize.width / 5, 0));
menuBG->runAction(menuMove);
}
if (t->getSelectedIndex() == 1 && (characterToggle->getSelectedIndex() == 1 || skillToggle->getSelectedIndex() == 1)) {
if (characterToggle->getSelectedIndex() == 1) {
characterToggle->setSelectedIndex(0);
auto characterMove = MoveBy::create(0.5, Vec2(vSize.width / 4.8, 0));
auto callVisibile = CallFunc::create([=](){
character->setVisible(false);
});
auto seqAction = Sequence::create(characterMove, callVisibile, NULL);
character->runAction(seqAction);
auto illustratedMove = MoveBy::create(0.5, Vec2(-vSize.width / 5, 0));
illustratedHhandbook->setVisible(true);
illustratedHhandbook->runAction(illustratedMove);
}
if (skillToggle->getSelectedIndex() == 1) {
skillToggle->setSelectedIndex(0);
auto skillMove = MoveBy::create(0.5, Vec2(vSize.width / 4.8, 0));
auto callVisibile = CallFunc::create([=](){
skill->setVisible(false);
});
auto seqAction = Sequence::create(skillMove, callVisibile, NULL);
skill->runAction(seqAction);
auto illustratedMove = MoveBy::create(0.5, Vec2(-vSize.width / 5, 0));
illustratedHhandbook->setVisible(true);
illustratedHhandbook->runAction(illustratedMove);
}
}
if (t->getSelectedIndex() == 0) {
auto illustratedMove = MoveBy::create(0.5, Vec2(vSize.width / 5, 0));
auto callVisibile = CallFunc::create([=](){
illustratedHhandbook->setVisible(false);
});
auto seqAction = Sequence::create(illustratedMove, callVisibile, NULL);
illustratedHhandbook->runAction(seqAction);
//.........这里部分代码省略.........