Class Window

All Implemented Interfaces:
Styleable<Window.WindowStyle>, Cullable, Layout
Direct Known Subclasses:
Dialog

public class Window extends Table implements Styleable<Window.WindowStyle>
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 WidgetGroup.pack() to size the window to the size of the children.

  • Field Details

    • edge

      protected int edge
    • dragging

      protected boolean dragging
  • Constructor Details

  • Method Details

    • newLabel

      protected Label newLabel(String text, Label.LabelStyle style)
    • setStyle

      public void setStyle(Window.WindowStyle style)
      Description copied from interface: Styleable
      Set the current style of the actor
      Specified by:
      setStyle in interface Styleable<Window.WindowStyle>
    • getStyle

      public Window.WindowStyle getStyle()
      Returns the window's style. Modifying the returned style may not have an effect until setStyle(WindowStyle) is called.
      Specified by:
      getStyle in interface Styleable<Window.WindowStyle>
    • keepWithinStage

      public void keepWithinStage()
    • draw

      public void draw(Batch batch, float parentAlpha)
      Description copied from class: WidgetGroup
      If this method is overridden, the super method or WidgetGroup.validate() should be called to ensure the widget group is laid out.
      Overrides:
      draw in class Table
      parentAlpha - The parent alpha, to be multiplied with this actor's alpha, allowing the parent's alpha to affect all children.
    • drawStageBackground

      protected void drawStageBackground(Batch batch, float parentAlpha, float x, float y, float width, float height)
    • drawBackground

      protected void drawBackground(Batch batch, float parentAlpha, float x, float y)
      Description copied from class: Table
      Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background drawable.
      Overrides:
      drawBackground in class Table
    • hit

      @Null public Actor hit(float x, float y, boolean touchable)
      Description copied from class: WidgetGroup
      If this method is overridden, the super method or WidgetGroup.validate() should be called to ensure the widget group is laid out.
      Overrides:
      hit in class Table
      touchable - If true, hit detection will respect the touchability.
      See Also:
    • isMovable

      public boolean isMovable()
    • setMovable

      public void setMovable(boolean isMovable)
    • isModal

      public boolean isModal()
    • setModal

      public void setModal(boolean isModal)
    • setKeepWithinStage

      public void setKeepWithinStage(boolean keepWithinStage)
    • isResizable

      public boolean isResizable()
    • setResizable

      public void setResizable(boolean isResizable)
    • setResizeBorder

      public void setResizeBorder(int resizeBorder)
    • isDragging

      public boolean isDragging()
    • getPrefWidth

      public float getPrefWidth()
      Specified by:
      getPrefWidth in interface Layout
      Overrides:
      getPrefWidth in class Table
    • getTitleTable

      public Table getTitleTable()
    • getTitleLabel

      public Label getTitleLabel()