本文整理汇总了C++中CAnimation::ResetAnimation方法的典型用法代码示例。如果您正苦于以下问题:C++ CAnimation::ResetAnimation方法的具体用法?C++ CAnimation::ResetAnimation怎么用?C++ CAnimation::ResetAnimation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAnimation
的用法示例。
在下文中一共展示了CAnimation::ResetAnimation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: SetVisible
void CGUIControl::SetVisible(bool bVisible, bool setVisState)
{
if (bVisible && setVisState)
{ // TODO: currently we only update m_visible from GUI_MSG_VISIBLE (SET_CONTROL_VISIBLE)
// otherwise we just set m_forceHidden
GUIVISIBLE visible;
if (m_visibleCondition)
visible = m_visibleCondition->Get() ? VISIBLE : HIDDEN;
else
visible = VISIBLE;
if (visible != m_visible)
{
m_visible = visible;
SetInvalid();
}
}
if (m_forceHidden == bVisible)
{
m_forceHidden = !bVisible;
SetInvalid();
if (m_forceHidden)
MarkDirtyRegion();
}
if (m_forceHidden)
{ // reset any visible animations that are in process
if (IsAnimating(ANIM_TYPE_VISIBLE))
{
// CLog::Log(LOGDEBUG, "Resetting visible animation on control %i (we are %s)", m_controlID, m_visible ? "visible" : "hidden");
CAnimation *visibleAnim = GetAnimation(ANIM_TYPE_VISIBLE);
if (visibleAnim) visibleAnim->ResetAnimation();
}
}
}
示例3: 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);
}
}
示例4: OnMessage
bool CGUIControl::OnMessage(CGUIMessage& message)
{
if ( message.GetControlId() == GetID() )
{
switch (message.GetMessage() )
{
case GUI_MSG_SETFOCUS:
// if control is disabled then move 2 the next control
if ( !CanFocus() )
{
CLog::Log(LOGERROR, "Control %u in window %u has been asked to focus, "
"but it can't",
GetID(), GetParentID());
return false;
}
SetFocus(true);
{
// inform our parent window that this has happened
CGUIMessage message(GUI_MSG_FOCUSED, GetParentID(), GetID());
if (m_parentControl)
m_parentControl->OnMessage(message);
else
SendWindowMessage(message);
}
return true;
break;
case GUI_MSG_LOSTFOCUS:
{
SetFocus(false);
// and tell our parent so it can unfocus
if (m_parentControl)
m_parentControl->OnMessage(message);
return true;
}
break;
case GUI_MSG_VISIBLE:
if (m_visibleCondition)
m_visible = g_infoManager.GetBool(m_visibleCondition, m_dwParentID) ? VISIBLE : HIDDEN;
else
m_visible = VISIBLE;
m_forceHidden = false;
return true;
break;
case GUI_MSG_HIDDEN:
m_forceHidden = true;
// reset any visible animations that are in process
if (IsAnimating(ANIM_TYPE_VISIBLE))
{
// CLog::DebugLog("Resetting visible animation on control %i (we are %s)", m_dwControlID, m_visible ? "visible" : "hidden");
CAnimation *visibleAnim = GetAnimation(ANIM_TYPE_VISIBLE);
if (visibleAnim) visibleAnim->ResetAnimation();
}
return true;
// Note that the skin <enable> tag will override these messages
case GUI_MSG_ENABLED:
SetEnabled(true);
return true;
case GUI_MSG_DISABLED:
SetEnabled(false);
return true;
}
}
return false;
}