Class CameraData
java.lang.Object
dev.prozilla.pine.core.component.Component
dev.prozilla.pine.core.component.camera.CameraData
- All Implemented Interfaces:
Destructible,Printable,ApplicationContext,ApplicationProvider,ComponentsContext,ComponentsProvider,EntityContext,EntityProvider,SceneContext,SceneProvider
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyTransform(float x, float y) Applies the camera's transformation to a given x and y value.applyTransform(Vector2f position) Applies the camera's transformation to a given position.floatReturns the horizontal center of this camera.floatReturns the vertical center of this camera.floatgetScale()Returns the scale of the camera's viewport.floatgetZoom()Returns the zoom value multiplied by the scale of the viewport.voidmultiplyZoom(float factor) Zooms the camera by a factor.screenToWorldPosition(int screenX, int screenY) screenToWorldPosition(Vector2i screenPosition) voidsetBackgroundColor(Color color) voidsetSize(int width, int height) voidzoomIn(float zoom) Zooms the camera in or out based on a zoom value.Methods inherited from class dev.prozilla.pine.core.component.Component
destroy, equals, getApplication, getEntity, getName, getScene, hashCode, onEntityChange, setActive, setEntity, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.prozilla.pine.core.ApplicationProvider
getAudioDevice, getConfig, getInput, getLocalStorage, getLogger, getModManager, getRenderer, getTimer, getTracker, getWindowMethods inherited from interface dev.prozilla.pine.core.component.ComponentsProvider
getComponent, getComponentInParent, getComponentInParent, getComponents, getComponentsInChildrenMethods inherited from interface dev.prozilla.pine.core.entity.EntityContext
isDescendantOfMethods inherited from interface dev.prozilla.pine.core.entity.EntityProvider
getChild, getChildWithTag, getFirstChild, getLastChild, getParentWithTag, getTransform, isDescendantOfMethods inherited from interface dev.prozilla.pine.core.scene.SceneProvider
getCameraData, getWorld
-
Field Details
-
zoomFactor
public float zoomFactor -
width
public float width -
height
public float height -
backgroundColor
-
-
Constructor Details
-
CameraData
public CameraData() -
CameraData
-
-
Method Details
-
setSize
public void setSize(int width, int height) -
setBackgroundColor
-
multiplyZoom
public void multiplyZoom(float factor) Zooms the camera by a factor.- Parameters:
factor- Zoom factor
-
zoomIn
public void zoomIn(float zoom) Zooms the camera in or out based on a zoom value. Use a positive value to zoom in and a negative value to zoom out.- Parameters:
zoom- Zoom value
-
getScale
public float getScale()Returns the scale of the camera's viewport.- Returns:
- Scale
-
getZoom
public float getZoom()Returns the zoom value multiplied by the scale of the viewport.- Returns:
- Zoom value
-
getCenterX
public float getCenterX()Returns the horizontal center of this camera.- Returns:
- X value
-
getCenterY
public float getCenterY()Returns the vertical center of this camera.- Returns:
- Y value
-
applyTransform
Applies the camera's transformation to a given x and y value.- Returns:
- Array of x and y values
-
applyTransform
Applies the camera's transformation to a given position.- Returns:
- Array of x and y values
-
screenToWorldPosition
-
screenToWorldPosition
-