public override void Initialize() { int w = button.Bounds.Width * 2; int h = button.Bounds.Height * 2; Rectangle window = KappaGame.Instance.GraphicsDevice.PresentationParameters.Bounds; b = new Button(new Rectangle((window.Width - w)/2, (window.Height - h)/2, w, h), button); b.ButtonPressed = () => SceneController.Instance.SwitchToScene(new SceneInGame()); }
public SceneMainMenu() { //playButton = new Button(new Rectangle((window.Width - w) / 2, (window.Height - h) / 2 - ((h + space) * 2), w, h)); playButton = new Button(); playButton.ButtonPressed = () => SceneController.Instance.SwitchToScene(Scene.IN_GAME); //bitmineButton = new Button(new Rectangle((window.Width - w) / 2, (window.Height - h) / 2 - ((h + space) * 1), w, h)); bitmineButton = new Button(); //buttons[1].ButtonPressed = () => SceneController.Instance.SwitchToScene(new SceneInGame()); //optionsButton = new Button(new Rectangle((window.Width - w) / 2, (window.Height - h) / 2 - ((h + space) * 0), w, h)); optionsButton = new Button(); optionsButton.ButtonPressed = () => SceneController.Instance.SwitchToScene(Scene.OPTIONS); //exitButton = new Button(new Rectangle((window.Width - w) / 2, (window.Height - h) / 2 - ((h + space) * -1), w, h)); exitButton = new Button(); exitButton.ButtonPressed = () => KappaGame.Instance.Exit(); }
public override void Initialize() { int w = buttonPlayTX.Bounds.Width * 1; int h = buttonPlayTX.Bounds.Height * 1; Rectangle window = KappaGame.Instance.GraphicsDevice.PresentationParameters.Bounds; int space = 32; buttons[0] = new Button(new Rectangle((window.Width - w) / 2, (window.Height - h) / 2 - ((h + space) * 2), w, h), buttonPlayTX); buttons[0].ButtonPressed = () => SceneController.Instance.SwitchToScene(new SceneInGame()); buttons[1] = new Button(new Rectangle((window.Width - w) / 2, (window.Height - h) / 2 - ((h + space) * 1), w, h), buttonBitmineTX); //buttons[1].ButtonPressed = () => SceneController.Instance.SwitchToScene(new SceneInGame()); buttons[2] = new Button(new Rectangle((window.Width - w) / 2, (window.Height - h) / 2 - ((h + space) * 0), w, h), buttonOptionsTX); buttons[2].ButtonPressed = () => SceneController.Instance.SwitchToScene(new SceneOptions()); buttons[3] = new Button(new Rectangle((window.Width - w) / 2, (window.Height - h) / 2 - ((h + space) * -1), w, h), buttonExitTX); //buttons[3].ButtonPressed = () => SceneController.Instance.SwitchToScene(new SceneInGame()); }