Module technology.sola.engine
Class TextGuiElement
java.lang.Object
technology.sola.engine.graphics.gui.GuiElement<TextStyles,TextGuiElement>
technology.sola.engine.graphics.gui.elements.TextGuiElement
TextGuiElement is a
GuiElement that renders text for a GUI. It does not render child elements.-
Field Summary
Fields inherited from class technology.sola.engine.graphics.gui.GuiElement
children, contentBounds, styleContainer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendChildren(GuiElement<?, ?>... children) TextGuiElement does not render children so this method will do nothing.Calculates content dimensions for this element.@Nullable StringgetText()booleanTextGuiElement is not focusable so this will return false.removeChild(GuiElement<?, ?> child) TextGuiElement does not render children so this method will do nothing.voidrenderContent(Renderer renderer) Method to render the main content of the gui element (not borders, backgrounds, etc.).self()Sets the text that will be rendered.Methods inherited from class technology.sola.engine.graphics.gui.GuiElement
addStyle, addStyle, addStyles, events, findElementById, findElementsByType, findFocussedChildIndex, getAssetLoaderProvider, getBounds, getContentBounds, getFocusableChildren, getId, getParent, invalidateLayout, isActive, isAttached, isFocussed, isHovered, isLayoutChanged, render, renderChildren, requestFocus, setId, setVirtualKeyboardVisible, styles
-
Constructor Details
-
TextGuiElement
public TextGuiElement()
-
-
Method Details
-
renderContent
Description copied from class:GuiElementMethod to render the main content of the gui element (not borders, backgrounds, etc.).- Specified by:
renderContentin classGuiElement<TextStyles,TextGuiElement> - Parameters:
renderer- theRendererinstance
-
calculateContentDimensions
Description copied from class:GuiElementCalculates content dimensions for this element. If its dimensions are derived from only its children then it should return null.- Specified by:
calculateContentDimensionsin classGuiElement<TextStyles,TextGuiElement> - Returns:
- the dimensions of the content of this element or null if only children dimensions matter
-
self
- Specified by:
selfin classGuiElement<TextStyles,TextGuiElement> - Returns:
- A correctly typed reference to this
GuiElement
-
isFocusable
public boolean isFocusable()TextGuiElement is not focusable so this will return false.- Overrides:
isFocusablein classGuiElement<TextStyles,TextGuiElement> - Returns:
- false
-
appendChildren
TextGuiElement does not render children so this method will do nothing.- Overrides:
appendChildrenin classGuiElement<TextStyles,TextGuiElement> - Parameters:
children- the child elements to add- Returns:
- this
-
removeChild
TextGuiElement does not render children so this method will do nothing.- Overrides:
removeChildin classGuiElement<TextStyles,TextGuiElement> - Parameters:
child- the child element that will not be removed- Returns:
- this
-
getText
- Returns:
- the text that will be rendered
-
setText
Sets the text that will be rendered.- Parameters:
text- the new text to be rendered- Returns:
- this
-