summaryrefslogtreecommitdiff
path: root/Penguloon/Controls
diff options
context:
space:
mode:
Diffstat (limited to 'Penguloon/Controls')
-rw-r--r--Penguloon/Controls/ObjectSelector.cs21
1 files changed, 16 insertions, 5 deletions
diff --git a/Penguloon/Controls/ObjectSelector.cs b/Penguloon/Controls/ObjectSelector.cs
index 8a48be4..fd444c8 100644
--- a/Penguloon/Controls/ObjectSelector.cs
+++ b/Penguloon/Controls/ObjectSelector.cs
@@ -129,7 +129,8 @@ namespace Penguloon.Controls
Objects.Add(new Tuple<ObjectBase, int>(new GoldPenguinObject(Map), 360));
Objects.Add(new Tuple<ObjectBase, int>(new CannonObject(Map), 650));
Objects.Add(new Tuple<ObjectBase, int>(new HealthGeneratorObject(Map), 800));
- Objects.Add(new Tuple<ObjectBase, int>(new MortarObject(Map), 150));
+ Objects.Add(new Tuple<ObjectBase, int>(new MortarObject(Map), 1200));
+ Objects.Add(new Tuple<ObjectBase, int>(new KingPenguinObject(Map), 2550));
}
public override void Update(float deltaTime, TouchLocation[] touchLocations)
@@ -172,11 +173,16 @@ namespace Penguloon.Controls
//int widthToDraw = (height / Objects[i].Item1.TileSpanY) - (padding * (3 - Objects[i].Item1.TileSpanY));
//int heightToDraw = (height / Objects[i].Item1.TileSpanX) - (padding * (3 - Objects[i].Item1.TileSpanX));
- int spanY = 1;
- int spanX = 1;
+ float spanY = 1;
+ float spanX = 1;
- int widthToDraw = (width / spanY) - (padding * 2);
- int heightToDraw = (height / spanX) - (padding * 2);
+ if (Objects[i].Item1.TileSpanX < Objects[i].Item1.TileSpanY)
+ spanY = 1.3f;
+ else if (Objects[i].Item1.TileSpanX > Objects[i].Item1.TileSpanY)
+ spanX = 1.3f;
+
+ int widthToDraw = (int)(height / spanY) - (padding * 2);
+ int heightToDraw = (int)(height / spanX) - (padding * 2);
if (Objects[i].Item1.TextureBase != null)
ParentScene.Main.SpriteBatch.Draw(Objects[i].Item1.TextureBase,
@@ -185,8 +191,13 @@ namespace Penguloon.Controls
ParentScene.Main.SpriteBatch.Draw(Objects[i].Item1.Texture,
destinationRectangle: new Rectangle(posX + (width - widthToDraw) / 2, (int)Position.Y + posY + (height / 2) - (heightToDraw / 2), widthToDraw, heightToDraw));
+ // object cost
ParentScene.DrawText(ContentManager.GetFont("Fonts/GWENT/36"), Objects[i].Item2.ToString(), new Vector2(posX, (int)Position.Y + posY),
new Vector2(width, height), TextAllignment.CenterBottom, Color.White, Color.Black, 2);
+
+ //object size
+ ParentScene.DrawText(ContentManager.GetFont("Fonts/GWENT/16"), Objects[i].Item1.TileSpanX.ToString() + "x" + Objects[i].Item1.TileSpanY.ToString(), new Vector2(posX + 5, (int)Position.Y + posY + 5),
+ new Vector2(width, height), TextAllignment.LeftTop, Color.White, Color.Black, 2);
}
// Draw borders