跳到主要内容

GList

命名空间:FairyGUI
源码:Assets/Scripts/UI/GList.cs (行 25)

public class GList : GComponent

GList class.

继承:EventDispatcher → GObject → GComponent → GList

继承成员​

GComponent

__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

GObject

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

EventDispatcher

AddCapture, AddEventListener, BroadcastEvent, BubbleEvent, DispatchEvent, RemoveCapture, RemoveEventListener, RemoveEventListeners, hasEventListeners, isDispatching

构造函数​

GList()​

public GList();

源码:UI/GList.cs (行 95)

字段​

foldInvisibleItems​

public bool foldInvisibleItems;

如果true,当item不可见时自动折叠,否则依然占位

源码:UI/GList.cs (行 30)

itemProvider​

public ListItemProvider itemProvider;

Callback funtion to return item resource url.

源码:UI/GList.cs (行 46)

itemRenderer​

public ListItemRenderer itemRenderer;

Callback function when an item is needed to update its look.

源码:UI/GList.cs (行 41)

scrollItemToViewOnClick​

public bool scrollItemToViewOnClick;

源码:UI/GList.cs (行 51)

selectionMode​

public ListSelectionMode selectionMode;

List selection mode

源码:UI/GList.cs (行 36)

方法​

AddChildAt(GObject, int)​

override public GObject AddChildAt(GObject child, int index);
参数类型说明
childGObject
indexint

源码:UI/GList.cs (行 381)

AddItemFromPool()​

public GObject AddItemFromPool();

Add a item to list, same as GetFromPool+AddChild

返回值

Item object

源码:UI/GList.cs (行 356)

AddItemFromPool(string)​

public GObject AddItemFromPool(string url);

Add a item to list, same as GetFromPool+AddChild

返回值

Item object

参数类型说明
urlstringItem resource url

源码:UI/GList.cs (行 368)

AddSelection(int, bool)​

public void AddSelection(int index, bool scrollItToView);
参数类型说明
indexint
scrollItToViewbool

源码:UI/GList.cs (行 567)

ChildIndexToItemIndex(int)​

public int ChildIndexToItemIndex(int index);
参数类型说明
indexint

源码:UI/GList.cs (行 1366)

ClearSelection()​

public void ClearSelection();

源码:UI/GList.cs (行 626)

DispatchItemEvent(GObject, EventContext)​

virtual protected void DispatchItemEvent(GObject item, EventContext context);
参数类型说明
itemGObject
contextEventContext

源码:UI/GList.cs (行 1048)

Dispose()​

public override void Dispose();

源码:UI/GList.cs (行 111)

EnableArrowKeyNavigation(bool)​

public void EnableArrowKeyNavigation(bool enabled);
参数类型说明
enabledbool

源码:UI/GList.cs (行 808)

EnableSelectionFocusEvents(bool)​

public void EnableSelectionFocusEvents(bool enabled);
参数类型说明
enabledbool

源码:UI/GList.cs (行 773)

GetFirstChildInView()​

public override int GetFirstChildInView();

Get first child in view.

源码:UI/GList.cs (行 1361)

GetFromPool(string)​

public GObject GetFromPool(string url);
参数类型说明
urlstring

源码:UI/GList.cs (行 336)

GetSelection()​

public List<int> GetSelection();

源码:UI/GList.cs (行 516)

GetSelection(List<int>)​

public List<int> GetSelection(List<int> result);
参数类型说明
resultList<int>

源码:UI/GList.cs (行 525)

GetSnappingPositionWithDir(float, float, float, float)​

override public void GetSnappingPositionWithDir(ref float xValue, ref float yValue, float xDir, float yDir);
参数类型说明
xValuefloat
yValuefloat
xDirfloat
yDirfloat

源码:UI/GList.cs (行 2489)

HandleArrowKey(int)​

public int HandleArrowKey(int dir);
参数类型说明
dirint

源码:UI/GList.cs (行 858)

HandleControllerChanged(Controller)​

override public void HandleControllerChanged(Controller c);
参数类型说明
cController

源码:UI/GList.cs (行 1234)

HandleSizeChanged()​

override protected void HandleSizeChanged();

源码:UI/GList.cs (行 1225)

ItemIndexToChildIndex(int)​

public int ItemIndexToChildIndex(int index);
参数类型说明
indexint

源码:UI/GList.cs (行 1395)

ReadItems(ByteBuffer)​

virtual protected void ReadItems(ByteBuffer buffer);
参数类型说明
bufferByteBuffer

源码:UI/GList.cs (行 2975)

RefreshVirtualList()​

public void RefreshVirtualList();

源码:UI/GList.cs (行 1580)

RemoveChildAt(int, bool)​

override public GObject RemoveChildAt(int index, bool dispose);
参数类型说明
indexint
disposebool

源码:UI/GList.cs (行 403)

RemoveChildToPool(GObject)​

public void RemoveChildToPool(GObject child);
参数类型说明
childGObject

源码:UI/GList.cs (行 426)

RemoveChildToPoolAt(int)​

public void RemoveChildToPoolAt(int index);
参数类型说明
indexint

源码:UI/GList.cs (行 416)

RemoveChildrenToPool()​

public void RemoveChildrenToPool();

