public class CameraStrategy extends CameraGame
CameraGame.setView(int, int, int, int)
and setBorders(MapTile)
when the map is
loaded.height, intervalHorizontal, intervalVertical, location, offset, width, x, y
Constructor and Description |
---|
CameraStrategy(int hStep,
int vStep)
Create a strategy oriented camera.
|
CameraStrategy(MapTile<?,?> map)
Create a strategy oriented camera.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canSee(EntityStrategy entity)
Check if camera can see the entity.
|
void |
follow(Localizable entity) |
int |
getLocationInTileX(MapTile<?,?> map)
Get the horizontal location in tile.
|
int |
getLocationInTileY(MapTile<?,?> map)
Get the vertical location in tile.
|
boolean |
isInside(CursorStrategy cursor)
Check if cursor in inside camera view (outside panel).
|
void |
moveLocation(double extrp,
double vx,
double vy) |
void |
setBorders(MapTile<?,?> map)
Set up camera limits depending of the map.
|
void |
setKeys(Integer left,
Integer right,
Integer up,
Integer down)
Set specific camera keyboard controls.
|
void |
setLocation(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, getLocationOldX, getLocationOldY, getLocationRealX, getLocationRealY, getLocationX, getLocationY, getMovementHorizontal, getMovementVertical, getViewHeight, getViewpointX, getViewpointY, getViewWidth, getViewX, getViewY, getWidth, isVisible, isVisible, moveLocation, resetInterval, setIntervals, setLocation, setLocationX, setLocationY, setSize, setView, teleport, teleportX, teleportY
public CameraStrategy(MapTile<?,?> map)
setBorders(MapTile)
function when the map is
loaded.map
- The map reference (hStep and vStep will use the map tile size).public CameraStrategy(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(MapTile<?,?> map)
map
- The map reference.public void setKeys(Integer left, Integer right, Integer up, Integer down)
left
- The left key.right
- The right key.up
- The up key.down
- The down key.public void setLocation(MapTile<?,?> map, int tx, int ty)
map
- The map reference.tx
- The horizontal tile location.ty
- The vertical tile location.public int getLocationInTileX(MapTile<?,?> map)
map
- The map reference.public int getLocationInTileY(MapTile<?,?> map)
map
- The map reference.public boolean isInside(CursorStrategy cursor)
cursor
- The cursor reference.true
if cursor in inside camera view, false
else.public boolean canSee(EntityStrategy 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 Localizable
moveLocation
in class CameraGame
public void follow(Localizable entity)
follow
in class CameraGame
Copyright © 2014 Byron 3D Games Studio. All rights reserved.