|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.background.LayeredBackground
public class LayeredBackground
Title: LayeredBackground
Description: LayeredBackground stores Backgrounds in a layer, where element 0 is the bottom layer and higher numbers are above.
Copyright: Copyright (c) Jul 5, 2014
Constructor Summary | |
---|---|
LayeredBackground()
|
|
LayeredBackground(Animation animation)
|
Method Summary | |
---|---|
void |
addAnimation(Animation animation)
Adds a FixedBackground in the next layer up. |
void |
addBackground(Background background)
Adds the Background to the top of the layers. |
void |
addBackground(int layer,
Background background)
Adds the Background at the specified layer. |
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)
Set the map size, so the back ground can be adjusted accordingly. |
void |
setScreenSize(int width,
int height)
Set the screen size, so the back ground can be adjusted accordingly. |
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 |
---|
public LayeredBackground()
public LayeredBackground(Animation animation)
Method Detail |
---|
public void addAnimation(Animation animation)
addAnimation
in interface Background
animation
- public void addBackground(Background background)
background
- public void addBackground(int layer, Background background)
layer
- background
- public void draw(java.awt.Graphics2D graphics, int xOffset, int yOffset)
Background
draw
in interface Background
xOffset
- intyOffset
- intpublic java.lang.String getName()
getName
in interface Updateable
public void setMapSize(MapSize mapSize)
Background
setMapSize
in interface Background
mapSize
- intpublic void setScreenSize(int width, int height)
Background
setScreenSize
in interface Background
width
- intheight
- intpublic void update(long elapseTime)
Updateable
update
in interface Updateable
elapseTime
- long
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |