Package com.prineside.tdi2
Class CameraController
java.lang.Object
com.prineside.tdi2.CameraController
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static interface
static interface
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final float
static final float
double
double
boolean
boolean
boolean
float
boolean
double
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
fitMapToScreen
(float padding) Centers the camera and sets the zoom level to make the whole map visibleint
int
double
double
double
boolean
isIntRectVisible
(IntRectangle rectangle) boolean
isPointVisible
(float x, float y, float size) boolean
isPointVisible
(Vector2 pos, float size) boolean
isRectVisible
(Rectangle rectangle) boolean
isRectVisibleMarginSmall
(Rectangle rectangle) void
lookAt
(float x, float y) void
lookAtAlignToViewport
(float x, float y, float viewportCoeffX, float viewportCoeffY) Make x, y appear at the specified vcX, vcY point of the viewport.void
mapToScreen
(Vector2 pos) void
mapToStage
(Vector2 pos) void
mapToViewport
(Vector2 pos) void
playScenario
(CameraTools.Scenario scenario, float time, boolean looped) void
realUpdate
(float deltaTime) void
void
screenToMap
(Vector2 pos) void
screenToStage
(Vector2 pos) void
screenToViewport
(Vector2 pos) void
void
setMapSize
(int width, int height) void
setRevZoomPercent
(double newZoom) void
setScreenSize
(int width, int height) void
setZoom
(double newZoom) void
setZoomBoundaries
(float minTileSizeCm, float maxZoomToMapScale) void
stageToMap
(Vector2 pos) void
stageToScreen
(Vector2 pos) Turn a stage coordinates (for example, an Actor's position) into a screen position (depends on the resolution)void
void
void
void
void
viewportToScreen
(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()
-