public class GuiUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
GuiUtil.AutoGlScissor
A type of
AutoCloseable that will pop off the current GL11.glScissor(int, int, int, int) . |
static interface |
GuiUtil.IVerticalAppendingDrawer<D> |
Constructor and Description |
---|
GuiUtil() |
Modifier and Type | Method and Description |
---|---|
static ToolTip |
createToolTip(GuiBC8<?> gui,
java.util.function.Supplier<net.minecraft.item.ItemStack> stackRef) |
static void |
drawFluid(IGuiArea position,
net.minecraftforge.fluids.FluidStack fluid,
int capacity) |
static void |
drawFluid(IGuiArea position,
net.minecraftforge.fluids.FluidStack fluid,
int amount,
int capacity) |
static void |
drawFluid(IGuiArea position,
Tank tank) |
static int |
drawHoveringText(java.util.List<java.lang.String> textLines,
int mouseX,
int mouseY,
int screenWidth,
int screenHeight,
int maxTextWidth,
net.minecraft.client.gui.FontRenderer font)
Straight copy of
GuiUtils.drawHoveringText(List, int, int, int, int, int, FontRenderer) , except that we
return the size of the box that was drawn. |
static void |
drawItemStackAt(net.minecraft.item.ItemStack stack,
int x,
int y) |
static <D> void |
drawVerticallyAppending(IGuiPosition element,
java.lang.Iterable<? extends D> iterable,
GuiUtil.IVerticalAppendingDrawer<D> drawer)
Draws multiple elements, one after each other.
|
static GuiUtil.AutoGlScissor |
scissor(double x,
double y,
double width,
double height) |
static GuiUtil.AutoGlScissor |
scissor(IGuiArea area) |
static SpriteNineSliced |
slice(ISprite sprite,
double uMin,
double vMin,
double uMax,
double vMax,
double scale) |
static SpriteNineSliced |
slice(ISprite sprite,
int uMin,
int vMin,
int uMax,
int vMax,
int textureSize) |
static ISprite |
subAbsolute(ISprite sprite,
double uMin,
double vMin,
double uMax,
double vMax) |
static ISprite |
subAbsolute(ISprite sprite,
double uMin,
double vMin,
double uMax,
double vMax,
double spriteSize) |
static ISprite |
subRelative(ISprite sprite,
double u,
double v,
double width,
double height) |
static ISprite |
subRelative(ISprite sprite,
double u,
double v,
double width,
double height,
double size) |
public static ToolTip createToolTip(GuiBC8<?> gui, java.util.function.Supplier<net.minecraft.item.ItemStack> stackRef)
public static <D> void drawVerticallyAppending(IGuiPosition element, java.lang.Iterable<? extends D> iterable, GuiUtil.IVerticalAppendingDrawer<D> drawer)
public static void drawItemStackAt(net.minecraft.item.ItemStack stack, int x, int y)
public static int drawHoveringText(java.util.List<java.lang.String> textLines, int mouseX, int mouseY, int screenWidth, int screenHeight, int maxTextWidth, net.minecraft.client.gui.FontRenderer font)
GuiUtils.drawHoveringText(List, int, int, int, int, int, FontRenderer)
, except that we
return the size of the box that was drawn. Draws a tooltip box on the screen with text in it. Automatically
positions the box relative to the mouse to match Mojang's implementation. Automatically wraps text when there is
not enough space on the screen to display the text without wrapping. Can have a maximum width set to avoid
creating very wide tooltips.textLines
- the lines of text to be drawn in a hovering tooltip box.mouseX
- the mouse X positionmouseY
- the mouse Y positionscreenWidth
- the available screen width for the tooltip to drawn inscreenHeight
- the available screen height for the tooltip to drawn inmaxTextWidth
- the maximum width of the text in the tooltip box. Set to a negative number to have no max
width.font
- the font for drawing the text in the tooltip boxpublic static void drawFluid(IGuiArea position, net.minecraftforge.fluids.FluidStack fluid, int capacity)
public static void drawFluid(IGuiArea position, net.minecraftforge.fluids.FluidStack fluid, int amount, int capacity)
public static GuiUtil.AutoGlScissor scissor(double x, double y, double width, double height)
public static GuiUtil.AutoGlScissor scissor(IGuiArea area)
public static ISprite subRelative(ISprite sprite, double u, double v, double width, double height, double size)
public static ISprite subAbsolute(ISprite sprite, double uMin, double vMin, double uMax, double vMax, double spriteSize)
public static ISprite subRelative(ISprite sprite, double u, double v, double width, double height)
public static ISprite subAbsolute(ISprite sprite, double uMin, double vMin, double uMax, double vMax)
public static SpriteNineSliced slice(ISprite sprite, int uMin, int vMin, int uMax, int vMax, int textureSize)
public static SpriteNineSliced slice(ISprite sprite, double uMin, double vMin, double uMax, double vMax, double scale)