Class SvgComponent


public final class SvgComponent extends GuiComponent<SvgComponent>
SVG-rendering component backed by files, raw strings, or the SVG builder.
  • Constructor Details

    • SvgComponent

      public SvgComponent()
  • Method Details

    • source

      public SvgComponent source(GuiSvgSource source)
      Sets the SVG source.
      Parameters:
      source - SVG source
      Returns:
      this component
    • document

      public SvgComponent document(GuiSvgDocument document)
      Sets a retained, dynamically styled SVG document.
      Parameters:
      document - retained SVG tree
      Returns:
      this component
    • resource

      public SvgComponent resource(net.minecraft.resources.Identifier resourceId)
      Sets an SVG resource source.
      Parameters:
      resourceId - SVG resource identifier
      Returns:
      this component
    • url

      public SvgComponent url(String url)
      Sets an SVG URL source.
      Parameters:
      url - SVG URL
      Returns:
      this component
    • svg

      public SvgComponent svg(String svg)
      Sets raw SVG markup.
      Parameters:
      svg - SVG markup
      Returns:
      this component
    • builder

      public SvgComponent builder(GuiSvgBuilder builder)
      Sets SVG content from a builder.
      Parameters:
      builder - SVG builder
      Returns:
      this component
    • fit

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

      public SvgComponent rotationDegrees(float rotationDegrees)
    • rotateClockwise90

      public SvgComponent rotateClockwise90()
    • rotateCounterClockwise90

      public SvgComponent rotateCounterClockwise90()
    • rotate180

      public SvgComponent rotate180()
    • mirrorHorizontal

      public SvgComponent mirrorHorizontal()
    • mirrorHorizontal

      public SvgComponent mirrorHorizontal(boolean mirrorHorizontal)
    • mirrorVertical

      public SvgComponent mirrorVertical()
    • mirrorVertical

      public SvgComponent mirrorVertical(boolean mirrorVertical)
    • mirror

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

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

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

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