Beispiel #1
0
 public ScreenManager(Engine game)
     : base(game)
 {
     TraceEnabled = false;
     _input = new InputState();
 }
Beispiel #2
0
        public virtual void HandleInput(InputState input)
        {
            if (input.MouseState.IsMouseIn(Position, Size))
            {
                _isHovered = true;

                if (!_playedHoverSound && HoverSound != null)
                {
                    HoverSound.Play();
                    _playedHoverSound = true;
                }

                if (input.LeftMouseClicked)
                {
                    OnClicked();
                }
            }
            else
            {
                _isHovered = false;
                _playedHoverSound = false;
            }
        }