org.deken.game.background
Class PanLengthBackground

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

public class PanLengthBackground
extends java.lang.Object
implements Background

Title: PanLengthBackground

Description: Pan the background image from one side of the map to the other side of the map.

Copyright: (c) 2010

Version:
1.0
Author:
Gary Deken

Constructor Summary
PanLengthBackground(Animation animation)
           
 
Method Summary
 void addAnimation(Animation animation)
           
 void draw(java.awt.Graphics2D graphics, int xOffset, int yOffset)
          Draws the back ground based on the current offset of the map, and the Backgrounds equation for calculating its position.
 java.lang.String getName()
           
 void setMapSize(MapSize mapSize)
          Also sets the dividend for calculating the scroll position.
 void setScreenSize(int width, int height)
          Also sets the dividend for calculating the scroll position.
 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
 

Constructor Detail

PanLengthBackground

public PanLengthBackground(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)
Description copied from interface: Background
Draws the back ground based on the current offset of the map, and the Backgrounds equation for calculating its position.

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

getName

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

setMapSize

public void setMapSize(MapSize mapSize)
Also sets the dividend for calculating the scroll position.

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

setScreenSize

public void setScreenSize(int width,
                          int height)
Also sets the dividend for calculating the scroll position.

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