Exemple #1
0
        public Button CreateChangeScreenButton(Image image, string text, SpriteFont font, Vector2 pos, GameScreen nextScreen)
        {
            effect = new ChangeScreen(nextScreen);
            if (text == null || font == null)
            {

                button = new Button(image, image, pos, effect);
            }
            else
                button = new Button(image, image, pos, effect, text, font);

            return button;
        }
Exemple #2
0
 public override void RemoveComponent(Button obj)
 {
     ButtonList.Remove(obj);
 }
Exemple #3
0
 public override void AddComponent(Button obj)
 {
     ButtonList.Add(obj);
 }
Exemple #4
0
        //Returns the a MainMenu GameScreen object
        public GameScreen MainMenu()
        {
            //Create the Menu and the GUI
            GameScreen gameScreen = new MainMenu();
            SceneManager.Instance.xmlGameScreenManager.Type = typeof(MainMenu);
            gameScreen = SceneManager.Instance.xmlGameScreenManager.Load("Content/XML/GameScreens/Menus/MainMenu.xml");

            //Load all GUI components via the GameScreen xmlGUIManager
            //The xmlManager MUST have it's type set to the correct child class for the object being added
            gameScreen.xmlGUIManager.Type = typeof(Menu);
            GUIComponent menu = gameScreen.xmlGUIManager.Load("Content/XML/GUI/MainMenu.xml");

            //Loads buttons
            //Set xmlGUIManager to type<Button>
            gameScreen.xmlGUIManager.Type = typeof(Button);
            
            GUIComponent newGameMenuButton = gameScreen.xmlGUIManager.Load("Content/XML/GUI/NewGameButton.xml");
            Button quitGameButton = new Button();
            
 


            
            //gameScreen.Init(backGround, mainmenumenu);
            menu.AddComponent((Button)newGameMenuButton);
            gameScreen.gui.Add(menu);
            

            return gameScreen;
        }
Exemple #5
0
 public virtual void RemoveComponent(Button obj)
 {
 }
Exemple #6
0
 public virtual void AddComponent(Button obj)
 {
 }