本文整理汇总了C++中SkeletonAnimation::setTag方法的典型用法代码示例。如果您正苦于以下问题:C++ SkeletonAnimation::setTag方法的具体用法?C++ SkeletonAnimation::setTag怎么用?C++ SkeletonAnimation::setTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkeletonAnimation
的用法示例。
在下文中一共展示了SkeletonAnimation::setTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testChangeAnimation
void SpineTest::testChangeAnimation(Object *sender)
{
log("testChangeAnimation");
// Setting the Animation
SkeletonAnimation *node = SkeletonAnimation::createWithFile("player.json", "player.atlas");
node->setAnimation(0, "walk", true);
node->setPosition(Point(200, 120));
node->setTag(kTagSpinePlayer);
addChild(node);
mAnime = node;
// Setting the buttons
std::vector<Node *> nodeArray;
ControlButton *button;
button = GUIHelper::createButton("Walk", this, cccontrol_selector(SpineTest::changeAnime), Point(0, 0));
button->setTag(kTagButtonWalk);
nodeArray.push_back(button);
button = GUIHelper::createButton("Jump", this, cccontrol_selector(SpineTest::changeAnime), Point(0, 0));
button->setTag(kTagButtonJump);
nodeArray.push_back(button);
button = GUIHelper::createButton("Hurt", this, cccontrol_selector(SpineTest::changeAnime), Point(0, 0));
button->setTag(kTagButtonHurt);
nodeArray.push_back(button);
button = GUIHelper::createButton("Idle", this, cccontrol_selector(SpineTest::changeAnime), Point(0, 0));
button->setTag(kTagButtonIdle);
nodeArray.push_back(button);
GUIHelper::addNodesToParent(this, nodeArray, 0, 50, 480, 10);
// hide the menu
hideMenu();
}