APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.badlogic.gdx.scenes.scene2d.ui

public Class Window

extends Table
implements Styleable<Window.WindowStyle>
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.scenes.scene2d.ui.Styleable
Known Direct Subclasses
com.badlogic.gdx.scenes.scene2d.ui.Dialog
Imports
com.badlogic.gdx.graphics.Camera, .Color, .OrthographicCamera, com.badlogic.gdx.graphics.g2d.Batch, .BitmapFont, com.badlogic.gdx.math.Vector2, com.badlogic.gdx.scenes.scene2d.Actor, .InputEvent, .InputListener, .Stage, .Touchable, com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle, com.badlogic.gdx.scenes.scene2d.utils.Drawable, com.badlogic.gdx.utils.Align, .Null

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 laid out by the table. After adding children to the window, it can be convenient to call pack() to size the window to the size of the children.

Author
Nathan Sweet

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Window.WindowStyle

The style for a window, see Window.

Field Summary

Modifier and TypeField and Description
protected boolean
pack-priv boolean
protected int
pack-priv boolean
pack-priv boolean
pack-priv boolean
pack-priv boolean
private static final int
pack-priv int
private Window.WindowStyle
pack-priv Label
pack-priv Table
private static final Vector2
private static final Vector2
Inherited from com.badlogic.gdx.scenes.scene2d.ui.Table:
alignbackgroundbackgroundBottombackgroundLeftbackgroundRightbackgroundTopcellPooldebugdebugActorColordebugCellColordebugRectsdebugTableColorpadBottompadLeftpadRightpadTopround

Constructor Summary

AccessConstructor and Description
public
Window(String title, Skin skin)

public
Window(String title, Skin skin, String styleName)

public

Method Summary

Modifier and TypeMethod and Description
public void
draw(Batch batch, float parentAlpha)

Overrides com.badlogic.gdx.scenes.scene2d.ui.Table.draw.

If this method is overridden, the super method or validate() should be called to ensure the widget group is laid out.

protected void
drawBackground(Batch batch, float parentAlpha, float x, float y)

Overrides com.badlogic.gdx.scenes.scene2d.ui.Table.drawBackground.

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)

public float
public Window.WindowStyle
getStyle()

Implements com.badlogic.gdx.scenes.scene2d.ui.Styleable.getStyle.

Returns the window's style.

public Label
public Table
public Actor
hit(float x, float y, boolean touchable)

Overrides com.badlogic.gdx.scenes.scene2d.ui.Table.hit.

If this method is overridden, the super method or validate() should be called to ensure the widget group is laid out.

public boolean
public boolean
public boolean
public boolean
public void
protected Label
public void
setKeepWithinStage(boolean keepWithinStage)

public void
setModal(boolean isModal)

public void
setMovable(boolean isMovable)

public void
setResizable(boolean isResizable)

public void
setResizeBorder(int resizeBorder)

public void
setStyle(Window.WindowStyle style)

Implements com.badlogic.gdx.scenes.scene2d.ui.Styleable.setStyle.

Set the current style of the actor

Inherited from com.badlogic.gdx.scenes.scene2d.ui.Table:
addaddaddaddaddaddaddalignbackgroundbackgroundbottomcenterclearChildrenclipclipcolumnDefaultsdebugdebugdebugActordebugAlldebugCelldebugTabledefaultsdrawDebugdrawDebugBoundsgetAligngetBackgroundgetCellgetCellsgetClipgetColumnMinWidthgetColumnPrefWidthgetColumnsgetColumnWidthgetMinHeightgetMinWidthgetPadBottomgetPadBottomValuegetPadLeftgetPadLeftValuegetPadRightgetPadRightValuegetPadTopgetPadTopValuegetPadXgetPadYgetPrefHeightgetRowgetRowHeightgetRowMinHeightgetRowPrefHeightgetRowsgetSkingetTableDebuginvalidatelayoutleftpadpadpadpadpadBottompadBottompadLeftpadLeftpadRightpadRightpadToppadTopremoveActorremoveActorremoveActorAtresetrightrowsetBackgroundsetBackgroundsetClipsetDebugsetRoundsetSkinstacktop

Field Detail

