Class CameraRenderer
java.lang.Object
org.collebol.engine.gui.graphics.renderer.Renderer
org.collebol.engine.gui.graphics.renderer.CameraRenderer
Render objects within the canvas of the camera. Change the position of the camera and the view will change.
- Since:
- 1.0-dev
- Author:
- ColleBol - contact@collebol.org
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrenderBatchObjects(Map<Integer, List<GameObject>> gameObjects) Render a Map with a List of GameObjects as Batch.voidrenderLight(int id, 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-
-
renderBatchObjects
Render a Map with a List of GameObjects as Batch. This will improve performance a lot.- Parameters:
gameObjects-- See Also:
-
renderText
Render text relative to the camera.- Parameters:
textBuilder-
-
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.
-