org.deken.game.background
Class ScrollBackground

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

public class ScrollBackground
extends java.lang.Object
implements Background, Updateable

Title: ScrollBackground

Description: Scroll the background image at the specified speed, tiling the image when needed. The image scrolls at a constant speed.

Copyright: (c) 2010

Version:
1.0
Author:
Gary Deken

Constructor Summary
ScrollBackground(Animation animation)
           
ScrollBackground(Animation animation, GameVector direction)
           
 
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 setName(java.lang.String name)
           
 void setScreenSize(int width, int height)
          setScreenSize
 void update(long elapseTime)
          update This updates the scroll position of the background image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScrollBackground

public ScrollBackground(Animation animation)

ScrollBackground

public ScrollBackground(Animation animation,
                        GameVector direction)
Parameters:
backgroundImage -
direction -
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:
graphics -
xOffset - int
yOffset - int

getName

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

setScreenSize

public void setScreenSize(int width,
                          int height)
setScreenSize

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

setMapSize

public void setMapSize(MapSize mapSize)
setMapSize

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

setName

public void setName(java.lang.String name)

update

public void update(long elapseTime)
update This updates the scroll position of the background image.

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