|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.rico.engine.effect.ortho.ListMenuRenderer
public class ListMenuRenderer
This class can be used as a renderer for a list menu. A list menu usually has several text entries that are ordered in a top-down array.
Constructor Summary | |
---|---|
ListMenuRenderer(int x,
int y,
int spacing,
int margin,
Color4f txtCol,
Color4f hoverCol,
Color4f bgCol)
Creates a new list menu with the specified parameters. |
|
ListMenuRenderer(int x,
int y,
int spacing,
int margin,
Color4f txtCol,
Color4f hoverCol,
Color4f bgCol,
Font font)
Creates a new list menu with the specified parameters. |
Method Summary | |
---|---|
void |
add(java.lang.String entry,
java.lang.String id)
Adds a new entry to the list menu. |
void |
clear()
Clears the entries from the list menu. |
void |
draw(int mouseX,
int mouseY)
Draws the list menu and its current entries. |
java.lang.String |
getEntryId(int mouseX,
int mouseY)
Returns the id of the entry that lies under the specified screen coordinates. |
void |
remove(java.lang.String id)
Removes the entry which corresponds to the specified id from the menu. |
void |
setBGImage(OverlayImage img,
float alpha)
Sets a background image to the list menu. |
void |
setVisible(boolean visible)
Sets whether or not the list menu ought to be visible. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListMenuRenderer(int x, int y, int spacing, int margin, Color4f txtCol, Color4f hoverCol, Color4f bgCol)
x
- x-coordinate of upper left cornery
- y-coordinate of upper left cornerspacing
- vertical spacing (gap size) between the entriesmargin
- margin for the menu box.txtCol
- text color for the menu entrieshoverCol
- color of text while mouse is hovering over itbgCol
- background color of the menupublic ListMenuRenderer(int x, int y, int spacing, int margin, Color4f txtCol, Color4f hoverCol, Color4f bgCol, Font font)
x
- x-coordinate of upper left cornery
- y-coordinate of upper left cornerspacing
- vertical spacing (gap size) between the entriesmargin
- margin for the menu box.txtCol
- text color for the menu entrieshoverCol
- color of text while mouse is hovering over itbgCol
- background color of the menufont
- font from the Font enumeration classMethod Detail |
---|
public void setBGImage(OverlayImage img, float alpha)
img
- overlay image that ought to be used as
a background image.alpha
- alpha value [0..1] for transparencypublic void add(java.lang.String entry, java.lang.String id)
entry
- new list menu entryid
- id to refer to the entrypublic void remove(java.lang.String id)
id
- id that refers to the entry which is meant to
be removed.public void clear()
public void setVisible(boolean visible)
visible
- set visible? --> true=yes, false=nopublic void draw(int mouseX, int mouseY)
mouseX
- x-coordinate of current mouse positionmouseY
- y-coordinate of current mouse positionpublic java.lang.String getEntryId(int mouseX, int mouseY)
null
.
mouseX
- screen x-coordinatemouseY
- screen y-coordinate
null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |