BlockingRunGame.cs 943 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using Microsoft.Xna.Framework;
  3. using Microsoft.Xna.Framework.Graphics;
  4. namespace BlockingRun
  5. {
  6. public class BlockingRunGame : Game
  7. {
  8. public BlockingRunGame()
  9. {
  10. new GraphicsDeviceManager(this);
  11. Content.RootDirectory = "Content";
  12. }
  13. private SpriteBatch _spriteBatch;
  14. private SpriteFont _font;
  15. protected override void LoadContent()
  16. {
  17. base.LoadContent();
  18. _spriteBatch = new SpriteBatch(GraphicsDevice);
  19. _font = Content.Load<SpriteFont>("SimpleFont");
  20. }
  21. protected override void Draw(GameTime gameTime)
  22. {
  23. GraphicsDevice.Clear(Color.CornflowerBlue);
  24. base.Draw(gameTime);
  25. _spriteBatch.Begin();
  26. _spriteBatch.DrawString(_font, "A magical blocking Game.Run!", Vector2.Zero, Color.White);
  27. _spriteBatch.End();
  28. }
  29. }
  30. }