Esempio n. 1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            screenManager = new ScreenManager(this, spriteBatch);
            this.Components.Add(screenManager);

            GameScreen menu = new GameScreen(screenManager);
            Button b = Button.CreateCenteredToPoint("New Game", Color.Blue, screenManager.Font,
                                                    GraphicsDevice.Viewport.Bounds.Center);
            b.ButtonClicked += new ClickHandler(NewGame);

            menu.AddButton(b);
            screenManager.Add(menu);
        }
 public void Add(GameScreen screen)
 {
     screens.Add(screen);
 }