示例#1
0
        public void Interact(GUIInput GUIInput)
        {
            if (Enabled)
            {
                HandleInteract(GUIInput);
            }

            pastKeyboardState = GUIInput.KeyboardState;
            pastMouseState    = GUIInput.MouseState;
        }
示例#2
0
        protected override void HandleInteract(GUIInput guiInput)
        {
            lock (elementLock)
            {
                for (int i = containedElements.Count - 1; i >= 0; i--)
                {
                    containedElements[i].Interact(guiInput);
                }

                if (consumeMouse && elementRectangle.Contains(guiInput.MouseState.Position))
                {
                    guiInput.MouseConsumed = true;
                }
            }
        }
示例#3
0
 protected override void HandleInteract(GUIInput guiInput)
 {
     if (!guiInput.MouseConsumed)
     {
         if (elementRectangle.Contains(guiInput.MouseState.Position))
         {
             if (!guiInput.LeftConsumed && guiInput.PastMouseState.LeftButton == ButtonState.Pressed && guiInput.MouseState.LeftButton == ButtonState.Released)
             {
                 this.ClickAction(this);
                 guiInput.LeftConsumed = true;
             }
             else if (!hovered)
             {
                 hovered = true;
                 this.HoverAction(this);
             }
             guiInput.MouseConsumed = true;
         }
         else
         {
             if (hovered)
             {
                 hovered = false;
                 this.UnHoverAction(this);
             }
         }
     }
     else
     {
         if (hovered)
         {
             hovered = false;
             this.UnHoverAction(this);
         }
     }
 }
示例#4
0
 protected override void HandleInteract(GUIInput guiInput)
 {
 }
示例#5
0
 protected abstract void HandleInteract(GUIInput GUIInput);