From 6a14434cffa7db999adef312f4ae1ef318825a59 Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Fri, 29 Nov 2013 23:01:50 +1300 Subject: [PATCH] Add a CenterPosition helper to Viewport --- OpenRA.Game/Graphics/Viewport.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Game/Graphics/Viewport.cs b/OpenRA.Game/Graphics/Viewport.cs index cc6ac5c0c2..4c61e2e18c 100755 --- a/OpenRA.Game/Graphics/Viewport.cs +++ b/OpenRA.Game/Graphics/Viewport.cs @@ -40,6 +40,9 @@ namespace OpenRA.Graphics // Viewport geometry (world-px) public int2 CenterLocation { get; private set; } + + public WPos CenterPosition { get { return worldRenderer.Position(CenterLocation); } } + public int2 TopLeft { get { return CenterLocation - viewportSize / 2; } } public int2 BottomRight { get { return CenterLocation + viewportSize / 2; } } int2 viewportSize;