public void Interact(GUIInput GUIInput) { if (Enabled) { HandleInteract(GUIInput); } pastKeyboardState = GUIInput.KeyboardState; pastMouseState = GUIInput.MouseState; }
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; } } }
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); } } }
protected override void HandleInteract(GUIInput guiInput) { }
protected abstract void HandleInteract(GUIInput GUIInput);