TextManager.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Microsoft.Xna.Framework;
  5. using Microsoft.Xna.Framework.Audio;
  6. using Microsoft.Xna.Framework.Content;
  7. using Microsoft.Xna.Framework.GamerServices;
  8. using Microsoft.Xna.Framework.Graphics;
  9. using Microsoft.Xna.Framework.Input;
  10. using Microsoft.Xna.Framework.Media;
  11. using Microsoft.Xna.Framework.Net;
  12. using Microsoft.Xna.Framework.Storage;
  13. namespace BackgroundThreadTester
  14. {
  15. public class TextManager : Microsoft.Xna.Framework.DrawableGameComponent
  16. {
  17. public SpriteFont sfStandard;
  18. protected SpriteBatch spriteBatch = null;
  19. public TextManager(Game game, SpriteFont sfStandardFont)
  20. : base(game)
  21. {
  22. spriteBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
  23. sfStandard = sfStandardFont;
  24. }//TextManager
  25. public override void Draw(GameTime gameTime)
  26. {
  27. spriteBatch.DrawString(sfStandard, "Click here to create background thread and make it\nadd 5 new components", new Vector2(50, 200), Color.White);
  28. }//Draw
  29. }
  30. }