apes
Class Menu

java.lang.Object
  extended by apes.Menu

public class Menu
extends java.lang.Object

This class represents a Menu. In this case, Menu means one container containing one or more MenuItems, which themselves can link to a different Menu or be responsible for a setting or something similar.

See Also:
MenuItem

Constructor Summary
Menu(float centerXPosition, float topYPosition, float yspaceBetweenItems)
          constructs a new Menu.
 
Method Summary
 void addItem(org.newdawn.slick.Image img, MenuAction action)
          add a new MenuItem to this menu.
 void render(org.newdawn.slick.Graphics grphcs)
          draws this menu/its MenuItems to the screen.
 void update(org.newdawn.slick.GameContainer gc, org.newdawn.slick.state.StateBasedGame sbg, int i)
          let this menu or its MenuItems react to userinput/changed conditions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Menu

public Menu(float centerXPosition,
            float topYPosition,
            float yspaceBetweenItems)
constructs a new Menu.

Parameters:
centerXPosition -
topYPosition -
yspaceBetweenItems -
Method Detail

addItem

public void addItem(org.newdawn.slick.Image img,
                    MenuAction action)
add a new MenuItem to this menu.

Parameters:
img - the image to represent this item
action - the action to be executed by this item
Throws:
org.newdawn.slick.SlickException

update

public void update(org.newdawn.slick.GameContainer gc,
                   org.newdawn.slick.state.StateBasedGame sbg,
                   int i)
            throws org.newdawn.slick.SlickException
let this menu or its MenuItems react to userinput/changed conditions.

Parameters:
gc -
sbg -
i -
Throws:
org.newdawn.slick.SlickException

render

public void render(org.newdawn.slick.Graphics grphcs)
draws this menu/its MenuItems to the screen.

Parameters:
grphcs -