using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework; namespace IntroScreen { public class PlayScreen : GameScreen { SpriteFont font; Vector2 fontPosition; string screenMessage; public PlayScreen() { TransitionOnTime = TimeSpan.FromSeconds(2); TransitionOffTime = TimeSpan.FromSeconds(1); } public override void Initialize() { screenMessage = "Play Game Screen"; Viewport viewport = ScreenManager.GraphicsDevice.Viewport; Vector2 fontDim = font.MeasureString(screenMessage); fontPosition = new Vector2((viewport.Width / 2) - (fontDim.X / 2), (viewport.Height / 2) - (fontDim.Y / 2)); } public override void LoadContent() { ContentManager content = ScreenManager.Game.Content; font = content.Load("font"); } public override void UnloadContent() { font = null; } public override void Update(GameTime gameTime, bool covered) { base.Update(gameTime, covered); } public override void Remove() { base.Remove(); ScreenManager.Game.Exit(); } public override void Draw(GameTime gameTime) { SpriteBatch spriteBatch = ScreenManager.SpriteBatch; spriteBatch.Begin(); spriteBatch.DrawString(font, screenMessage, fontPosition, Color.White); spriteBatch.End(); } } }