GuiButton

GuiButton : GuiObject

Overview

The GuiButtonis an abstract class that serves as the foundation for creating interactive, clickable user interface elements. It inherits from the GuiObject class and provides the core functionality needed for buttons. GuiButton is not directly instantiable but is extended by other classes like TextButton and ImageButton.\

Description

The GuiButton class is designed to enable interaction with GUI elements through various input methods. It provides properties, methods, and events that allow creators to implement clickable or tappable buttons in their user interfaces.

Properties

Methods

Events

Activated

The Activated event is triggered when the GuiButton is clicked or tapped by the user. This event allows developers to define custom behavior when a button is activated, enabling interactivity in the interface. You can connect this event to a function to execute specific actions upon user interaction.

Parameters

Code Samples

local ScreenGui = script.Parent
local GuiButton = ScreenGui.GuiButton

local function OnActivated()
    print("Activated!")
end
GuiButton.Activated:Connect(OnActivated)