draggingback to summary
protected boolean dragging
drawTitleTableback to summary
pack-priv boolean drawTitleTable
edgeback to summary
protected int edge
isModalback to summary
pack-priv boolean isModal
isMovableback to summary
pack-priv boolean isMovable
isResizableback to summary
pack-priv boolean isResizable
keepWithinStageback to summary
pack-priv boolean keepWithinStage
MOVEback to summary
private static final int MOVE
resizeBorderback to summary
pack-priv int resizeBorder
styleback to summary
private Window.WindowStyle style
titleLabelback to summary
pack-priv Label titleLabel
titleTableback to summary
pack-priv Table titleTable
tmpPositionback to summary
private static final Vector2 tmpPosition
tmpSizeback to summary
private static final Vector2 tmpSize

Constructor Detail

Windowback to summary
public Window(String title, Skin skin)
Windowback to summary
public Window(String title, Skin skin, String styleName)
Windowback to summary
public Window(String title, Window.WindowStyle style)

Method Detail

drawback to summary
public void draw(Batch batch, float parentAlpha)

Overrides com.badlogic.gdx.scenes.scene2d.ui.Table.draw.

Doc from com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.draw.

If this method is overridden, the super method or validate() should be called to ensure the widget group is laid out.

drawBackgroundback to summary
protected void drawBackground(Batch batch, float parentAlpha, float x, float y)

Overrides com.badlogic.gdx.scenes.scene2d.ui.Table.drawBackground.

Doc from com.badlogic.gdx.scenes.scene2d.ui.Table.drawBackground.

Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background drawable.

drawStageBackgroundback to summary
protected void drawStageBackground(Batch batch, float parentAlpha, float x, float y, float width, float height)
getPrefWidthback to summary
public float getPrefWidth()

Overrides com.badlogic.gdx.scenes.scene2d.ui.Table.getPrefWidth.

Implements com.badlogic.gdx.scenes.scene2d.utils.Layout.getPrefWidth.

getStyleback to summary
public Window.WindowStyle getStyle()

Implements com.badlogic.gdx.scenes.scene2d.ui.Styleable.getStyle.

Returns the window's style. Modifying the returned style may not have an effect until setStyle(WindowStyle) is called.

getTitleLabelback to summary
public Label getTitleLabel()
getTitleTableback to summary
public Table getTitleTable()
hitback to summary
public Actor hit(float x, float y, boolean touchable)

Overrides com.badlogic.gdx.scenes.scene2d.ui.Table.hit.

Doc from com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.hit.

If this method is overridden, the super method or validate() should be called to ensure the widget group is laid out.

Annotations
@Null
isDraggingback to summary
public boolean isDragging()
isModalback to summary
public boolean isModal()
isMovableback to summary
public boolean isMovable()
isResizableback to summary
public boolean isResizable()
keepWithinStageback to summary
public void keepWithinStage()
newLabelback to summary
protected Label newLabel(String text, Label.LabelStyle style)
setKeepWithinStageback to summary
public void setKeepWithinStage(boolean keepWithinStage)
setModalback to summary
public void setModal(boolean isModal)
setMovableback to summary
public void setMovable(boolean isMovable)
setResizableback to summary
public void setResizable(boolean isResizable)
setResizeBorderback to summary
public void setResizeBorder(int resizeBorder)
setStyleback to summary
public void setStyle(Window.WindowStyle style)

Implements com.badlogic.gdx.scenes.scene2d.ui.Styleable.setStyle.

Doc from com.badlogic.gdx.scenes.scene2d.ui.Styleable.setStyle.

Set the current style of the actor

com.badlogic.gdx.scenes.scene2d.ui back to summary

public Class Window.WindowStyle

extends Object
Class Inheritance

The style for a window, see Window.
Author
Nathan Sweet

Field Summary

Modifier and TypeField and Description
public Drawable
public Drawable
public BitmapFont
public Color

Constructor Summary

AccessConstructor and Description
public
public
WindowStyle(BitmapFont titleFont, Color titleFontColor, Drawable background)

public

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

backgroundback to summary
public Drawable background
Annotations
@Null
stageBackgroundback to summary
public Drawable stageBackground
Annotations
@Null
titleFontback to summary
public BitmapFont titleFont
titleFontColorback to summary
public Color titleFontColor
Annotations
@Null

Constructor Detail

WindowStyleback to summary
public WindowStyle()
WindowStyleback to summary
public WindowStyle(BitmapFont titleFont, Color titleFontColor, Drawable background)
WindowStyleback to summary
public WindowStyle(Window.WindowStyle style)