PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

GuiButton

Show deprecated

GuiButton

Show deprecated

GuiLabel is an abstract class that inherits from GuiObject. It is the base class for ImageButton and TextButton. Objects of this type serve to be interactive, clickable user interface elements. It defines several properties for interaction behavior, namely GuiButton/AutoButtonColor and GuiButton/Modal, as well as a handful of events for mouse buttons (GuiButton/MouseButton1Click, GuiButton/MouseButton1Down, etc).

The most import ant event of a GuiButton is GuiButton/Activated, a multi-platform event that fires when the button is activated. When using a mouse, this means clicking the button and releasing with the cursor still over the UI object. For touch, the same applies but with a touch instead of button press. Finally, for gamepads, GuiButton/Activated fires if a GuiButton is selected when the A-button is pressed and released. In short, this event is very useful for multi-platform user interface programming as it provides a nice general interface for a single user input.

Properties

bool

AutoButtonColor

Determines whether the button automatically changes color when the mouse hovers over or clicks on it

bool

Modal

If true while the GUI element is visible, the mouse will not be locked unless the right mouse button is down.

bool

Selected

A boolean property which indicates whether the object has been selected

ButtonStyle

Style

Sets the style of the GuiButton based on a list of pre-determined styles.

Functions

Events

RBXScriptSignal

Activated ( Instance inputObject )

Fires when the button is activated

RBXScriptSignal

MouseButton1Click ( )

Fired when the mouse has fully left clicked the GUI button

RBXScriptSignal

MouseButton1Down ( int x , int y )

Fired when the mouse is in the left mouse down state on the GUI object

RBXScriptSignal

MouseButton1Up ( int x , int y )

Fired when the left mouse has released the GUI object

RBXScriptSignal

MouseButton2Click ( )

Fired when the mouse has fully right clicked the GUI button

RBXScriptSignal

MouseButton2Down ( int x , int y )

Fired when the mouse is in the right mouse down state on the GUI object

RBXScriptSignal

MouseButton2Up ( int x , int y )

Fired when the right mouse button has been released on a GUI Object