Class InlineItemRenderer
java.lang.Object
com.samsthenerd.inline.api.client.renderers.InlineItemRenderer
- All Implemented Interfaces:
InlineRenderer<ItemInlineData>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.samsthenerd.inline.api.client.InlineRenderer
InlineRenderer.TextRenderingContext -
Field Summary
FieldsFields inherited from interface com.samsthenerd.inline.api.client.InlineRenderer
DEFAULT_FONT_COLOR, DEFAULT_SHADOW_COLOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcharWidth(ItemInlineData data, net.minecraft.text.Style style, int codepoint) Gets the width of the render without doing the rendering.getGlowPreference(ItemInlineData forData) Indicates preferences for how the render system should handle glow effects with this renderer.net.minecraft.util.IdentifiergetId()Gets this renderer's ID.intrender(ItemInlineData data, net.minecraft.client.gui.DrawContext context, int index, net.minecraft.text.Style style, int codepoint, InlineRenderer.TextRenderingContext trContext) Renders in place of a single codepoint/character based on the data given.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.samsthenerd.inline.api.client.InlineRenderer
handleOwnSizing, handleOwnTransparency
-
Field Details
-
INSTANCE
-
debugEarlyReturn
public static boolean debugEarlyReturn
-
-
Constructor Details
-
InlineItemRenderer
public InlineItemRenderer()
-
-
Method Details
-
getId
public net.minecraft.util.Identifier getId()Description copied from interface:InlineRendererGets this renderer's ID. Used primarily by the InlineData to specify which renderer to use for it.- Specified by:
getIdin interfaceInlineRenderer<ItemInlineData>- Returns:
- the id
-
render
public int render(ItemInlineData data, net.minecraft.client.gui.DrawContext context, int index, net.minecraft.text.Style style, int codepoint, InlineRenderer.TextRenderingContext trContext) Description copied from interface:InlineRendererRenders in place of a single codepoint/character based on the data given.- Specified by:
renderin interfaceInlineRenderer<ItemInlineData>- Parameters:
data- the data to render.context- aDrawContextwith aMatrixStackset to the correct position for this character and with aVertexConsumerProviderfor 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
Description copied from interface:InlineRendererGets the width of the render without doing the rendering.- Specified by:
charWidthin interfaceInlineRenderer<ItemInlineData>- 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
Description copied from interface:InlineRendererIndicates 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. SeeGlowHandlingfor more details.- Specified by:
getGlowPreferencein interfaceInlineRenderer<ItemInlineData>- Parameters:
forData- 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.
-