clean to working state
This commit is contained in:
parent
9a0b74135a
commit
04f8fbd8cd
@ -53,7 +53,6 @@
|
||||
<Compile Include="Zer01HD\Utilities\Input\InputListener.cs" />
|
||||
<Compile Include="Zer01HD\Utilities\Input\InputUtilities.cs" />
|
||||
<Compile Include="Zer01HD\Utilities\Persistence\Preferences.cs" />
|
||||
<Compile Include="Zer01HD\Utilities\Renderer\ScaledRenderer.cs" />
|
||||
<Compile Include="Zer01HD\Utilities\UI\Interactive\BasicButton.cs" />
|
||||
<Compile Include="Zer01HD\Utilities\UI\ScreenSystem\ITransition.cs" />
|
||||
<Compile Include="Zer01HD\Utilities\UI\ScreenSystem\LoadingScreen.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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user