User:NXTBoy/Sandbox
Alternative to RbxGui#The_API. Better? Worse?
CreateSlider
CreateSlider(steps, width, position)
Parameters:
number | steps | The number of different positions the slider can be in along the bar |
number | width | Width in pixels of the slider |
UDim2 | position | The location to place the slider gui in |
Returns:
Frame | sliderGui | The container of the entire slider gui |
IntValue | sliderPosition | Holds the current value of the step the slider is on - readable and writable |
Returns 2 objects, (sliderGui, sliderPosition). 'sliderGui' is a frame that contains the entire slider gui. 'sliderPosition' is an IntValue whose current value specifies the specific step the slider is currently on (This value can be modified by a script, and the slider with adjust position). The 'steps' argument specifies how many different positions the slider can hold along the bar. 'width' specifies in pixels how wide the bar should be (modifiable afterwards if desired). 'position' argument should be a UDim2 for slider gui positioning.
CreateScrollingFrame
CreateScrollingFrame(orderList, style)
Parameters:
table | orderList | |
string | style |
Returns:
Frame | scrollFrame | |
ImageButton | scrollUpButton | |
ImageButton | scrollDownButton | |
function | recalculateFunction |
Returns 4 objects, (scrollFrame, scrollUpButton, scrollDownButton, recalculateFunction). 'scrollFrame' can be filled with GuiObjects. It will lay them out and allow scrollUpButton/scrollDownButton to interact with them. orderList is an optional argument (and specifies the order to layout the children. Without orderlist, it uses the children order) style is also optional, and allows for a 'grid' styling if style is passed 'grid' as a string. recalculateFunction can be called when a relayout is needed (when orderList changes, or when scrollFrame size changes).
AutoTruncateTextObject
AutoTruncateTextObject(textLabelToAutoTruncate)
Parameters:
TextLabel | textLabelToAutoTruncate |
Returns:
TextLabel | autoTruncatingTextLabel | |
Function | changeText | A function that can be used to change the text, taking a string as an argument. |
Returns 2 objects, (autoTruncatingTextLabel, changeText). The 'textLabelToAutoTruncate' input is modified to automatically truncate text (with ellipsis), if it gets too small to fit.
CreateScrollingFrame
CreateScrollingFrame(orderList, style)
Parameters:
table | orderList | |
string | style |
Returns:
Frame | scrollFrame | |
ImageButton | scrollUpButton | |
ImageButton | scrollDownButton | |
function | recalculateFunction |
Returns 4 objects, (scrollFrame, scrollUpButton, scrollDownButton, recalculateFunction). 'scrollFrame' can be filled with GuiObjects. It will lay them out and allow scrollUpButton/scrollDownButton to interact with them. orderList is an optional argument (and specifies the order to layout the children. Without orderlist, it uses the children order) style is also optional, and allows for a 'grid' styling if style is passed 'grid' as a string. recalculateFunction can be called when a relayout is needed (when orderList changes, or when scrollFrame size changes).
GetFontHeight
GetFontHeight(font, fontSize)
Parameters:
Font | font | |
FontSize | fontSize |
Returns:
number | pixelSize |
Returns the vertical size in pixels of the given font + fontSize.
CreateStyledMessageDialog
CreateStyledMessageDialog(title, message, style, buttons)
Parameters:
string | title | |
string | message | |
string | style | |
table | buttons |
Returns:
Instance | messageContainer |
Returns a gui object of a message box with 'title' and 'message' as passed in. 'buttons' input is an array of Tables contains a 'Text' and 'Function' field for the text/callback of each button, 'style' is a string, either 'Error', 'Notify' or 'Confirm'.
CreateMessageDialog
CreateMessageDialog(title, message, buttons)
Parameters:
string | title | |
string | message | |
table | buttons |
Returns:
Instance | messageContainer |
Returns a gui object of a message box with 'title' and 'message' as passed in. 'buttons' input is an array of tables that contains a 'Text' and 'Function' field for the text/callback of each button.
CreateDropDownMenu
CreateDropDownMenu(items, onItemSelected)
Parameters:
table | items | |
function | onItemSelected |
Returns:
Instance | guiContainer | |
function | updateSelection |
First argument should be a table full of strings that will populate menu. Second argument should be a function that takes one argument, and is called when a user selects a new object in the drop down menu. Returns 2 results, a gui container to the gui object and a 'updateSelection' function for external updating. The container is a drop-down-box created around a list of items.
CreatePropertyDropDownMenu
CreatePropertyDropDownMenu(descendant, propertyName, enumType)
Parameters:
Instance | descendant | |
string | propertyName | |
Enum | enumType |
Returns:
Instance | guiContainer |
returns a container with a drop-down-box that is linked to the 'property' field of 'instance' which is of type 'enumType'.