|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.Group
com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
com.badlogic.gdx.scenes.scene2d.ui.FlickScrollPane
public class FlickScrollPane
A group that scrolls a child widget by pressing and 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.
The scroll pane's preferred size is that of the child widget. At this size, the child widget will not need to scroll, so the scroll pane is typically sized by ignoring the preferred size in one or both directions.
Field Summary |
---|
Fields inherited from class com.badlogic.gdx.scenes.scene2d.Group |
---|
batchTransform, children, cullingArea, debug, debugTexture, groups, immutableChildren, immutableGroups, lastTouchedChild, localTransform, namesToActors, oldBatchTransform, point, transform, worldTransform |
Fields inherited from class com.badlogic.gdx.scenes.scene2d.Actor |
---|
actions, color, height, name, originX, originY, parent, rotation, scaleX, scaleY, stage, touchable, visible, width, x, y |
Constructor Summary | |
---|---|
FlickScrollPane()
|
|
FlickScrollPane(Actor widget)
|
|
FlickScrollPane(Actor widget,
java.lang.String name)
|
Method Summary | |
---|---|
void |
act(float delta)
|
void |
addActor(Actor actor)
Adds an Actor to this Group. |
void |
addActorAt(int index,
Actor actor)
Adds an Actor at the given index in the group. |
void |
addActorBefore(Actor actorBefore,
Actor actor)
Adds an Actor before the given Actor. |
void |
draw(SpriteBatch batch,
float parentAlpha)
If this method is overridden, the super method or WidgetGroup.validate() should be called to ensure the widget group is laid
out. |
float |
getMaxX()
Returns the maximum scroll value in the x direction. |
float |
getMaxY()
Returns the maximum scroll value in the y direction. |
float |
getMinHeight()
|
float |
getMinWidth()
|
float |
getPrefHeight()
|
float |
getPrefWidth()
|
float |
getScrollPercentX()
|
float |
getScrollPercentY()
|
float |
getScrollX()
Returns the x scroll position in pixels. |
float |
getScrollY()
Returns the y scroll position in pixels. |
float |
getVelocityX()
|
float |
getVelocityY()
|
Actor |
getWidget()
|
Actor |
hit(float x,
float y)
|
boolean |
isFlinging()
|
boolean |
isPanning()
|
void |
layout()
Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child and calls Layout.invalidate() and then Layout.validate() on each one. |
void |
removeActor(Actor actor)
Removes an Actor from this Group. |
void |
removeActorRecursive(Actor actor)
Removes an Actor from this Group recursively by checking if the Actor is in this group or one of its child-groups. |
void |
setClamp(boolean clamp)
Prevents scrolling out of the widget's bounds. |
void |
setEmptySpaceOnlyScroll(boolean emptySpaceOnlyScroll)
If true, only pressing and dragging on empty space in the FlickScrollPane will cause a scroll and widgets receive touch down events as normal. |
void |
setFlingTime(float flingTime)
Sets the amount of time in seconds that a fling will continue to scroll. |
void |
setForceOverscroll(boolean x,
boolean y)
Forces the enabling of overscrolling in a direction, even if the contents do not exceed the bounds in that direction. |
void |
setOverscroll(boolean overscroll)
If true, the widget can be scrolled slightly past its bounds and will animate back to its bounds when scrolling is stopped. |
void |
setScrollingDisabled(boolean x,
boolean y)
Disables scrolling in a direction. |
void |
setScrollPercentX(float percentX)
|
void |
setScrollPercentY(float percentY)
|
void |
setScrollX(float pixels)
|
void |
setScrollY(float pixels)
|
void |
setupOverscroll(float distance,
float speedMin,
float speedMax)
Sets the overscroll distance in pixels and the speed it returns to the widgets bounds in seconds. |
void |
setVelocityX(float velocityX)
|
void |
setVelocityY(float velocityY)
|
void |
setWidget(Actor widget)
Sets the Actor embedded in this scroll pane. |
boolean |
touchDown(float x,
float y,
int pointer)
|
void |
touchDragged(float x,
float y,
int pointer)
|
void |
touchUp(float x,
float y,
int pointer)
|
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup |
---|
childrenChanged, getMaxHeight, getMaxWidth, invalidate, invalidateHierarchy, needsLayout, pack, setFillParent, validate |
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Group |
---|
addActorAfter, applyTransform, clear, disableDebugging, drawChild, drawChildren, enableDebugging, findActor, getActors, getGroups, isDescendant, resetTransform, setCullingArea, sortChildren, swapActor, swapActor, toChildCoordinates, toLocalCoordinates, touchMoved, updateTransform |
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor |
---|
action, clearActions, getStage, isMarkedToRemove, keyDown, keyTyped, keyUp, markToRemove, remove, scrolled, toLocalCoordinates, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FlickScrollPane()
public FlickScrollPane(Actor widget)
widget
- May be null.public FlickScrollPane(Actor widget, java.lang.String name)
widget
- May be null.Method Detail |
---|
public void act(float delta)
act
in class Group
public void layout()
Layout
Layout.invalidate()
and then Layout.validate()
on each one. Usually this should not be called directly, instead
Layout.validate()
should be used.
layout
in interface Layout
layout
in class WidgetGroup
public void draw(SpriteBatch batch, float parentAlpha)
WidgetGroup
WidgetGroup.validate()
should be called to ensure the widget group is laid
out.
draw
in class WidgetGroup
batch
- the spritebatch to render withparentAlpha
- the parent's alpha value.public boolean touchDown(float x, float y, int pointer)
touchDown
in class Group
public void touchUp(float x, float y, int pointer)
touchUp
in class Actor
public void touchDragged(float x, float y, int pointer)
touchDragged
in class Actor
public void setScrollX(float pixels)
public float getScrollX()
public void setScrollY(float pixels)
public float getScrollY()
public float getScrollPercentX()
public void setScrollPercentX(float percentX)
public float getScrollPercentY()
public void setScrollPercentY(float percentY)
public float getMaxX()
public float getMaxY()
public void setWidget(Actor widget)
Actor
embedded in this scroll pane.
widget
- May be null.public Actor getWidget()
public void addActor(Actor actor)
Group
Actor
to this Group. The order Actors are added is reversed for hit testing.
addActor
in class Group
actor
- the Actorpublic void addActorAt(int index, Actor actor)
Group
Actor
at the given index in the group. The first Actor added will be at index 0 and so on. Throws an
IndexOutOfBoundsException in case the index is invalid.
addActorAt
in class Group
index
- the index to add the actor at.public void addActorBefore(Actor actorBefore, Actor actor)
Group
Actor
before the given Actor.
addActorBefore
in class Group
actorBefore
- the Actor to add the other actor in front ofactor
- the Actor to addpublic void removeActor(Actor actor)
Group
Actor
from this Group.
removeActor
in class Group
public void removeActorRecursive(Actor actor)
Group
Actor
from this Group recursively by checking if the Actor is in this group or one of its child-groups.
removeActorRecursive
in class Group
actor
- the Actorpublic boolean isPanning()
public boolean isFlinging()
public void setVelocityX(float velocityX)
public float getVelocityX()
public void setVelocityY(float velocityY)
public float getVelocityY()
public float getPrefWidth()
public float getPrefHeight()
public float getMinWidth()
getMinWidth
in interface Layout
getMinWidth
in class WidgetGroup
public float getMinHeight()
getMinHeight
in interface Layout
getMinHeight
in class WidgetGroup
public Actor hit(float x, float y)
hit
in class Group
public void setOverscroll(boolean overscroll)
public void setupOverscroll(float distance, float speedMin, float speedMax)
public void setForceOverscroll(boolean x, boolean y)
public void setFlingTime(float flingTime)
public void setEmptySpaceOnlyScroll(boolean emptySpaceOnlyScroll)
public void setScrollingDisabled(boolean x, boolean y)
public void setClamp(boolean clamp)
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |