コード例 #1
0
ファイル: UIComponent.cs プロジェクト: jensj12/MeesGame
        protected virtual void InterpretInput(InputHelper inputHelper)
        {
            bool mouseHovering = false;
            bool mouseDown     = false;
            bool mouseClicked  = false;

            if (AbsoluteRectangle.Contains(inputHelper.MousePosition))
            {
                mouseHovering = true;
                if (inputHelper.MouseLeftButtonDown())
                {
                    mouseDown = true;
                }
                if (inputHelper.MouseLeftButtonPressed())
                {
                    mouseClicked = true;
                    InputUser    = this;
                    InvokeClickEvent();
                }
            }

            MouseHovering = mouseHovering;
            MouseDown     = mouseDown;
            MouseClicked  = mouseClicked;
        }
コード例 #2
0
ファイル: SortedList.cs プロジェクト: jensj12/MeesGame
        public override void HandleInput(InputHelper inputHelper)
        {
            //Because the scrollbar is drawn first it needs to be the first object to have its input checked
            scrollBar.HandleInput(inputHelper);

            if (AbsoluteRectangle.Contains(inputHelper.MousePosition))
            {
                ChildOffset = ChildOffset - inputHelper.ScrollDelta;
            }

            base.HandleInput(inputHelper);
        }