Class ButtonRenderer

java.lang.Object
org.collebol.client.gui.graphics.renderer.Renderer
org.collebol.client.gui.graphics.renderer.ui.ButtonRenderer

public class ButtonRenderer extends Renderer
The ButtonRenderer class is responsible for rendering button components in the UI. It handles the rendering of both standalone buttons and sub-buttons within a parent component. This class uses OpenGL for rendering the button's background, border, and text.

Usage:

     ButtonRenderer buttonRenderer = new ButtonRenderer(engine);
     buttonRenderer.renderButton(buttonId);
     buttonRenderer.renderSubButton(subButtonId, parentId);
 
Since:
1.0-dev
Author:
ColleBol - contact@collebol.org
  • Constructor Details

    • ButtonRenderer

      public ButtonRenderer(EJGEngine engine)
      ButtonRenderer constructor.
      Parameters:
      engine - instance
  • Method Details

    • renderButton

      public void renderButton(int id)
      Renders a button with the specified ID.

      This method retrieves the button component by its ID, and renders its background, border, and text.

      Parameters:
      id - the ID of the button to render
    • renderSubButton

      public void renderSubButton(int id, int parentId)
      Renders a sub-button with the specified ID within a parent component.

      This method retrieves the parent component and the sub-button by their IDs, and renders the sub-button's background, border, and text. The sub-button's position is relative to the parent component's position.

      Parameters:
      id - the ID of the sub-button to render
      parentId - the ID of the parent component