java.lang.Object
dev.aurumbyte.sypherengine.components.camera.Camera2D
Camera class for 2D camera transforms, currently still experimental
- Since:
- v0.3.2
- Author:
- AurumByte
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
attachToEntity
(Entity entity) A method to attach the camera to an entityjavafx.scene.ParallelCamera
Getting the base camera to attach to the scene.void
setCameraPos
(float xPos, float yPos) A method to move the camera to a specific location.void
setCameraPos
(Vector2 cameraPos) A method to move the camera to a specific location.void
update()
Updating the camera's position.
-
Field Details
-
Constructor Details
-
Camera2D
Creating a new camera attached to an entity
- Parameters:
parent
- The entity to which the camera will be attached to- Since:
- 0.3.2
-
Camera2D
public Camera2D()Creating a new camera, not attched to any entity
- Since:
- 0.3.2
-
-
Method Details
-
attachToEntity
A method to attach the camera to an entity
- Parameters:
entity
- the Entity to which the camera will be attched to- Since:
- 0.3.2
-
setCameraPos
public void setCameraPos(float xPos, float yPos) A method to move the camera to a specific location.
- Parameters:
xPos
- the new x position of the camerayPos
- the new y position of the camera- Since:
- 0.3.2
-
setCameraPos
A method to move the camera to a specific location.
- Parameters:
cameraPos
- the new x and y position of the camera, using the Vector2 class- Since:
- 0.3.2
-
getParallelCamera
public javafx.scene.ParallelCamera getParallelCamera()Getting the base camera to attach to the scene.
- Since:
- 0.3.2
-
update
public void update()Updating the camera's position.
- Since:
- 0.3.2
-