mdh.hephaestus2.gamelib
Class Icon

java.lang.Object
  |
  +--mdh.hephaestus2.gamelib.Icon

public class Icon
extends Object

An Icon is an image or part of an image. If x == -1, then the width and height will be set equal to the image's width and height, and the whole image will be drawn; otherwise, they're fixed clipping areas of the image. If the icon width or height exceeds 'maxsize', it is scaled down 50% repeatedly until it fits.

Author:
Copyright © 2000 by Mark Hughes <kamikaze@kuoi.asui.uidaho.edu>

Constructor Summary
Icon()
           
Icon(Image img, int maxsize)
           
Icon(Image img, int x, int y, int w, int h, int maxsize)
           
 
Method Summary
 void drawImage(Graphics g, int atx, int aty)
           
 boolean equals(Object o)
           
 Image getImage()
           
 int getMaxsize()
           
 int h()
           
 void setH(int h)
           
 void setImage(Image i)
           
 void setMaxsize(int m)
           
 void setW(int w)
           
 void setX(int x)
           
 void setY(int y)
           
 String toString()
           
 int w()
           
 int x()
           
 int y()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Icon

public Icon()

Icon

public Icon(Image img,
            int maxsize)

Icon

public Icon(Image img,
            int x,
            int y,
            int w,
            int h,
            int maxsize)
Method Detail

drawImage

public void drawImage(Graphics g,
                      int atx,
                      int aty)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getImage

public Image getImage()

getMaxsize

public int getMaxsize()

x

public int x()

y

public int y()

w

public int w()

h

public int h()

setImage

public void setImage(Image i)

setMaxsize

public void setMaxsize(int m)

setX

public void setX(int x)

setY

public void setY(int y)

setW

public void setW(int w)

setH

public void setH(int h)

toString

public String toString()
Overrides:
toString in class Object