|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.game.Camera
com.b3dgs.lionengine.game.strategy.StrategyCamera
public class StrategyCamera
This camera should be used for a strategy oriented game. It allows free movement arround the current map, using its border as limit. It is also possible to define specific keys for camera handling.
Field Summary |
---|
Fields inherited from class com.b3dgs.lionengine.game.Camera |
---|
horizontalInterval, verticalInterval, x, xOff, xOffOld, xOld, y, yOff, yOffOld, yOld |
Constructor Summary | |
---|---|
StrategyCamera(Screen screen,
AbstractControlPanel<?,?,?> panel,
int hStep,
int vStep)
Create a strategy oriented camera. |
Method Summary | |
---|---|
void |
follow(Entity entity)
Follow automatically the specified entity. |
int |
getOffsetX()
Get horizontal offset. |
int |
getOffsetY()
Get vertical offset. |
int |
getX()
Get horizontal location. |
float |
getXReal()
Get horizontal location. |
int |
getY()
Get vertical location. |
float |
getYReal()
Get vertical location. |
void |
move(float vx,
float vy)
Move the camera using specific vector. |
void |
setBorders(TileBasedMap<?> map,
AbstractControlPanel<?,?,?> panel)
Set up camera limits depending of the map. |
void |
setKeys(int left,
int right,
int up,
int down)
Set specific camera keyboard controls. |
void |
setOffsets(AbstractControlPanel<?,?,?> panel)
Calculate offset depending of the control panel. |
void |
setSensibility(int hSens,
int vSens)
Set camera sensibility (the lowest it is, the fastest it is). |
void |
update(Keyboard keyboard,
Mouse mouse,
float extrp)
Update camera by handling its movements. |
Methods inherited from class com.b3dgs.lionengine.game.Camera |
---|
backupLocation, getDiffX, getDiffY, getXOld, getYOld, place, setIntervals |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StrategyCamera(Screen screen, AbstractControlPanel<?,?,?> panel, int hStep, int vStep)
screen
- screen reference.hStep
- horizontal force move.vStep
- vertical force move.Method Detail |
---|
public void setSensibility(int hSens, int vSens)
hSens
- horizontal sensibility value.vSens
- vertical sensibility value.public void setOffsets(AbstractControlPanel<?,?,?> panel)
panel
- panel reference.public void setBorders(TileBasedMap<?> map, AbstractControlPanel<?,?,?> panel)
map
- map reference.panel
- control panel reference;public void update(Keyboard keyboard, Mouse mouse, float extrp)
keyboard
- keyboard reference.mouse
- mouse reference.extrp
- extrapolation value.public void move(float vx, float vy)
Camera
move
in class Camera
vx
- horizontal vector.vy
- vertical vector.public void follow(Entity entity)
Camera
follow
in class Camera
entity
- entity to follow.public void setKeys(int left, int right, int up, int down)
left
- left key.right
- right key.up
- up key.down
- down key.Keyboard
public int getX()
Camera
getX
in class Camera
public int getY()
Camera
getY
in class Camera
public float getXReal()
Camera
getXReal
in class Camera
public float getYReal()
Camera
getYReal
in class Camera
public int getOffsetX()
public int getOffsetY()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |