converted moneybin to widget; generic tooltip hax

This commit is contained in:
Chris Forbes
2010-04-15 19:06:01 +12:00
parent 0b2da36aea
commit f61c87f0d2
8 changed files with 266 additions and 69 deletions

View File

@@ -70,11 +70,12 @@ namespace OpenRA.Widgets
}
var stateOffset = (Depressed) ? new int2(VisualHeight, VisualHeight) : new int2(0, 0);
WidgetUtils.DrawPanel(Depressed ? "dialog3" : "dialog2", Bounds,
() => Game.chrome.renderer.BoldFont.DrawText(Text,
WidgetUtils.DrawPanel(Depressed ? "dialog3" : "dialog2", Bounds, null);
Game.chrome.renderer.BoldFont.DrawText(Text,
new int2(Bounds.X + Bounds.Width / 2, Bounds.Y + Bounds.Height / 2)
- new int2(Game.chrome.renderer.BoldFont.Measure(Text).X / 2,
Game.chrome.renderer.BoldFont.Measure(Text).Y / 2) + stateOffset, Color.White));
Game.chrome.renderer.BoldFont.Measure(Text).Y / 2) + stateOffset, Color.White);
base.Draw(world);
}