Module technology.sola.engine
Class TextRenderUtils
java.lang.Object
technology.sola.engine.graphics.gui.util.TextRenderUtils
TextRenderUtils contains methods useful for rendering text for a GUI.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TextRenderDetailscalculateRenderDetails(Font font, String text, GuiElementBounds contentBounds) CalculatesTextRenderDetailsfor the text based on the content bounds available on currentFont.static voidrenderLines(Renderer renderer, TextRenderDetails textRenderDetails, TextStyles.TextAlignment textAlignment, GuiElementBounds contentBounds, Color textColor) Handles rendering lines of GUI text to aRenderer.
-
Method Details
-
calculateRenderDetails
public static TextRenderDetails calculateRenderDetails(Font font, String text, GuiElementBounds contentBounds) CalculatesTextRenderDetailsfor the text based on the content bounds available on currentFont.- Parameters:
font- the font to render withtext- the text to rendercontentBounds- the bounds to render the text within- Returns:
- the details needed to render the text
-
renderLines
public static void renderLines(Renderer renderer, TextRenderDetails textRenderDetails, TextStyles.TextAlignment textAlignment, GuiElementBounds contentBounds, Color textColor) Handles rendering lines of GUI text to aRenderer.- Parameters:
renderer- theRendererinstancetextRenderDetails- theTextRenderDetailstextAlignment- theTextStyles.TextAlignmentfor renderingcontentBounds- theGuiElement's contentGuiElementBoundstextColor- theColorof the lines of text
-