GList
Namespace:FairyGUI
Source:Assets/Scripts/UI/GList.cs (line 25)
public class GList : GComponent
GList class.
Inheritance:EventDispatcher → GObject → GComponent → GList
Inherited members
__onConstruct, __onDispose, _apexIndex, _boundsChanged, _childrenRenderOrder, _margin, _trackBounds, AddChild, AddController, CallLua, ChangeChildrenOrder, ConstructExtension, ConstructFromResource, ConstructFromXML, CreateDisplayObject, EnsureBoundsCorrect, GetChild, GetChildAt, GetChildByPath, GetChildInGroup, GetChildIndex, GetChildren, GetController, GetControllerAt, GetSnappingPosition, GetTransition, GetTransitionAt, GetVisibleChild, HandleGrayedChanged, InvalidateBatchingState, IsAncestorOf, IsChildInView, OnUpdate, RemoveChild, RemoveChildren, RemoveController, SetBounds, SetBoundsChangedFlag, SetChildIndex, SetChildIndexBefore, SetLuaPeer, SetupOverflow, SetupScroll, ShouldSnapToNext, SwapChildren, SwapChildrenAt, Controllers, Transitions, apexIndex, baseUserData, childrenRenderOrder, clipSoftness, container, fairyBatching, margin, mask, numChildren, onDrop, opaque, reversedMask, rootContainer, scrollPane, tabStopChildren, viewHeight, viewWidth
data, dragBounds, initHeight, initWidth, maxHeight, maxWidth, minHeight, minWidth, name, packageItem, sourceHeight, sourceWidth, underConstruct, AddRelation, Center, GetGear, GlobalToLocal, HandleAlphaChanged, HandlePositionChanged, HandleScaleChanged, HandleVisibleChanged, LocalToGlobal, LocalToRoot, MakeFullScreen, RemoveFromParent, RemoveRelation, RequestFocus, RootToLocal, SetHome, SetPivot, SetPosition, SetScale, SetSize, SetSizeDirectly, SetXY, StartDrag, StopDrag, TransformPoint, TransformRect, TweenFade, TweenMove, TweenMoveX, TweenMoveY, TweenResize, TweenRotate, TweenScale, TweenScaleX, TweenScaleY, UpdateGear, WorldToLocal, actualHeight, actualWidth, alpha, asButton, asComboBox, asCom, asGraph, asGroup, asImage, asLabel, asList, asLoader3D, asLoader, asMovieClip, asProgress, asRichTextField, asSlider, asTextField, asTextInput, asTree, blendMode, cursor, displayObject, dragStartPos, draggable, draggingObject, dragging, enabled, filter, focusable, focused, gameObjectName, gearLook, gearSize, gearXY, grayed, group, height, icon, id, inContainer, isDisposed, onAddedToStage, onClickLink, onClick, onDragEnd, onDragMove, onDragStart, onFocusIn, onFocusOut, onGearStop, onKeyDown, onPositionChanged, onRemovedFromStage, onRightClick, onRollOut, onRollOver, onSizeChanged, onStage, onTouchBegin, onTouchEnd, onTouchMove, parent, pivotAsAnchor, pivotX, pivotY, pivot, pixelSnapping, position, relations, resourceURL, root, rotationX, rotationY, rotation, scaleX, scaleY, scale, size, skew, sortingOrder, tabStop, text, tooltips, touchable, treeNode, visible, width, xMin, xy, x, yMin, y, z
AddCapture, AddEventListener, BroadcastEvent, BubbleEvent, DispatchEvent, RemoveCapture, RemoveEventListener, RemoveEventListeners, hasEventListeners, isDispatching
Constructors
GList()
public GList();
Source:UI/GList.cs (line 95)
Fields
foldInvisibleItems
public bool foldInvisibleItems;
如果true,当item不可见时自动折叠,否则依然占位
Source:UI/GList.cs (line 30)
itemProvider
public ListItemProvider itemProvider;
Callback funtion to return item resource url.
Source:UI/GList.cs (line 46)
itemRenderer
public ListItemRenderer itemRenderer;
Callback function when an item is needed to update its look.
Source:UI/GList.cs (line 41)
scrollItemToViewOnClick
public bool scrollItemToViewOnClick;
Source:UI/GList.cs (line 51)
selectionMode
public ListSelectionMode selectionMode;
List selection mode
Source:UI/GList.cs (line 36)
Methods
AddChildAt(GObject, int)
override public GObject AddChildAt(GObject child, int index);
| Parameter | Type | Description |
|---|---|---|
child | GObject | |
index | int |
Source:UI/GList.cs (line 381)
AddItemFromPool()
public GObject AddItemFromPool();
Add a item to list, same as GetFromPool+AddChild
returns
Item object
Source:UI/GList.cs (line 356)
AddItemFromPool(string)
public GObject AddItemFromPool(string url);
Add a item to list, same as GetFromPool+AddChild
returns
Item object
| Parameter | Type | Description |
|---|---|---|
url | string | Item resource url |
Source:UI/GList.cs (line 368)
AddSelection(int, bool)
public void AddSelection(int index, bool scrollItToView);
| Parameter | Type | Description |
|---|---|---|
index | int | |
scrollItToView | bool |
Source:UI/GList.cs (line 567)
ChildIndexToItemIndex(int)
public int ChildIndexToItemIndex(int index);
| Parameter | Type | Description |
|---|---|---|
index | int |
Source:UI/GList.cs (line 1366)
ClearSelection()
public void ClearSelection();
Source:UI/GList.cs (line 626)
DispatchItemEvent(GObject, EventContext)
virtual protected void DispatchItemEvent(GObject item, EventContext context);
| Parameter | Type | Description |
|---|---|---|
item | GObject | |
context | EventContext |
Source:UI/GList.cs (line 1048)
Dispose()
public override void Dispose();
Source:UI/GList.cs (line 111)
EnableArrowKeyNavigation(bool)
public void EnableArrowKeyNavigation(bool enabled);
| Parameter | Type | Description |
|---|---|---|
enabled | bool |
Source:UI/GList.cs (line 808)
EnableSelectionFocusEvents(bool)
public void EnableSelectionFocusEvents(bool enabled);
| Parameter | Type | Description |
|---|---|---|
enabled | bool |
Source:UI/GList.cs (line 773)
GetFirstChildInView()
public override int GetFirstChildInView();
Get first child in view.
Source:UI/GList.cs (line 1361)
GetFromPool(string)
public GObject GetFromPool(string url);
| Parameter | Type | Description |
|---|---|---|
url | string |
Source:UI/GList.cs (line 336)
GetSelection()
public List<int> GetSelection();
Source:UI/GList.cs (line 516)
GetSelection(List<int>)
public List<int> GetSelection(List<int> result);
| Parameter | Type | Description |
|---|---|---|
result | List<int> |
Source:UI/GList.cs (line 525)
GetSnappingPositionWithDir(float, float, float, float)
override public void GetSnappingPositionWithDir(ref float xValue, ref float yValue, float xDir, float yDir);
| Parameter | Type | Description |
|---|---|---|
xValue | float | |
yValue | float | |
xDir | float | |
yDir | float |
Source:UI/GList.cs (line 2489)
HandleArrowKey(int)
public int HandleArrowKey(int dir);
| Parameter | Type | Description |
|---|---|---|
dir | int |
Source:UI/GList.cs (line 858)
HandleControllerChanged(Controller)
override public void HandleControllerChanged(Controller c);
| Parameter | Type | Description |
|---|---|---|
c | Controller |
Source:UI/GList.cs (line 1234)
HandleSizeChanged()
override protected void HandleSizeChanged();
Source:UI/GList.cs (line 1225)
ItemIndexToChildIndex(int)
public int ItemIndexToChildIndex(int index);
| Parameter | Type | Description |
|---|---|---|
index | int |
Source:UI/GList.cs (line 1395)
ReadItems(ByteBuffer)
virtual protected void ReadItems(ByteBuffer buffer);
| Parameter | Type | Description |
|---|---|---|
buffer | ByteBuffer |
Source:UI/GList.cs (line 2975)
RefreshVirtualList()
public void RefreshVirtualList();
Source:UI/GList.cs (line 1580)
RemoveChildAt(int, bool)
override public GObject RemoveChildAt(int index, bool dispose);
| Parameter | Type | Description |
|---|---|---|
index | int | |
dispose | bool |
Source:UI/GList.cs (line 403)
RemoveChildToPool(GObject)
public void RemoveChildToPool(GObject child);
| Parameter | Type | Description |
|---|---|---|
child | GObject |
Source:UI/GList.cs (line 426)
RemoveChildToPoolAt(int)
public void RemoveChildToPoolAt(int index);
| Parameter | Type | Description |
|---|---|---|
index | int |
Source:UI/GList.cs (line 416)
RemoveChildrenToPool()
public void RemoveChildrenToPool();
Source:UI/GList.cs (line 435)
RemoveChildrenToPool(int, int)
public void RemoveChildrenToPool(int beginIndex, int endIndex);
| Parameter | Type | Description |
|---|---|---|
beginIndex | int | |
endIndex | int |
Source:UI/GList.cs (line 445)
RemoveSelection(int)
public void RemoveSelection(int index);
| Parameter | Type | Description |
|---|---|---|
index | int |
Source:UI/GList.cs (line 603)
ResizeToFit()
public void ResizeToFit();
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.
Source:UI/GList.cs (line 1137)
ResizeToFit(int)
public void ResizeToFit(int itemCount);
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 | Type | Description |
|---|---|---|
itemCount | int | Item count |
Source:UI/GList.cs (line 1148)
ResizeToFit(int, int)
public void ResizeToFit(int itemCount, int minSize);
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 | Type | Description |
|---|---|---|
itemCount | int | >Item count |
minSize | int | If the result size if smaller than minSize, then use minSize. |
Source:UI/GList.cs (line 1160)
ScrollToView(int)
public void ScrollToView(int index);
Scroll the list to make an item with certain index visible.
| Parameter | Type | Description |
|---|---|---|
index | int | Item index |
Source:UI/GList.cs (line 1258)
ScrollToView(int, bool)
public void ScrollToView(int index, bool ani);
Scroll the list to make an item with certain index visible.
| Parameter | Type | Description |
|---|---|---|
index | int | Item index |
ani | bool | True to scroll smoothly, othewise immdediately. |
Source:UI/GList.cs (line 1268)
ScrollToView(int, bool, bool)
public void ScrollToView(int index, bool ani, bool setFirst);
Scroll the list to make an item with certain index visible.
| Parameter | Type | Description |
|---|---|---|
index | int | Item index |
ani | bool | True to scroll smoothly, othewise immdediately. |
setFirst | bool | If true, scroll to make the target on the top/left; If false, scroll to make the target any position in view. |
Source:UI/GList.cs (line 1279)
SelectAll()
public void SelectAll();
Source:UI/GList.cs (line 682)
SelectNone()
public void SelectNone();
Source:UI/GList.cs (line 722)
SelectReverse()
public void SelectReverse();
Source:UI/GList.cs (line 730)
SetVirtual()
public void SetVirtual();
Set the list to be virtual list. 设置列表为虚拟列表模式。在虚拟列表模式下,列表不会为每一条列表数据创建一个实体对象,而是根据视口大小创建最小量的显示对象,然后通过itemRenderer指定的回调函数设置列表数据。 在虚拟模式下,你不能通过AddChild、RemoveChild等方式管理列表,只能通过设置numItems设置列表数据的长度。 如果要刷新列表,可以通过重新设置numItems,或者调用RefreshVirtualList完成。 ‘单行’或者‘单列’的列表布局可支持不等高的列表项目。 除了‘页面’的列表布局,其他布局均支持使用不同资源构建列表项目,你可以在itemProvider里返回。如果不提供,默认使用defaultItem。
Source:UI/GList.cs (line 1430)
SetVirtualAndLoop()
public void SetVirtualAndLoop();
Set the list to be virtual list, and has loop behavior.
Source:UI/GList.cs (line 1443)
SetupItem(ByteBuffer, GObject)
protected void SetupItem(ByteBuffer buffer, GObject obj);
| Parameter | Type | Description |
|---|---|---|
buffer | ByteBuffer | |
obj | GObject |
Source:UI/GList.cs (line 3005)
Setup_AfterAdd(ByteBuffer, int)
override public void Setup_AfterAdd(ByteBuffer buffer, int beginPos);
| Parameter | Type | Description |
|---|---|---|
buffer | ByteBuffer | |
beginPos | int |
Source:UI/GList.cs (line 3056)
Setup_BeforeAdd(ByteBuffer, int)
override public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos);
| Parameter | Type | Description |
|---|---|---|
buffer | ByteBuffer | |
beginPos | int |
Source:UI/GList.cs (line 2919)
UpdateBounds()
override protected void UpdateBounds();
Source:UI/GList.cs (line 2561)
Properties
align
public AlignType align { get; set; }
Source:UI/GList.cs (line 252)
autoResizeItem
public bool autoResizeItem { get; set; }
If the item will resize itself to fit the list width/height.
Source:UI/GList.cs (line 287)
columnCount
public int columnCount { get; set; }
Source:UI/GList.cs (line 195)
columnGap
public int columnGap { get; set; }
Source:UI/GList.cs (line 234)
defaultItem
public string defaultItem { get; set; }
Resource url of the default item.
Source:UI/GList.cs (line 144)
defaultItemSize
public Vector2 defaultItemSize { get; set; }
Source:UI/GList.cs (line 306)
isVirtual
public bool isVirtual { get; }
Source:UI/GList.cs (line 1435)
itemPool
public GObjectPool itemPool { get; }
Source:UI/GList.cs (line 326)
layout
public ListLayoutType layout { get; set; }
List layout type.
Source:UI/GList.cs (line 156)
lineCount
public int lineCount { get; set; }
Source:UI/GList.cs (line 174)
lineGap
public int lineGap { get; set; }
Source:UI/GList.cs (line 216)
numItems
public int numItems { get; set; }
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.
Source:UI/GList.cs (line 1508)
onClickItem
public EventListener onClickItem { get; }
Dispatched when a list item being clicked.
Source:UI/GList.cs (line 128)
onRightClickItem
public EventListener onRightClickItem { get; }
Dispatched when a list item being clicked with right button.
Source:UI/GList.cs (line 136)
selectedIndex
public int selectedIndex { get; set; }
Source:UI/GList.cs (line 457)
selectionController
public Controller selectionController { get; set; }
Source:UI/GList.cs (line 506)
touchItem
public GObject touchItem { get; }
获取当前点击哪个item
Source:UI/GList.cs (line 1336)
verticalAlign
public VertAlignType verticalAlign { get; set; }
Source:UI/GList.cs (line 270)