java.lang.Object
net.fabricmc.fabric.api.client.screen.v1.Screens

@Environment(CLIENT) public final class Screens extends Object
Utility methods related to screens.
See Also:
  • Method Details

    • getButtons

      public static List<ClickableWidget> getButtons(Screen screen)
      Gets all of a screen's button widgets. The provided list allows for addition and removal of buttons from the screen. This method should be preferred over adding buttons directly to a screen's child elements.
      Returns:
      a list of all of a screen's buttons
    • getItemRenderer

      public static ItemRenderer getItemRenderer(Screen screen)
      Gets a screen's item renderer.
      Returns:
      the screen's item renderer
    • getTextRenderer

      public static TextRenderer getTextRenderer(Screen screen)
      Gets a screen's text renderer.
      Returns:
      the screen's text renderer.
    • getClient

      public static MinecraftClient getClient(Screen screen)