本文整理汇总了C++中Bone::getChildArmature方法的典型用法代码示例。如果您正苦于以下问题:C++ Bone::getChildArmature方法的具体用法?C++ Bone::getChildArmature怎么用?C++ Bone::getChildArmature使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bone
的用法示例。
在下文中一共展示了Bone::getChildArmature方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setAnimationScale
void ArmatureAnimation::setAnimationScale(float animationScale )
{
if(animationScale == _animationScale)
{
return;
}
_animationScale = animationScale;
DictElement *element = NULL;
Dictionary *dict = _armature->getBoneDic();
CCDICT_FOREACH(dict, element)
{
Bone *bone = (Bone *)element->getObject();
bone->getTween()->setAnimationScale(_animationScale);
if (bone->getChildArmature())
{
bone->getChildArmature()->getAnimation()->setAnimationScale(_animationScale);
}
}
示例2: setSpeedScale
void ArmatureAnimation::setSpeedScale(float speedScale)
{
if(speedScale == _speedScale)
{
return;
}
_speedScale = speedScale;
_processScale = !_movementData ? _speedScale : _speedScale * _movementData->scale;
const Map<std::string, Bone*>& map = _armature->getBoneDic();
for(auto& element : map)
{
Bone *bone = element.second;
bone->getTween()->setProcessScale(_processScale);
if (bone->getChildArmature())
{
bone->getChildArmature()->getAnimation()->setSpeedScale(_processScale);
}
}
}
示例3: setSpeedScale
void ArmatureAnimation::setSpeedScale(float speedScale)
{
if(speedScale == _speedScale)
{
return;
}
_speedScale = speedScale;
_processScale = !_movementData ? _speedScale : _speedScale * _movementData->scale;
DictElement *element = NULL;
Dictionary *dict = _armature->getBoneDic();
CCDICT_FOREACH(dict, element)
{
Bone *bone = static_cast<Bone*>(element->getObject());
bone->getTween()->setProcessScale(_processScale);
if (bone->getChildArmature())
{
bone->getChildArmature()->getAnimation()->setProcessScale(_processScale);
}
}
示例4: play
void ArmatureAnimation::play(const std::string& animationName, int durationTo, int loop)
{
if (animationName.empty())
{
CCLOG("_animationData can not be null");
return;
}
// CCASSERT(_animationData, "_animationData can not be null");
_movementData = _animationData->getMovement(animationName);
if (nullptr == _movementData)
{
CCLOG("_movementData can not be null");
return;
}
// CCASSERT(_movementData, "_movementData can not be null");
//! Get key frame count
_rawDuration = _movementData->duration;
_movementID = animationName;
_processScale = _speedScale * _movementData->scale;
//! Further processing parameters
durationTo = (durationTo == -1) ? _movementData->durationTo : durationTo;
int durationTween = _movementData->durationTween == 0 ? _rawDuration : _movementData->durationTween;
cocos2d::tweenfunc::TweenType tweenEasing = _movementData->tweenEasing;
loop = (loop < 0) ? _movementData->loop : loop;
_onMovementList = false;
ProcessBase::play(durationTo, durationTween, loop, tweenEasing);
if (_rawDuration == 0)
{
_loopType = SINGLE_FRAME;
}
else
{
if (loop)
{
_loopType = ANIMATION_TO_LOOP_FRONT;
}
else
{
_loopType = ANIMATION_NO_LOOP;
}
_durationTween = durationTween;
}
MovementBoneData *movementBoneData = nullptr;
_tweenList.clear();
const Map<std::string, Bone*>& map = _armature->getBoneDic();
for(auto& element : map)
{
Bone *bone = element.second;
movementBoneData = static_cast<MovementBoneData *>(_movementData->movBoneDataDic.at(bone->getName()));
Tween *tween = bone->getTween();
if(movementBoneData && movementBoneData->frameList.size() > 0)
{
_tweenList.push_back(tween);
movementBoneData->duration = _movementData->duration;
tween->play(movementBoneData, durationTo, durationTween, loop, tweenEasing);
tween->setProcessScale(_processScale);
if (bone->getChildArmature())
{
bone->getChildArmature()->getAnimation()->setSpeedScale(_processScale);
}
}
else
{
if(!bone->isIgnoreMovementBoneData())
{
//! this bone is not include in this movement, so hide it
bone->getDisplayManager()->changeDisplayWithIndex(-1, false);
tween->stop();
}
}
}
_armature->update(0);
}