Sprite -> AutoActor
This commit is contained in:
@@ -24,10 +24,10 @@ CombinedLifeMeterTug::CombinedLifeMeterTug()
|
||||
m_Stream[PLAYER_2].SetZoomX( -1 );
|
||||
|
||||
m_sprSeparator.Load( THEME->GetPathG("CombinedLifeMeterTug","separator") );
|
||||
this->AddChild( &m_sprSeparator );
|
||||
this->AddChild( m_sprSeparator );
|
||||
|
||||
m_sprFrame.Load( THEME->GetPathG("CombinedLifeMeterTug","frame") );
|
||||
this->AddChild( &m_sprFrame );
|
||||
this->AddChild( m_sprFrame );
|
||||
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
@@ -52,7 +52,7 @@ void CombinedLifeMeterTug::Update( float fDelta )
|
||||
|
||||
float fSeparatorX = SCALE( fPercentToShow, 0.f, 1.f, -METER_WIDTH/2.f, +METER_WIDTH/2.f );
|
||||
|
||||
m_sprSeparator.SetX( fSeparatorX );
|
||||
m_sprSeparator->SetX( fSeparatorX );
|
||||
|
||||
ActorFrame::Update( fDelta );
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ protected:
|
||||
void ChangeLife( PlayerNumber pn, float fPercentToMove );
|
||||
|
||||
MeterDisplay m_Stream[NUM_PLAYERS];
|
||||
Sprite m_sprSeparator;
|
||||
Sprite m_sprFrame;
|
||||
AutoActor m_sprSeparator;
|
||||
AutoActor m_sprFrame;
|
||||
|
||||
CharacterHead m_Head[NUM_PLAYERS];
|
||||
};
|
||||
|
||||
@@ -19,8 +19,8 @@ void MeterDisplay::Load( CString sStreamPath, float fStreamWidth, CString sTipPa
|
||||
m_fStreamWidth = fStreamWidth;
|
||||
|
||||
m_sprStream.Load( sStreamPath );
|
||||
m_sprStream.SetZoomX( fStreamWidth / m_sprStream.GetUnzoomedWidth() );
|
||||
this->AddChild( &m_sprStream );
|
||||
m_sprStream->SetZoomX( fStreamWidth / m_sprStream->GetUnzoomedWidth() );
|
||||
this->AddChild( m_sprStream );
|
||||
|
||||
m_sprTip.Load( sTipPath );
|
||||
this->AddChild( m_sprTip );
|
||||
@@ -44,8 +44,8 @@ void MeterDisplay::LoadFromNode( const CString& sDir, const XNode* pNode )
|
||||
ActorUtil::ResolvePath( sStreamPath, sDir );
|
||||
|
||||
m_sprStream.Load( sStreamPath );
|
||||
m_sprStream.SetZoomX( m_fStreamWidth / m_sprStream.GetUnzoomedWidth() );
|
||||
this->AddChild( &m_sprStream );
|
||||
m_sprStream->SetZoomX( m_fStreamWidth / m_sprStream->GetUnzoomedWidth() );
|
||||
this->AddChild( m_sprStream );
|
||||
}
|
||||
|
||||
const XNode* pChild = pNode->GetChild( "Tip" );
|
||||
@@ -64,7 +64,7 @@ void MeterDisplay::SetPercent( float fPercent )
|
||||
{
|
||||
ASSERT( fPercent >= 0 && fPercent <= 1 );
|
||||
|
||||
m_sprStream.SetCropRight( 1-fPercent );
|
||||
m_sprStream->SetCropRight( 1-fPercent );
|
||||
|
||||
m_sprTip->SetX( SCALE(fPercent, 0.f, 1.f, -m_fStreamWidth/2, m_fStreamWidth/2) );
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
private:
|
||||
float m_fStreamWidth;
|
||||
float m_fPercent;
|
||||
Sprite m_sprStream;
|
||||
AutoActor m_sprStream;
|
||||
AutoActor m_sprTip;
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ ScoreDisplayRave::ScoreDisplayRave()
|
||||
|
||||
m_textLevel.LoadFromFont( THEME->GetPathF("ScoreDisplayRave","level") );
|
||||
m_textLevel.SetText( "1" );
|
||||
m_textLevel.SetShadowLength( 0 );
|
||||
this->AddChild( &m_textLevel );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user