예제 #1
0
        protected override void LoadContent()
        {
            // Load fonts
            hudFont = stateContentManager.Load <SpriteFont>("UI/Fonts/Hud");
            // Load and add all the UI elements, buttons
            menuUI.UIElements.Add(new UIElement(stateContentManager.Load <Texture2D>("UI/AwardsBig"), new Rectangle((Game1.SCREENWIDTH / 2) - (700 / 2), 100, 700, 199)));
            menuUI.Buttons.Add(new Button(stateContentManager.Load <Texture2D>("UI/Back"), new Rectangle((Game1.SCREENWIDTH / 2) - (250 / 2), 850, 250, 96), MenuState));

            menuUI.LoadContent();

            base.LoadContent();
        }
예제 #2
0
        protected override void LoadContent()
        {
            // Load fonts
            hudFont = stateContentManager.Load <SpriteFont>("UI/Fonts/Hud");
            // Load and add all the UI elements
            // Only add if lost
            if (!win)
            {
                menuUI.UIElements.Add(new UIElement(stateContentManager.Load <Texture2D>("UI/GameOver"), new Rectangle((Game1.SCREENWIDTH / 2) - (968 / 2), 100, 968, 198)));
            }
            menuUI.Buttons.Add(new Button(stateContentManager.Load <Texture2D>("UI/Retry"), new Rectangle((Game1.SCREENWIDTH / 2) - (287 / 2), 650, 287, 90), GameplayState, gameManager.OnNewGame));
            menuUI.Buttons.Add(new Button(stateContentManager.Load <Texture2D>("UI/BackToMain"), new Rectangle((Game1.SCREENWIDTH / 2) - (424 / 2), 850, 424, 67), MenuState));

            menuUI.LoadContent();

            base.LoadContent();
        }
예제 #3
0
        // Load relevant content for the state
        // All the menuUI content
        protected override void LoadContent()
        {
            //
            // Load and add all the UI elements
            menuUI.UIElements.Add(new UIElement(stateContentManager.Load <Texture2D>("UI/Title"), new Rectangle((Game1.SCREENWIDTH / 2) - (700 / 2), 100, 700, 199)));

            // Try getting save data on the gamemanager
            // If there is save data then display the continue button
            if (GameManager.Instance.GetSaveData())
            {
                menuUI.Buttons.Add(new Button(stateContentManager.Load <Texture2D>("UI/Continue"), new Rectangle((Game1.SCREENWIDTH / 2) - (400 / 2), 450, 400, 94), GameplayState, OnContinueButton));
            }
            // Load all buttons
            menuUI.Buttons.Add(new Button(stateContentManager.Load <Texture2D>("UI/NewGame"), new Rectangle((Game1.SCREENWIDTH / 2) - (454 / 2), 550, 454, 100), GameplayState, OnNewGame));
            menuUI.Buttons.Add(new Button(stateContentManager.Load <Texture2D>("UI/Protocol"), new Rectangle((Game1.SCREENWIDTH / 2) - (423 / 2), 650, 423, 84), ProtocolState));
            menuUI.Buttons.Add(new Button(stateContentManager.Load <Texture2D>("UI/Awards"), new Rectangle((Game1.SCREENWIDTH / 2) - (360 / 2), 750, 360, 94), AwardsState));
            menuUI.Buttons.Add(new Button(stateContentManager.Load <Texture2D>("UI/Quit"), new Rectangle((Game1.SCREENWIDTH / 2) - (205 / 2), 850, 205, 104), null, OnQuitGame));

            // Let menuUI load its content
            menuUI.LoadContent();

            base.LoadContent();
        }