public MainMenuScreen(int widthScreen, int heightScreen, IScreenMaster master) : base(widthScreen, heightScreen, master) { Texture2D up = Load<Texture2D>("Image/buttonUp"); Texture2D down = Load<Texture2D>("Image/buttonDown"); SpriteFont font = Load<SpriteFont>("Font/text"); int centerX = widthScreen / 2 - up.Width / 2; int buttonStartY = heightScreen / 3; int buttonSpacing = 10; ColorRect c = new ColorRect(0, 0, widthScreen, heightScreen, Color.Black); bg = c; Label t = new Label(widthScreen / 2, 10, font, "Project: Height"); t.x -= (int)t.GetDim().X / 2; title = t; Button newGame = new TextButton(centerX, buttonStartY, up, down, font, "New Game"); Button loadGame = new TextButton(centerX, buttonStartY + up.Height + buttonSpacing, up, down, font, "Load Game"); Button options = new TextButton(centerX, buttonStartY + 2 * (up.Height + buttonSpacing), up, down, font, "Options"); newGame.select += delegate() { LevelLoader.Load(1); ChangeScreen<StoryScreen>(); }; loadGame.select += delegate() { ChangeScreen<LoadGameScreen>(); }; options.select += delegate() { ChangeScreen<OptionScreen>(); }; buttons.Add(newGame); buttons.Add(loadGame); buttons.Add(options); }
public OptionScreen(int widthScreen, int heightScreen, IScreenMaster master) : base(widthScreen, heightScreen, master) { Texture2D up = Load<Texture2D>("Image/buttonUp"); Texture2D down = Load<Texture2D>("Image/buttonDown"); SpriteFont font = Load<SpriteFont>("Font/text"); int centerX = widthScreen / 2 - up.Width / 2; ColorRect c = new ColorRect(0, 0, widthScreen, heightScreen, Color.Black); bg = c; Label t = new Label(widthScreen / 2, 10, font, "Options"); t.x -= (int) t.GetDim().X / 2; title = t; Button back = new TextButton(centerX, heightScreen - up.Height - 10, up, down, font, "Back"); back.select += delegate() { ChangeScreen<MainMenuScreen>(); }; buttons.Add(back); }