using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; class TextGameObject : GameObject { protected SpriteFont spriteFont; protected Color textcolor; public string text; public TextGameObject(GameWorld gameWorld, string assetname, int layer = 0, string id = "") : base(layer, id) { spriteFont = gameWorld.ResourceManager.Content.Load(assetname); } public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { spriteBatch.DrawString(spriteFont, text, this.GlobalPosition, textcolor); } public override void Reset() { base.Reset(); textcolor = Color.DarkGreen; } public Color TextColor { get { return textcolor; } set { textcolor = value; } } public string Text { get { return text; } set { text = value; } } }