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 TextRenderDetails
calculateRenderDetails
(Font font, String text, GuiElementBounds contentBounds) CalculatesTextRenderDetails
for the text based on the content bounds available on currentFont
.static void
renderLines
(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) CalculatesTextRenderDetails
for 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
- theRenderer
instancetextRenderDetails
- theTextRenderDetails
textAlignment
- theTextStyles.TextAlignment
for renderingcontentBounds
- theGuiElement
's contentGuiElementBounds
textColor
- theColor
of the lines of text
-