public interface ICamera extends IUpdateable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ICamera.FocusChangedListener
This listener interface receives focus events for a camera.
|
static interface |
ICamera.ZoomChangedListener
This listener interface receives zoom events for a camera.
|
| 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 |
onFocus(ICamera.FocusChangedListener listener)
Adds the specified focus changed listener to receive events when the focus of this camera changed.
|
void |
onZoom(ICamera.ZoomChangedListener listener)
Adds the specified zoom changed listener to receive events when the zoom of this camera changed.
|
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 |
removeFocusListener(ICamera.FocusChangedListener listener)
Removes the specified focus changed listener.
|
void |
removeZoomListener(ICamera.ZoomChangedListener listener)
Removes the specified zoom changed listener.
|
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() |
updatevoid onZoom(ICamera.ZoomChangedListener listener)
listener - The listener to add.void removeZoomListener(ICamera.ZoomChangedListener listener)
listener - The listener to add.void onFocus(ICamera.FocusChangedListener listener)
listener - The listener to add.void removeFocusListener(ICamera.FocusChangedListener listener)
listener - The listener to add.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 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()