forked from cyborgize/LoveFrames
-
Notifications
You must be signed in to change notification settings - Fork 15
(API) Tooltip
João Lopes edited this page Mar 6, 2019
·
1 revision
The tooltip object displays text when the mouse cursor hovers over an object it has been asigned to.
local panel = loveframes.Create("panel")
local tooltip = loveframes.Create("tooltip")
tooltip:SetObject(panel)
tooltip:SetPadding(10)
tooltip:SetText("This is a panel object.")
The tooltip object has no unique event callbacks.
Sets whether the object should follow the mouse cursor when it is visible or not
object:SetFollowCursor(followcursor[boolean])
Sets the object of the tooltip. The tooltip will make itself visible when the object specified is in a hover state.
object:SetObject(object[object])
Sets the object's text.
Note: You can use color formatted tables of text with this method the same way you would with the text object.
object:SetText(text[string or table])
Sets the max width the object's text will be before wrapping itself.
Note: Set to 0 to disable wrapping
object:SetTextMaxWidth(maxwidth[number])
Sets the object's x and y offsets
object:SetOffsets(xoffset[number], yoffset[number])
Set's the object's padding
object:SetPadding(padding[number])
Set's the object's font
object:SetFont(font[font])