Class CameraRenderer
java.lang.Object
org.collebol.gui.graphics.renderer.CameraRenderer
- All Implemented Interfaces:
Renderer
Render objects within the canvas of the camera. Change the position of the camera and the view will change.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrenderLight(int index, GameLocation location, float radius, float[] color) Render light relative to the camera.voidrenderObject(GameObject gameObject) Render a GameObject relative to the Camera.voidrenderObjects(List<GameObject> gameObjects) Render GameObjects relative to the Camera.voidrenderText(CameraRenderer.TextBuilder textBuilder) Render text relative to the camera.voidDisplays various coordinates and camera information on the screen.voidRenders grid lines on the screen based on the camera's position and zoom level.voidRenders the origin point of the camera on the screen.
-
Constructor Details
-
CameraRenderer
-
-
Method Details
-
renderObjects
Render GameObjects relative to the Camera.- Parameters:
gameObjects-
-
renderObject
Render a GameObject relative to the Camera.- Parameters:
gameObject-
-
renderText
Render text relative to the camera.- Parameters:
textBuilder-
-
renderLight
Render light relative to the camera.- Parameters:
location- the game location of the lightradius- radius of the light (how big)color- the color of the light, example: new float[]{ 1.0f, 1.0f, 1.0f, 1.0f }
-
showOriginPoint
public void showOriginPoint()Renders the origin point of the camera on the screen.This method uses OpenGL to draw a red point at the camera's origin and a circle around it.
-
showCoordinates
public void showCoordinates()Displays various coordinates and camera information on the screen.This method retrieves the current camera and mouse positions, and renders text on the screen showing the mouse game location, camera-origin game location, mouse panel position, camera-origin panel position, camera zoom level, and camera rotation.
-
showGridLines
public void showGridLines()Renders grid lines on the screen based on the camera's position and zoom level.This method calculates the starting positions for the grid lines based on the camera's offset and origin. It then uses OpenGL to draw yellow grid lines across the screen and blue diagonal lines forming a square.
-