public class ImageEntity extends BaseGameEntity
Modifier and Type | Field and Description |
---|---|
protected java.awt.Graphics |
g |
protected org.havi.ui.HScene |
hscene |
protected java.awt.Image |
img |
Constructor and Description |
---|
ImageEntity(org.havi.ui.HScene hscene)
class constructor
|
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.Graphics g)
Draws the image on the screen on its x and y coordinate
|
java.awt.Rectangle |
getBounds()
Returns the bounding rectangle for the image
|
int |
getCenterX()
returns the x coordinate of the center of the image
|
int |
getCenterY()
returns the y coordinate of the center of the image
|
java.awt.Image |
getImage()
Returns the image to display
|
int |
height()
returns the height of the image
|
void |
load(java.lang.String filename)
loads an image to display
|
void |
setGraphics(java.awt.Graphics g)
Sets the graphic context for the image
|
void |
setImage(java.awt.Image img)
Sets the image to display
|
int |
width()
returns the width of the image
|
protected java.awt.Image img
protected org.havi.ui.HScene hscene
protected java.awt.Graphics g
public ImageEntity(org.havi.ui.HScene hscene)
hscene
- scene to add to for drawing purposespublic final java.awt.Image getImage()
public final void setImage(java.awt.Image img)
img
- Image to displaypublic final int width()
public final int height()
public final int getCenterX()
public final int getCenterY()
public final void setGraphics(java.awt.Graphics g)
g
- new graphic context to usepublic final void load(java.lang.String filename)
filename
- filename of image to loadpublic final void draw(java.awt.Graphics g)
g
- graphics context to use for drawingpublic final java.awt.Rectangle getBounds()