/// <summary> /// Construct a GameScreen. /// </summary> /// <param name="transitionOnTime"></param> /// <param name="transitionOffTime"></param> public GameScreen(double transitionOnTime, double transitionOffTime, bool fullscreen, PlayerIndex controllingIndex) { transition = new Transition(transitionOnTime, transitionOffTime); this.fullscreen = fullscreen; Controls = new ControlManager(); Controls.ControllingIndex = controllingIndex; AddControls(transitionOnTime, transitionOffTime); }
/// <summary> /// Runs the control's logic. /// </summary> /// <param name="gameTime"></param> public virtual void Update(GameTime gameTime, ControlManager manager) { transition.Update(gameTime); UpdatePosition(); if (manager.Enabled && TabStop) //Don't take input if the manager isn't. { UpdateBounds(); MouseState ms = Mouse.GetState(); bool selected = (ms.X > Bounds.X && ms.X < Bounds.Right && ms.Y > Bounds.Y && ms.Y < Bounds.Bottom); Selected = selected; } }