summaryrefslogtreecommitdiff
path: root/Penguloon
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2018-01-16 17:58:56 +0100
committeraldrikboy <aldrikboy@gmail.com>2018-01-16 17:58:56 +0100
commit5de3254aa0d6f69dbb6e08ddd699c3f78797be3b (patch)
tree4d961f2fff1e8784bcf92cfc0a5e4c1646449efa /Penguloon
parent6996be0fc143085b6aa459f2eb7b288ac1617c0b (diff)
XD
Diffstat (limited to 'Penguloon')
-rw-r--r--Penguloon/Objects/ObjectBase.cs26
-rw-r--r--Penguloon/StaticUIValues.cs4
2 files changed, 21 insertions, 9 deletions
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)
{