Skip to content

Interact ​

Interaction state as read-only boolean nodes (hover, press, selected, focused) and the hit tests pointIn, sunk and covered. Available as Flux.Interact.

luau
local hovered = Flux.Interact.hover(button)

Types ​

HoverOptions type ​

luau
type HoverOptions = {
	-- Only guis outside the object cover it: a row, a card or a scrolling area stays hovered over its own buttons.
	within: boolean?,
}

Functions ​

pointIn ​

luau
Interact.pointIn(x: number, y: number, object: GuiObject): boolean

Whether the point (x, y) lies within object's absolute bounds (inclusive, ignoring rotation). Coordinates are inset-relative, matching InputObject.Position and AbsolutePosition.

Open Documentation

sunk ​

luau
Interact.sunk(x: number, y: number, object: GuiObject, token: any?): boolean

Whether input at (x, y) would be claimed by an Active or input-sinking gui rendered above object, e.g. dropping a hover state while a floating menu covers the control. Outside a BasePlayerGui (a plugin dock, a SurfaceGui in workspace) nothing can claim the point, so this yields false. With token (the InputObject), the hit test is asked once per input per point, however many objects under the pointer ask.

Open Documentation

covered ​

luau
Interact.covered(x: number, y: number, object: GuiObject, token: any?): boolean

Whether input at (x, y) would be claimed by an Active or input-sinking gui above object that is not inside it: another panel, window or menu on top. Unlike sunk, the object's own buttons don't count, so a container (a scrolling list, a row list you drag to reorder, a window's body) still hears a press on its rows while nothing else covers it.

Open Documentation

hover ​

luau
Interact.hover(object: GuiObject, options: HoverOptions?): Graph.Node<boolean>

Whether a mouse pointer or touch contact is over object with no input-claiming gui drawn above it (see sunk), as a read-only boolean node. It is settled again every frame the pointer is in its bounds, so a menu or dialog opening over it, the pointer moving onto one, a scroll that carries it away, or it hiding drops the hover, and the cover closing over a still pointer brings it back. With { within = true }, only guis outside object cover it (see covered): a row or card stays hovered over its own buttons. Listening starts on call and stops when the node, the scope that created it, or object is destroyed, which settles it false.

Open Documentation

press ​

luau
Interact.press(object: GuiObject): Graph.Node<boolean>

Whether object is held down, as a read-only boolean node: from a left mouse button or touch that begins on it (unless a gui above claims the input), or ButtonA/Enter pressed while it is the GuiService.SelectedObject and no text box has focus, until that same input ends anywhere, so dragging off a control never leaves it stuck. It cleans up like hover.

Open Documentation

selected ​

luau
Interact.selected(object: GuiObject): Graph.Node<boolean>

Whether object is the GuiService.SelectedObject, the gui that gamepad or keyboard UI navigation currently highlights, as a read-only boolean node. It cleans up like hover.

Open Documentation

focused ​

luau
Interact.focused(textBox: TextBox): Graph.Node<boolean>

Whether textBox has keyboard focus, as a read-only boolean node seeded from IsFocused() and kept current by Focused and FocusLost. It cleans up like hover.

Open Documentation