public abstract class AbstractBackground extends java.lang.Object implements Background
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
BACKGROUNDS |
protected java.util.List<BackgroundComponent> |
components |
protected int |
componentsNumber |
static java.lang.String |
DIR |
protected int |
fact |
protected int |
maxY |
protected int |
minY |
protected java.lang.String |
theme |
protected int |
totalHeight |
protected boolean |
wide |
Constructor and Description |
---|
AbstractBackground(java.lang.String theme,
int min,
int max,
boolean wide,
int factor)
Create a new background.
|
Modifier and Type | Method and Description |
---|---|
protected void |
add(BackgroundComponent component) |
protected BackgroundElement |
createElement(java.lang.String path,
java.lang.String name,
int x,
int y,
int factor) |
void |
render(java.awt.Graphics2D g)
Background renderings.
|
void |
update(float speed,
float y,
float extrp)
Background updates.
|
public static final java.lang.String DIR
public static final java.lang.String[] BACKGROUNDS
protected final int maxY
protected final int minY
protected java.util.List<BackgroundComponent> components
protected int totalHeight
protected int fact
protected boolean wide
protected int componentsNumber
protected java.lang.String theme
public AbstractBackground(java.lang.String theme, int min, int max, boolean wide, int factor)
theme
- background theme.min
- minimal y value for background.max
- maximal y value for background.wide
- wide state.factor
- factor reference.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)
protected BackgroundElement createElement(java.lang.String path, java.lang.String name, int x, int y, int factor)