-
Notifications
You must be signed in to change notification settings - Fork 78
(API) Collapsible Category
Aaron H edited this page Dec 10, 2016
·
2 revisions
The collapsible category object can is essentially a panel that can be opened or closed and can contain one object as a child.
local panel = loveframes.Create("panel")
local colcat = loveframes.Create("collapsiblecategory")
colcat:SetObject(panel)
Called when the object is opened or closed
Arguments passed: self [object]
local frame = loveframes.Create("frame")
frame:SetName("Collapsible Category")
frame:SetSize(500, 300)
frame:CenterWithinArea(unpack(demo.centerarea))
local panel = loveframes.Create("panel")
panel:SetHeight(230)
local text = loveframes.Create("text", panel)
text:SetText("Collapsible Category")
local collapsiblecategory = loveframes.Create("collapsiblecategory", frame)
collapsiblecategory:SetPos(5, 30)
collapsiblecategory:SetSize(490, 265)
collapsiblecategory:SetText("Category 1")
collapsiblecategory:SetObject(panel)
text:Center()
Sets the object's text
object:SetText(text[string])
Gets the object's text
Returns 1 value: text [string]
local text = object:GetText()
Sets the object's object
local panel = loveframes.Create("panel")
object:SetObject(panel)
Gets the object's object
Returns 1 value: object [object]
local selfobject = object:GetObject()
Sets the height of the object when it is closed
object:SetClosedHeight(height[number])
Gets the height of the object when it is closed
Returns 1 value: closedheight [number]
local closedheight = object:GetClosedHeight()
Sets whether the object is open or not
object:SetOpen(open[boolean])
Gets whether the object is open or not
Returns 1 value: open [boolean]
local open = object:GetOpen()