MouseHandler - LiruJ/GuiCookie GitHub Wiki

Overview

A MouseHandler component handles the mouse clicking and hovering over the element. This is mostly used to create buttons and other interactable elements.

XML Attributes

ClickType

Sets the ClickType of the MouseHandler between these two values:

  • OnMouseDown. The click events are invoked on the mouse button down.
  • OnMouseUp. The click events are invoked on the mouse button up, as long as the mouse is still hovered over the element.

Properties

AbsoluteMousePosition

Gets the absolute position of the mouse.

RelativeMousePosition

Gets the position of the mouse relative to the MouseHandler's element.

IsClickDragged

Is true if the mouse was clicked on the element and is being held down, regardless of mouse position.

IsLeftClicked

Is true if the mouse is over the element and the left click button is pressed. This is true for every frame that the mouse is over the element and clicked.

IsRightClicked

Is true if the mouse is over the element and the right click button is pressed. This is true for every frame that the mouse is over the element and clicked.

ClickType

The type of click detection to use.

Signals

MouseEntered

Is fired when the mouse enters the element's bounds.

MouseLeft

Is fired when the mouse leaves the element's bounds.

LeftClicked

Is fired when the mouse is over the element and the left click button is released/pressed depending on the ClickType.

RightClicked

Is fired when the mouse is over the element and the right click button is released/pressed depending on the ClickType.

⚠️ **GitHub.com Fallback** ⚠️