Clone wiki

FlowGUI / Panel

Description

Panels can be used as containers for GUI elements. A panel is dragable by default and shows a titlebar with a close button on the top right. When you add GUI elements to a panel, you no longer need to add the GUI element to the GUI manager. The panel itself does need to be added to the GUI manager. See example map "Panel.map" for more information.

Functions

  • FG_Panel:Create() --Creates a new dropdown.
  • SetHasTitleBar(boolean) --True by default. Sets whether the titlebar should be enabled.
  • SetContextSnap(boolean) –True by default. Sets whether panels are snapped back to the context border if they are dragged outside the context.
  • GetHasTitleBar() -- Retrieves a boolean that indicates if the titlebar should be enabled.
  • SetAllowDragging(boolean) --True by default. Sets whether the panel can be dragged.
  • GetAllowDragging() -- Retrieves a boolean that indicates if the panel can be dragged.
  • SetTitleBarHeight( value) --Sets the height for the titlebar. The width of the titlebar is the same as the scale of the panel.
  • SetCloseButtonScale(Vec2() scale) --Sets the scale of the CloseButton.
  • GetCloseButtonScale() --Retrieves a vector2 of the scale of the close button.
  • AddElement( guiElement ) --Add a GUIelement to panel.
  • RemoveElement( guiElement) -- Remove a GUI element from the panel.
  • SetOnPanelCloseEvent(event) --Stores the function that needs to be executed when a the panel is closed. By default the panel disables the panel, but does not remove it.

Updated