Hey! I know this topic has been posted once before, but nobody gave a clear answer + it was posted over a year ago.
So, I have an image button with a picture of a boat. I want to make it so that when I hover my mouse over the image button, a text label appears above the mouse with a description of the boat or whatever image I have.
I am quite new to scripting, but i’d quite like this feature in my game.
The display frame is the frame that you want to appear when you hover over the button, make sure it’s anchor point is 0.5, 0.5, and its position is 0, 0, 0, 0, and that it’s invisible.
Make sure the ScreenGui has IgnoreGUIInset set to true.
Paste this into the local script:
--//Services
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
--//Variables
local LocalPlayer = Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local ImageButton = script.Parent
local Display = ImageButton.Parent.Parent.Display
--//Controls
local isHovering = false
--//Functions
ImageButton.MouseEnter:Connect(function()
isHovering = true
end)
ImageButton.MouseLeave:Connect(function()
isHovering = false
end)
RunService.RenderStepped:Connect(function()
Display.Position = UDim2.fromOffset(Mouse.X, Mouse.Y)
Display.Visible = isHovering
end)