Skip to content

InputCollector

requires layer

A top-layer component that collects all input in the current layer.

Usage

In order to create responsive components, it is essential that there is a certain amount of leniency in the way input is handled. The InputCollector component allows you to collect all input even when not hovering the component through a top-layer TextButton that sinks all input. This is especially useful for components like sliders, where the user might drag the mouse outside of the component.

This component does not provide any visual instances and cleans itself up when it's ReferenceObject is destroyed. As such, there is no need to assign it to a variable or clean it up manually.

Properties

ReferenceObject

The equivalent of the first parameter in a lot of other top-layer components. This is used to determine the layer to place the InputCollector in and the component to watch for destruction.

Type

luau

Code block has not loaded. An error may have occurred.

Visible

Whether the InputCollector is visible or not. Be careful with this, as this being true means all input on the layer is collected.

Type

luau

Code block has not loaded. An error may have occurred.

OnHover

Type

luau

Code block has not loaded. An error may have occurred.

OnMouseButton1Changed

Type

luau

Code block has not loaded. An error may have occurred.

OnClick

Type

luau

Code block has not loaded. An error may have occurred.

OnMouseMove

Type

luau

Code block has not loaded. An error may have occurred.

OnInputBegan

Type

luau

Code block has not loaded. An error may have occurred.

OnInputEnded

Type

luau

Code block has not loaded. An error may have occurred.

OnInputChanged

Type

luau

Code block has not loaded. An error may have occurred.