The actor is sized to its preferred size. If the actor'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 actor is larger than the scroll pane.
The scroll pane's preferred size is that of the child actor. At this size, the child actor will not need to scroll, so the scroll pane is typically sized by ignoring the preferred size in one or both directions.
If the scroll pane contains widgets that respond to drag, a listener that calls Event#stop() in
touchDown can be added to the widgets to prevent the scroll
pane from panning when setScrollBarTouch(boolean) is true.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ScrollPane.
The style for a scroll pane, see |
| Modifier and Type | Field and Description |
|---|---|
| private Actor | |
| pack-priv final Rectangle | |
| private final Rectangle | |
| pack-priv float | |
| pack-priv float | |
| pack-priv boolean | |
| private boolean | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv int | |
| pack-priv float | |
| pack-priv float | |
| pack-priv float | |
| pack-priv float | |
| pack-priv boolean | |
| pack-priv boolean | |
| private ActorGestureListener | |
| pack-priv float | |
| pack-priv float | |
| private boolean | |
| private boolean | |
| pack-priv final Rectangle | |
| pack-priv final Rectangle | |
| pack-priv boolean | |
| pack-priv final Vector2 | |
| pack-priv float | |
| pack-priv float | |
| private float | |
| private float | |
| private float | |
| private boolean | |
| private boolean | |
| private boolean | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv boolean | |
| private ScrollPane. | |
| pack-priv boolean | |
| pack-priv boolean | |
| private boolean | |
| pack-priv float | |
| pack-priv float | |
| pack-priv float | |
| pack-priv float | |
| pack-priv final Rectangle | |
| pack-priv final Rectangle | |
| pack-priv boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | act(float delta)
Overrides com. Updates the actor based on time. |
| public void | addActor(Actor actor)
Overrides com.
Deprecated
ScrollPane may have only a single child.
Adds an actor as a child of this group, removing it from its previous parent. |
| public void | addActorAfter(Actor actorAfter, Actor actor)
Overrides com.
Deprecated
ScrollPane may have only a single child.
Adds an actor as a child of this group immediately after another child actor, removing it from its previous parent. |
| public void | addActorAt(int index, Actor actor)
Overrides com.
Deprecated
ScrollPane may have only a single child.
Adds an actor as a child of this group at a specific index, removing it from its previous parent. |
| public void | addActorBefore(Actor actorBefore, Actor actor)
Overrides com.
Deprecated
ScrollPane may have only a single child.
Adds an actor as a child of this group immediately before another child actor, removing it from its previous parent. |
| protected void | |
| protected void | |
| public void | |
| public void | cancelTouchFocus()
Cancels the stage's touch focus for all listeners except this scroll pane's flick scroll listener. |
| pack-priv void | |
| public void | draw(Batch batch, float parentAlpha)
Overrides com. If this method is overridden, the super method or |
| public void | drawDebug(ShapeRenderer shapes)
Overrides com. Draws this actor's debug lines if |
| protected void | drawScrollBars(Batch batch, float r, float g, float b, float a)
Renders the scrollbars after the children have been drawn. |
| public void | fling(float
Time in seconds for which you want to fling last. flingTime, float Velocity for horizontal direction. velocityX, float Velocity for vertical direction. velocityY)Generate fling gesture. |
| public Actor | |
| public boolean | |
| protected ActorGestureListener | |
| public float | |
| public float | |
| public float | |
| public float | |
| protected float | |
| protected float | |
| public float | |
| public float | |
| public float | |
| public float | |
| public float | |
| public float | |
| public float | |
| public float | |
| public float | |
| public float | |
| public float | |
| public ScrollPane. | getStyle()
Implements com. Returns the scroll pane's style. |
| public boolean | |
| public float | |
| public float | |
| public float | |
| public float | |
| public float | |
| public float | |
| public Actor | |
| public Actor | hit(float x, float y, boolean touchable)
Overrides com. If this method is overridden, the super method or |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | layout()
Overrides com. Implements com. Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child,
calls |
| public boolean | removeActor(Actor actor)
Overrides com. Removes an actor from this group and unfocuses it. |
| public boolean | removeActor(Actor actor, boolean unfocus)
Overrides com. Removes an actor from this group. |
| public Actor | removeActorAt(int index, boolean unfocus)
Overrides com. Removes an actor from this group. |
| public void | scrollTo(float x, float y, float width, float height)
Sets the scroll offset so the specified rectangle is fully in view, if possible. |
| public void | scrollTo(float x, float y, float width, float height, boolean centerHorizontal, boolean centerVertical)
Sets the scroll offset so the specified rectangle is fully in view, and optionally centered vertically and/or horizontally, if possible. |
| protected void | |
| protected void | |
| public void | |
| public void | setCancelTouchFocus(boolean cancelTouchFocus)
When true (default) and flick scrolling begins, |
| public void | |
| public void | setFadeScrollBars(boolean fadeScrollBars)
When true the scrollbars don't reduce the scrollable size and fade out after some time of not being used. |
| public void | |
| public void | |
| public void | setFlingTime(float flingTime)
For flick scroll, sets the amount of time in seconds that a fling will continue to scroll. |
| public void | setForceScroll(boolean x, boolean y)
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 void | setOverscroll(boolean overscrollX, boolean overscrollY)
For flick scroll, if true the actor can be scrolled slightly past its bounds and will animate back to its bounds when scrolling is stopped. |
| public void | setScrollBarPositions(boolean bottom, boolean right)
Set the position of the vertical and horizontal scroll bars. |
| public void | setScrollbarsOnTop(boolean scrollbarsOnTop)
When false (the default), the actor is clipped so it is not drawn under the scrollbars. |
| public void | setScrollbarsVisible(boolean visible)
Shows or hides the scrollbars for when using |
| public void | setScrollBarTouch(boolean scrollBarTouch)
When false, the scroll bars don't respond to touch or mouse events. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setSmoothScrolling(boolean smoothScrolling)
When true, the visual scroll position is transitioned to the actual position over time using
|
| public void | setStyle(ScrollPane.
Implements com. Set the current style of the actor |
| public void | |
| public void | setupOverscroll(float distance, float speedMin, float speedMax)
For flick scroll, sets the overscroll distance in pixels and the speed it returns to the actor's bounds in seconds. |
| public void | setVariableSizeKnobs(boolean variableSizeKnobs)
If true, the scroll knobs are sized based on |
| public void | |
| public void | |
| public void | |
| protected float | smoothScroll(float
The absolute difference between the visual scroll position and the actual position. difference, float Time in seconds since last frame. delta)Returns the amount to adjust the visual scroll position each frame. |
| private void | |
| public void | |
| protected void | |
| protected void |