Clone wiki

FlowGUI / Dropdown


Dropdown menus are used for displaying a list of keys and values where a player can choose for.


  • FG_Dropdown:Create() --Creates a new dropdown.
  • SetItemScale(Vec2() scale) --Set the scale for the dropdown items.
  • GetItemScale() --Returns the drawing scale of the dropdown items.
  • AddItem(key, textValue) --Adds a new item of the dropdown list. The key has to be unique and the textValue is the text you want the dropdown item to display.
  • GetValue() --Returns the currently selected text value.
  • GetKey() --Returns the currently selected key.
  • SetText() --Set the initial text for dropdown button.
  • GetText() --Returns the text of the dropdown.
  • SetTextPosition() --Set the text position for this element. Use the predefined text positions for anchoring text. There are 9 fixed text positions that can be used for labels. You can either use the positions name or the number:
    • FG_TextPosition.TopLeft = 0
    • FG_TextPosition.TopCenter = 1
    • FG_TextPosition.TopRight = 2
    • FG_TextPosition.CenterLeft = 3
    • FG_TextPosition.Center = 4
    • FG_TextPosition.CenterRight = 5
    • FG_TextPosition.BottomLeft = 6
    • FG_TextPosition.BottomCenter = 7
    • FG_TextPosition.BottomRight = 8
  • SetOnValueChangeEvent(function event) --Stores the function that needs to be executed when a dropdown item is being selected.