public class CameraRts
extends com.b3dgs.lionengine.game.CameraGame
CameraGame.setView(int, int, int, int)
and setBorders(MapTile)
when the map is loaded.Constructor and Description |
---|
CameraRts(int hStep,
int vStep)
Create a strategy oriented camera.
|
CameraRts(com.b3dgs.lionengine.game.map.MapTile<?,?> map)
Create a strategy oriented camera.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canSee(EntityRts entity)
Check if camera can see the entity.
|
void |
follow(com.b3dgs.lionengine.game.purview.Localizable entity) |
int |
getLocationInTileX(com.b3dgs.lionengine.game.map.MapTile<?,?> map)
Get the horizontal location in tile.
|
int |
getLocationInTileY(com.b3dgs.lionengine.game.map.MapTile<?,?> map)
Get the vertical location in tile.
|
boolean |
isInside(CursorRts cursor)
Check if cursor in inside camera view (outside panel).
|
void |
moveLocation(double extrp,
double vx,
double vy) |
void |
setBorders(com.b3dgs.lionengine.game.map.MapTile<?,?> map)
Set up camera limits depending of the map.
|
void |
setKeys(java.lang.Integer left,
java.lang.Integer right,
java.lang.Integer up,
java.lang.Integer down)
Set specific camera keyboard controls.
|
void |
setLocation(com.b3dgs.lionengine.game.map.MapTile<?,?> map,
int tx,
int ty)
Set the camera location at the specified tile location.
|
void |
setSensibility(int hSens,
int vSens)
Set camera sensibility (the lower it is, the faster is the camera movement).
|
void |
update(com.b3dgs.lionengine.Keyboard keyboard)
Update camera by handling its movements.
|
getHeight, getLocationIntX, getLocationIntY, getLocationOffsetX, getLocationOffsetY, getLocationOldX, getLocationOldY, getLocationRealX, getLocationRealY, getLocationX, getLocationY, getMovementHorizontal, getMovementVertical, getViewHeight, getViewpointX, getViewpointY, getViewWidth, getViewX, getViewY, getWidth, isVisible, isVisible, moveLocation, resetInterval, setIntervals, setLocation, setLocationOffset, setLocationX, setLocationY, setSize, setView, teleport, teleportX, teleportY
public CameraRts(com.b3dgs.lionengine.game.map.MapTile<?,?> map)
setBorders(MapTile)
function when the map is
loaded.map
- The map reference (hStep and vStep will use the map tile size).public CameraRts(int hStep, int vStep)
hStep
- The horizontal force move (usually the map tile width).vStep
- The vertical force move (usually the map tile height).public void update(com.b3dgs.lionengine.Keyboard keyboard)
keyboard
- The keyboard reference.public void setSensibility(int hSens, int vSens)
hSens
- The horizontal sensibility value (positive value).vSens
- The vertical sensibility value (positive value).public void setBorders(com.b3dgs.lionengine.game.map.MapTile<?,?> map)
map
- The map reference.public void setKeys(java.lang.Integer left, java.lang.Integer right, java.lang.Integer up, java.lang.Integer down)
left
- The left key.right
- The right key.up
- The up key.down
- The down key.public void setLocation(com.b3dgs.lionengine.game.map.MapTile<?,?> map, int tx, int ty)
map
- The map reference.tx
- The horizontal tile location.ty
- The vertical tile location.public int getLocationInTileX(com.b3dgs.lionengine.game.map.MapTile<?,?> map)
map
- The map reference.public int getLocationInTileY(com.b3dgs.lionengine.game.map.MapTile<?,?> map)
map
- The map reference.public boolean isInside(CursorRts cursor)
cursor
- The cursor reference.true
if cursor in inside camera view, false
else.public boolean canSee(EntityRts entity)
entity
- The entity to check.true
if can see the entity, false
else.public void moveLocation(double extrp, double vx, double vy)
moveLocation
in interface com.b3dgs.lionengine.game.purview.Localizable
moveLocation
in class com.b3dgs.lionengine.game.CameraGame
public void follow(com.b3dgs.lionengine.game.purview.Localizable entity)
follow
in class com.b3dgs.lionengine.game.CameraGame