override public void update() { base.update(); // Handle button input for (int i = 0; i < _buttons.Count; i++) { TextureButton button = _buttons[i]; if (button.hitTest(new Vector2(_newMouseState.X, _newMouseState.Y))) { button.mouseOver(); if (_newMouseState.LeftButton == ButtonState.Pressed && _oldMouseState.LeftButton == ButtonState.Released) { button.activate(); } } else if (button.selected) { button.mouseOut(); } } base.update(); }
private void hitTestButton(TextureButton button) { if (button.hitTest(new Vector2(_newMouseState.X, _newMouseState.Y))) { button.mouseOver(); if (_newMouseState.LeftButton == ButtonState.Pressed && _oldMouseState.LeftButton == ButtonState.Released) { button.activate(); } } else if (button.selected) { button.mouseOut(); } }
private void hitTestTextureButton(TextureButton button, Vector2 point) { if (button.hitTest(point)) { button.mouseOver(); if (_newMouseState.LeftButton == ButtonState.Pressed && _oldMouseState.LeftButton == ButtonState.Released) { button.activate(); } } else { if (button.selected) { button.mouseOut(); } } }
private bool hitTestTextureButton(TextureButton button) { if (button.hitTest(new Vector2(_newMouseState.X, _newMouseState.Y))) { if (!button.selected) { button.mouseOver(); } if (_newMouseState.LeftButton == ButtonState.Pressed && _oldMouseState.LeftButton == ButtonState.Released) { button.activate(); } return(true); } else if (button.selected) { button.mouseOut(); } return(false); }
private void hitTestTextureButton(TextureButton button, Vector2 point) { if (button.hitTest(point)) { button.mouseOver(); if (_newMouseState.LeftButton == ButtonState.Pressed && _oldMouseState.LeftButton == ButtonState.Released) button.activate(); } else { if (button.selected) button.mouseOut(); } }
private bool hitTestTextureButton(TextureButton button) { if (button.hitTest(new Vector2(_newMouseState.X, _newMouseState.Y))) { if (!button.selected) button.mouseOver(); if (_newMouseState.LeftButton == ButtonState.Pressed && _oldMouseState.LeftButton == ButtonState.Released) button.activate(); return true; } else if (button.selected) { button.mouseOut(); } return false; }