add tip to MeterDisplay

This commit is contained in:
Chris Danford
2004-01-18 20:43:36 +00:00
parent 9c34c2ae9b
commit c8d3e46ea4
3 changed files with 9 additions and 3 deletions
+6 -1
View File
@@ -15,15 +15,18 @@
MeterDisplay::MeterDisplay()
{
this->AddChild( &m_sprStream );
this->AddChild( &m_sprTip );
}
void MeterDisplay::Load( CString sStreamPath, float fStreamWidth )
void MeterDisplay::Load( CString sStreamPath, float fStreamWidth, CString sTipPath )
{
m_fStreamWidth = fStreamWidth;
m_sprStream.Load( sStreamPath );
m_sprStream.SetZoomX( fStreamWidth / m_sprStream.GetUnzoomedWidth() );
m_sprTip.Load( sTipPath );
SetPercent( 0.5f );
}
@@ -32,4 +35,6 @@ void MeterDisplay::SetPercent( float fPercent )
ASSERT( fPercent >= 0 && fPercent <= 1 );
m_sprStream.SetCropRight( 1-fPercent );
m_sprTip.SetX( SCALE(fPercent, 0.f, 1.f, -m_fStreamWidth/2, m_fStreamWidth/2) );
}
+2 -1
View File
@@ -20,7 +20,7 @@ class MeterDisplay : public ActorFrame
{
public:
MeterDisplay();
void Load( CString sStreamPath, float fStreamWidth );
void Load( CString sStreamPath, float fStreamWidth, CString sTipPath = "" );
void SetPercent( float fPercent );
@@ -28,6 +28,7 @@ private:
float m_fStreamWidth;
float m_fPercent;
Sprite m_sprStream;
Sprite m_sprTip;
};
#endif
+1 -1
View File
@@ -422,7 +422,7 @@ ScreenGameplay::ScreenGameplay( CString sName, bool bDemonstration ) : Screen("S
this->AddChild( &m_textSongTitle );
m_meterSongPosition.Load( THEME->GetPathToG("ScreenGameplay song position meter"), SONG_POSITION_METER_WIDTH );
m_meterSongPosition.Load( THEME->GetPathToG("ScreenGameplay song position meter"), SONG_POSITION_METER_WIDTH, THEME->GetPathToG("ScreenGameplay song position tip") );
m_meterSongPosition.SetName( "SongPositionMeter" );
SET_XY( m_meterSongPosition );
this->AddChild( &m_meterSongPosition );