public interface ICamera extends IUpdateable
Modifier and Type | Method and Description |
---|---|
Align |
getClampAlign() |
Valign |
getClampValign() |
java.awt.geom.Point2D |
getFocus()
Gets the map location that is focused by this camera.
|
java.awt.geom.Point2D |
getMapLocation(java.awt.geom.Point2D point)
Gets the map location.
|
double |
getPixelOffsetX()
Gets the pixel offset x.
|
double |
getPixelOffsetY()
Gets the pixel offset y.
|
float |
getRenderScale() |
java.awt.geom.Rectangle2D |
getViewport()
Gets the camera region.
|
java.awt.geom.Point2D |
getViewportDimensionCenter(IEntity entity) |
java.awt.geom.Point2D |
getViewportLocation(double x,
double y)
Gets the render location.
|
java.awt.geom.Point2D |
getViewportLocation(IEntity entity)
This method calculates to location for the specified entity in relation to
the focus map location of the camera.
|
java.awt.geom.Point2D |
getViewportLocation(java.awt.geom.Point2D point)
This method calculates to location for the specified point in relation to
the focus map location of the camera.
|
float |
getZoom() |
boolean |
isClampToMap() |
void |
onFocusChanged(java.util.function.Consumer<java.awt.geom.Point2D> focusCons) |
void |
onZoomChanged(java.util.function.DoubleConsumer zoomCons) |
void |
pan(double x,
double y,
int duration)
Pans the camera over the specified duration (in frames) to the target
location, after accounting for modifications such as clamping to the
map.
|
void |
pan(java.awt.geom.Point2D focus,
int duration)
Pans the camera over the specified duration (in frames) to the target
location, after accounting for modifications such as clamping to the
map.
|
void |
setClampAlign(Align align,
Valign valign) |
void |
setClampToMap(boolean clampToMap) |
void |
setFocus(double x,
double y) |
void |
setFocus(java.awt.geom.Point2D focus) |
void |
setZoom(float zoom,
int delay) |
void |
shake(double intensity,
int delay,
int duration) |
void |
updateFocus() |
update
java.awt.geom.Point2D getFocus()
java.awt.geom.Point2D getMapLocation(java.awt.geom.Point2D point)
point
- the pointdouble getPixelOffsetX()
double getPixelOffsetY()
java.awt.geom.Rectangle2D getViewport()
java.awt.geom.Point2D getViewportDimensionCenter(IEntity entity)
java.awt.geom.Point2D getViewportLocation(double x, double y)
x
- the xy
- the yjava.awt.geom.Point2D getViewportLocation(IEntity entity)
entity
- the entityjava.awt.geom.Point2D getViewportLocation(java.awt.geom.Point2D point)
point
- the pointfloat getRenderScale()
float getZoom()
void onZoomChanged(java.util.function.DoubleConsumer zoomCons)
void onFocusChanged(java.util.function.Consumer<java.awt.geom.Point2D> focusCons)
void setFocus(java.awt.geom.Point2D focus)
void setFocus(double x, double y)
void pan(java.awt.geom.Point2D focus, int duration)
focus
- the new focus for the camera once the panning is completeduration
- the number of frames between this call and when the pan
completesvoid pan(double x, double y, int duration)
x
- the new X position for the camera once the panning is completey
- the new Y position for the camera once the panning is completeduration
- the number of frames between this call and when the pan
completesvoid setZoom(float zoom, int delay)
boolean isClampToMap()
void setClampToMap(boolean clampToMap)
Align getClampAlign()
Valign getClampValign()
void shake(double intensity, int delay, int duration)
void updateFocus()