Module technology.sola.engine
Class ImageGuiElement
java.lang.Object
technology.sola.engine.graphics.gui.GuiElement<BaseStyles,ImageGuiElement>
technology.sola.engine.graphics.gui.elements.ImageGuiElement
ImageGuiElement is a
GuiElement
that renders a SolaImage
in 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) ImageGuiElement does not render children so this method will do nothing.Calculates content dimensions for this element.@Nullable String
List<GuiElement<?,
?>> ImageGuiElement does not render children so this method will return an empty List.boolean
ImageGuiElement is not focusable so this will return false.removeChild
(GuiElement<?, ?> child) ImageGuiElement does not render children so this method will do nothing.void
renderContent
(Renderer renderer) Method to render the main content of the gui element (not borders, backgrounds, etc.).setAssetId
(String assetId) Sets the id of theSolaImage
asset to 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, isFocussed, isHovered, isLayoutChanged, render, renderChildren, requestFocus, setId, styles
-
Constructor Details
-
ImageGuiElement
public ImageGuiElement()
-
-
Method Details
-
renderContent
Description copied from class:GuiElement
Method to render the main content of the gui element (not borders, backgrounds, etc.).- Specified by:
renderContent
in classGuiElement<BaseStyles,
ImageGuiElement> - Parameters:
renderer
- theRenderer
instance
-
calculateContentDimensions
Description copied from class:GuiElement
Calculates content dimensions for this element. If its dimensions are derived from only its children then it should return null.- Specified by:
calculateContentDimensions
in classGuiElement<BaseStyles,
ImageGuiElement> - Returns:
- the dimensions of the content of this element or null if only children dimensions matter
-
isFocusable
public boolean isFocusable()ImageGuiElement is not focusable so this will return false.- Overrides:
isFocusable
in classGuiElement<BaseStyles,
ImageGuiElement> - Returns:
- false
-
appendChildren
ImageGuiElement does not render children so this method will do nothing.- Overrides:
appendChildren
in classGuiElement<BaseStyles,
ImageGuiElement> - Parameters:
children
- the child elements that will not be added- Returns:
- this
-
removeChild
ImageGuiElement does not render children so this method will do nothing.- Overrides:
removeChild
in classGuiElement<BaseStyles,
ImageGuiElement> - Parameters:
child
- the child element that will not be removed- Returns:
- this
-
getChildren
ImageGuiElement does not render children so this method will return an empty List.- Overrides:
getChildren
in classGuiElement<BaseStyles,
ImageGuiElement> - Returns:
- empty List
-
getAssetId
- Returns:
- the id of the
SolaImage
asset to be rendered
-
setAssetId
Sets the id of theSolaImage
asset to be rendered.- Parameters:
assetId
- the new asset id of the image- Returns:
- this
-