public class MainMenu extends Screen
Modifier and Type | Field and Description |
---|---|
private static double |
BUTTON_HEIGHT
Height of the buttons.
|
private static double |
BUTTON_WIDTH
Width of the buttons.
|
private java.awt.geom.Path2D |
host
Bounds of the multiplayer host button.
|
private java.awt.geom.Path2D |
info
Bounds of the info button.
|
private java.awt.geom.Path2D |
join
Bounds of the multiplayer join button.
|
private java.awt.geom.Path2D[] |
objects
Main menu show case objects.
|
private java.awt.geom.Path2D |
quit
Bounds of the quit button.
|
private java.awt.geom.Path2D |
single
Bounds of the single player button.
|
BOTTOM_OFFSET, BOX_HEADER_HEIGHT, BOX_INSETS, BOX_SPACING, BOX_TEXT_OFFSET, SIDE_OFFSET, SPACING, TOP_MIDDLE_OFFSET, TOP_MIDDLE_TEXT_OFFSET, TOP_MIDDLE_WIDTH, TOP_OFFSET, TOP_SIDE_TRIANGLE, TOP_SPACE
Modifier | Constructor and Description |
---|---|
protected |
MainMenu(ConvexMerger context)
Constructs a new main menu with the given game context.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getLeftButtonText()
Gets the text for the bottom left button.
|
protected java.lang.String |
getRightButtonText()
Gets the text for the bottom right button.
|
protected void |
handleLeftButtonClick()
Handles the bottom left button being clicked.
|
void |
handleMouseRelease(java.awt.geom.Point2D loc,
int width,
int height)
Handles a mouse button release on this screen.
|
protected void |
handleRightButtonClick()
Handles the bottom right button being clicked.
|
protected boolean |
isLeftButtonEnabled()
Checks if the bottom left button is enabled.
|
protected boolean |
isRightButtonEnabled()
Checks if the bottom right button is enabled.
|
protected void |
render(java.awt.Graphics2D g,
int width,
int height,
java.awt.geom.Point2D mouseLoc)
Renders the content of this screen with the given graphics.
|
private void |
render(java.awt.Graphics2D g,
java.awt.Shape obj,
Theme.PlayerTheme theme)
Renders the given shape in
the convex object style.
|
computeBox, drawBox, drawButton, drawTitle, drawTitledBox, fillText, getContext, getMaxWidth, handleKeyPressed, handleKeyReleased, handleMouseDrag, handleMouseMove, handleMousePress, render, renderMainInterface, renderMenuTitle, switchScene
private static final double BUTTON_WIDTH
private static final double BUTTON_HEIGHT
private java.awt.geom.Path2D join
private java.awt.geom.Path2D host
private java.awt.geom.Path2D single
private java.awt.geom.Path2D info
private java.awt.geom.Path2D quit
private java.awt.geom.Path2D[] objects
protected MainMenu(ConvexMerger context)
context
- The game context.protected void render(java.awt.Graphics2D g, int width, int height, java.awt.geom.Point2D mouseLoc)
Screen
private void render(java.awt.Graphics2D g, java.awt.Shape obj, Theme.PlayerTheme theme)
g
- The graphics context to use.obj
- The shape to render.theme
- The theme to use.public void handleMouseRelease(java.awt.geom.Point2D loc, int width, int height)
Screen
handleMouseRelease
in class Screen
loc
- The location that was clicked.width
- The width of the screen.height
- The height of the screen.protected boolean isLeftButtonEnabled()
Screen
isLeftButtonEnabled
in class Screen
protected boolean isRightButtonEnabled()
Screen
isRightButtonEnabled
in class Screen
protected java.lang.String getLeftButtonText()
Screen
getLeftButtonText
in class Screen
protected java.lang.String getRightButtonText()
Screen
getRightButtonText
in class Screen
protected void handleLeftButtonClick()
Screen
handleLeftButtonClick
in class Screen
protected void handleRightButtonClick()
Screen
handleRightButtonClick
in class Screen