Add a Shadow option to LabelWidget and ButtonWidget

This commit is contained in:
Oliver Brakmann
2016-08-26 22:18:46 +02:00
parent 8ad18ad161
commit 1059d5b88d
9 changed files with 60 additions and 17 deletions

View File

@@ -99,6 +99,19 @@ namespace OpenRA.Graphics
DrawTextWithContrast(text, location, fg, WidgetUtils.GetContrastColor(fg, bgDark, bgLight), offset);
}
public void DrawTextWithShadow(string text, float2 location, Color fg, Color bg, int offset)
{
if (offset != 0)
DrawText(text, location + new float2(offset, offset), bg);
DrawText(text, location, fg);
}
public void DrawTextWithShadow(string text, float2 location, Color fg, Color bgDark, Color bgLight, int offset)
{
DrawTextWithShadow(text, location, fg, WidgetUtils.GetContrastColor(fg, bgDark, bgLight), offset);
}
public int2 Measure(string text)
{
if (string.IsNullOrEmpty(text))