Java Code Examples for com.badlogic.gdx.utils.Align#topLeft()

The following examples show how to use com.badlogic.gdx.utils.Align#topLeft() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AlignUtils.java    From bladecoder-adventure-engine with Apache License 2.0 6 votes vote down vote up
public static String getAlign(int align) {
	switch (align) {
	case Align.bottomRight:
		return "bottom-right";
	case Align.bottomLeft:
		return "bottom-left";
	case Align.topRight:
		return "top-right";
	case Align.topLeft:
		return "top-left";
	case Align.right:
		return "right";
	case Align.left:
		return "left";
	case Align.bottom:
		return "bottom";
	case Align.top:
		return "top";
	case Align.center:
		return "center";
	}

	return "";
}
 
Example 2
Source File: AlignUtils.java    From bladecoder-adventure-engine with Apache License 2.0 6 votes vote down vote up
public static int getAlign(String s) {
	if ("bottom-right".equals(s))
		return Align.bottomRight;
	else if ("bottom-left".equals(s))
		return Align.bottomLeft;
	else if ("top-right".equals(s))
		return Align.topRight;
	else if ("top-left".equals(s))
		return Align.topLeft;
	else if ("right".equals(s))
		return Align.right;
	else if ("left".equals(s))
		return Align.left;
	else if ("bottom".equals(s))
		return Align.bottom;
	else if ("top".equals(s))
		return Align.top;
	else if ("center".equals(s))
		return Align.center;

	return 0;
}