summaryrefslogtreecommitdiff
path: root/Penguloon/Objects/ObjectBase.cs
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/Objects/ObjectBase.cs
parent6996be0fc143085b6aa459f2eb7b288ac1617c0b (diff)
XD
Diffstat (limited to 'Penguloon/Objects/ObjectBase.cs')
-rw-r--r--Penguloon/Objects/ObjectBase.cs26
1 files changed, 19 insertions, 7 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);