LavaUI docs

enum HoverState

Swift

enum HoverState

Which node the pointer is over.

Tracked as a single id rather than per-node flags so a move only ever invalidates when the hovered node changes — pointer motion arrives per pixel, and redrawing on every one of those would undo the frame gating.

One id for the whole process, not one per window, because the pointer is one thing: moving from window A into window B has to un-hover A's button, and nothing else reliably reports that. GLFW's cursor-leave would, but only for the window the pointer left — a pointer that jumps straight from one window to another still needs the arrival to do the work. So the scope that was current when the hover was set is remembered alongside it, and a cross-window move repaints both windows.

Sources/LavaUI/Focus.swift:518

Methods

static func clear()

Not documented.

Sources/LavaUI/Focus.swift:561

static func isHovered(_ id: NodeID) -> Bool

Not documented.

Sources/LavaUI/Focus.swift:528

static func register(_ id: NodeID, handler: @escaping (Bool) -> Void)

Not documented.

Sources/LavaUI/Focus.swift:530

@discardableResult static func set(_ id: NodeID?) -> Bool

Returns true when the hovered node actually changed.

Sources/LavaUI/Focus.swift:549

static func unregister(_ id: NodeID)

Not documented.

Sources/LavaUI/Focus.swift:534