diff options
Diffstat (limited to 'Penguloon/Objects')
| -rw-r--r-- | Penguloon/Objects/ObjectBase.cs | 26 |
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); |
