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

            pastKeyboardState = GUIInput.KeyboardState;
            pastMouseState    = GUIInput.MouseState;
        }
Example #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;
                }
            }
        }
Example #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);
         }
     }
 }
Example #4
0
 protected override void HandleInteract(GUIInput guiInput)
 {
 }
Example #5
0
 protected abstract void HandleInteract(GUIInput GUIInput);