Class ImageComponent


public class ImageComponent extends GuiComponent<ImageComponent>
Image-rendering component backed by jar resources or runtime URLs.
  • Constructor Details

    • ImageComponent

      public ImageComponent()
  • Method Details

    • source

      public ImageComponent source(GuiImageSource source)
      Sets the image source.
      Parameters:
      source - image source
      Returns:
      this component
    • resource

      public ImageComponent resource(net.minecraft.resources.Identifier resourceId)
      Sets a jar/resource-pack image source.
      Parameters:
      resourceId - image resource identifier
      Returns:
      this component
    • url

      public ImageComponent url(String url)
      Sets a URL image source.
      Parameters:
      url - image URL
      Returns:
      this component
    • fit

      public ImageComponent fit(GuiImageFit fit)
      Sets how the image fits the available content box.
      Parameters:
      fit - fit mode
      Returns:
      this component
    • rotationDegrees

      public ImageComponent rotationDegrees(float rotationDegrees)
    • rotateClockwise90

      public ImageComponent rotateClockwise90()
    • rotateCounterClockwise90

      public ImageComponent rotateCounterClockwise90()
    • rotate180

      public ImageComponent rotate180()
    • mirrorHorizontal

      public ImageComponent mirrorHorizontal()
    • mirrorHorizontal

      public ImageComponent mirrorHorizontal(boolean mirrorHorizontal)
    • mirrorVertical

      public ImageComponent mirrorVertical()
    • mirrorVertical

      public ImageComponent mirrorVertical(boolean mirrorVertical)
    • mirror

      public ImageComponent mirror(boolean mirrorHorizontal, boolean mirrorVertical)
    • preferredWidth

      protected float preferredWidth(com.render.api.gui.GuiRenderContext context)
      Overrides:
      preferredWidth in class GuiComponent<ImageComponent>
    • preferredHeight

      protected float preferredHeight(com.render.api.gui.GuiRenderContext context)
      Overrides:
      preferredHeight in class GuiComponent<ImageComponent>
    • renderSelf

      protected void renderSelf(com.render.api.gui.GuiRenderContext context)
      Overrides:
      renderSelf in class GuiComponent<ImageComponent>