Interface GuiProvider

All Known Implementing Classes:
ContainerGuiProvider

public interface GuiProvider
This interface is used to build modular gui Screens. For modular gui container screens use ContainerGuiProvider Created by brandon3055 on 19/08/2023
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Use this method to build the modular gui.
    default GuiElement<?>
    Override this to defile a custom root gui element.
  • Method Details

    • createRootElement

      default GuiElement<?> createRootElement(ModularGui gui)
      Override this to defile a custom root gui element. Useful if you want to use something like a background texture or a manipulable element as the root element.
      Parameters:
      gui - The modular GUI.
      Returns:
      the root gui element.
    • buildGui

      void buildGui(ModularGui gui)
      Use this method to build the modular gui.

      Initialize the gui root element with ModularGui.initStandardGui(int, int), ModularGui.initFullscreenGui() This applies bindings to fix the size and position of the root element, you can also do this manually for custom configurations.

      Build your gui by adding and configuring your desired gui elements. Elements must be added to the root gui element which is obtainable via gui.getRoot()

      Note: gui elements are added on construction, meaning you do not need to use element.addChild. Instead, just construct the elements, and pass in the root element (or any other initialized element) as the parent.

      Parameters:
      gui - The modular gui instance.