clean to working state

This commit is contained in:
2018-11-11 11:32:06 -06:00
parent 9a0b74135a
commit 04f8fbd8cd
2 changed files with 7 additions and 5 deletions

View File

@@ -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);
}
}