本文整理汇总了C++中ControlButton::getTag方法的典型用法代码示例。如果您正苦于以下问题:C++ ControlButton::getTag方法的具体用法?C++ ControlButton::getTag怎么用?C++ ControlButton::getTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ControlButton
的用法示例。
在下文中一共展示了ControlButton::getTag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: choicesCallback
void ChoiceLayer::choicesCallback(Ref* sender, Control::EventType event)
{
ControlButton *pressedBtn = (ControlButton*)sender;
_selectedTag = pressedBtn->getTag();
CCLOG("Select tag : %d", _selectedTag);
for (auto child : getChildren())
child->setOpacity(0);
}
示例2: changeAnime
void SpineTest::changeAnime(Object *sender, Control::EventType type)
{
if(mAnime == NULL) {
log("mAnime is NULL");
return;
}
//
ControlButton *button = dynamic_cast<ControlButton *>(sender);
if(button == NULL) {
return;
}
//
int tag = button->getTag();
switch(tag) {
case kTagButtonWalk:
{
log("walk");
mAnime->setAnimation(0, "walk", true);
break;
}
case kTagButtonJump:
{
log("jump");
mAnime->setAnimation(0, "jump", true);
break;
}
case kTagButtonHurt:
{
log("hurt");
mAnime->setAnimation(0, "hurt", true);
break;
}
case kTagButtonIdle:
{
log("idle");
mAnime->setAnimation(0, "idle", true);
break;
}
}
}
示例3: touchUpInsideAction
void TDDSubMenu::touchUpInsideAction(Ref *sender, Control::EventType controlEvent)
{
ControlButton *button = (ControlButton *)sender;
log("Button is clicked");
int tag = button->getTag();
switch(tag) {
case kActionTagToggle:
{
toggleMenu();
break;
}
case kActionTagBack:
{
closeTest();
break;
}
}
}