Class ImageBackground

java.lang.Object
   |
   +----Background
           |
           +----ImageBackground

public class ImageBackground
extends Background
This class extends the "Background" class so that the game background can be be an image and not just a single color background. This class is taken directly from the book "Teach yourself Internet Game Programming with Java in 21 days" by Michael Morrison. See chapter 6 for details.


Variable Index

 o image

Constructor Index

 o ImageBackground(Component, Image)
ImageBackground constructor method sets image for background

Method Index

 o draw(Graphics)
Draw background image.
 o getImage()
Return the background "image" object
 o setImage(Image)
Sets image for background

Variables

 o image
 protected Image image

Constructors

 o ImageBackground
 public ImageBackground(Component comp,
                        Image img)
ImageBackground constructor method sets image for background

Methods

 o getImage
 public Image getImage()
Return the background "image" object

 o setImage
 public void setImage(Image img)
Sets image for background

 o draw
 public void draw(Graphics g)
Draw background image.

Overrides:
draw in class Background