Class InlineErrorRenderer

java.lang.Object
com.samsthenerd.inline.api.client.renderers.InlineErrorRenderer
All Implemented Interfaces:
InlineRenderer

public class InlineErrorRenderer extends Object implements InlineRenderer
  • Field Details

  • Constructor Details

    • InlineErrorRenderer

      public InlineErrorRenderer()
  • Method Details

    • getId

      public net.minecraft.util.Identifier getId()
      Description copied from interface: InlineRenderer
      Gets this renderer's ID. Used primarily by the InlineData to specify which renderer to use for it.
      Specified by:
      getId in interface InlineRenderer
      Returns:
      the id
    • render

      public int render(InlineData data, net.minecraft.client.gui.DrawContext context, int index, net.minecraft.text.Style style, int codepoint, InlineRenderer.TextRenderingContext trContext)
      Description copied from interface: InlineRenderer
      Renders in place of a single codepoint/character based on the data given.
      Specified by:
      render in interface InlineRenderer
      Parameters:
      data - the data to render.
      context - a DrawContext with a MatrixStack set to the correct position for this character and with a VertexConsumerProvider for rendering to.
      index - the index of this character in the overall string.
      style - the style attached to the text.
      codepoint - the unicode codepoint for this character.
      trContext - a collection of values taken from the text renderer.
      Returns:
      the width that this render takes up. more or less corresponds to pixels in the default font.
    • charWidth

      public int charWidth(InlineData data, net.minecraft.text.Style style, int codepoint)
      Description copied from interface: InlineRenderer
      Gets the width of the render without doing the rendering.
      Specified by:
      charWidth in interface InlineRenderer
      Parameters:
      data - the data to render.
      style - the style attached to the text.
      codepoint - the unicode codepoint for this character.
      Returns:
      the width that this render takes up. more or less corresponds to pixels in the default font.
    • getGlowPreference

      public GlowHandling getGlowPreference(InlineData data)
      Description copied from interface: InlineRenderer
      Indicates preferences for how the render system should handle glow effects with this renderer. Glow effects happen when a sign is clicked with a glow ink sac. Vanilla text handles this by rendering text in 8 offsets, doing this with inline renders tends to create a busy z-fighting mess. Instead, the render system can flatten the rendering to create an outline. See GlowHandling for more details.
      Specified by:
      getGlowPreference in interface InlineRenderer
      Parameters:
      data - incase the handling changes based on data. This should really only be used for returning a cache id in the GlowHandling.
      Returns:
      a GlowHandling for if this renderer needs glow help.