Module GUIFrames
This module provides functions to create and manage GUI frames.
Usage:
local Frames = NGUI.Frames
Functions
Frames:Create (title) | Returns a newly created frame with the specified title. |
Frames:AddBehavior (fr, title) | Adds standard behaviors to a frame like draggable, no resize, and custom close button. |
Frames:Resize (fr) | Resizes the frame to a standard size based on screen dimensions. |
Frames:Unfocused (title) | Creates an unfocused frame, usually for background use. |
Frames:Input (title, acceptFunc, typeOfInput) | Creates a frame dedicated to input fields. |
Frames:Binder (title, command) | Creates a frame specifically for binding commands or actions. |
Frames:Rules (title, checkBoxes, acceptFunc) | Creates a rules editor frame with checkboxes for various options. |
Frames:AcceptDialogue (text, textYes, textNo, acceptFunc) | Creates a dialogue frame with accept and decline options. |
Frames:List (title) | Creates a frame containing a list derived from a specified source. |
Frames:ManyFields (text, tblFields, acceptFunc) | Creates a frame with multiple input fields. |
Functions
- Frames:Create (title)
-
Returns a newly created frame with the specified title.
Parameters:
- title string The title of the frame.
Returns:
-
frame Newly created frame.
- Frames:AddBehavior (fr, title)
-
Adds standard behaviors to a frame like draggable, no resize, and custom close button.
Parameters:
- fr framePanel The frame to which the behavior will be added.
- title string The title of the frame.
- Frames:Resize (fr)
-
Resizes the frame to a standard size based on screen dimensions.
Parameters:
- fr frame The frame to resize.
- Frames:Unfocused (title)
-
Creates an unfocused frame, usually for background use.
Parameters:
- title string The title of the frame.
Returns:
-
frame The newly created unfocused frame.
- Frames:Input (title, acceptFunc, typeOfInput)
-
Creates a frame dedicated to input fields.
Parameters:
- title string The title for the input field.
- acceptFunc function The function to call on input accept.
- typeOfInput string Specifies the type of input.
Returns:
-
frame The frame containing the input.
- Frames:Binder (title, command)
-
Creates a frame specifically for binding commands or actions.
Parameters:
- title string The title of the frame.
- command string The command to bind.
Returns:
-
frame, binder The frame and the binder panel.
- Frames:Rules (title, checkBoxes, acceptFunc)
-
Creates a rules editor frame with checkboxes for various options.
Parameters:
- title string The title of the rules editor.
- checkBoxes table A table of checkboxes to include.
- acceptFunc function The function to call when changes are accepted.
Returns:
-
frame The rules editor frame.
- Frames:AcceptDialogue (text, textYes, textNo, acceptFunc)
-
Creates a dialogue frame with accept and decline options.
Parameters:
- text string The text to display in the dialogue.
- textYes string The text for the accept button.
- textNo string The text for the decline button.
- acceptFunc function The function to execute on accept.
Returns:
-
frame The dialogue frame.
- Frames:List (title)
-
Creates a frame containing a list derived from a specified source.
Parameters:
- title any The title of the list frame.
Returns:
-
frame The frame containing the list.
- Frames:ManyFields (text, tblFields, acceptFunc)
-
Creates a frame with multiple input fields.
Parameters:
- text any The title or main text for the frame.
- tblFields any The table of fields for inputs.
- acceptFunc any The function to call when inputs are accepted.
Returns:
-
frame, inputs The frame and the collection of inputs.