TextManager.cs 803 B

123456789101112131415161718192021222324
  1. using System;
  2. using Microsoft.Xna.Framework;
  3. using Microsoft.Xna.Framework.Graphics;
  4. namespace BackgroundThreadTester
  5. {
  6. public class TextManager : Microsoft.Xna.Framework.DrawableGameComponent
  7. {
  8. public SpriteFont sfStandard;
  9. protected SpriteBatch spriteBatch = null;
  10. public TextManager(Game game, SpriteFont sfStandardFont)
  11. : base(game)
  12. {
  13. spriteBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
  14. sfStandard = sfStandardFont;
  15. }//TextManager
  16. public override void Draw(GameTime gameTime)
  17. {
  18. spriteBatch.DrawString(sfStandard, "Click here to create background thread and make it\nadd 5 new components", new Vector2(50, 200), Color.White);
  19. }//Draw
  20. }
  21. }