|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.background.ParallaxWrapBackground
public class ParallaxWrapBackground
Title: ParallaxWrapBackground
Description: A Background that scrolls as the controlling sprite moves. The background wraps when it has moved beyond its size.
Copyright: Copyright (c) Aug 20, 2014
Constructor Summary | |
---|---|
ParallaxWrapBackground(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 |
setControllingActor(Actor controlingActor)
|
void |
setMapSize(MapSize mapSize)
Set the map size, so the back ground can be adjusted accordingly. |
void |
setParallaxOffset(ParallaxOffset offset)
|
void |
setScreenSize(int width,
int height)
Set the screen size, so the back ground can be adjusted accordingly. |
void |
setSpeed(double speed)
|
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 ParallaxWrapBackground(Animation animation)
Method Detail |
---|
public void addAnimation(Animation animation)
addAnimation
in interface Background
public void draw(java.awt.Graphics2D graphics, int xOffset, int yOffset)
Background
draw
in interface Background
xOffset
- intyOffset
- intpublic void setControllingActor(Actor controlingActor)
public void setScreenSize(int width, int height)
Background
setScreenSize
in interface Background
width
- intheight
- intpublic void setSpeed(double speed)
public void setMapSize(MapSize mapSize)
Background
setMapSize
in interface Background
mapSize
- intpublic java.lang.String getName()
getName
in interface Updateable
public void setParallaxOffset(ParallaxOffset offset)
setParallaxOffset
in interface Parallax
public 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 |