Draw annotations using the UI renderers.

This commit is contained in:
Paul Chote
2019-09-15 12:20:08 +01:00
committed by abcdefg30
parent 8c1b0f1afe
commit e772adb0a9
13 changed files with 108 additions and 112 deletions

View File

@@ -59,11 +59,11 @@ namespace OpenRA.Mods.Common.Widgets
var modifiers = Game.GetModifierKeys();
if (IsValidDragbox)
{
var a = worldRenderer.Viewport.WorldToViewPx(dragStart);
var b = worldRenderer.Viewport.WorldToViewPx(mousePos);
Game.Renderer.RgbaColorRenderer.DrawRect(a, b, 1, Color.White);
// Render actors in the dragbox
var a = new float3(dragStart.X, dragStart.Y, dragStart.Y);
var b = new float3(mousePos.X, mousePos.Y, mousePos.Y);
Game.Renderer.WorldRgbaColorRenderer.DrawRect(a, b,
1 / worldRenderer.Viewport.Zoom, Color.White);
foreach (var u in SelectActorsInBoxWithDeadzone(World, dragStart, mousePos, modifiers))
DrawRollover(u);
}