add contrast surround to timer & chat which are displayed straight over the world

This commit is contained in:
Chris Forbes
2011-01-08 12:10:29 +13:00
parent 303525a5ba
commit db63724aeb
6 changed files with 30 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ namespace OpenRA.Widgets
public class ChatDisplayWidget : Widget
{
public readonly int RemoveTime = 0;
public readonly bool UseContrast = false;
const int logLength = 9;
public string Notification = "";
@@ -52,10 +53,13 @@ namespace OpenRA.Widgets
{
var owner = line.Owner + ":";
inset = Game.Renderer.RegularFont.Measure(owner).X + 10;
Game.Renderer.RegularFont.DrawText(owner, chatpos, line.Color);
Game.Renderer.RegularFont.DrawTextWithContrast(owner, chatpos,
line.Color, Color.Black, UseContrast ? 1 : 0);
}
Game.Renderer.RegularFont.DrawText(line.Text, chatpos + new int2(inset, 0), Color.White);
Game.Renderer.RegularFont.DrawTextWithContrast(line.Text, chatpos + new int2(inset, 0),
Color.White, Color.Black, UseContrast ? 1 : 0);
}
Game.Renderer.DisableScissor();