CreateScrollingFrame (Function)
CreateScrollingFrame( table orderList, string style ) | |
Returns | Frame scrollFrame, ImageButton scrollUpButton, ImageButton scrollDownButton, function recalculateFunction |
Description: | 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). |
The code below is used in the current backpack, and allows gear to be shown in a 2d grid style that the user can scroll through if the gear takes up more room than the frame allows.
</syntaxhighlight> |