public class BackgroundImage
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.awt.image.BufferedImage |
background
The image.
|
Constructor and Description |
---|
BackgroundImage(double speed,
java.awt.image.BufferedImage image)
Creates a new background image.
|
BackgroundImage(double speed,
int width,
int height)
Creates a new background image.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.Graphics g,
java.awt.image.ImageObserver observer)
Draw the background picture.
|
int |
getHeight()
Get the height of the image.
|
int |
getWidth()
Get the width of the image.
|
void |
move()
Move the image with the given speed.
|
public BackgroundImage(double speed, java.awt.image.BufferedImage image)
speed
- speed of the scroll operationimage
- the image to be used as the backgroundpublic BackgroundImage(double speed, int width, int height)
speed
- speed of the scroll operationwidth
- width of the imageheight
- height of the imagepublic void draw(java.awt.Graphics g, java.awt.image.ImageObserver observer)
g
- the graphics context to draw intoobserver
- the image observerpublic int getHeight()
public int getWidth()
public void move()