|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.game.background.AbstractBackground
public abstract class AbstractBackground
AbstractBackground skeleton, used for future backgrounds implementation.
Field Summary | |
---|---|
protected java.util.List<BackgroundComponent> |
components
List of components contained by this background. |
protected int |
componentsNumber
Number of background components. |
protected int |
maxY
Minimum/maximum background value. |
protected int |
minY
Minimum/maximum background value. |
protected java.lang.String |
theme
Background theme name. |
protected int |
totalHeight
Total background height. |
protected boolean |
wide
Wide state. |
Constructor Summary | |
---|---|
AbstractBackground(java.lang.String theme,
int min,
int max,
boolean wide)
Create a new background. |
Method Summary | |
---|---|
protected void |
add(BackgroundComponent component)
Add a component to the background. |
protected BackgroundElement |
createElement(java.lang.String path,
java.lang.String name,
int x,
int y,
boolean alpha)
Create an element from a path and its name, plus its coordinates. |
protected Sprite |
createSprite(java.lang.String filename,
boolean alpha)
Create a sprite from its filename. |
void |
render(java.awt.Graphics2D g)
Background renderings. |
void |
update(float speed,
float y,
float extrp)
Background updates. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.List<BackgroundComponent> components
protected final int maxY
protected final int minY
protected final boolean wide
protected int totalHeight
protected int componentsNumber
protected final java.lang.String theme
Constructor Detail |
---|
public AbstractBackground(java.lang.String theme, int min, int max, boolean wide)
theme
- background theme.min
- minimal y value for background.max
- maximal y value for background.wide
- wide state.Method Detail |
---|
public final void update(float speed, float y, float extrp)
Background
update
in interface Background
speed
- scrolling speed.y
- background y.extrp
- extrapolation value.public final void render(java.awt.Graphics2D g)
Background
render
in interface Background
g
- graphic output.protected void add(BackgroundComponent component)
component
- component reference.protected Sprite createSprite(java.lang.String filename, boolean alpha)
filename
- filename.
protected BackgroundElement createElement(java.lang.String path, java.lang.String name, int x, int y, boolean alpha)
path
- element path.name
- element name.x
- location x.y
- location y.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |