Class TextureRenderer

java.lang.Object
org.collebol.engine.gui.graphics.renderer.Renderer
org.collebol.engine.gui.graphics.renderer.TextureRenderer

public class TextureRenderer extends Renderer
This class contains everything you need to render Textures on a Panel.
Since:
1.0-dev
Author:
ColleBol - contact@collebol.org
  • Constructor Details

    • TextureRenderer

      public TextureRenderer(String name, float width, float height)
    • TextureRenderer

      public TextureRenderer(String name, EJGEngine e)
  • Method Details

    • render

      public void render(int id, Vector2D position, float scale, float rotation, Vector2D origin, boolean lighting)
      Render a texture from a registered id.
      Parameters:
      id - register a texture first!
      position -
      scale -
      rotation -
      origin -
    • renderBatch

      public void renderBatch(Batch batch, boolean lighting)
      Renders a batch of items using a specified texture. This method iterates through each item in the batch, applies transformations (translation, rotation, scaling), and renders the item as a textured quad.
      Parameters:
      batch - the batch of items to be rendered
      lighting - whether to enable lighting during rendering
    • applyLight

      public void applyLight(int id, Light light, float scale, float[] ambientColor)
    • registerTexture

      public void registerTexture(Texture texture)
    • getTexture

      public Texture getTexture(int id)
    • getName

      public String getName()