/// <summary> /// Creates an instance of the Options screen. /// </summary> /// <param name="screenResolution">Screen resolution used for scaling.</param> /// <param name="screenResolutionChanged">True if the screen resolution has changed.</param> /// <param name="game">Game1 class passed on to options to allow changing of options.</param> /// <param name="director">The director of the game</param> public OptionsScreen(Vector2 screenResolution, bool screenResolutionChanged, Game1 game, ref Director director) : base(screenResolution) { // scaling of all positions according to viewport size mMenuBoxPosition = new Vector2(mScreenResolution.X / 2 - 306, mScreenResolution.Y / 4); mMenuBoxSize = new Vector2(612, 420); mDirector = director; GlobalVariables.ChosenResolution = GlobalVariables.ResolutionList.IndexOf(new Tuple <int, int>((int)screenResolution.X, (int)screenResolution.Y)); if (GlobalVariables.ChosenResolution == -1) { GlobalVariables.ChosenResolution = 0; } mTabPadding = 36; mContentPadding = 204; mTopContentPadding = mMenuBoxPosition.Y + 84; mTextColor = new Color(new Vector3(.9137f, .9058f, .8314f)); mScreenState = EOptionScreenState.Graphics; mGame = game; mMenuOpacity = screenResolutionChanged ? 1 : 0; mWindowOpacity = 1; }
/// <summary> /// Handler for the Audio button /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> private void OnAudioReleased(Object sender, EventArgs eventArgs) { mScreenState = EOptionScreenState.Audio; mAudioSliders[0].SetSliderPosition(GlobalVariables.MasterVolume); mAudioSliders[1].SetSliderPosition(GlobalVariables.MusicVolume / GlobalVariables.MasterVolume); mAudioSliders[2].SetSliderPosition(GlobalVariables.EffectsVolume / GlobalVariables.MasterVolume); mAudioSliders[3].SetSliderPosition(GlobalVariables.UiVolume / GlobalVariables.MasterVolume); }
/// <summary> /// Handler for the Graphics button /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> private void OnGraphicsReleased(Object sender, EventArgs eventArgs) { mScreenState = EOptionScreenState.Graphics; }
/// <summary> /// Handler for the Gameplay button /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> private void OnGameplayReleased(Object sender, EventArgs eventArgs) { mScreenState = EOptionScreenState.Gameplay; }