public class BasicMenuItem
extends java.lang.Object
Constructor and Description |
---|
BasicMenuItem(int index,
java.lang.String label)
Create a new menu Item which does something specific like exiting or showing the option screen.
|
BasicMenuItem(int index,
java.lang.String label,
java.lang.Class<? extends Controller> gameController,
java.lang.Class<? extends GameView> gameView)
Create a new menu Item which can launch a game.
|
Modifier and Type | Method and Description |
---|---|
void |
action() |
java.lang.Class<? extends Controller> |
getGameController() |
java.lang.Class<? extends GameView> |
getGameView() |
static int |
getHighlight() |
boolean |
isClicked()
Check if the mouse clicked the menuItem.
|
void |
render(com.badlogic.gdx.graphics.g2d.BitmapFont font,
com.badlogic.gdx.graphics.g2d.SpriteBatch batch,
com.badlogic.gdx.graphics.glutils.ShapeRenderer sr)
Renders the menu item.
|
static void |
setHighlight(int highlight) |
static void |
setSound(com.badlogic.gdx.audio.Sound sound) |
public BasicMenuItem(int index, java.lang.String label, java.lang.Class<? extends Controller> gameController, java.lang.Class<? extends GameView> gameView)
index
- the index of the buttonlabel
- the string displayed by the button. If "exit" or "options" they change their behaviour.gameController
- Your game controller class for this menu itemgameView
- Your game view class for this menu itempublic BasicMenuItem(int index, java.lang.String label)
index
- the index of the buttonlabel
- the string displayed by the button. If "exit" or "options" they cahnge they behaviour.public void render(com.badlogic.gdx.graphics.g2d.BitmapFont font, com.badlogic.gdx.graphics.g2d.SpriteBatch batch, com.badlogic.gdx.graphics.glutils.ShapeRenderer sr)
font
- batch
- sr
- public boolean isClicked()
public java.lang.Class<? extends Controller> getGameController()
public java.lang.Class<? extends GameView> getGameView()
public void action()
public static void setSound(com.badlogic.gdx.audio.Sound sound)
sound
- public static int getHighlight()
public static void setHighlight(int highlight)
highlight
-