本文整理汇总了C++中Tween::stop方法的典型用法代码示例。如果您正苦于以下问题:C++ Tween::stop方法的具体用法?C++ Tween::stop怎么用?C++ Tween::stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tween
的用法示例。
在下文中一共展示了Tween::stop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}