add tip to MeterDisplay
This commit is contained in:
@@ -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) );
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user