From 5de3254aa0d6f69dbb6e08ddd699c3f78797be3b Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Tue, 16 Jan 2018 17:58:56 +0100 Subject: XD --- Penguloon/Objects/ObjectBase.cs | 26 +++++++++++++++++++------- Penguloon/StaticUIValues.cs | 4 ++-- 2 files changed, 21 insertions(+), 9 deletions(-) (limited to 'Penguloon') diff --git a/Penguloon/Objects/ObjectBase.cs b/Penguloon/Objects/ObjectBase.cs index ee2b04c..c71b5e3 100644 --- a/Penguloon/Objects/ObjectBase.cs +++ b/Penguloon/Objects/ObjectBase.cs @@ -66,17 +66,17 @@ namespace Penguloon.Objects InfoPanelTexture = ContentManager.GetTexture("UI/objectinfo"); InfoPanelLineTexture = ContentManager.GetTexture("UI/objectinfo-line"); - InfoPanelPos = new Vector2(); - - // alight right + // align right if (Position.X < 450) { - + InfoPanelPos = new Vector2(Position.X + (TileSpanX * Map.TileWidth), Position.Y); + InfoPanelRotation = 3.14f; } - // alight left + // align left else { - + InfoPanelPos = new Vector2(Position.X - StaticUIValues.ObjectInfoPanelSize.X, Position.Y); + InfoPanelRotation = 0f; } } @@ -176,7 +176,6 @@ namespace Penguloon.Objects if(RangeCircle == null) RangeCircle = CreateCircle((int)Range * 2); - float rot = (float)Rotation + (float)MathHelper.PiOver2; if (!ShouldRotate) @@ -218,6 +217,19 @@ namespace Penguloon.Objects destinationRectangle: rangeCircleRec, origin: new Vector2(RangeCircle.Width / 2, RangeCircle.Height / 2)); } + + DrawInfoPanel(); + } + + private void DrawInfoPanel() + { + if (!Selected) return; + + Map.ParentScene.Main.SpriteBatch.Draw(InfoPanelTexture, destinationRectangle: + new Rectangle(InfoPanelPos.ToPoint(), StaticUIValues.ObjectInfoPanelSize.ToPoint())); + + Map.ParentScene.Main.SpriteBatch.Draw(InfoPanelLineTexture, destinationRectangle: + new Rectangle(Position.ToPoint(), StaticUIValues.ObjectInfoPanelLineSize.ToPoint()), rotation: InfoPanelRotation); } public abstract void DrawUnique(float deltaTime); diff --git a/Penguloon/StaticUIValues.cs b/Penguloon/StaticUIValues.cs index bfce477..d7910a5 100644 --- a/Penguloon/StaticUIValues.cs +++ b/Penguloon/StaticUIValues.cs @@ -45,8 +45,8 @@ namespace Penguloon public static Vector2 UpgradePanelSize { get; set; } - public static Vector2 ObjectInfoPanelSize { get; set; } = new Vector2(350, 400); - public static Vector2 ObjectInfoPanelLineSize { get; set; } = new Vector2(350, 100); + public static Vector2 ObjectInfoPanelSize { get; set; } = new Vector2(100, 120); + public static Vector2 ObjectInfoPanelLineSize { get; set; } = new Vector2(50, 20); public static void Initialize(Main main) { -- cgit v1.2.3-70-g09d2