ImageButton

ImageButton : GuiButton

Overview

The ImageButton class is a type of GUI object that displays an interactive image, allowing users to click or tap on it to trigger events. It combines the image-rendering capabilities of an ImageLabel with the interactive features of a GuiButton, making it a versatile component for creating visually engaging and interactive user interfaces.

Description

The ImageButton class is designed to function as a clickable or tappable image, providing both visual and interactive elements. It supports various properties and events that allow developers to customize its appearance and behavior.

Properties

Image

string

The content id of the image to display.

Code Samples

local ScreenGui = script.Parent
local ImageButton = ScreenGui.ImageButton

ImageButton.Image = "ovdrassetid://1234"

HoverImage

string

HoverImage is the content ID of the image to display when the user's cursor is hovering over the ImageButton.

Code Samples

local ScreenGui = script.Parent
local ImageButton = ScreenGui.ImageButton

ImageButton.HoverImage = "ovdrassetid://5678"

PressImage

string

PressImage defines the content ID of the image to display when the ImageButton is pressed or clicked.

Code Samples

local ScreenGui = script.Parent
local ImageButton = ScreenGui.ImageButton

ImageButton.PressImage = "ovdrassetid://9012"

ImageTransparency

number

ImageTransparency controls the transparency level of the displayed image, ranging from 0 to 1.

Code Samples

local ScreenGui = script.Parent
local ImageButton = ScreenGui.ImageButton

ImageButton.ImageTransparency = 0.5

ImageColor3

Color3

ImageColor3 adjusts the color tint of the displayed image using a Color3 value.

Code Samples

local ScreenGui = script.Parent
local ImageButton = ScreenGui.ImageButton

ImageButton.ImageColor3 = Color3.new(1, 0, 0) -- Red tint

ImageContent

Content

ImageContent specifies the complete content data of the primary image displayed by the ImageButton.

Code Samples

local ScreenGui = script.Parent
local ImageButton = ScreenGui.ImageButton

ImageButton.ImageContent = "Complete content data here"

HoverImageContent

Content

HoverImageContent defines the full content data of the image to show when the user's cursor hovers over the ImageButton.

Code Samples

local ScreenGui = script.Parent
local ImageButton = ScreenGui.ImageButton

ImageButton.HoverImageContent = "Hover content data here"

PressImageContent

Content

PressImageContent provides the full content data of the image to display while the ImageButton is being pressed.

Code Samples

local ScreenGui = script.Parent
local ImageButton = ScreenGui.ImageButton

ImageButton.PressImageContent = "Press content data here"

Methods

Events