|
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.Table
com.badlogic.gdx.scenes.scene2d.ui.Window
public class Window
A table that can be dragged and act as a modal window. The top padding is used as the window's title height.
The preferred size of a window is the preferred size of the title text and the children as layed out by the table. After adding
children to the window, it can be convenient to call WidgetGroup.pack()
to size the window to the size of the children.
Nested Class Summary | |
---|---|
static class |
Window.WindowStyle
The style for a window, see Window . |
Constructor Summary | |
---|---|
Window(java.lang.String title,
Skin skin)
|
|
Window(java.lang.String title,
Skin skin,
java.lang.String styleName)
|
|
Window(java.lang.String title,
Window.WindowStyle style)
|
Method Summary | |
---|---|
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. |
protected void |
drawBackground(SpriteBatch batch,
float parentAlpha)
Called to draw the background, before clipping is applied (if enabled). |
float |
getPrefWidth()
|
Window.WindowStyle |
getStyle()
Returns the window's style. |
java.lang.String |
getTitle()
|
Actor |
hit(float x,
float y,
boolean touchable)
Returns the deepest actor that contains the specified point and is touchable and
visible , or null if no actor was hit. |
boolean |
isDragging()
|
void |
setKeepWithinStage(boolean keepWithinStage)
|
void |
setModal(boolean isModal)
|
void |
setMovable(boolean isMovable)
|
void |
setStyle(Window.WindowStyle style)
|
void |
setTitle(java.lang.String title)
|
void |
setTitleAlignment(int titleAlignment)
|
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Table |
---|
add, add, add, add, add, add, align, bottom, center, clear, columnDefaults, debug, debug, debugCell, debugTable, debugWidget, defaults, drawDebug, getAlign, getBackground, getCell, getCells, getDebug, getMinHeight, getMinWidth, getPadBottom, getPadBottomValue, getPadLeft, getPadLeftValue, getPadRight, getPadRightValue, getPadTop, getPadTopValue, getPadX, getPadY, getPrefHeight, getRow, invalidate, layout, left, pad, pad, padBottom, padLeft, padRight, padTop, reset, right, row, setBackground, setBackground, setClip, setRound, setSkin, stack, top |
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup |
---|
childrenChanged, getMaxHeight, getMaxWidth, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, validate |
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Group |
---|
act, addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, computeTransform, drawChildren, findActor, getChildren, isTransform, localToDescendantCoordinates, removeActor, resetTransform, setCullingArea, setStage, setTransform, swapActor, swapActor |
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor |
---|
addAction, addCaptureListener, addListener, clearActions, clipBegin, clipBegin, clipEnd, fire, getActions, getCaptureListeners, getColor, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getWidth, getX, getY, getZIndex, hasParent, isAscendantOf, isDescendantOf, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, notify, parentToLocalCoordinates, remove, removeAction, removeCaptureListener, removeListener, rotate, scale, scale, screenToLocalCoordinates, setBounds, setColor, setColor, setHeight, setName, setOrigin, setOriginX, setOriginY, setParent, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setVisible, setWidth, setX, setY, setZIndex, size, size, stageToLocalCoordinates, toBack, toFront, toString, translate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Window(java.lang.String title, Skin skin)
public Window(java.lang.String title, Skin skin, java.lang.String styleName)
public Window(java.lang.String title, Window.WindowStyle style)
Method Detail |
---|
public void setStyle(Window.WindowStyle style)
public Window.WindowStyle getStyle()
setStyle(WindowStyle)
is
called.
public void draw(SpriteBatch batch, float parentAlpha)
WidgetGroup
WidgetGroup.validate()
should be called to ensure the widget group is laid
out.
draw
in class Table
parentAlpha
- Should be multipied with the actor's alpha, allowing a parent's alpha to affect all children.protected void drawBackground(SpriteBatch batch, float parentAlpha)
Table
drawBackground
in class Table
public Actor hit(float x, float y, boolean touchable)
Actor
touchable
and
visible
, or null if no actor was hit. The point is specified in the actor's local coordinate system (0,0
is the bottom left of the actor and width,height is the upper right).
This method is used to delegate touchDown events. If this method returns null, touchDown will not occur.
The default implementation returns this actor if the point is within this actor's bounds.
hit
in class Table
touchable
- If true, the hit detection will respect the touchability
.Touchable
public void setTitle(java.lang.String title)
public java.lang.String getTitle()
public void setTitleAlignment(int titleAlignment)
titleAlignment
- Align
public void setMovable(boolean isMovable)
public void setModal(boolean isModal)
public void setKeepWithinStage(boolean keepWithinStage)
public boolean isDragging()
public float getPrefWidth()
getPrefWidth
in interface Layout
getPrefWidth
in class Table
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |