Class GuideText
java.lang.Object
net.ixdarklord.folios.api.client.page.GuideText
Text written for a book, set out in lines to a width. It is a small part of Markdown, so long text reads well in
a JSON file:
- A line is a line; an empty line starts a new paragraph.
# Headingand## Smaller heading;---alone is a dividing rule.- item(or* item) is a bullet,1. itema numbered one; two spaces before nest it.> textis set apart as a note.**bold**,*italic*(or_italic_),__underlined__,~~struck~~,`code`.[label](target)links to an entry (entry:id,entry:id#anchoror the bare id), a category (category:id) or a web page (https://...).{#FF8800}coloured{/}colours text;{key:key.jump}names the key bound to something.- A backslash keeps the next character as it is:
\*.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat a line is part of, which decides how it is drawn.static final recordOne line, at (x, y) from the text's top left. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final StringThe insertion text of a link's characters starts with this; the rest is where it goes. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(GuidePainter painter, int x, int y) Draws the text with its top left at (x, y), its links pressable.intheight()From the top of the first line to the bottom of the last.static net.minecraft.network.chat.ComponentOne line of marked-up text (a title or a label) as a component; block marks are kept as written.booleanisEmpty()lines()static GuideTextReads marked-up text and sets it out in lines no wider thanwidth.static StringText without its marks, for searching.static StringThe text a raw string stands for: its translation if it is a translation key, otherwise itself.split(int firstHeight, int nextHeight) Splits the text into pieces that fit: the firstfirstHeighttall, the restnextHeight.intwidth()The width it was set out to.intwidth(net.minecraft.client.gui.Font font) The widest line.
-
Field Details
-
LINK
The insertion text of a link's characters starts with this; the rest is where it goes.- See Also:
-
LINE_HEIGHT
public static final int LINE_HEIGHT- See Also:
-
-
Method Details
-
lines
-
height
public int height()From the top of the first line to the bottom of the last. -
width
public int width()The width it was set out to. -
isEmpty
public boolean isEmpty() -
resolve
-
inline
One line of marked-up text (a title or a label) as a component; block marks are kept as written. -
plain
-
of
-
split
-
draw
Draws the text with its top left at (x, y), its links pressable. -
width
public int width(net.minecraft.client.gui.Font font) The widest line.
-