public MainMenu(Game1 g, MenuEventHandler eventH) : base(g, "Menus\\MainMenu\\Menu") { eventHandler = eventH; game = g; Rectangle backgroundBound = base.getBound(); Texture2D exitButtonTex = game.Content.Load<Texture2D>("Menus\\MainMenu\\Buttons\\exit_button"); Texture2D optionsButtonTex = game.Content.Load<Texture2D>("Menus\\MainMenu\\Buttons\\options_button"); Texture2D resumeButtonTex = game.Content.Load<Texture2D>("Menus\\MainMenu\\Buttons\\resume_button"); Texture2D recordTex = game.Content.Load<Texture2D>("Menus\\MainMenu\\record"); Texture2D tonearmTex = game.Content.Load<Texture2D>("Menus\\MainMenu\\toneArm"); exitButton = new MenuButton(exitButtonTex, new Vector2(backgroundBound.X + (backgroundBound.Width / 2) - (exitButtonTex.Width / 2), backgroundBound.Y + 3 * (backgroundBound.Height / 4) - 3 * (exitButtonTex.Height / 4))); optionsButton = new MenuButton(optionsButtonTex, new Vector2(backgroundBound.X + (backgroundBound.Width / 2) - (optionsButtonTex.Width / 2), backgroundBound.Y + 2 * (backgroundBound.Height / 4) - 2 * (optionsButtonTex.Height / 4))); resumeButton = new MenuButton(resumeButtonTex, new Vector2(backgroundBound.X + (backgroundBound.Width / 2) - (resumeButtonTex.Width / 2), backgroundBound.Y + 1 * (backgroundBound.Height / 4) - 1 * (resumeButtonTex.Height / 4))); recordButton = new SpinningMenuButton(recordTex, new Vector2(backgroundBound.X + (backgroundBound.Width * 0.8251f), backgroundBound.Y + (backgroundBound.Height * 0.7606f))); toneArm = new MenuButton(tonearmTex, new Vector2(backgroundBound.X + (backgroundBound.Width * 0.8180f), backgroundBound.Y + (backgroundBound.Height * 0.5172f))); }
public OptionsMenu(Game1 g, MenuEventHandler eventH) : base(g, "Menus\\OptionsMenu\\menu_options") { game = g; eventHandler = eventH; Rectangle backgroundBound = base.getBound(); #region textures Texture2D toggleOffTex = game.Content.Load<Texture2D>("Menus\\OptionsMenu\\Buttons\\off"); Texture2D toggleOnTex = game.Content.Load<Texture2D>("Menus\\OptionsMenu\\Buttons\\on"); Texture2D changeControlsButtonTex = game.Content.Load<Texture2D>("Menus\\OptionsMenu\\Buttons\\changeControllerButton"); Texture2D sliderTex = game.Content.Load<Texture2D>("Menus\\OptionsMenu\\Buttons\\slider"); Texture2D sliderBGTex = game.Content.Load<Texture2D>("Menus\\OptionsMenu\\Buttons\\sliderBackGround"); Texture2D saveTex = game.Content.Load<Texture2D>("Menus\\OptionsMenu\\Buttons\\saveButton"); Texture2D backTex = game.Content.Load<Texture2D>("Menus\\OptionsMenu\\Buttons\\backButton"); #endregion #region buttons and sliders changeControlsButton = new MenuButton(changeControlsButtonTex, new Vector2(backgroundBound.X + (backgroundBound.Width * 0.1975f)-11, backgroundBound.Y + (backgroundBound.Height * 0.7404f)-9)); fullscreenButton = new ToggleMenuButton(toggleOnTex, toggleOffTex, new Vector2(backgroundBound.X + (backgroundBound.Width * 0.5430f)-15, backgroundBound.Y + (backgroundBound.Height * 0.5375f)-10)); invertYButton = new ToggleMenuButton(toggleOnTex, toggleOffTex, new Vector2(backgroundBound.X + (backgroundBound.Width * 0.5430f) - 15, backgroundBound.Y + (backgroundBound.Height * 0.6592f) - 12)); backButton = new MenuButton(backTex, new Vector2(backgroundBound.X + (backgroundBound.Width * 0.7475f) - 0, backgroundBound.Y + (backgroundBound.Height * 0.7505f) - 0)); saveButton = new MenuButton(saveTex, new Vector2(backgroundBound.X + (backgroundBound.Width * 0.6348f) - 0, backgroundBound.Y + (backgroundBound.Height * 0.7505f) - 0)); clippingSlider = new SliderMenuButton(sliderBGTex, sliderTex, new Vector2(backgroundBound.X + (backgroundBound.Width * 0.5430f), backgroundBound.Y + (backgroundBound.Height * 0.4462f))); soundSlider = new SliderMenuButton(sliderBGTex, sliderTex, new Vector2(backgroundBound.X + (backgroundBound.Width * 0.5430f), backgroundBound.Y + (backgroundBound.Height * 0.3448f))); musicSlider = new SliderMenuButton(sliderBGTex, sliderTex, new Vector2(backgroundBound.X + (backgroundBound.Width * 0.5430f), backgroundBound.Y + (backgroundBound.Height * 0.2535f))); #endregion loadOptions(); }