public override void Update(GameTime gameTime) { #if WINDOWS elapsedButtonDelay += gameTime.ElapsedGameTime; #elif XBOX AllButtons.Update(gameTime); currentGamePad = GamePad.GetState(PlayerIndex.One); lastGamePad = currentGamePad; #endif base.Update(gameTime); }
public override void Update(GameTime gameTime) { if (!StateManager.IsWindowFocused()) { //Not active window return; } #if XBOX ButtonManagement.Update(gameTime); #endif base.Update(gameTime); }
public override void Update(GameTime gameTime) { #if WINDOWS MouseState currentMs = MouseManager.CurrentMouseState; if (lastMs.LeftButton == ButtonState.Released && currentMs.LeftButton == ButtonState.Pressed) { if (mouseInBackButton) { StateManager.GoBack(); } if (MusicVolumeLabel.IsSelected) { StateManager.Options.MusicEnabled = !StateManager.Options.MusicEnabled; MusicVolumeLabel.Text = String.Format("Music: {0}", StateManager.Options.MusicEnabled ? "On" : "Off"); } if (SFXLabel.IsSelected) { StateManager.Options.SFXEnabled = !StateManager.Options.SFXEnabled; SFXLabel.Text = String.Format("SFX: {0}", StateManager.Options.SFXEnabled ? "On" : "Off"); } if (mouseOnGraphicButton) { StateManager.Options.ToggleFullscreen(); } if (ControlLabel.IsSelected) { StateManager.ScreenState = ScreenType.ControlScreen; } } lastMs = currentMs; #elif XBOX AllButtons.Update(gameTime); currentGamePad = GamePad.GetState(PlayerIndex.One); lastGamePad = currentGamePad; #endif base.Update(gameTime); }