arkanoid/Arkanoidv3.0/Classes/Label.cs
Mootfrost777 79260807c7 v.0.3
Start commit. All gameplay. Textbox lib by my friend was broken(not fatal for gameplay).
2021-12-21 19:57:41 +03:00

49 lines
No EOL
1.2 KiB
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace Arkanoid.Classes
{
class Label
{
private SpriteFont spriteFont;
private Color color_default;
public Vector2 Position { get; set; }
public string Text { get; set; }
public Color Color { get; set; }
public Label()
{
Position = new Vector2(100, 100);
Text = "Label";
Color = Color.Yellow;
color_default = Color;
}
public Label(string Text, Vector2 Position, Color Color)
{
this.Text = Text;
this.Position = Position;
this.Color = Color;
color_default = Color;
}
public void ResetColor()
{
Color = color_default;
}
public void LoadContent(ContentManager Content)
{
spriteFont = Content.Load<SpriteFont>("GameOverFont");
}
public void Draw(SpriteBatch spriteBatch)
{
spriteBatch.DrawString(spriteFont, Text, Position, Color);
}
}
}