Fonts are now defined in mod.yaml

This commit is contained in:
Paul Chote
2011-05-16 17:48:31 +12:00
parent ab423fbe8c
commit e1c8658fdc
9 changed files with 74 additions and 37 deletions

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Widgets
[Obsolete] public string Background = null;
public TextAlign Align = TextAlign.Left;
public TextVAlign VAlign = TextVAlign.Middle;
public Renderer.FontType Font = Renderer.FontType.Regular;
public string Font = "Regular";
public Color Color = Color.White;
public bool Bold = false; // Legacy flag. TODO: Remove
public bool Contrast = false;
@@ -61,8 +61,8 @@ namespace OpenRA.Widgets
if (bg != null)
WidgetUtils.DrawPanel(bg, RenderBounds );
if (Font == Renderer.FontType.Regular && Bold)
Font = Renderer.FontType.Bold;
if (Font == "Regular" && Bold)
Font = "Bold";
SpriteFont font = Game.Renderer.Fonts[Font];
var text = GetText();