源码:UI/GList.cs (行 435)

RemoveChildrenToPool(int, int)​

public void RemoveChildrenToPool(int beginIndex, int endIndex);
参数类型说明
beginIndexint
endIndexint

源码:UI/GList.cs (行 445)

RemoveSelection(int)​

public void RemoveSelection(int index);
参数类型说明
indexint

源码:UI/GList.cs (行 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.

源码:UI/GList.cs (行 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.

参数类型说明
itemCountintItem count

源码:UI/GList.cs (行 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.

参数类型说明
itemCountint>Item count
minSizeintIf the result size if smaller than minSize, then use minSize.

源码:UI/GList.cs (行 1160)

ScrollToView(int)​

public void ScrollToView(int index);

Scroll the list to make an item with certain index visible.

参数类型说明
indexintItem index

源码:UI/GList.cs (行 1258)

ScrollToView(int, bool)​

public void ScrollToView(int index, bool ani);

Scroll the list to make an item with certain index visible.

参数类型说明
indexintItem index
aniboolTrue to scroll smoothly, othewise immdediately.

源码:UI/GList.cs (行 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.

参数类型说明
indexintItem index
aniboolTrue to scroll smoothly, othewise immdediately.
setFirstboolIf true, scroll to make the target on the top/left; If false, scroll to make the target any position in view.

源码:UI/GList.cs (行 1279)

SelectAll()​

public void SelectAll();

源码:UI/GList.cs (行 682)

SelectNone()​

public void SelectNone();

源码:UI/GList.cs (行 722)

SelectReverse()​

public void SelectReverse();

源码:UI/GList.cs (行 730)

SetVirtual()​

public void SetVirtual();

Set the list to be virtual list. 设置列表为虚拟列表模式。在虚拟列表模式下,列表不会为每一条列表数据创建一个实体对象,而是根据视口大小创建最小量的显示对象,然后通过itemRenderer指定的回调函数设置列表数据。 在虚拟模式下,你不能通过AddChild、RemoveChild等方式管理列表,只能通过设置numItems设置列表数据的长度。 如果要刷新列表,可以通过重新设置numItems,或者调用RefreshVirtualList完成。 ‘单行’或者‘单列’的列表布局可支持不等高的列表项目。 除了‘页面’的列表布局,其他布局均支持使用不同资源构建列表项目,你可以在itemProvider里返回。如果不提供,默认使用defaultItem。

源码:UI/GList.cs (行 1430)

SetVirtualAndLoop()​

public void SetVirtualAndLoop();

Set the list to be virtual list, and has loop behavior.

源码:UI/GList.cs (行 1443)

SetupItem(ByteBuffer, GObject)​

protected void SetupItem(ByteBuffer buffer, GObject obj);
参数类型说明
bufferByteBuffer
objGObject

源码:UI/GList.cs (行 3005)

Setup_AfterAdd(ByteBuffer, int)​

override public void Setup_AfterAdd(ByteBuffer buffer, int beginPos);
参数类型说明
bufferByteBuffer
beginPosint

源码:UI/GList.cs (行 3056)

Setup_BeforeAdd(ByteBuffer, int)​

override public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos);
参数类型说明
bufferByteBuffer
beginPosint

源码:UI/GList.cs (行 2919)

UpdateBounds()​

override protected void UpdateBounds();

源码:UI/GList.cs (行 2561)

属性​

align​

public AlignType align { get; set; }

源码:UI/GList.cs (行 252)

autoResizeItem​

public bool autoResizeItem { get; set; }

If the item will resize itself to fit the list width/height.

源码:UI/GList.cs (行 287)

columnCount​

public int columnCount { get; set; }

源码:UI/GList.cs (行 195)

columnGap​

public int columnGap { get; set; }

源码:UI/GList.cs (行 234)

defaultItem​

public string defaultItem { get; set; }

Resource url of the default item.

源码:UI/GList.cs (行 144)

defaultItemSize​

public Vector2 defaultItemSize { get; set; }

源码:UI/GList.cs (行 306)

isVirtual​

public bool isVirtual { get; }

源码:UI/GList.cs (行 1435)

itemPool​

public GObjectPool itemPool { get; }

源码:UI/GList.cs (行 326)

layout​

public ListLayoutType layout { get; set; }

List layout type.

源码:UI/GList.cs (行 156)

lineCount​

public int lineCount { get; set; }

源码:UI/GList.cs (行 174)

lineGap​

public int lineGap { get; set; }

源码:UI/GList.cs (行 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.

源码:UI/GList.cs (行 1508)

onClickItem​

public EventListener onClickItem { get; }

Dispatched when a list item being clicked.

源码:UI/GList.cs (行 128)

onRightClickItem​

public EventListener onRightClickItem { get; }

Dispatched when a list item being clicked with right button.

源码:UI/GList.cs (行 136)

selectedIndex​

public int selectedIndex { get; set; }

源码:UI/GList.cs (行 457)

selectionController​

public Controller selectionController { get; set; }

源码:UI/GList.cs (行 506)

touchItem​

public GObject touchItem { get; }

获取当前点击哪个item

源码:UI/GList.cs (行 1336)

verticalAlign​

public VertAlignType verticalAlign { get; set; }

源码:UI/GList.cs (行 270)