From 04f8fbd8cd6122bbf82680d077640873c64df890 Mon Sep 17 00:00:00 2001 From: Recrown Date: Sun, 11 Nov 2018 11:32:06 -0600 Subject: [PATCH] clean to working state --- RhythmBullet/RhythmBullet.csproj | 1 - RhythmBullet/Zer01HD/Utilities/UI/Modular/Text.cs | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/RhythmBullet/RhythmBullet.csproj b/RhythmBullet/RhythmBullet.csproj index 851a6f7..e0d772a 100644 --- a/RhythmBullet/RhythmBullet.csproj +++ b/RhythmBullet/RhythmBullet.csproj @@ -53,7 +53,6 @@ - diff --git a/RhythmBullet/Zer01HD/Utilities/UI/Modular/Text.cs b/RhythmBullet/Zer01HD/Utilities/UI/Modular/Text.cs index c778ded..8ee435a 100644 --- a/RhythmBullet/Zer01HD/Utilities/UI/Modular/Text.cs +++ b/RhythmBullet/Zer01HD/Utilities/UI/Modular/Text.cs @@ -12,6 +12,7 @@ namespace RhythmBullet.Zer01HD.UI.Modular { private SpriteFont font; private float scale; + private Vector2 position; public string DisplayedText { get @@ -21,19 +22,21 @@ namespace RhythmBullet.Zer01HD.UI.Modular set { Vector2 size = font.MeasureString(value); - Width = size.X; - scale = Height / size.Y; + Bounds.Width = (int) size.X; + scale = Bounds.Height / size.Y; } } public Text(string displayedText, SpriteFont font, int height) { + Bounds.Height = height; this.font = font; - Height = height; } public override void Draw(SpriteBatch batch) { - batch.DrawString(font, DisplayedText, Position, Color); + position.X = Bounds.X; + position.Y = Bounds.Y; + batch.DrawString(font, DisplayedText, position, Color); base.Draw(batch); } }