Abstract Font Renderer
Draws text with minecraft font markup.
The FormattedCharSequence overloads are the primitives and draw the sequence as it is: no sanitizeForeignInput, so text that came from a server has to be sanitized by the caller. The Component overloads do it for you, at the price of an extra pass per call (flatten the component, match the protected names) - pass a sequence once the text is settled, or when it is measured before it is drawn, to pay that only once.
Inheritors
Types
Properties
Functions
inline fun draw(text: Component, parameters: AbstractFontRenderer.DrawParameters.() -> Unit = {}): Float
inline fun draw(text: FormattedCharSequence, parameters: AbstractFontRenderer.DrawParameters.() -> Unit = {}): Float
inline fun draw(text: FormattedCharSequence, parameters: AbstractFontRenderer.DrawParameters.() -> Unit = {}): Float
Draws text as it is - unlike the Component overloads, it is not sanitized.
abstract fun draw(text: FormattedCharSequence, parameters: AbstractFontRenderer.DrawParameters): Float
Draws text with minecraft font markup on GUI with WorldRenderEnvironment.
inline fun draw(text: Component, parameters: AbstractFontRenderer.DrawParameters.() -> Unit = {}): Float
Draws a Component, degenerating its legacy formatting and applying sanitizeForeignInput first. Pass a FormattedCharSequence when the text is already prepared.
abstract fun draw(text: FormattedCharSequence, parameters: AbstractFontRenderer.DrawParameters): Float
Draws text with minecraft font markup on GUI with GuiGraphicsExtractor.
Draws text on the GUI at x/y in GUI pixels; scale 1 is this font's own size, the default matches vanilla's. For Kotlin the context overloads with DrawParameters do the same.
Approximates the width of a text. Accurate except for obfuscated (§k) formatting