ScrollPane
Namespace:FairyGUI
Source:Assets/Scripts/UI/ScrollPane.cs (line 10)
public class ScrollPane : EventDispatcher
Inheritance:EventDispatcher → ScrollPane
Inherited members
AddCapture, AddEventListener, BroadcastEvent, BubbleEvent, DispatchEvent, RemoveCapture, RemoveEventListener, RemoveEventListeners, hasEventListeners, isDispatching
Constructors
ScrollPane(GComponent)
public ScrollPane(GComponent owner);
| Parameter | Type | Description |
|---|---|---|
owner | GComponent |
Source:UI/ScrollPane.cs (line 92)
Fields
PULL_RATIO
public static float PULL_RATIO;
Source:UI/ScrollPane.cs (line 90)
TWEEN_TIME_DEFAULT
public static float TWEEN_TIME_DEFAULT;
Source:UI/ScrollPane.cs (line 89)
TWEEN_TIME_GO
public static float TWEEN_TIME_GO;
Source:UI/ScrollPane.cs (line 88)
Methods
CancelDragging()
public void CancelDragging();
当滚动面板处于拖拽滚动状态或即将进入拖拽状态时,可以调用此方法停止或禁止本次拖拽。
Source:UI/ScrollPane.cs (line 959)
Dispose()
public void Dispose();
Source:UI/ScrollPane.cs (line 242)
IsChildInView(GObject)
public bool IsChildInView(GObject obj);
| Parameter | Type | Description |
|---|---|---|
obj | GObject | obj must be the direct child of this container |
Source:UI/ScrollPane.cs (line 938)
LockFooter(int)
public void LockFooter(int size);
设置Footer固定显示。如果size为0,则取消固定显示。
| Parameter | Type | Description |
|---|---|---|
size | int |
Source:UI/ScrollPane.cs (line 994)
LockHeader(int)
public void LockHeader(int size);
设置Header固定显示。如果size为0,则取消固定显示。
| Parameter | Type | Description |
|---|---|---|
size | int | Header显示的大小 |
Source:UI/ScrollPane.cs (line 974)
ScrollBottom()
public void ScrollBottom();
Source:UI/ScrollPane.cs (line 736)
ScrollBottom(bool)
public void ScrollBottom(bool ani);
| Parameter | Type | Description |
|---|---|---|
ani | bool |
Source:UI/ScrollPane.cs (line 745)
ScrollDown()
public void ScrollDown();
Source:UI/ScrollPane.cs (line 774)
ScrollDown(float, bool)
public void ScrollDown(float ratio, bool ani);
| Parameter | Type | Description |
|---|---|---|
ratio | float | |
ani | bool |
Source:UI/ScrollPane.cs (line 784)
ScrollLeft()
public void ScrollLeft();
Source:UI/ScrollPane.cs (line 795)
ScrollLeft(float, bool)
public void ScrollLeft(float ratio, bool ani);
| Parameter | Type | Description |
|---|---|---|
ratio | float | |
ani | bool |
Source:UI/ScrollPane.cs (line 805)
ScrollRight()
public void ScrollRight();
Source:UI/ScrollPane.cs (line 816)
ScrollRight(float, bool)
public void ScrollRight(float ratio, bool ani);
| Parameter | Type | Description |
|---|---|---|
ratio | float | |
ani | bool |
Source:UI/ScrollPane.cs (line 826)
ScrollToView(GObject)
public void ScrollToView(GObject obj);
| Parameter | Type | Description |
|---|---|---|
obj | GObject | obj can be any object on stage, not limited to the direct child of this container. |
Source:UI/ScrollPane.cs (line 838)
ScrollToView(GObject, bool)
public void ScrollToView(GObject obj, bool ani);
| Parameter | Type | Description |
|---|---|---|
obj | GObject | obj can be any object on stage, not limited to the direct child of this container. |
ani | bool | If moving to target position with animation |
Source:UI/ScrollPane.cs (line 848)
ScrollToView(GObject, bool, bool)
public void ScrollToView(GObject obj, bool ani, bool setFirst);
| Parameter | Type | Description |
|---|---|---|
obj | GObject | obj can be any object on stage, not limited to the direct child of this container. |
ani | bool | If moving to target position with animation |
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/ScrollPane.cs (line 859)
ScrollToView(Rect, bool, bool)
public void ScrollToView(Rect rect, bool ani, bool setFirst);
| Parameter | Type | Description |
|---|---|---|
rect | Rect | Rect in local coordinates |
ani | bool | If moving to target position with animation |
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/ScrollPane.cs (line 877)
ScrollTop()
public void ScrollTop();
Source:UI/ScrollPane.cs (line 719)
ScrollTop(bool)
public void ScrollTop(bool ani);
| Parameter | Type | Description |
|---|---|---|
ani | bool |
Source:UI/ScrollPane.cs (line 728)
ScrollUp()
public void ScrollUp();
Source:UI/ScrollPane.cs (line 753)
ScrollUp(float, bool)
public void ScrollUp(float ratio, bool ani);
| Parameter | Type | Description |
|---|---|---|
ratio | float | |
ani | bool |
Source:UI/ScrollPane.cs (line 763)
SetCurrentPageX(int, bool)
public void SetCurrentPageX(int value, bool ani);
如果处于分页模式,可设置X轴的页码。
| Parameter | Type | Description |
|---|---|---|
value | int | |
ani | bool | 是否使用缓动到达目标。 |
Source:UI/ScrollPane.cs (line 587)
SetCurrentPageY(int, bool)
public void SetCurrentPageY(int value, bool ani);
如果处于分页模式,可设置Y轴的页码。
| Parameter | Type | Description |
|---|---|---|
value | int | |
ani | bool | 是否使用缓动到达目标。 |
Source:UI/ScrollPane.cs (line 631)
SetPercX(float, bool)
public void SetPercX(float value, bool ani);
设置当前X轴滚动位置百分比,0~1(包含)。
| Parameter | Type | Description |
|---|---|---|
value | float | |
ani | bool | 是否使用缓动到达目标。 |
Source:UI/ScrollPane.cs (line 454)
SetPercY(float, bool)
public void SetPercY(float value, bool ani);
设置当前Y轴滚动位置百分比,0~1(包含)。
| Parameter | Type | Description |
|---|---|---|
value | float | |
ani | bool | 是否使用缓动到达目标。 |
Source:UI/ScrollPane.cs (line 474)
SetPosX(float, bool)
public void SetPosX(float value, bool ani);
设置当前X轴滚动位置。
| Parameter | Type | Description |
|---|---|---|
value | float | |
ani | bool | 是否使用缓动到达目标。 |
Source:UI/ScrollPane.cs (line 494)
SetPosY(float, bool)
public void SetPosY(float value, bool ani);
设置当前Y轴滚动位置。
| Parameter | Type | Description |
|---|---|---|
value | float | |
ani | bool | 是否使用缓动到达目标。 |
Source:UI/ScrollPane.cs (line 523)
Setup(ByteBuffer)
public void Setup(ByteBuffer buffer);
| Parameter | Type | Description |
|---|---|---|
buffer | ByteBuffer |
Source:UI/ScrollPane.cs (line 124)
UpdateScrollBarVisible()
public void UpdateScrollBarVisible();
Source:UI/ScrollPane.cs (line 1775)
Properties
bouncebackEffect
public bool bouncebackEffect { get; set; }
滚动到达边缘时是否允许回弹效果。
Source:UI/ScrollPane.cs (line 340)
contentHeight
public float contentHeight { get; }
显示内容高度。
Source:UI/ScrollPane.cs (line 678)
contentWidth
public float contentWidth { get; }
显示内容宽度。
Source:UI/ScrollPane.cs (line 667)
currentPageX
public int currentPageX { get; set; }
如果处于分页模式,返回当前在X轴的页码。
Source:UI/ScrollPane.cs (line 557)
currentPageY
public int currentPageY { get; set; }
如果处于分页模式,返回当前在Y轴的页码。
Source:UI/ScrollPane.cs (line 601)
decelerationRate
public float decelerationRate { get; set; }
当处于惯性滚动时减速的速率。默认值是UIConfig.defaultScrollDecelerationRate。 越接近1,减速越慢,意味着滑动的时间和距离更长。
Source:UI/ScrollPane.cs (line 427)
draggingPane
public static ScrollPane draggingPane { get; private set; }
当前被拖拽的滚动面板。同一时间只能有一个在进行此操作。
Source:UI/ScrollPane.cs (line 15)
footer
public GComponent footer { get; }
Source:UI/ScrollPane.cs (line 332)
header
public GComponent header { get; }
Source:UI/ScrollPane.cs (line 324)
hzScrollBar
public GScrollBar hzScrollBar { get; }
Source:UI/ScrollPane.cs (line 308)
inertiaDisabled
public bool inertiaDisabled { get; set; }
是否允许惯性滚动。
Source:UI/ScrollPane.cs (line 358)
isBottomMost
public bool isBottomMost { get; }
返回当前滚动位置是否在最下边。
Source:UI/ScrollPane.cs (line 541)
isDragged
public bool isDragged { get; }
Source:UI/ScrollPane.cs (line 435)
isRightMost
public bool isRightMost { get; }
返回当前滚动位置是否在最右边。
Source:UI/ScrollPane.cs (line 549)
mouseWheelEnabled
public bool mouseWheelEnabled { get; set; }
是否允许使用鼠标滚轮进行滚动。
Source:UI/ScrollPane.cs (line 417)
onPullDownRelease
public EventListener onPullDownRelease { get; }
向下拉过上边缘后释放则派发该事件。
Source:UI/ScrollPane.cs (line 284)
onPullUpRelease
public EventListener onPullUpRelease { get; }
向上拉过下边缘后释放则派发该事件。
Source:UI/ScrollPane.cs (line 292)
onScroll
public EventListener onScroll { get; }
Dispatched when scrolling. 在滚动时派发该事件。
Source:UI/ScrollPane.cs (line 268)
onScrollEnd
public EventListener onScrollEnd { get; }
在滚动结束时派发该事件。
Source:UI/ScrollPane.cs (line 276)
owner
public GComponent owner { get; }
Source:UI/ScrollPane.cs (line 300)
pageController
public Controller pageController { get; set; }
Source:UI/ScrollPane.cs (line 408)
pageMode
public bool pageMode { get; set; }
是否页面滚动模式。
Source:UI/ScrollPane.cs (line 399)
percX
public float percX { get; set; }
当前X轴滚动位置百分比,0~1(包含)。
Source:UI/ScrollPane.cs (line 443)
percY
public float percY { get; set; }
当前Y轴滚动位置百分比,0~1(包含)。
Source:UI/ScrollPane.cs (line 463)
posX
public float posX { get; set; }
当前X轴滚动位置,值范围是viewWidth与contentWidth之差。
Source:UI/ScrollPane.cs (line 483)
posY
public float posY { get; set; }
当前Y轴滚动位置,值范围是viewHeight与contentHeight之差。
Source:UI/ScrollPane.cs (line 512)
scrollStep
public float scrollStep { get; set; }
当调用ScrollPane.scrollUp/Down/Left/Right时,或者点击滚动条的上下箭头时,滑动的距离。
Source:UI/ScrollPane.cs (line 376)
scrollingPosX
public float scrollingPosX { get; }
这个值与PosX不同在于,他反映的是实时位置,而PosX在有缓动过程的情况下只是终值。
Source:UI/ScrollPane.cs (line 645)
scrollingPosY
public float scrollingPosY { get; }
这个值与PosY不同在于,他反映的是实时位置,而PosY在有缓动过程的情况下只是终值。
Source:UI/ScrollPane.cs (line 656)
snapToItem
public bool snapToItem { get; set; }
滚动位置是否保持贴近在某个元件的边缘。
Source:UI/ScrollPane.cs (line 390)
softnessOnTopOrLeftSide
public bool softnessOnTopOrLeftSide { get; set; }
是否允许在左/上边缘显示虚化效果。
Source:UI/ScrollPane.cs (line 367)
touchEffect
public bool touchEffect { get; set; }
是否允许拖拽内容区域进行滚动。
Source:UI/ScrollPane.cs (line 349)
viewHeight
public float viewHeight { get; set; }
显示区域高度。
Source:UI/ScrollPane.cs (line 704)
viewWidth
public float viewWidth { get; set; }
显示区域宽度。
Source:UI/ScrollPane.cs (line 689)
vtScrollBar
public GScrollBar vtScrollBar { get; }
Source:UI/ScrollPane.cs (line 316)