public abstract class BackgroundPlatform extends Object implements Background
Modifier and Type | Field and Description |
---|---|
protected List<BackgroundComponent> |
components
List of components contained by this background.
|
protected int |
componentsNumber
Number of background components.
|
protected int |
maxY
Minimum background value.
|
protected int |
minY
Maximum background value.
|
protected String |
theme
Background theme name.
|
protected int |
totalHeight
Total background height.
|
Constructor and Description |
---|
BackgroundPlatform(String theme,
int min,
int max)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
add(BackgroundComponent component)
Add a component to the background.
|
BackgroundElement |
createElement(String name,
int x,
int y,
boolean alpha)
Create an element from a name, plus its coordinates.
|
BackgroundElement |
createElement(String path,
String name,
int x,
int y,
boolean alpha)
Create an element from a path and its name, plus its coordinates.
|
protected com.b3dgs.lionengine.drawable.Sprite |
createSprite(com.b3dgs.lionengine.core.Media media,
boolean alpha)
Create a sprite from its filename.
|
int |
getOffsetY()
Get the y offset.
|
String |
getTheme()
Get the background theme.
|
void |
render(com.b3dgs.lionengine.Graphic g)
Background renderings.
|
protected void |
renderComponent(int index,
com.b3dgs.lionengine.Graphic g)
Render the specified component.
|
protected void |
setOffsetY(int offsetY)
Set the y offset.
|
void |
update(double extrp,
double speed,
double y)
Background updates.
|
protected final List<BackgroundComponent> components
protected final int maxY
protected final int minY
protected final String theme
protected int totalHeight
protected int componentsNumber
public BackgroundPlatform(String theme, int min, int max)
theme
- The background theme.min
- The minimal y value for background.max
- The maximal y value for background.public BackgroundElement createElement(String name, int x, int y, boolean alpha)
name
- The element name.x
- The location x.y
- The location y.alpha
- The alpha use flag.public BackgroundElement createElement(String path, String name, int x, int y, boolean alpha)
path
- The element path.name
- The element name.x
- The location x.y
- The location y.alpha
- The alpha use flag.public int getOffsetY()
public String getTheme()
protected void add(BackgroundComponent component)
component
- The component reference.protected void renderComponent(int index, com.b3dgs.lionengine.Graphic g)
index
- The component index.g
- The graphic output.protected com.b3dgs.lionengine.drawable.Sprite createSprite(com.b3dgs.lionengine.core.Media media, boolean alpha)
media
- The sprite media.alpha
- The alpha use flag.protected void setOffsetY(int offsetY)
offsetY
- The y offset.public final void update(double extrp, double speed, double y)
Background
update
in interface Background
extrp
- The extrapolation value.speed
- The scrolling speed.y
- The background y.public final void render(com.b3dgs.lionengine.Graphic g)
Background
render
in interface Background
g
- The graphic output.Copyright © 2014 Byron 3D Games Studio. All rights reserved.