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) );
}