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) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user