public class Parallax extends Object implements BackgroundComponent
Constructor and Description |
---|
Parallax(Resolution source,
Media media,
int parallaxsNumber,
int decX,
int decY,
int sx,
int sy)
Create a parallax.
|
Modifier and Type | Method and Description |
---|---|
void |
render(Graphic g)
Render component.
|
void |
setScreenSize(int screenWidth,
int screenHeight)
Set the screen size.
|
void |
update(double extrp,
int x,
int y,
double speed)
Update component.
|
public Parallax(Resolution source, Media media, int parallaxsNumber, int decX, int decY, int sx, int sy)
source
- The resolution source used.media
- The parallax image media.parallaxsNumber
- The number parallax lines.decX
- The horizontal offset.decY
- The vertical offset.sx
- The starting width.sy
- The starting height.LionEngineException
- If arguments are invalid.public final void setScreenSize(int screenWidth, int screenHeight)
screenWidth
- The screen width.screenHeight
- The screen height.public void update(double extrp, int x, int y, double speed)
BackgroundComponent
update
in interface BackgroundComponent
extrp
- The extrapolation value.x
- The horizontal offset.y
- The vertical offset.speed
- The scrolling speed.public void render(Graphic g)
BackgroundComponent
render
in interface BackgroundComponent
g
- The graphic output.Copyright © 2016 Byron 3D Games Studio. All rights reserved.