This is a game component that implements IUpdateable.
Inheritance: Microsoft.Xna.Framework.DrawableGameComponent
Example #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="game"></param>
        /// <param name="spriteBatch"></param>
        /// <param name="spriteFont"></param>
        /// <param name="image"></param>
        public GameOverScreen(Game game, SpriteBatch spriteBatch, SpriteFont spriteFont, Texture2D image)
            : base(game, spriteBatch)
        {
            string[] menuItems = { "Quit", "New Game" };
            menuComponent = new MenuComponent(game,
                spriteBatch,
                spriteFont,
                menuItems);
            Components.Add(menuComponent);
            this.image = image;

            fontation = spriteFont;

            position.X = 275;
            position.Y = 250;

            position2.X = 275;
            position2.Y = 300;

            imageRectangle = new Rectangle(0, 0, Game.Window.ClientBounds.Width, Game.Window.ClientBounds.Height);

            menuComponent.Position = new Vector2(
                (imageRectangle.Width - menuComponent.Width) / 2,
                imageRectangle.Bottom - menuComponent.Height - 10);
        }
Example #2
0
 /// <summary>
 /// Constructor for the Instructions Screen
 /// </summary>
 /// <param name="game"></param>
 /// <param name="spriteBatch"></param>
 /// <param name="spriteFont"></param>
 /// <param name="image"></param>
 public InstructionsScreen(Game game, SpriteBatch spriteBatch, SpriteFont spriteFont, Texture2D image)
     : base(game, spriteBatch)
 {
     string[] menuItems = { "Up Arrow - move up", "Down Arrow - move down", "Left Arrow - move left", "Right Arrow - move right", "Space - shoot laser" };
     menuComponent = new MenuComponent(game, spriteBatch, spriteFont, menuItems);
     Components.Add(menuComponent);
     this.image = image;
     imageRectangle = new Rectangle(0, 0, Game.Window.ClientBounds.Width, Game.Window.ClientBounds.Height);
 }
Example #3
0
 /// <summary>
 /// Main method to create all the components of this game screen.
 /// All items are currently selectable but will be converted to non-selectable text.
 /// </summary>
 /// <param name="game"></param>
 /// <param name="spriteBatch"></param>
 /// <param name="spriteFont"></param>
 /// <param name="image"></param>
 public CreditScreen(Game game, SpriteBatch spriteBatch, SpriteFont spriteFont, Texture2D image)
     : base(game, spriteBatch)
 {
     string[] menuItems = { "Credits:", "Gerald Hogue", "Ben Gooding", "Aarao Gouveia", "Mike Davis" };
      menuComponent = new MenuComponent(game, spriteBatch, spriteFont, menuItems);
       Components.Add(menuComponent);
     this.image = image;
     imageRectangle = new Rectangle(0, 0, Game.Window.ClientBounds.Width, Game.Window.ClientBounds.Height);
 }
Example #4
0
        public StartScreen(Game game, SpriteBatch spriteBatch, SpriteFont spriteFont, Texture2D image)
            : base(game, spriteBatch)
        {
            string[] menuItems = { "Start Game", "Instructions", "Credits", "Quit" };
            menuComponent = new MenuComponent(game, spriteBatch, spriteFont, menuItems);
            Components.Add(menuComponent);
            this.image = image;

            imageRectangle = new Rectangle(0, 0, Game.Window.ClientBounds.Width, Game.Window.ClientBounds.Height);
        }
Example #5
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="game"></param>
        /// <param name="spriteBatch"></param>
        /// <param name="spriteFont"></param>
        /// <param name="image"></param>
        public PopUpScreen(Game game, SpriteBatch spriteBatch, SpriteFont spriteFont, Texture2D image)
            : base(game, spriteBatch)
        {
            string[] menuItems = { "Yes", "No" };
            menuComponent = new MenuComponent(game,
                spriteBatch,
                spriteFont,
                menuItems);
            Components.Add(menuComponent);
            this.image = image;

            imageRectangle = new Rectangle(
                (Game.Window.ClientBounds.Width - this.image.Width) / 2,
                (Game.Window.ClientBounds.Height - this.image.Height) / 2,
                this.image.Width,
                this.image.Height);

            menuComponent.Position = new Vector2(
                (imageRectangle.Width - menuComponent.Width) / 2,
                imageRectangle.Bottom - menuComponent.Height - 10);
        }