Package com.prineside.tdi2
Class CameraController
java.lang.Object
com.prineside.tdi2.CameraController
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic interfacestatic class - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatstatic final floatdoubledoublebooleanbooleanbooleanfloatbooleandouble - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidfitMapToScreen(float padding) Centers the camera and sets the zoom level to make the whole map visibleintintdoubledoubledoublebooleanisIntRectVisible(IntRectangle rectangle) booleanisPointVisible(float x, float y, float size) booleanisPointVisible(Vector2 pos, float size) booleanisRectVisible(Rectangle rectangle) booleanisRectVisibleMarginSmall(Rectangle rectangle) voidlookAt(float x, float y) voidlookAtAlignToViewport(float x, float y, float viewportCoeffX, float viewportCoeffY) Make x, y appear at the specified vcX, vcY point of the viewport.voidmapToScreen(Vector2 pos) voidmapToStage(Vector2 pos) voidmapToViewport(Vector2 pos) voidplayScenario(CameraTools.Scenario scenario, float time, boolean looped) voidrealUpdate(float deltaTime) voidvoidscreenToMap(Vector2 pos) voidscreenToStage(Vector2 pos) voidscreenToViewport(Vector2 pos) voidvoidsetMapSize(int width, int height) voidsetRevZoomPercent(double newZoom) voidsetScreenSize(int width, int height) voidsetZoom(double newZoom) voidsetZoomBoundaries(float minTileSizeCm, float maxZoomToMapScale) voidstageToMap(Vector2 pos) voidstageToScreen(Vector2 pos) Turn a stage coordinates (for example, an Actor's position) into a screen position (depends on the resolution)voidvoidvoidvoidvoidviewportToScreen(Vector2 pos)  
- 
Field Details
- 
DEFAULT_MIN_ZOOM_TILE_SIZE
public static final float DEFAULT_MIN_ZOOM_TILE_SIZE- See Also:
 
 - 
DEFAULT_MAX_ZOOM_MAP_SCALE
public static final float DEFAULT_MAX_ZOOM_MAP_SCALE- See Also:
 
 - 
camera
 - 
zoom
public double zoom - 
hardZoomLimits
public boolean hardZoomLimits - 
hardMinZoom
public double hardMinZoom - 
hardMaxZoom
public double hardMaxZoom - 
scrollZoomRequiresAlt
public boolean scrollZoomRequiresAlt - 
outmapCheckEnabled
public boolean outmapCheckEnabled - 
dragButtonIndices
 - 
currentScenario
 - 
scenarioTime
public float scenarioTime - 
scenarioLooped
public boolean scenarioLooped 
 - 
 - 
Constructor Details
- 
CameraController
 
 - 
 - 
Method Details
- 
getRevZoomPercent
public double getRevZoomPercent() - 
setRevZoomPercent
public void setRevZoomPercent(double newZoom)  - 
getMinZoom
public double getMinZoom() - 
getMaxZoom
public double getMaxZoom() - 
setMap
 - 
getMapWidth
public int getMapWidth() - 
getMapHeight
public int getMapHeight() - 
getInputProcessor
 - 
stopScenario
public void stopScenario() - 
animate
 - 
stopAnimations
public void stopAnimations() - 
setScreenSize
public void setScreenSize(int width, int height)  - 
setMapSize
public void setMapSize(int width, int height)  - 
isRectVisible
 - 
isIntRectVisible
 - 
isPointVisible
 - 
isPointVisible
public boolean isPointVisible(float x, float y, float size)  - 
isRectVisibleMarginSmall
 - 
addListener
 - 
removeListener
 - 
updateMinMaxZoom
public void updateMinMaxZoom() - 
setZoomBoundaries
public void setZoomBoundaries(float minTileSizeCm, float maxZoomToMapScale)  - 
setZoom
public void setZoom(double newZoom)  - 
lookAt
public void lookAt(float x, float y)  - 
getLookPos
 - 
lookAtAlignToViewport
public void lookAtAlignToViewport(float x, float y, float viewportCoeffX, float viewportCoeffY) Make x, y appear at the specified vcX, vcY point of the viewport. Viewport coordinates are values in range 0..1- Parameters:
 x- X axis of the point on map (px)y- Y axis of the point on map (px)viewportCoeffX- viewport coefficient, value between 0 (left) and 1 (right)viewportCoeffY- viewport coefficient, value between 0 (bottom) and 1 (top)
 - 
screenToViewport
 - 
viewportToScreen
 - 
stageToScreen
Turn a stage coordinates (for example, an Actor's position) into a screen position (depends on the resolution) - 
screenToStage
 - 
screenToMap
 - 
stageToMap
 - 
mapToViewport
 - 
mapToScreen
 - 
mapToStage
 - 
fitMapToScreen
public void fitMapToScreen(float padding) Centers the camera and sets the zoom level to make the whole map visible- Parameters:
 padding- a minimal distance from a tile to the edge of the screen
 - 
realUpdate
public void realUpdate(float deltaTime)  - 
updateCamera
public void updateCamera() 
 -