Skip to content

Commit

Permalink
Added Align.toString.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Jul 13, 2018
1 parent 88c0c31 commit aa0cbc5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions gdx/src/com/badlogic/gdx/utils/Align.java
Expand Up @@ -53,4 +53,21 @@ static public final boolean isCenterVertical (int align) {
static public final boolean isCenterHorizontal (int align) {
return (align & left) == 0 && (align & right) == 0;
}

static public String toString (int align) {
StringBuilder buffer = new StringBuilder(13);
if ((align & top) != 0)
buffer.append("top,");
else if ((align & bottom) != 0)
buffer.append("bottom,");
else
buffer.append("center,");
if ((align & left) != 0)
buffer.append("left");
else if ((align & right) != 0)
buffer.append("right");
else
buffer.append("center");
return buffer.toString();
}
}

0 comments on commit aa0cbc5

Please sign in to comment.