Class Screens
java.lang.Object
net.fabricmc.fabric.api.client.screen.v1.Screens
Utility methods related to screens.
- See Also:
ScreenEvents
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<net.minecraft.client.gui.widget.AbstractButtonWidget>
getButtons(net.minecraft.client.gui.screen.Screen screen)
Gets all of a screen's button widgets.static net.minecraft.client.MinecraftClient
getClient(net.minecraft.client.gui.screen.Screen screen)
static net.minecraft.client.render.item.ItemRenderer
getItemRenderer(net.minecraft.client.gui.screen.Screen screen)
Gets a screen's item renderer.static net.minecraft.client.font.TextRenderer
getTextRenderer(net.minecraft.client.gui.screen.Screen screen)
Gets a screen's text renderer.
-
Method Details
-
getButtons
public static List<net.minecraft.client.gui.widget.AbstractButtonWidget> getButtons(net.minecraft.client.gui.screen.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'schild elements
.- Returns:
- a list of all of a screen's buttons
-
getItemRenderer
public static net.minecraft.client.render.item.ItemRenderer getItemRenderer(net.minecraft.client.gui.screen.Screen screen)Gets a screen's item renderer.- Returns:
- the screen's item renderer
-
getTextRenderer
public static net.minecraft.client.font.TextRenderer getTextRenderer(net.minecraft.client.gui.screen.Screen screen)Gets a screen's text renderer.- Returns:
- the screen's text renderer.
-
getClient
public static net.minecraft.client.MinecraftClient getClient(net.minecraft.client.gui.screen.Screen screen)
-