center text in ComboGraph

This commit is contained in:
Chris Danford
2005-04-05 10:48:08 +00:00
parent 62a2834202
commit f98638e27e
2 changed files with 8 additions and 1 deletions
+3
View File
@@ -4437,3 +4437,6 @@ Answer3Of3Text=CANCEL
[GameState] [GameState]
UseNameBlacklist=0 UseNameBlacklist=0
[ComboGraph]
NumbersY=0
+4
View File
@@ -6,9 +6,12 @@
#include "ActorUtil.h" #include "ActorUtil.h"
#include "BitmapText.h" #include "BitmapText.h"
#include "Sprite.h" #include "Sprite.h"
#include "ThemeMetric.h"
const int MinComboSizeToShow = 5; const int MinComboSizeToShow = 5;
static ThemeMetric<float> NUMBERS_Y("ComboGraph","NumbersY");
void ComboGraph::Load( const CString& sScreen, const CString& sElement, const StageStats &s, PlayerNumber pn ) void ComboGraph::Load( const CString& sScreen, const CString& sElement, const StageStats &s, PlayerNumber pn )
{ {
ASSERT( m_SubActors.size() == 0 ); ASSERT( m_SubActors.size() == 0 );
@@ -71,6 +74,7 @@ void ComboGraph::Load( const CString& sScreen, const CString& sElement, const St
const float CenterPercent = start + size/2; const float CenterPercent = start + size/2;
const float CenterXPos = SCALE( CenterPercent, 0.0f, 1.0f, -width/2.0f, width/2.0f ); const float CenterXPos = SCALE( CenterPercent, 0.0f, 1.0f, -width/2.0f, width/2.0f );
text->SetX( CenterXPos ); text->SetX( CenterXPos );
text->SetY( NUMBERS_Y );
text->SetText( ssprintf("%i",combo.GetStageCnt()) ); text->SetText( ssprintf("%i",combo.GetStageCnt()) );
ON_COMMAND( text ); ON_COMMAND( text );