Interface ComponentLayout


public interface ComponentLayout
A layout that aligns components on a TextScreen.
  • Method Summary

    Modifier and Type
    Method
    Description
    alignComponents(net.minecraft.client.gui.Font font, int width)
    Aligns some components for the screen.
    simple(net.minecraft.network.chat.Component... content)
    Creates a simple ComponentLayout that aligns the given components below each other.
    simple(net.minecraft.network.chat.Component title, List<net.minecraft.network.chat.Component> content)
    Creates a simple ComponentLayout that aligns the given components below each other.
    default net.minecraft.network.chat.Component
    Gets the screen title if available.
  • Method Details

    • title

      @Nullable default net.minecraft.network.chat.Component title()
      Gets the screen title if available.
    • alignComponents

      List<TextScreenEntry> alignComponents(net.minecraft.client.gui.Font font, int width)
      Aligns some components for the screen.
      Parameters:
      font - The font that is used to display the content.
      width - The available screen width
    • simple

      static ComponentLayout simple(net.minecraft.network.chat.Component... content)
      Creates a simple ComponentLayout that aligns the given components below each other.
    • simple

      static ComponentLayout simple(@Nullable net.minecraft.network.chat.Component title, List<net.minecraft.network.chat.Component> content)
      Creates a simple ComponentLayout that aligns the given components below each other. The title is displayed centered above the other text.