libgdx API

com.badlogic.gdx.scenes.scene2d.ui
Class Window

java.lang.Object
  extended by com.badlogic.gdx.scenes.scene2d.Actor
      extended by com.badlogic.gdx.scenes.scene2d.Group
          extended by com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
              extended by com.badlogic.gdx.scenes.scene2d.ui.tablelayout.Table
                  extended by com.badlogic.gdx.scenes.scene2d.ui.Window
All Implemented Interfaces:
Cullable, Layout

public class Window
extends Table

A table that can be dragged and act as a modal window.

The preferred size of a window is the preferred size of 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.

Author:
Nathan Sweet

Nested Class Summary
static class Window.WindowStyle
           
 
Field Summary
 
Fields inherited from class com.badlogic.gdx.scenes.scene2d.ui.tablelayout.Table
clip, isPressed
 
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
Window(Skin skin)
           
Window(java.lang.String title, Skin skin)
           
Window(java.lang.String title, Window.WindowStyle style)
           
Window(java.lang.String title, Window.WindowStyle style, java.lang.String name)
           
 
Method Summary
protected  void drawBackground(SpriteBatch batch, float parentAlpha)
          Called to draw the background, before clipping is applied (if enabled).
 Window.WindowStyle getStyle()
          Returns the window's style.
 java.lang.String getTitle()
           
 Actor hit(float x, float y)
           
 void layout()
          Positions and sizes children of the actor being laid out using the cell associated with each child.
 void setModal(boolean isModal)
           
 void setMovable(boolean isMovable)
           
 void setStyle(Window.WindowStyle style)
           
 void setTitle(java.lang.String title)
           
 boolean touchDown(float x, float y, int pointer)
           
 void touchDragged(float x, float y, int pointer)
           
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.tablelayout.Table
add, add, add, align, align, bottom, center, clear, click, columnDefaults, debug, debug, debug, defaults, draw, drawDebug, getAlign, getAllCells, getAllCells, getBackgroundPatch, getCell, getCell, getCells, getClickListener, getDebug, getHeight, getMinHeight, getMinWidth, getPadBottom, getPadLeft, getPadRight, getPadTop, getPrefHeight, getPrefWidth, getRow, getTableLayout, getWidget, getWidgets, getWidgets, height, height, invalidate, left, newTable, pad, pad, pad, pad, padBottom, padBottom, padLeft, padLeft, padRight, padRight, padTop, padTop, parse, parse, register, reset, right, row, setAssetManager, setBackground, setClickListener, setClip, setSkin, setWidget, size, size, stack, top, touchUp, width, width
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
childrenChanged, getMaxHeight, getMaxWidth, invalidateHierarchy, needsLayout, pack, setFillParent, validate
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Group
act, addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, disableDebugging, drawChild, drawChildren, enableDebugging, findActor, getActors, getGroups, isDescendant, removeActor, removeActorRecursive, 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

Window

public Window(Skin skin)

Window

public Window(java.lang.String title,
              Skin skin)

Window

public Window(java.lang.String title,
              Window.WindowStyle style)

Window

public Window(java.lang.String title,
              Window.WindowStyle style,
              java.lang.String name)
Method Detail

setStyle

public void setStyle(Window.WindowStyle style)

getStyle

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


layout

public void layout()
Description copied from class: Table
Positions and sizes children of the actor being laid out using the cell associated with each child.

Specified by:
layout in interface Layout
Overrides:
layout in class Table
See Also:
TableLayout.layout()

drawBackground

protected void drawBackground(SpriteBatch batch,
                              float parentAlpha)
Description copied from class: Table
Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background nine patch.

Overrides:
drawBackground in class Table

touchDown

public boolean touchDown(float x,
                         float y,
                         int pointer)
Overrides:
touchDown in class Table

touchDragged

public void touchDragged(float x,
                         float y,
                         int pointer)
Overrides:
touchDragged in class Actor

hit

public Actor hit(float x,
                 float y)
Overrides:
hit in class Group

setTitle

public void setTitle(java.lang.String title)

getTitle

public java.lang.String getTitle()

setMovable

public void setMovable(boolean isMovable)

setModal

public void setModal(boolean isModal)

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)