cursor: tween width at the same time as tweening the position for smoother motion
This commit is contained in:
@@ -44,6 +44,24 @@ void OptionsCursor::Set( PlayerNumber pn )
|
||||
m_sprRight.SetState( iBaseFrameNo+2 );
|
||||
}
|
||||
|
||||
void OptionsCursor::StopTweening()
|
||||
{
|
||||
ActorFrame::StopTweening();
|
||||
|
||||
m_sprLeft.StopTweening();
|
||||
m_sprMiddle.StopTweening();
|
||||
m_sprRight.StopTweening();
|
||||
}
|
||||
|
||||
void OptionsCursor::BeginTweening( float fSecs )
|
||||
{
|
||||
ActorFrame::BeginTweening( fSecs );
|
||||
|
||||
m_sprLeft.BeginTweening( fSecs );
|
||||
m_sprMiddle.BeginTweening( fSecs );
|
||||
m_sprRight.BeginTweening( fSecs );
|
||||
}
|
||||
|
||||
void OptionsCursor::SetBarWidth( int iWidth )
|
||||
{
|
||||
if( iWidth%2 == 1 )
|
||||
@@ -56,19 +74,6 @@ void OptionsCursor::SetBarWidth( int iWidth )
|
||||
m_sprRight.SetX( +iWidth/2 + fFrameWidth/2 );
|
||||
}
|
||||
|
||||
void OptionsCursor::TweenBarWidth( int iNewWidth )
|
||||
{
|
||||
m_sprLeft.StopTweening();
|
||||
m_sprMiddle.StopTweening();
|
||||
m_sprRight.StopTweening();
|
||||
|
||||
m_sprLeft.BeginTweening( 0.2f );
|
||||
m_sprMiddle.BeginTweening( 0.2f );
|
||||
m_sprRight.BeginTweening( 0.2f );
|
||||
|
||||
SetBarWidth( iNewWidth );
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) 2001-2003 Chris Danford
|
||||
* All rights reserved.
|
||||
|
||||
Reference in New Issue
Block a user