C# Класс Nez.UI.ScrollPane

A group that scrolls a child widget using scrollbars and/or mouse or touch dragging. The widget is sized to its preferred size.If the widget's preferred width or height is less than the size of this scroll pane, it is set to the size of this scroll pane. Scrollbars appear when the widget is larger than the scroll pane. The scroll pane's preferred size is that of the child widget. At this size, the child widget will not need to scroll, so scroll pane is typically sized by ignoring the preferred size in one or both directions.
Наследование: Group, IInputListener
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_disableX bool

Открытые методы

Метод Описание
ScrollPane ( Element widget ) : System
ScrollPane ( Element widget, ScrollPaneStyle style ) : System
ScrollPane ( Element widget, Skin skin ) : System
ScrollPane ( Element widget, Skin skin, string styleName ) : System
cancel ( ) : void

If currently scrolling by tracking a touch down, stop scrolling.

debugRender ( Graphics graphics ) : void
draw ( Graphics graphics, float parentAlpha ) : void
fling ( float flingTime, float velocityX, float velocityY ) : void

Generate fling gesture

getMaxX ( ) : float

Returns the maximum scroll value in the x direction.

getMaxY ( ) : float

Returns the maximum scroll value in the y direction.

getScrollBarHeight ( ) : float
getScrollBarWidth ( ) : float
getScrollHeight ( ) : float

Returns the height of the scrolled viewport.

getScrollPercentX ( ) : float
getScrollPercentY ( ) : float
getScrollSpeed ( ) : float

Returns the x scroll speed

getScrollWidth ( ) : float

Returns the width of the scrolled viewport.

getScrollX ( ) : float

Returns the x scroll position in pixels, where 0 is the left of the scroll pane.

getScrollY ( ) : float

Returns the y scroll position in pixels, where 0 is the top of the scroll pane.

getStyle ( ) : ScrollPaneStyle

Returns the scroll pane's style. Modifying the returned style may not have an effect until {@link #setStyle(ScrollPaneStyle)} is called.

getUseNaturalScrolling ( ) : bool
getVariableSizeKnobs ( ) : bool
getVelocityX ( ) : float

Gets the flick scroll x velocity

getVelocityY ( ) : float

Gets the flick scroll y velocity

getVisualScrollPercentX ( ) : float
getVisualScrollPercentY ( ) : float
getVisualScrollX ( ) : float
getVisualScrollY ( ) : float
getWidget ( ) : Element

Returns the Element embedded in this scroll pane, or null

hit ( Vector2 point ) : Element
isBottomEdge ( ) : bool
isFlinging ( ) : bool
isForceScrollX ( ) : bool
isForceScrollY ( ) : bool
isLeftEdge ( ) : bool
isRightEdge ( ) : bool
isScrollX ( ) : bool

Returns true if the widget is larger than the scroll pane horizontally.

isScrollY ( ) : bool

Returns true if the widget is larger than the scroll pane vertically.

isScrollingDisabledX ( ) : bool
isScrollingDisabledY ( ) : bool
isTopEdge ( ) : bool
layout ( ) : void
scrollTo ( float x, float y, float width, float height ) : void

Sets the scroll offset so the specified rectangle is fully in view, if possible. Coordinates are in the scroll pane widget's coordinate system.

scrollTo ( float x, float y, float width, float height, bool centerHorizontal, bool centerVertical ) : void

Sets the scroll offset so the specified rectangle is fully in view, and optionally centered vertically and/or horizontally, if possible. Coordinates are in the scroll pane widget's coordinate system.

setClamp ( bool clamp ) : ScrollPane

For flick scroll, prevents scrolling out of the widget's bounds. Default is true.

setFadeScrollBars ( bool fadeScrollBars ) : ScrollPane

When true the scrollbars don't reduce the scrollable size and fade out after some time of not being used.

setFlingTime ( float flingTime ) : ScrollPane

For flick scroll, sets the amount of time in seconds that a fling will continue to scroll. Default is 1.

setForceScroll ( bool x, bool y ) : ScrollPane

Forces enabling scrollbars (for non-flick scroll) and overscrolling (for flick scroll) in a direction, even if the contents do not exceed the bounds in that direction.

setOverscroll ( bool overscrollX, bool overscrollY ) : ScrollPane

For flick scroll, if true the widget can be scrolled slightly past its bounds and will animate back to its bounds when scrolling is stopped. Default is true.

setScrollBarPositions ( bool bottom, bool right ) : ScrollPane

Set the position of the vertical and horizontal scroll bars.

setScrollPercentX ( float percentX ) : void
setScrollPercentY ( float percentY ) : void
setScrollSpeed ( float scrollSpeed ) : ScrollPane

sets the scroll speed when the mouse wheel is used to scroll the ScrollPane

setScrollX ( float pixelsX ) : ScrollPane

