|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.game.Camera
public class Camera
Standard camera, able to handle move, and both vertical/horizontal floating interleave. Camera can be used to move easily arround a map by following a specific entity.
Field Summary | |
---|---|
protected float |
horizontalInterval
Interleave value. |
protected float |
verticalInterval
Interleave value. |
protected float |
x
Current and old location. |
protected float |
xOff
Current and old offsets. |
protected float |
xOffOld
Current and old offsets. |
protected float |
xOld
Current and old location. |
protected float |
y
Current and old location. |
protected float |
yOff
Current and old offsets. |
protected float |
yOffOld
Current and old offsets. |
protected float |
yOld
Current and old location. |
Constructor Summary | |
---|---|
Camera(int horizontalInterval,
int verticalInterval)
Create a new camera. |
Method Summary | |
---|---|
void |
backupLocation()
Save current location. |
void |
follow(Entity entity)
Follow automatically the specified entity. |
float |
getDiffX()
Get the horizontal movement. |
float |
getDiffY()
Get the vertical movement. |
int |
getX()
Get horizontal location. |
float |
getXOld()
Get old horizontal location. |
float |
getXReal()
Get horizontal location. |
int |
getY()
Get vertical location. |
float |
getYOld()
Get old vertical location. |
float |
getYReal()
Get vertical location. |
void |
move(float vx,
float vy)
Move the camera using specific vector. |
void |
place(float x,
float y)
Place camera at a specific location. |
void |
setIntervals(int horizontalInterval,
int verticalInterval)
Set intervals. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected float x
protected float y
protected float xOld
protected float yOld
protected float xOff
protected float xOffOld
protected float yOff
protected float yOffOld
protected float horizontalInterval
protected float verticalInterval
Constructor Detail |
---|
public Camera(int horizontalInterval, int verticalInterval)
horizontalInterval
- horizontal margin.verticalInterval
- vertical margin.Method Detail |
---|
public void setIntervals(int horizontalInterval, int verticalInterval)
horizontalInterval
- horizontal margin.verticalInterval
- vertical margin.public void move(float vx, float vy)
vx
- horizontal vector.vy
- vertical vector.public void place(float x, float y)
x
- horizontal location.y
- vertical location.public void follow(Entity entity)
entity
- entity to follow.public void backupLocation()
public float getXReal()
public float getYReal()
public int getX()
public int getY()
public float getXOld()
public float getYOld()
public float getDiffX()
public float getDiffY()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |