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 Type
    Method
    Description
    boolean
    Items and sprites are drawn by Minecraft's GUI renderer after everything else in the frame: they show on top of later drawing and ignore GuiPainter.pushAlpha(float).
    static GuiImage
    item(net.minecraft.world.item.ItemStack stack)
     
    static GuiImage
    sprite(net.minecraft.resources.Identifier sprite)
     
    static GuiImage
    svg(net.minecraft.resources.Identifier svg)
    A vector image: the filled shapes of an SVG file in one color, sharp at any size.
    static GuiImage
    texture(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

      static GuiImage texture(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.
      Parameters:
      texture - Location of a texture, for example myaddon:textures/gui/logo.png. Minecraft loads it the first time it is drawn.
      Returns:
      The image
    • svg

      static GuiImage svg(net.minecraft.resources.Identifier 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 to GuiPainter.image(GuiImage, double, double, double, double, GuiPaint) (white otherwise), with the text shadow when asked for, and glows with GuiPainter.pushTextGlow(int, float). Strokes, colors and styles in the file are ignored, and a shape with fill="none" is left out.
      Parameters:
      svg - Location of an SVG file, for example myaddon:textures/gui/logo.svg. It is read the first time it is drawn.
      Returns:
      The image
    • item

      static GuiImage item(net.minecraft.world.item.ItemStack stack)
      Parameters:
      stack - The item
      Returns:
      The image, or null for an empty stack
    • sprite

      static GuiImage sprite(net.minecraft.resources.Identifier 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 ignore GuiPainter.pushAlpha(float). Clips still apply, rounded to whole GUI pixels.
      Returns:
      Whether this image is drawn that way