Class ButtonRenderer
java.lang.Object
org.collebol.engine.gui.graphics.renderer.Renderer
org.collebol.engine.gui.graphics.renderer.ui.ButtonRenderer
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrenderButton(int id) Renders a button with the specified ID.voidrenderSubButton(int id, int parentId) Renders a sub-button with the specified ID within a parent component.
-
Constructor Details
-
ButtonRenderer
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 renderparentId- the ID of the parent component
-