Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
        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();
                }
            }
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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();
            }
        }
Ejemplo n.º 6
0
        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();
            }
        }
Ejemplo n.º 7
0
        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;
        }