org.deken.game.background
Class FixedBackground

java.lang.Object
  extended by org.deken.game.background.FixedBackground
All Implemented Interfaces:
Background, Updateable

public class FixedBackground
extends java.lang.Object
implements Background

Title: FixedBackground

Description: Renders a background image that is in a fixed location of 0, 0. It does not move even if the foreground does.

Copyright: (c) 2010

Version:
1.0
Author:
Gary Deken

Field Summary
protected  Animation animation
           
 
Constructor Summary
FixedBackground(Animation animation)
           
 
Method Summary
 void addAnimation(Animation animation)
           
 void draw(java.awt.Graphics2D graphics, int xOffset, int yOffset)
          drawBackground
 java.lang.String getName()
           
 void setMapSize(MapSize mapSize)
          setMapSize
 void setScreenSize(int width, int height)
          setScreenSize
 void update(long elapseTime)
          This method takes the elapse time, and calculates the new current frame of the animation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

animation

protected Animation animation
Constructor Detail

FixedBackground

public FixedBackground(Animation animation)
Method Detail

addAnimation

public void addAnimation(Animation animation)
Specified by:
addAnimation in interface Background

draw

public void draw(java.awt.Graphics2D graphics,
                 int xOffset,
                 int yOffset)
drawBackground

Specified by:
draw in interface Background
Parameters:
xOffset - int
yOffset - int

getName

public java.lang.String getName()
Specified by:
getName in interface Updateable
Returns:

setMapSize

public void setMapSize(MapSize mapSize)
setMapSize

Specified by:
setMapSize in interface Background
Parameters:
mapSize - int

setScreenSize

public void setScreenSize(int width,
                          int height)
setScreenSize

Specified by:
setScreenSize in interface Background
Parameters:
width - int
height - int

update

public void update(long elapseTime)
Description copied from interface: Updateable
This method takes the elapse time, and calculates the new current frame of the animation.

Specified by:
update in interface Updateable
Parameters:
elapseTime - long