|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSprite
vooga.engine.overlay.Overlay
vooga.engine.overlay.OverlayBar
public class OverlayBar
The OverlayBar class displays a bar that grows or shrinks based on a Stat and a maximum indicated by the user. An example is included in OverlayExample. For an example see OverlayExample.java.
Constructor Summary | |
---|---|
OverlayBar(java.util.Map<java.lang.String,java.lang.String> attributes,
OverlayTracker tracker)
|
|
OverlayBar(Stat<java.lang.Integer> stat,
int maxScore)
Constructs an OverlayBar with the given Stat |
Method Summary | |
---|---|
java.awt.Color |
getBackgroundColor()
Returns the background color of the OverlayBar. |
java.awt.Color |
getColor()
This method returns the color of the OverlayBar's fill. |
int |
getHeight()
Returns the height of the OverlayBar. |
int |
getMaxLength()
Returns the maximum length of the OverlayBar. |
int |
getMaxScore()
Returns the maximum score for the OverlayBar, which determines the length of the OverlayBar relative to the current score. |
Stat<java.lang.Integer> |
getStat()
Returns the Stat that the OverlayBar represents. |
void |
setBackgroundColor(java.awt.Color backgroundColor)
Sets the backgroundColor of the OverlayBar. |
void |
setColor(java.awt.Color color)
This method sets the color of the OverlayBar's fill. |
void |
setHeight(int height)
Sets the height of the OverlayBar. |
void |
setMaxLength(int maxLength)
Sets the maximum length of the OverlayBar. |
void |
setMaxScore(int maxScore)
Sets the maximum score for the OverlayBar, which determines the length of the OverlayBar relative to the current score. |
void |
setStat(Stat<java.lang.Integer> stat)
Sets the Stat the OverlayBar represents. |
void |
update(long t)
Prints the bar on the screen by calling drawBar(). |
Methods inherited from class vooga.engine.overlay.Overlay |
---|
setLocation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OverlayBar(Stat<java.lang.Integer> stat, int maxScore)
stat
- The statistic that the OverlayBar should represent.maxScore
- The maximum value the statistic can reach.public OverlayBar(java.util.Map<java.lang.String,java.lang.String> attributes, OverlayTracker tracker)
Method Detail |
---|
public void update(long t)
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
color
- The new color for the rectanglepublic int getMaxLength()
public void setMaxLength(int maxLength)
maxLength
- The length the maximum should be set to.public Stat<java.lang.Integer> getStat()
public void setStat(Stat<java.lang.Integer> stat)
stat
- The stat the OverlayBar should represent.public int getMaxScore()
public void setMaxScore(int maxScore)
maxScore
- The score the maximum should be set to.public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color backgroundColor)
backgroundColor
- The color the background color should be set to.public int getHeight()
public void setHeight(int height)
height
- The height the OverlayBar should be set to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |