public class Window extends Table
The preferred size of a window is the preferred size of the title text and the children as laid 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.
| Modifier and Type | Class and Description |
|---|---|
static class |
Window.WindowStyle
The style for a window, see
Window. |
Table.Debug, Table.DebugRect| Modifier and Type | Field and Description |
|---|---|
protected boolean |
dragging |
protected int |
edge |
backgroundBottom, backgroundLeft, backgroundRight, backgroundTop, debugActorColor, debugCellColor, debugTableColor| Constructor and Description |
|---|
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) |
| Modifier and Type | Method and Description |
|---|---|
void |
draw(Batch 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(Batch batch,
float parentAlpha,
float x,
float y)
Called to draw the background, before clipping is applied (if enabled).
|
protected void |
drawStageBackground(Batch batch,
float parentAlpha,
float x,
float y,
float width,
float height) |
float |
getPrefWidth() |
Window.WindowStyle |
getStyle()
Returns the window's style.
|
Label |
getTitleLabel() |
Table |
getTitleTable() |
Actor |
hit(float x,
float y,
boolean touchable)
|
boolean |
isDragging() |
boolean |
isModal() |
boolean |
isMovable() |
boolean |
isResizable() |
void |
setKeepWithinStage(boolean keepWithinStage) |
void |
setModal(boolean isModal) |
void |
setMovable(boolean isMovable) |
void |
setResizable(boolean isResizable) |
void |
setResizeBorder(int resizeBorder) |
void |
setStyle(Window.WindowStyle style) |
add, add, add, add, add, add, add, align, background, background, bottom, center, clearChildren, columnDefaults, debug, debug, debugActor, debugAll, debugCell, debugTable, defaults, drawDebug, drawDebugBounds, getAlign, getBackground, getCell, getCells, getClip, getColumnMinWidth, getColumnPrefWidth, getColumns, getColumnWidth, getMinHeight, getMinWidth, getPadBottom, getPadBottomValue, getPadLeft, getPadLeftValue, getPadRight, getPadRightValue, getPadTop, getPadTopValue, getPadX, getPadY, getPrefHeight, getRow, getRowHeight, getRowMinHeight, getRowPrefHeight, getRows, getSkin, getTableDebug, invalidate, layout, left, pad, pad, pad, pad, padBottom, padBottom, padLeft, padLeft, padRight, padRight, padTop, padTop, removeActor, removeActor, reset, right, row, setBackground, setBackground, setClip, setDebug, setRound, setSkin, stack, topchildrenChanged, getMaxHeight, getMaxWidth, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, sizeChanged, validateact, addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, applyTransform, clear, computeTransform, drawChildren, drawDebugChildren, findActor, getChildren, getCullingArea, hasChildren, isTransform, localToDescendantCoordinates, resetTransform, resetTransform, setCullingArea, setDebug, setStage, setTransform, swapActor, swapActor, toStringaddAction, addCaptureListener, addListener, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasParent, isAscendantOf, isDescendantOf, isTouchable, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, screenToLocalCoordinates, setBounds, setColor, setColor, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFrontpublic 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)
public void setStyle(Window.WindowStyle style)
public Window.WindowStyle getStyle()
setStyle(WindowStyle) is
called.public void draw(Batch batch, float parentAlpha)
WidgetGroupWidgetGroup.validate() should be called to ensure the widget group is laid
out.protected void drawStageBackground(Batch batch, float parentAlpha, float x, float y, float width, float height)
protected void drawBackground(Batch batch, float parentAlpha, float x, float y)
TabledrawBackground in class Tablepublic Actor hit(float x, float y, boolean touchable)
Actortouchable 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, mouse, and enter/exit events. If this method returns null, those events will not occur on this Actor.
The default implementation returns this actor if the point is within this actor's bounds.
hit in class Tabletouchable - If true, the hit detection will respect the touchability.Touchablepublic boolean isMovable()
public void setMovable(boolean isMovable)
public boolean isModal()
public void setModal(boolean isModal)
public void setKeepWithinStage(boolean keepWithinStage)
public boolean isResizable()
public void setResizable(boolean isResizable)
public void setResizeBorder(int resizeBorder)
public boolean isDragging()
public float getPrefWidth()
getPrefWidth in interface LayoutgetPrefWidth in class Tablepublic Table getTitleTable()
public Label getTitleLabel()