Hi guys! Before I start, I wan’t to tell you something:
1- My grammar is bad
2- I may not explain properly things, since this is my first text tutorial
Thanks to Lightning_Game27 for making a suggestion to add video demonstration
Ok thats it.
–
ToolTip Texts for GUIs
So, I’ve packed up this code in a model called “EZ ToolTips” to make your life easy.
But, I know that if you doesn’t clicked EZ ToolTips, you wanna do it yourself.
First of all, I will make a reusable script for any GUI, this means that you can duplicate it in other GUIs and it will work.
So, start by making a simple local script, and make a name for it. In this case, I wanna call it “PlaceholderScript”. After, inside this script, add a TextLabel, and name it. I’m calling it “Placeholder”, since this will be our Placeholder Text.
Scripting
Now, open your Local Script, and type something like that:
local text="This is a great placeholder text" -- The text that we will be using on your Placeholder
local mode="Middle" -- I wanna make 3 modes:
-- Middle: Sets the placeholder in the middle
-- Up: Sets the placeholder in the up
-- Down: Sets the placeholder in the down.
-- Now, lets go for the real scripting
script.Parent.MouseEnter:Connect(function() -- Mouse Enter = trigger this
local placeholder = script.Placeholder -- Remember the name you inserted on!
placeholder.Visible = true -- Is this Visible?
placeholder.Parent = script.Parent -- OMG, placeholder is visible
placeholder = script.Parent.Placeholder
placeholder.Text = text
if mode == "Middle" then
placeholder.Position=UDim2.new(0,0,0.25,0) -- This is the middle of the frame or object.
end
if mode == "Up" then
placeholder.Position=UDim2.new(0,0,-0.37,0) -- This is the up of the frame or object.
end
if mode == "Down" then
placeholder.Position=UDim2.new(0,0,0.88,0) -- The down of a object
end
end)
-- Congractulations warrior, you passed the summon part, but now the disappear part
script.Parent.MouseLeave:Connect(function() -- When mouse leaves the box, this will trigger
local placeholder = script.Parent.Placeholder -- Always remember your placeholder name
placeholder.Visible = false -- It can't be visible
placeholder.Parent = script -- Now, we reset placeholder.
end)
Now we made it!
See how it looks like:
Middle:
robloxapp-20220422-0854290.wmv (1.3 MB)
Down:
robloxapp-20220422-0856579.wmv (1.3 MB)
Up:
robloxapp-20220422-0858300.wmv (2.0 MB)
–