se.liu.student.kimgr905.tilegame
Class TileMapRenderer
java.lang.Object
se.liu.student.kimgr905.tilegame.TileMapRenderer
public final class TileMapRenderer
- extends java.lang.Object
The TileMapRenderer class draws a TileMap on the screen.
It draws all sprites, status bars and 3 background images
that together creates a scrolling background.
|
Method Summary |
void |
draw(java.awt.Graphics2D g,
TileMap map,
int screenWidth,
int screenHeight)
Draws the specified TileMap. |
void |
setBackground(java.awt.Image background)
Sets the background to draw. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
background
private java.awt.Image background
offsetY
private int offsetY
statusBarHeight
private final int statusBarHeight
- the height of the windowBar in pixels
- See Also:
- Constant Field Values
TileMapRenderer
public TileMapRenderer()
setBackground
public void setBackground(java.awt.Image background)
- Sets the background to draw.
- Parameters:
background - the background image
draw
public void draw(java.awt.Graphics2D g,
TileMap map,
int screenWidth,
int screenHeight)
- Draws the specified TileMap.
- Parameters:
g - Graphics2Dmap - TileMapscreenWidth - the width of the screen in pixelsscreenHeight - the height of the screen in pixels