sets x scroll amount

setScrollY ( float pixelsY ) : ScrollPane

Called whenever the y scroll amount is changed

setScrollbarsOnTop ( bool scrollbarsOnTop ) : ScrollPane

When false (the default), the widget is clipped so it is not drawn under the scrollbars. When true, the widget is clipped to the entire scroll pane bounds and the scrollbars are drawn on top of the widget. If {@link #setFadeScrollBars(boolean)} is true, the scroll bars are always drawn on top.

setScrollingDisabled ( bool x, bool y ) : ScrollPane

Disables scrolling in a direction. The widget will be sized to the FlickScrollPane in the disabled direction.

setSmoothScrolling ( bool smoothScrolling ) : ScrollPane
setStyle ( ScrollPaneStyle style ) : ScrollPane
setUseNaturalScrolling ( bool useNaturalScrolling ) : ScrollPane

sets how the mouse wheel/trackpad operates. Natural scrolling moves the contents of a window the same direction as your fingers.

setVariableSizeKnobs ( bool variableSizeKnobs ) : ScrollPane

If true, the scroll knobs are sized based on getMaxX() or getMaxY(). If false, the scroll knobs are sized based on Drawable#getMinWidth() or Drawable#getMinHeight(). Default is true.

setVelocityX ( float velocityX ) : void
setVelocityY ( float velocityY ) : ScrollPane
setWidget ( Element widget ) : ScrollPane

Sets the {@link Element} embedded in this scroll pane

setupFadeScrollBars ( float fadeAlphaSeconds, float fadeDelaySeconds ) : ScrollPane
setupOverscroll ( float distance, float speedMin, float speedMax ) : ScrollPane

For flick scroll, sets the overscroll distance in pixels and the speed it returns to the widget's bounds in seconds. Default is 50, 30, 200.

updateVisualScroll ( ) : ScrollPane

Sets the visual scroll amount equal to the scroll amount. This can be used when setting the scroll amount without animating.

Защищенные методы

Метод Описание
setVisualScrollX ( float pixelsX ) : void

Called whenever the visual x scroll amount is changed

setVisualScrollY ( float pixelsY ) : void

Called whenever the visual y scroll amount is changed

update ( ) : void

Приватные методы

Метод Описание
IInputListener ( Vector2 mousePos ) : bool
IInputListener ( int mouseWheelDelta ) : bool
IInputListener ( ) : void
IInputListener ( Vector2 mousePos ) : void
clamp ( ) : void
resetFade ( ) : void

Описание методов

ScrollPane() публичный Метод

public ScrollPane ( Element widget ) : System
widget Element
Результат System

ScrollPane() публичный Метод

public ScrollPane ( Element widget, ScrollPaneStyle style ) : System
widget Element
style ScrollPaneStyle
Результат System

ScrollPane() публичный Метод

public ScrollPane ( Element widget, Skin skin ) : System
widget Element
skin Skin
Результат System

ScrollPane() публичный Метод

public ScrollPane ( Element widget, Skin skin, string styleName ) : System
widget Element
skin Skin
styleName string
Результат System

cancel() публичный Метод

If currently scrolling by tracking a touch down, stop scrolling.
public cancel ( ) : void
Результат void

debugRender() публичный Метод

public debugRender ( Graphics graphics ) : void
graphics Graphics
Результат void

draw() публичный Метод

public draw ( Graphics graphics, float parentAlpha ) : void
graphics Graphics
parentAlpha float
Результат void

fling() публичный Метод

Generate fling gesture
public fling ( float flingTime, float velocityX, float velocityY ) : void
flingTime float Fling time.
velocityX float Velocity x.
velocityY float Velocity y.
Результат void

getMaxX() публичный Метод

Returns the maximum scroll value in the x direction.
public getMaxX ( ) : float
Результат float

getMaxY() публичный Метод

Returns the maximum scroll value in the y direction.
public getMaxY ( ) : float
Результат float

getScrollBarHeight() публичный Метод

public getScrollBarHeight ( ) : float
Результат float

getScrollBarWidth() публичный Метод

public getScrollBarWidth ( ) : float
Результат float

getScrollHeight() публичный Метод

Returns the height of the scrolled viewport.
public getScrollHeight ( ) : float
Результат float

getScrollPercentX() публичный Метод

public getScrollPercentX ( ) : float
Результат float

getScrollPercentY() публичный Метод

public getScrollPercentY ( ) : float
Результат float

getScrollSpeed() публичный Метод

Returns the x scroll speed
public getScrollSpeed ( ) : float
Результат float

getScrollWidth() публичный Метод

Returns the width of the scrolled viewport.
public getScrollWidth ( ) : float
Результат float

getScrollX() публичный Метод

Returns the x scroll position in pixels, where 0 is the left of the scroll pane.
public getScrollX ( ) : float
Результат float

getScrollY() публичный Метод

Returns the y scroll position in pixels, where 0 is the top of the scroll pane.
public getScrollY ( ) : float
Результат float

getStyle() публичный Метод

Returns the scroll pane's style. Modifying the returned style may not have an effect until {@link #setStyle(ScrollPaneStyle)} is called.
public getStyle ( ) : ScrollPaneStyle
Результат ScrollPaneStyle

getUseNaturalScrolling() публичный Метод

public getUseNaturalScrolling ( ) : bool
Результат bool

getVariableSizeKnobs() публичный Метод

public getVariableSizeKnobs ( ) : bool
Результат bool

getVelocityX() публичный Метод

Gets the flick scroll x velocity
public getVelocityX ( ) : float
Результат float

getVelocityY() публичный Метод

Gets the flick scroll y velocity
public getVelocityY ( ) : float
Результат float

getVisualScrollPercentX() публичный Метод

public getVisualScrollPercentX ( ) : float
Результат float

getVisualScrollPercentY() публичный Метод

public getVisualScrollPercentY ( ) : float
Результат float

getVisualScrollX() публичный Метод

public getVisualScrollX ( ) : float
Результат float

getVisualScrollY() публичный Метод

public getVisualScrollY ( ) : float
Результат float

getWidget() публичный Метод

Returns the Element embedded in this scroll pane, or null
public getWidget ( ) : Element
Результат Element

hit() публичный Метод

public hit ( Vector2 point ) : Element
point Vector2
Результат Element

isBottomEdge() публичный Метод

public isBottomEdge ( ) : bool
Результат bool

isFlinging() публичный Метод

public isFlinging ( ) : bool
Результат bool

isForceScrollX() публичный Метод

public isForceScrollX ( ) : bool
Результат bool

isForceScrollY() публичный Метод

public isForceScrollY ( ) : bool
Результат bool

isLeftEdge() публичный Метод

public isLeftEdge ( ) : bool
Результат bool

isRightEdge() публичный Метод

public isRightEdge ( ) : bool
Результат bool

isScrollX() публичный Метод

Returns true if the widget is larger than the scroll pane horizontally.
public isScrollX ( ) : bool
Результат bool

isScrollY() публичный Метод

Returns true if the widget is larger than the scroll pane vertically.
public isScrollY ( ) : bool
Результат bool

isScrollingDisabledX() публичный Метод

public isScrollingDisabledX ( ) : bool
Результат bool

isScrollingDisabledY() публичный Метод

public isScrollingDisabledY ( ) : bool
Результат bool

isTopEdge() публичный Метод

public isTopEdge ( ) : bool
Результат bool

layout() публичный Метод

public layout ( ) : void
Результат void

scrollTo() публичный Метод

Sets the scroll offset so the specified rectangle is fully in view, if possible. Coordinates are in the scroll pane widget's coordinate system.
public scrollTo ( float x, float y, float width, float height ) : void
x float The x coordinate.
y float The y coordinate.
width float Width.
height float Height.
Результат void

scrollTo() публичный Метод

Sets the scroll offset so the specified rectangle is fully in view, and optionally centered vertically and/or horizontally, if possible. Coordinates are in the scroll pane widget's coordinate system.
public scrollTo ( float x, float y, float width, float height, bool centerHorizontal, bool centerVertical ) : void
x float The x coordinate.
y float The y coordinate.
width float Width.
height float Height.
centerHorizontal bool Center horizontal.
centerVertical bool Center vertical.
Результат void

setClamp() публичный Метод

For flick scroll, prevents scrolling out of the widget's bounds. Default is true.
public setClamp ( bool clamp ) : ScrollPane
clamp bool Clamp.
Результат ScrollPane

setFadeScrollBars() публичный Метод

When true the scrollbars don't reduce the scrollable size and fade out after some time of not being used.
public setFadeScrollBars ( bool fadeScrollBars ) : ScrollPane
fadeScrollBars bool Fade scroll bars.
Результат ScrollPane

setFlingTime() публичный Метод

For flick scroll, sets the amount of time in seconds that a fling will continue to scroll. Default is 1.
public setFlingTime ( float flingTime ) : ScrollPane
flingTime float Fling time.
Результат ScrollPane

setForceScroll() публичный Метод

Forces enabling scrollbars (for non-flick scroll) and overscrolling (for flick scroll) in a direction, even if the contents do not exceed the bounds in that direction.
public setForceScroll ( bool x, bool y ) : ScrollPane
x bool The x coordinate.
y bool The y coordinate.
Результат ScrollPane

setOverscroll() публичный Метод

For flick scroll, if true the widget can be scrolled slightly past its bounds and will animate back to its bounds when scrolling is stopped. Default is true.
public setOverscroll ( bool overscrollX, bool overscrollY ) : ScrollPane
overscrollX bool Overscroll x.
overscrollY bool Overscroll y.
Результат ScrollPane

setScrollBarPositions() публичный Метод

Set the position of the vertical and horizontal scroll bars.
public setScrollBarPositions ( bool bottom, bool right ) : ScrollPane
bottom bool Bottom.
right bool Right.
Результат ScrollPane

setScrollPercentX() публичный Метод

public setScrollPercentX ( float percentX ) : void
percentX float
Результат void

setScrollPercentY() публичный Метод

public setScrollPercentY ( float percentY ) : void
percentY float
Результат void

setScrollSpeed() публичный Метод

sets the scroll speed when the mouse wheel is used to scroll the ScrollPane
public setScrollSpeed ( float scrollSpeed ) : ScrollPane
scrollSpeed float Scroll speed.
Результат ScrollPane

setScrollX() публичный Метод

sets x scroll amount
public setScrollX ( float pixelsX ) : ScrollPane
pixelsX float Pixels x.
Результат ScrollPane

setScrollY() публичный Метод

Called whenever the y scroll amount is changed
public setScrollY ( float pixelsY ) : ScrollPane
pixelsY float Pixels y.
Результат ScrollPane

setScrollbarsOnTop() публичный Метод

When false (the default), the widget is clipped so it is not drawn under the scrollbars. When true, the widget is clipped to the entire scroll pane bounds and the scrollbars are drawn on top of the widget. If {@link #setFadeScrollBars(boolean)} is true, the scroll bars are always drawn on top.
public setScrollbarsOnTop ( bool scrollbarsOnTop ) : ScrollPane
scrollbarsOnTop bool Scrollbars on top.
Результат ScrollPane

setScrollingDisabled() публичный Метод

Disables scrolling in a direction. The widget will be sized to the FlickScrollPane in the disabled direction.
public setScrollingDisabled ( bool x, bool y ) : ScrollPane
x bool The x coordinate.
y bool The y coordinate.
Результат ScrollPane

setSmoothScrolling() публичный Метод

public setSmoothScrolling ( bool smoothScrolling ) : ScrollPane
smoothScrolling bool
Результат ScrollPane

setStyle() публичный Метод

public setStyle ( ScrollPaneStyle style ) : ScrollPane
style ScrollPaneStyle
Результат ScrollPane

setUseNaturalScrolling() публичный Метод

sets how the mouse wheel/trackpad operates. Natural scrolling moves the contents of a window the same direction as your fingers.
public setUseNaturalScrolling ( bool useNaturalScrolling ) : ScrollPane
useNaturalScrolling bool Use natural scrolling.
Результат ScrollPane

setVariableSizeKnobs() публичный Метод

If true, the scroll knobs are sized based on getMaxX() or getMaxY(). If false, the scroll knobs are sized based on Drawable#getMinWidth() or Drawable#getMinHeight(). Default is true.
public setVariableSizeKnobs ( bool variableSizeKnobs ) : ScrollPane
variableSizeKnobs bool Variable size knobs.
Результат ScrollPane

setVelocityX() публичный Метод

public setVelocityX ( float velocityX ) : void
velocityX float
Результат void

setVelocityY() публичный Метод

public setVelocityY ( float velocityY ) : ScrollPane
velocityY float
Результат ScrollPane

setVisualScrollX() защищенный Метод

Called whenever the visual x scroll amount is changed
protected setVisualScrollX ( float pixelsX ) : void
pixelsX float Pixels x.
Результат void

setVisualScrollY() защищенный Метод

Called whenever the visual y scroll amount is changed
protected setVisualScrollY ( float pixelsY ) : void
pixelsY float Pixels y.
Результат void

setWidget() публичный Метод

Sets the {@link Element} embedded in this scroll pane
public setWidget ( Element widget ) : ScrollPane
widget Element Widget.
Результат ScrollPane

setupFadeScrollBars() публичный Метод

public setupFadeScrollBars ( float fadeAlphaSeconds, float fadeDelaySeconds ) : ScrollPane
fadeAlphaSeconds float
fadeDelaySeconds float
Результат ScrollPane

setupOverscroll() публичный Метод

For flick scroll, sets the overscroll distance in pixels and the speed it returns to the widget's bounds in seconds. Default is 50, 30, 200.
public setupOverscroll ( float distance, float speedMin, float speedMax ) : ScrollPane
distance float Distance.
speedMin float Speed minimum.
speedMax float Speed max.
Результат ScrollPane

update() защищенный Метод

protected update ( ) : void
Результат void

updateVisualScroll() публичный Метод

Sets the visual scroll amount equal to the scroll amount. This can be used when setting the scroll amount without animating.
public updateVisualScroll ( ) : ScrollPane
Результат ScrollPane

Описание свойств

_disableX защищенное свойство

protected bool _disableX
Результат bool