Interface GuiImage
public interface GuiImage
A picture for
GuiPainter.image(GuiImage, double, double, double): an item, a GUI sprite, a texture, or a vector image.-
Method Summary
Modifier and TypeMethodDescriptionbooleandeferred()Items and sprites are drawn by Minecraft's GUI renderer after everything else in the frame: they show on top of later drawing and ignoreGuiPainter.pushAlpha(float).static GuiImageitem(net.minecraft.world.item.ItemStack stack) static GuiImagesprite(net.minecraft.resources.Identifier sprite) static GuiImagesvg(net.minecraft.resources.Identifier svg) A vector image: the filled shapes of an SVG file in one color, sharp at any size.static GuiImagetexture(net.minecraft.resources.Identifier texture) A texture, drawn in order with the rest of the frame: clipped, faded and covered by later drawing like any shape.
-
Method Details
-
texture
A texture, drawn in order with the rest of the frame: clipped, faded and covered by later drawing like any shape.- Parameters:
texture- Location of a texture, for examplemyaddon:textures/gui/logo.png. Minecraft loads it the first time it is drawn.- Returns:
- The image
-
svg
A vector image: the filled shapes of an SVG file in one color, sharp at any size. It is drawn like text, in the paint given toGuiPainter.image(GuiImage, double, double, double, double, GuiPaint)(white otherwise), with the text shadow when asked for, and glows withGuiPainter.pushTextGlow(int, float). Strokes, colors and styles in the file are ignored, and a shape withfill="none"is left out.- Parameters:
svg- Location of an SVG file, for examplemyaddon:textures/gui/logo.svg. It is read the first time it is drawn.- Returns:
- The image
-
item
- Parameters:
stack- The item- Returns:
- The image, or null for an empty stack
-
sprite
- Parameters:
sprite- A GUI atlas sprite, for example a mob effect icon- Returns:
- The image
-
deferred
boolean deferred()Items and sprites are drawn by Minecraft's GUI renderer after everything else in the frame: they show on top of later drawing and ignoreGuiPainter.pushAlpha(float). Clips still apply, rounded to whole GUI pixels.- Returns:
- Whether this image is drawn that way
-