Löve Frames - The Tooltip Object
Return to Index
Information
The tooltip object displays text when the mouse cursor hovers over an object it has been asigned to.
Example Use
local panel = loveframes.Create("panel") local tooltip = loveframes.Create("tooltip") tooltip:SetObject(panel) tooltip:SetPadding(10) tooltip:SetText("This is a panel object.")
Event Callbacks
The tooltip object has no unique event callbacks.
Methods
SetFollowCursor - Sets whether or not the object should follow the mouse cursor when it is visible
- Returns 1 value: follow_cursor [bool]
- Returns 1 value: follow_object [bool]
- Returns 1 value: object [object]
- Note: You can use color formatted tables of text with this method the same way you would with the text object.
- Returns 1 value: text [string]
- Note: Set to 0 to disable wrapping
- Returns 1 value: offset_x [number]
- Returns 1 value: offset_y [number]
- Returns 2 value: offset_x [number], offset_y [number]
- Returns 1 value: font [font]
object:SetFollowCursor(followcursor[boolean])GetFollowCursor - Gets whether or not the object should follow the mouse cursor when it is visible
- Returns 1 value: follow_cursor [bool]
local follow_cursor = object:GetFollowCursor()SetFollowObject - Sets whether or not the tooltip should follow it's assigned object
object:SetFollowObject(followobject[boolean])GetFollowObject - Gets whether or not the tooltip should follow it's assigned object
- Returns 1 value: follow_object [bool]
local follow_object = object:GetFollowObject()SetObject - 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])GetObject - Gets the tooltip's object
- Returns 1 value: object [object]
local object = object:GetObject()SetText - 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])GetText - Gets the objects text
- Returns 1 value: text [string]
object:GetText()SetTextMaxWidth - Sets the max width the object's text will be before wrapping itself.
- Note: Set to 0 to disable wrapping
object:SetTextMaxWidth(maxwidth[number])SetOffsetX - Set's the object's x offset
object:SetOffsetX(offset_x[number])GetOffsetX - Gets the object's x offset
- Returns 1 value: offset_x [number]
local offset_x = object:GetOffsetX()SetOffsetY - Set's the object's y offset
object:SetOffsetY(offset_y[number])GetOffsetY - Gets the object's y offset
- Returns 1 value: offset_y [number]
local offset_y = object:GetOffsetY()SetOffsets - Sets the object's x and y offsets
object:SetOffsets(xoffset[number], yoffset[number])GetOffsets - Gets the object's x and y offsets
- Returns 2 value: offset_x [number], offset_y [number]
local offset_x, offset_y = object:GetOffsets()SetPadding - Set's the object's padding
object:SetPadding(padding[number])SetFont - Set's the object's font
object:SetFont(font[font])GetFont - Gets the object's font
- Returns 1 value: font [font]
local font = object:GetFont()