Show version on shellmap (via alzeih)

This commit is contained in:
Paul Chote
2010-07-03 15:23:44 +12:00
committed by Chris Forbes
parent 1b38c4a6cb
commit 2835fd66fe
6 changed files with 38 additions and 4 deletions

View File

@@ -56,12 +56,18 @@ namespace OpenRA.Widgets
{
var font = (Bold) ? Game.chrome.renderer.BoldFont : Game.chrome.renderer.RegularFont;
var text = GetText();
if (text == null)
return;
int2 textSize = font.Measure(text);
int2 position = DrawPosition();
if (Align == TextAlign.Center)
position += new int2((Bounds.Width - textSize.X)/2, 0);
if (Align == TextAlign.Right)
position += new int2(Bounds.Width - textSize.X,0);
font.DrawText(text, position, Color.White);
}