UI Elements
GuiText
This element is used to display text on the screen.
Fields:
text- The text to display, a Component (can be a Literal or a Translatable likegui.my_mod.my_text)HorizontalAlignment- The horizontal alignment of the text, can beLEFT,CENTERorRIGHTVerticalAlignment- The vertical alignment of the text, can beTOP,CENTERorBOTTOM
GuiRichText
This element is used to display rich text on the screen.
Supports BBCode formatting, allowing for standard BBCode featurs such as colors, bold, italic.
LibLib provides custom BBCode tags for additional features, such as shake, wave, tornado, rainbow, gradient and pulse.
Same fields as GuiText, but also supports the following additional fields:
textWidth- The width of the text area, if the text exceeds this width it will wrap to the next line.
GuiImage
This element is used to display an image on the screen.
When constructing a GuiImage, you need to provied the image's dimensions.
Fields:
imagePath- The path to the image, a ResourceLocationimageHorizontalAlignment- The horizontal alignment of the image, can beLEFT,CENTERorRIGHTimageVerticalAlignment- The vertical alignment of the image, can beTOP,CENTERorBOTTOM
GuiButton
A button element that can be clicked by the user.
When constructing a GuiButton, you need to provide the button's content (a Component) and optionally the click calback.
GuiColorRect
This element is used to display a colored rectangle on the screen.
When constructing a GuiColorRect, you need to provide the color of the rectangle as well as its corners.