ComboBox

From Crumbled World Wiki

Example

function changeSetting(button)
	comboBox:setText(button:getTag())
end

comboBox = panel:add(ComboBox(PanelSize(size), items[1]))
local items = {"item1","item2","item3","item4"}

for i=1, #items do
	local itemButton = comboBox:addItem( Button(PanelSize(Vec2(-1,0.03)), items[i]) )
	itemButton:setTag(items[i])
	itemButton:addEventCallbackExecute(changeSetting)
end

Inheritance

Panel

Constructor

function description
ComboBox(PanelSize size)
ComboBox(PanelSize size, string text)

Functions

return function description
Text getText() Get text.
int getInt() Get text.
float getFloat() Get text.
setText(string text) Set text.
setText(Text text) Set text.
Panel addItem(Panel item) Add a drop down menu item.
removeItem(Panel item) Remove a drop down menu item.
clearItems() Removes all drop down menu items.
hideDropDownMenu()
showDropDownMenu()