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; }
public override void RemoveComponent(Button obj) { ButtonList.Remove(obj); }
public override void AddComponent(Button obj) { ButtonList.Add(obj); }
//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; }
public virtual void RemoveComponent(Button obj) { }
public virtual void AddComponent(Button obj) { }