com.b3dgs.lionengine.game.background
Class AbstractClouds

java.lang.Object
  extended by com.b3dgs.lionengine.game.background.AbstractClouds
All Implemented Interfaces:
BackgroundComponent

public abstract class AbstractClouds
extends java.lang.Object
implements BackgroundComponent

This class handle clouds effect.


Field Summary
protected  TiledSprite sprite
           
 
Constructor Summary
AbstractClouds(java.lang.String path, int cloudWidth, int cloudHeight, boolean wide, int screenWidth, int decY)
          Create a new cloud.
 
Method Summary
 void render(java.awt.Graphics2D g)
          Render component.
 void setSpeed(int line, float speed)
          Set cloud line speed (usually, line 0 is faster than last line).
 void setY(int line, int y)
          Set cloud line height (usually, line 0 is higher than last line).
 void update(int x, int y, float speed, float extrp)
          Update component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sprite

protected final TiledSprite sprite
Constructor Detail

AbstractClouds

public AbstractClouds(java.lang.String path,
                      int cloudWidth,
                      int cloudHeight,
                      boolean wide,
                      int screenWidth,
                      int decY)
Create a new cloud.

Parameters:
path - clouds image path.
cloudWidth - image width.
cloudHeight - image height.
wide - screen wide.
screenWidth - screen height.
decY - vertical offset.
Method Detail

setY

public void setY(int line,
                 int y)
Set cloud line height (usually, line 0 is higher than last line).

Parameters:
line - cloud line (0 = top, last = bottom).
y - cloud height.

setSpeed

public void setSpeed(int line,
                     float speed)
Set cloud line speed (usually, line 0 is faster than last line).

Parameters:
line - cloud line (0 = top, last = bottom).
speed - cloud speed.

update

public void update(int x,
                   int y,
                   float speed,
                   float extrp)
Description copied from interface: BackgroundComponent
Update component.

Specified by:
update in interface BackgroundComponent
Parameters:
x - horizontal offset.
y - vertical offset.
speed - scrolling speed.
extrp - extrapolation value.

render

public void render(java.awt.Graphics2D g)
Description copied from interface: BackgroundComponent
Render component.

Specified by:
render in interface BackgroundComponent
Parameters:
g - graphic output.