Example #1
0
        protected override void Load()
        {
            string[] items = { "New Game", "Load Game", "Help", "Quit" };
            menu = new MenuComponent(Engine.Content.Load<SpriteFont>("Content/Georgia"), items);
            this.AddComponent(menu);

            //    this.AddComponent(new InputManager());

            // reposition menu
            menu.Position = new Vector2((Engine.GraphicsDevice.
               PresentationParameters.BackBufferWidth - menu.Width) / 2, (Engine.GraphicsDevice.
               PresentationParameters.BackBufferHeight - menu.Height)/2);
        }
 protected override void Load()
 {
     string[] menuStrings = { "New Game", "Load Game", "Exit" };
     spriteFont = Engine.Content.Load<SpriteFont>("Content/Georgia");
     menu = new MenuComponent(spriteFont, menuStrings);
     spriteBatch = Engine.SpriteBatch;
     menu.Position = new Vector2((Engine.GraphicsDevice.PresentationParameters.BackBufferWidth -
     menu.Width) / 2,(Engine.GraphicsDevice.PresentationParameters.BackBufferHeight- menu.Height)/2 );
     menu.SetMenuItems(menuItems);
     AddComponent(menu);
     base.Load();
 }