vooga.engine.overlay
Class OverlayIcon

java.lang.Object
  extended by Sprite
      extended by vooga.engine.overlay.Overlay
          extended by vooga.engine.overlay.OverlayIcon

public class OverlayIcon
extends Overlay

This Overlay class displays a finite number of icons, with an image provided by the user.


Constructor Summary
OverlayIcon(java.util.Map<java.lang.String,java.lang.String> attributes, OverlayTracker tracker)
           
OverlayIcon(Stat<java.lang.Integer> stat, java.awt.image.BufferedImage icon, java.lang.String label)
          Creates Overlay Icon class that is Integer specific
 
Method Summary
protected  OverlayString getOverlayString()
           
 int getWidth()
           
 void render(java.awt.Graphics2D g)
          Used to render to the screen.
 void scaleIcon(int width, int height)
          Adjusts the icon to be the given width, height.
 void setColor(java.awt.Color color)
           
 void setFont(java.awt.Font font)
           
 void setFont(GameFont font)
           
 void update(long t)
          Updates the number of images showing
 
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

OverlayIcon

public OverlayIcon(Stat<java.lang.Integer> stat,
                   java.awt.image.BufferedImage icon,
                   java.lang.String label)
Creates Overlay Icon class that is Integer specific

Parameters:
stat - Stat object that contains an Integer to keep track of
icon - Icon to display
label - String to label the icons

OverlayIcon

public OverlayIcon(java.util.Map<java.lang.String,java.lang.String> attributes,
                   OverlayTracker tracker)
Method Detail

scaleIcon

public void scaleIcon(int width,
                      int height)
Adjusts the icon to be the given width, height.

Parameters:
width -
height -

render

public void render(java.awt.Graphics2D g)
Used to render to the screen.

Parameters:
g - Graphic to render image to.

update

public void update(long t)
Updates the number of images showing


getWidth

public int getWidth()
Returns:
width of the Overlay Icon including String and all icons

setFont

public void setFont(java.awt.Font font)

setFont

public void setFont(GameFont font)

setColor

public void setColor(java.awt.Color color)

getOverlayString

protected OverlayString getOverlayString()