FairyGUI.GList
class FairyGUI.GList
Fields and Properties:
bool foldInvisibleItems
- Description: If set to true, invisible items will be automatically collapsed; otherwise, they will still occupy space.
FairyGUI.ListSelectionMode selectionMode
- Description: List selection mode
FairyGUI.ListItemRenderer itemRenderer
- Description: Callback function when an item is needed to update its look.
FairyGUI.ListItemProvider itemProvider
- Description: Callback funtion to return item resource url.
bool scrollItemToViewOnClick
- Description:
FairyGUI.EventListener onClickItem
- Description: Dispatched when a list item being clicked.
FairyGUI.EventListener onRightClickItem
- Description: Dispatched when a list item being clicked with right button.
string defaultItem
- Description: Resource url of the default item.
FairyGUI.ListLayoutType layout
- Description: List layout type.
int lineCount
- Description:
int columnCount
- Description:
int lineGap
- Description:
int columnGap
- Description:
FairyGUI.AlignType align
- Description:
FairyGUI.VertAlignType verticalAlign
- Description:
bool autoResizeItem
- Description: If the item will resize itself to fit the list width/height.
UnityEngine.Vector2 defaultItemSize
- Description:
FairyGUI.GObjectPool itemPool
- Description:
int selectedIndex
- Description:
FairyGUI.Controller selectionController
- Description:
FairyGUI.GObject touchItem
- Description: Gets the item that is currently being touched.
bool isVirtual
int numItems
- Description: Set the list item count. If the list is not virtual, specified number of items will be created. If the list is virtual, only items in view will be created.
Constructors:
FairyGUI.GList.New()
Methods:
void Dispose()
FairyGUI.GObject GetFromPool(string)
- Description:
- Parameter url:
- Return:
FairyGUI.GObject AddItemFromPool()
- Description: Add a item to list, same as GetFromPool+AddChild
- Return: Item object
FairyGUI.GObject AddItemFromPool(string)
- Description: Add a item to list, same as GetFromPool+AddChild
- Parameter url: Item resource url
- Return: Item object
FairyGUI.GObject AddChildAt(FairyGUI.GObject, int)
- Description:
- Parameter child:
- Parameter index:
- Return:
FairyGUI.GObject RemoveChildAt(int, bool)
- Description:
- Parameter index:
- Parameter dispose:
- Return:
void RemoveChildToPoolAt(int)
- Description:
- Parameter index:
void RemoveChildToPool(FairyGUI.GObject)
- Description:
- Parameter child:
void RemoveChildrenToPool()
- Description:
void RemoveChildrenToPool(int, int)
- Description:
- Parameter beginIndex:
- Parameter endIndex:
List<int> GetSelection()
- Description:
- Return:
List<int> GetSelection(List<int>)
- Description:
- Return:
void AddSelection(int, bool)
- Description:
- Parameter index:
- Parameter scrollItToView:
void RemoveSelection(int)
- Description:
- Parameter index:
void ClearSelection()
- Description:
void SelectAll()
- Description:
void SelectNone()
- Description:
void SelectReverse()
- Description:
void EnableSelectionFocusEvents(bool)
- Description:
- Parameter enabled:
void EnableArrowKeyNavigation(bool)
- Description:
int HandleArrowKey(int)
- Description:
- Parameter dir:
void ResizeToFit()
- Description: Resize to list size to fit specified item count. If list layout is single column or flow horizontally, the height will change to fit. If list layout is single row or flow vertically, the width will change to fit.
void ResizeToFit(int)
- Description: Resize to list size to fit specified item count. If list layout is single column or flow horizontally, the height will change to fit. If list layout is single row or flow vertically, the width will change to fit.
- Parameter itemCount: Item count
void ResizeToFit(int, int)
- Description: Resize to list size to fit specified item count. If list layout is single column or flow horizontally, the height will change to fit. If list layout is single row or flow vertically, the width will change to fit.
- Parameter itemCount: >Item count
- Parameter minSize: If the result size if smaller than minSize, then use minSize.
void HandleControllerChanged(FairyGUI.Controller)
void ScrollToView(int)
- Description: Scroll the list to make an item with certain index visible.
- Parameter index: Item index
void ScrollToView(int, bool)
- Description: Scroll the list to make an item with certain index visible.
- Parameter index: Item index
- Parameter ani: True to scroll smoothly, othewise immdediately.
void ScrollToView(int, bool, bool)
- Description: Scroll the list to make an item with certain index visible.
- Parameter index: Item index
- Parameter ani: True to scroll smoothly, othewise immdediately.
- Parameter setFirst: If true, scroll to make the target on the top/left; If false, scroll to make the target any position in view.
int GetFirstChildInView()
- Description: Get first child in view.
- Return:
int ChildIndexToItemIndex(int)
int ItemIndexToChildIndex(int)
void SetVirtual()
- Description: Set the list to be virtual list. In virtual list mode, the list does not create a physical object for each list data item. Instead, it creates the minimum number of display objects based on the viewport size and sets the list data through the callback function specified by itemRenderer. In virtual mode, you cannot manage the list through methods like AddChild or RemoveChild; you can only set the length of the list data by setting numItems. To refresh the list, you can reset numItems or call RefreshVirtualList. 'Single row' or 'single column' list layouts support lists with items of varying heights. All layouts except 'page' support using different resources to build list items, which you can return in the itemProvider. If not provided, the defaultItem will be used by default.
void SetVirtualAndLoop()
- Description: Set the list to be virtual list, and has loop behavior.
void RefreshVirtualList()
void GetSnappingPositionWithDir(ref float, ref float, float, float)