本文整理汇总了C++中Armature::init方法的典型用法代码示例。如果您正苦于以下问题:C++ Armature::init方法的具体用法?C++ Armature::init怎么用?C++ Armature::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Armature
的用法示例。
在下文中一共展示了Armature::init方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Armature
Armature *Armature::create(const char *name, Bone *parentBone)
{
Armature *armature = new Armature();
if (armature && armature->init(name, parentBone))
{
armature->autorelease();
return armature;
}
CC_SAFE_DELETE(armature);
return NULL;
}
示例2: Armature
Armature *Armature::create(const std::string& name, Bone *parentBone)
{
Armature *armature = new Armature();
if (armature && armature->init(name, parentBone))
{
armature->autorelease();
return armature;
}
CC_SAFE_DELETE(armature);
return nullptr;
}
示例3: new
Armature *Armature::create(const std::string& name)
{
Armature *armature = new (std::nothrow) Armature();
if (armature && armature->init(name))
{
armature->autorelease();
return armature;
}
CC_SAFE_DELETE(armature);
return nullptr;
}
示例4: addArmature
void TestPerformance::addArmature(int number)
{
for (int i = 0; i<number; i++)
{
armatureCount++;
Armature *armature = nullptr;
armature = new (std::nothrow) Armature();
armature->init("Cowboy");
armature->getAnimation()->playWithIndex(0);
armature->setPosition(50 + armatureCount * 2, 150);
armature->setScale(0.1f);
addArmatureToParent(armature);
armature->release();
}
refreshTitle();
}
示例5: update
void TestPerformance::update(float delta)
{
frames ++;
times += delta;
if (frames / times > 58)
{
Armature *armature = NULL;
armature = new Armature();
armature->init("Knight_f/Knight");
armature->getAnimation()->playByIndex(0);
armature->setPosition(50 + armatureCount * 2, 150);
armature->setScale(0.6f);
addArmature(armature);
armature->release();
char pszCount[255];
sprintf(pszCount, "%s %i", subtitle().c_str(), armatureCount);
LabelTTF *label = (LabelTTF *)getChildByTag(10001);
label->setString(pszCount);
}
}