java.lang.Object
technology.sola.engine.graphics.gui.style.BaseStyles
Direct Known Subclasses:
TextStyles

@NullMarked public class BaseStyles extends Object
BaseStyles contains properties that are common to all GuiElement to use as part of rendering.
  • Constructor Details

  • Method Details

    • create

      public static BaseStyles.Builder<?> create()
      Convenience method for creating a new BaseStyles.Builder.
      Returns:
      a new builder instance
    • background

      public @Nullable Background background()
      Describes how the background of the GuiElement should render.
      Returns:
      the Background
    • border

      public @Nullable Border border()
      Describes how the border of the GuiElement should render.
      Returns:
      the Border
    • padding

      public Padding padding()
      Contains the padding values between the content and border of the GuiElement.
      Returns:
      the Padding
    • width

      public @Nullable StyleValue width()
      Defines the preferred width of the GuiElement. This will cause it to not resize based on its children for its width.
      Returns:
      the width of the element
    • height

      public @Nullable StyleValue height()
      Defines the preferred height of the GuiElement. This will cause it to not resize based on its children for its height.
      Returns:
      the height of the element
    • gap

      public @Nullable Integer gap()
      Defines the space between each child GuiElement of this element.
      Returns:
      the gap between child elements
    • direction

      public @Nullable Direction direction()
      Defines the Direction child elements flow.
      Returns:
      the direction child elements flow
    • mainAxisChildren

      public @Nullable MainAxisChildren mainAxisChildren()
      Defines how child elements will align on the main axis (based on the direction()).
      Returns:
      the MainAxisChildren
    • crossAxisChildren

      public @Nullable CrossAxisChildren crossAxisChildren()
      Defines how child elements will align on the cross axis (based on the direction()).
      Returns:
      the CrossAxisChildren
    • position

      public Position position()
      Defines whether this GuiElement is positioned absolutely or relatively. Absolutely positioned elements are not considered part of the flow of its parent but instead position based on its parent's GuiElement.getBounds().
      Returns:
      the Position
    • visibility

      public @Nullable Visibility visibility()
      Defines the visibility of the GuiElement.
      Returns:
      the Visibility