Beispiel #1
0
 /**
  * Creates a table with a skin, which enables the {@link #add(String)} and {@link #add(String,
  * String)} methods to be used.
  */
 public Table(Skin skin) {
   this.skin = skin;
   layout = new TableLayout();
   layout.setTable(this);
   setTransform(false);
   setTouchable(Touchable.childrenOnly);
 }
Beispiel #2
0
 public void draw(Batch batch, float parentAlpha) {
   validate();
   drawBackground(batch, parentAlpha);
   if (isTransform()) {
     applyTransform(batch, computeTransform());
     if (clip) {
       boolean draw =
           background == null
               ? clipBegin(0, 0, getWidth(), getHeight())
               : clipBegin(
                   layout.getPadLeft(),
                   layout.getPadBottom(),
                   getWidth() - layout.getPadLeft() - layout.getPadRight(),
                   getHeight() - layout.getPadBottom() - layout.getPadTop());
       if (draw) {
         drawChildren(batch, parentAlpha);
         clipEnd();
       }
     } else drawChildren(batch, parentAlpha);
     resetTransform(batch);
   } else super.draw(batch, parentAlpha);
 }
Beispiel #3
0
 /** Padding at the left edge of the table. */
 public Table padLeft(float padLeft) {
   layout.padLeft(padLeft);
   return this;
 }
Beispiel #4
0
 /** If true (the default), positions and sizes are rounded to integers. */
 public void setRound(boolean round) {
   layout.round = round;
 }
Beispiel #5
0
 /** Returns {@link #getPadTop()} plus {@link #getPadBottom()}. */
 public float getPadY() {
   return layout.getPadTop() + layout.getPadBottom();
 }
Beispiel #6
0
 public float getPadRight() {
   return layout.getPadRight();
 }
Beispiel #7
0
 public float getPadBottom() {
   return layout.getPadBottom();
 }
Beispiel #8
0
 public float getPadLeft() {
   return layout.getPadLeft();
 }
Beispiel #9
0
 /**
  * Adds {@link Align#bottom} and clears {@link Align#top} for the alignment of the logical table
  * within the table widget.
  */
 public Table bottom() {
   layout.bottom();
   return this;
 }
Beispiel #10
0
 /**
  * Adds {@link Align#left} and clears {@link Align#right} for the alignment of the logical table
  * within the table widget.
  */
 public Table left() {
   layout.left();
   return this;
 }
Beispiel #11
0
 /**
  * Adds {@link Align#top} and clears {@link Align#bottom} for the alignment of the logical table
  * within the table widget.
  */
 public Table top() {
   layout.top();
   return this;
 }
Beispiel #12
0
 /**
  * Sets the alignment of the logical table within the table widget to {@link Align#center}. This
  * clears any other alignment.
  */
 public Table center() {
   layout.center();
   return this;
 }
Beispiel #13
0
 /**
  * Sets the alignment of the logical table within the table widget. Set to {@link Align#center},
  * {@link Align#top}, {@link Align#bottom} , {@link Align#left} , {@link Align#right}, or any
  * combination of those.
  */
 public Table align(int align) {
   layout.align(align);
   return this;
 }
Beispiel #14
0
 /** Padding at the right edge of the table. */
 public Table padRight(float padRight) {
   layout.padRight(padRight);
   return this;
 }
Beispiel #15
0
 /** Padding at the bottom edge of the table. */
 public Table padBottom(float padBottom) {
   layout.padBottom(padBottom);
   return this;
 }
Beispiel #16
0
 public float getPadTop() {
   return layout.getPadTop();
 }
Beispiel #17
0
 public Value getPadLeftValue() {
   return layout.getPadLeftValue();
 }
Beispiel #18
0
 /**
  * Adds {@link Align#right} and clears {@link Align#left} for the alignment of the logical table
  * within the table widget.
  */
 public Table right() {
   layout.right();
   return this;
 }
Beispiel #19
0
 public Value getPadBottomValue() {
   return layout.getPadBottomValue();
 }
Beispiel #20
0
 /** Turns on table debug lines. */
 public Table debugTable() {
   layout.debugTable();
   return this;
 }
Beispiel #21
0
 public Value getPadRightValue() {
   return layout.getPadRightValue();
 }
Beispiel #22
0
 /** Turns on cell debug lines. */
 public Table debugCell() {
   layout.debugCell();
   return this;
 }
Beispiel #23
0
 /** Returns {@link #getPadLeft()} plus {@link #getPadRight()}. */
 public float getPadX() {
   return layout.getPadLeft() + layout.getPadRight();
 }
Beispiel #24
0
 /** Turns on widget debug lines. */
 public Table debugWidget() {
   layout.debugWidget();
   return this;
 }
Beispiel #25
0
 public int getAlign() {
   return layout.getAlign();
 }
Beispiel #26
0
 /** Turns on debug lines. */
 public Table debug(Debug debug) {
   layout.debug(debug);
   return this;
 }
Beispiel #27
0
 public Debug getDebug() {
   return layout.getDebug();
 }
Beispiel #28
0
 public Value getPadTopValue() {
   return layout.getPadTopValue();
 }
Beispiel #29
0
 public void addDebugRectangle(
     TableLayout layout, Debug type, float x, float y, float w, float h) {
   drawDebug = true;
   if (layout.debugRects == null) layout.debugRects = new Array();
   layout.debugRects.add(new DebugRect(type, x, layout.getTable().getHeight() - y, w, h));
 }
Beispiel #30
0
 /** Padding at the top edge of the table. */
 public Table padTop(float padTop) {
   layout.padTop(padTop);
   return this;
 }