|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectapes.MenuItem
public class MenuItem
A MenuItem
represents one part of a Menu
.
It contains an Image that is shown to represent it when the menu it belongs
to is shown. It also contains a MenuAction
which contains
instruction on how to act if isMouseOverItem returns true and the user
pressed a mouse button.
Menu
,
MenuAction
Constructor Summary | |
---|---|
MenuItem(org.newdawn.slick.Image img,
float xPos,
float yPos,
float offset,
MenuAction action)
constructs a new MenuItem. |
Method Summary | |
---|---|
void |
applyMouseInput(float x,
float y,
boolean mouseButtonDown,
int i,
org.newdawn.slick.GameContainer gc,
org.newdawn.slick.state.StateBasedGame sbg)
Checks weather or not this MenuItem is affected by the current condition of the mouse. |
org.newdawn.slick.Image |
getImg()
returns the image represented by this item. |
org.newdawn.slick.geom.Polygon |
getPolygon()
returns the polygon surrounding the image representing this item. |
void |
render()
draw the image representing this menuitem with the set x/y position and scale. |
void |
setImg(org.newdawn.slick.Image img)
sets the image to represent this item. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MenuItem(org.newdawn.slick.Image img, float xPos, float yPos, float offset, MenuAction action)
img
- the image, which is shown to represent this MenuItemxPos
- the top left x position of this imageyPos
- top left y position of this imageaction
- the action to executeoffset
- the offset, the polygon around this item may haveMethod Detail |
---|
public void applyMouseInput(float x, float y, boolean mouseButtonDown, int i, org.newdawn.slick.GameContainer gc, org.newdawn.slick.state.StateBasedGame sbg) throws org.newdawn.slick.SlickException
x
- position of mouse on x axisy
- position of mouse on y axismouseButtonDown
- is mouse klicked?i
- delta valuegc
- gamecontainersbg
- statebased game
org.newdawn.slick.SlickException
public void render()
public org.newdawn.slick.Image getImg()
public void setImg(org.newdawn.slick.Image img)
img
- public org.newdawn.slick.geom.Polygon getPolygon()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |