|
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.SplitPane
public class SplitPane
A container that divides two widgets either horizontally or vertically and allows the user to resize them. The child widgets are always sized to fill the half of the splitpane.
The preferred size of a splitpane is that of the child widgets and the size of the SplitPane.SplitPaneStyle.handle
. The widgets
are sized depending on the splitpane's size and the split position
.
Nested Class Summary | |
---|---|
static class |
SplitPane.SplitPaneStyle
The style for a splitpane, see SplitPane . |
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 | |
---|---|
SplitPane(Actor firstWidget,
Actor secondWidget,
boolean vertical,
Skin skin)
|
|
SplitPane(Actor firstWidget,
Actor secondWidget,
boolean vertical,
SplitPane.SplitPaneStyle style)
|
|
SplitPane(Actor firstWidget,
Actor secondWidget,
boolean vertical,
SplitPane.SplitPaneStyle style,
java.lang.String name)
|
|
SplitPane(Skin skin)
Creates a horizontal splitpane with no children. |
Method Summary | |
---|---|
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 |
getMinHeight()
|
float |
getMinWidth()
|
float |
getPrefHeight()
|
float |
getPrefWidth()
|
float |
getSplit()
|
SplitPane.SplitPaneStyle |
getStyle()
Returns the split pane's style. |
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 |
setFirstWidget(Actor widget)
|
void |
setMaxSplitAmount(float maxAmount)
|
void |
setMinSplitAmount(float minAmount)
|
void |
setSecondWidget(Actor widget)
|
void |
setSplitAmount(float split)
|
void |
setStyle(SplitPane.SplitPaneStyle style)
|
void |
setVertical(boolean vertical)
|
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 |
---|
act, addActorAfter, applyTransform, clear, disableDebugging, drawChild, drawChildren, enableDebugging, findActor, getActors, getGroups, hit, 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 SplitPane(Skin skin)
public SplitPane(Actor firstWidget, Actor secondWidget, boolean vertical, Skin skin)
firstWidget
- May be null.secondWidget
- May be null.public SplitPane(Actor firstWidget, Actor secondWidget, boolean vertical, SplitPane.SplitPaneStyle style)
firstWidget
- May be null.secondWidget
- May be null.public SplitPane(Actor firstWidget, Actor secondWidget, boolean vertical, SplitPane.SplitPaneStyle style, java.lang.String name)
firstWidget
- May be null.secondWidget
- May be null.Method Detail |
---|
public void setStyle(SplitPane.SplitPaneStyle style)
public SplitPane.SplitPaneStyle getStyle()
setStyle(SplitPaneStyle)
is called.
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 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 void setVertical(boolean vertical)
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 setSplitAmount(float split)
split
- The split amount between the min and max amount.public float getSplit()
public void setMinSplitAmount(float minAmount)
public void setMaxSplitAmount(float maxAmount)
public void setFirstWidget(Actor widget)
widget
- May be null.public void setSecondWidget(Actor widget)
widget
- May be null.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 Actor
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |