se.liu.student.kimgr905.tilegame
Class TileMapRenderer

java.lang.Object
  extended by 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.


Field Summary
private  java.awt.Image background
           
private  int offsetY
           
private  int statusBarHeight
          the height of the windowBar in pixels
 
Constructor Summary
TileMapRenderer()
           
 
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
 

Field Detail

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
Constructor Detail

TileMapRenderer

public TileMapRenderer()
Method Detail

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 - Graphics2D
map - TileMap
screenWidth - the width of the screen in pixels
screenHeight - the height of the screen in pixels