Package dev.kyzel.game.menu
Class Menu
java.lang.Object
dev.kyzel.game.menu.Menu
- Direct Known Subclasses:
TextMenu
The menu super class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
The alignment of the menu.protected int
The height of the menu.protected Renderer
TheRenderer
where the menu will be drawn on.protected int
The width of the menu.protected int
The x coordinate of the menu.static final int
The constant for the center alignment on the x-axis.static final int
The constant for the left alignment.static final int
The constant for the right alignment.protected int
The y coordinate of the menu.static final int
The constant for the bottom alignment.static final int
The constant for the center alignment on the y-axis.static final int
The constant for the top alignment. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new menu with no information, aligned to the center of the screen by default.Creates a menu without x, y coordinates and width, height.Creates a new menu, aligned to the center of the screen by default.Creates a new menu. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Draws the container of the menu.int
Gets the x-axis alignment.int
Gets the y-axis alignment.
-
Field Details
-
X_LEFT
public static final int X_LEFTThe constant for the left alignment.- See Also:
-
X_CENTER
public static final int X_CENTERThe constant for the center alignment on the x-axis.- See Also:
-
X_RIGHT
public static final int X_RIGHTThe constant for the right alignment.- See Also:
-
Y_TOP
public static final int Y_TOPThe constant for the top alignment.- See Also:
-
Y_CENTER
public static final int Y_CENTERThe constant for the center alignment on the y-axis.- See Also:
-
Y_BOTTOM
public static final int Y_BOTTOMThe constant for the bottom alignment.- See Also:
-
render
TheRenderer
where the menu will be drawn on. -
x
protected int xThe x coordinate of the menu. -
y
protected int yThe y coordinate of the menu. -
width
protected int widthThe width of the menu. -
height
protected int heightThe height of the menu. -
alignment
protected int alignmentThe alignment of the menu.
-
-
Constructor Details
-
Menu
Creates a new menu.- Parameters:
render
- theRenderer
where the menu will be drawn onx
- the x coordinatey
- the y coordinatewidth
- the width of the menuheight
- the height of the menualignment
- the alignment of the menu
-
Menu
Creates a new menu, aligned to the center of the screen by default.- Parameters:
render
- theRenderer
where the menu will be drawn onx
- the x coordinatey
- the y coordinatewidth
- the width of the menuheight
- the height of the menu
-
Menu
Creates a menu without x, y coordinates and width, height.- Parameters:
render
- theRenderer
where the menu will be drawn onalignment
- the alignment of the menu
-
Menu
Creates a new menu with no information, aligned to the center of the screen by default.- Parameters:
render
- theRenderer
where the menu will be drawn on
-
-
Method Details
-
getXAlignment
public int getXAlignment()Gets the x-axis alignment.- Returns:
- the x-axis alignment
-
getYAlignment
public int getYAlignment()Gets the y-axis alignment.- Returns:
- the y-axis alignment
-
draw
Draws the container of the menu.- Parameters:
g
- theGraphics
which is used to draw
-