本文整理汇总了C++中CAnimation::QueueAnimation方法的典型用法代码示例。如果您正苦于以下问题:C++ CAnimation::QueueAnimation方法的具体用法?C++ CAnimation::QueueAnimation怎么用?C++ CAnimation::QueueAnimation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAnimation
的用法示例。
在下文中一共展示了CAnimation::QueueAnimation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QueueAnimation
void CGUIControl::QueueAnimation(ANIMATION_TYPE animType)
{
MarkDirtyRegion();
if (!CheckAnimation(animType))
return;
CAnimation *reverseAnim = GetAnimation((ANIMATION_TYPE)-animType, false);
CAnimation *forwardAnim = GetAnimation(animType);
// we first check whether the reverse animation is in progress (and reverse it)
// then we check for the normal animation, and queue it
if (reverseAnim && reverseAnim->IsReversible() && (reverseAnim->GetState() == ANIM_STATE_IN_PROCESS || reverseAnim->GetState() == ANIM_STATE_DELAYED))
{
reverseAnim->QueueAnimation(ANIM_PROCESS_REVERSE);
if (forwardAnim) forwardAnim->ResetAnimation();
}
else if (forwardAnim)
{
forwardAnim->QueueAnimation(ANIM_PROCESS_NORMAL);
if (reverseAnim) reverseAnim->ResetAnimation();
}
else
{ // hidden and visible animations delay the change of state. If there is no animations
// to perform, then we should just change the state straightaway
if (reverseAnim) reverseAnim->ResetAnimation();
UpdateStates(animType, ANIM_PROCESS_NORMAL, ANIM_STATE_APPLIED);
}
}
示例2: QueueAnimation
void CGUIControl::QueueAnimation(ANIMATION_TYPE animType)
{
// rule out the animations we shouldn't perform
if (!IsVisible() || !HasRendered())
{ // hidden or never rendered - don't allow exit or entry animations for this control
if (animType == ANIM_TYPE_WINDOW_CLOSE)
{ // could be animating a (delayed) window open anim, so reset it
ResetAnimation(ANIM_TYPE_WINDOW_OPEN);
return;
}
}
if (!IsVisible())
{ // hidden - only allow hidden anims if we're animating a visible anim
if (animType == ANIM_TYPE_HIDDEN && !IsAnimating(ANIM_TYPE_VISIBLE))
{
// update states to force it hidden
UpdateStates(animType, ANIM_PROCESS_NORMAL, ANIM_STATE_APPLIED);
return;
}
if (animType == ANIM_TYPE_WINDOW_OPEN)
return;
}
CAnimation *reverseAnim = GetAnimation((ANIMATION_TYPE)-animType, false);
CAnimation *forwardAnim = GetAnimation(animType);
// we first check whether the reverse animation is in progress (and reverse it)
// then we check for the normal animation, and queue it
if (reverseAnim && reverseAnim->IsReversible() && (reverseAnim->GetState() == ANIM_STATE_IN_PROCESS || reverseAnim->GetState() == ANIM_STATE_DELAYED))
{
reverseAnim->QueueAnimation(ANIM_PROCESS_REVERSE);
if (forwardAnim) forwardAnim->ResetAnimation();
}
else if (forwardAnim)
{
forwardAnim->QueueAnimation(ANIM_PROCESS_NORMAL);
if (reverseAnim) reverseAnim->ResetAnimation();
}
else
{ // hidden and visible animations delay the change of state. If there is no animations
// to perform, then we should just change the state straightaway
if (reverseAnim) reverseAnim->ResetAnimation();
UpdateStates(animType, ANIM_PROCESS_NORMAL, ANIM_STATE_APPLIED);
}
}