@Environment(value=CLIENT)
public interface Segment
| Modifier and Type | Method and Description |
|---|---|
Segment |
next()
Set after construction of document, used for formatting, specifically
to compute the height for last segment on a line (to force a new line).
|
int |
nextX(int indent,
int maxWidth,
net.minecraft.client.font.TextRenderer renderer)
Get the X coordinate at which to render the next segment.
|
int |
nextY(int indent,
int maxWidth,
net.minecraft.client.font.TextRenderer renderer)
Get the Y coordinate at which to render the next segment.
|
Segment |
parent()
Parent segment, i.e.
|
java.lang.Iterable<Segment> |
refine(java.util.regex.Pattern pattern,
SegmentRefiner refiner)
Used during construction, checks a segment for inner segments.
|
java.util.Optional<InteractiveSegment> |
render(net.minecraft.client.util.math.MatrixStack matrices,
int x,
int y,
int indent,
int maxWidth,
net.minecraft.client.font.TextRenderer renderer,
int mouseX,
int mouseY)
Render the segment at the specified coordinates with the specified
properties.
|
Segment |
root()
The root segment, i.e.
|
void |
setNext(Segment segment) |
@Nullable Segment parent()
Segment root()
int nextX(int indent,
int maxWidth,
net.minecraft.client.font.TextRenderer renderer)
For flowing/inline segments this will be to the right of the last line this segment renders, for block segments it will be at the start of the next line below this segment.
The coordinates in this context are relative to (0,0).
indent - the current indentation.maxWidth - the maximum width of the document.renderer - the font renderer used.int nextY(int indent,
int maxWidth,
net.minecraft.client.font.TextRenderer renderer)
For flowing/inline segments this will be the same level as the last line this segment renders, unless it's the last segment on its line. For block segments and last-on-line segments this will be the next line after.
The coordinates in this context are relative to (0,0).
indent - the current indentation.maxWidth - the maximum width of the document.renderer - the font renderer used.java.util.Optional<InteractiveSegment> render(net.minecraft.client.util.math.MatrixStack matrices, int x, int y, int indent, int maxWidth, net.minecraft.client.font.TextRenderer renderer, int mouseX, int mouseY)
matrices - the transformation stack.x - the x position to render at.y - the y position to render at.indent - the current indentation.maxWidth - the maximum width of the document.renderer - the font renderer to use.mouseX - the x mouse position.mouseY - the y mouse position.java.lang.Iterable<Segment> refine(java.util.regex.Pattern pattern, SegmentRefiner refiner)
pattern - the regex pattern used for refinement.refiner - the callback for successful matches.@Nullable Segment next()
void setNext(Segment segment)