Package com.csse3200.game.components
Class CameraComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.CameraComponent
CameraComponent to control aspects of the camera in game.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSets Orthographic CameraCameraComponent(com.badlogic.gdx.graphics.Camera camera) Used for camera reset/change -
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.graphics.CameraReturns cameracom.badlogic.gdx.math.Matrix4Getter for Projection Matrixvoidresize(int screenWidth, int screenHeight, float gameWidth) Resizes the camera FOVvoidupdate()Called once per frame of the game, and should be used for most component logic.Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
CameraComponent
public CameraComponent()Sets Orthographic Camera -
CameraComponent
public CameraComponent(com.badlogic.gdx.graphics.Camera camera) Used for camera reset/change- Parameters:
camera-
-
-
Method Details
-
update
public void update()Description copied from class:ComponentCalled once per frame of the game, and should be used for most component logic. Not called if component is disabled. -
getProjectionMatrix
public com.badlogic.gdx.math.Matrix4 getProjectionMatrix()Getter for Projection Matrix- Returns:
- Matrix4 Projection Matrix
-
getCamera
public com.badlogic.gdx.graphics.Camera getCamera()Returns camera- Returns:
- camera
-
resize
public void resize(int screenWidth, int screenHeight, float gameWidth) Resizes the camera FOV- Parameters:
screenWidth-screenHeight-gameWidth-
-