Skip to content

IDraw2D ​

com.jsmacrosce.jsmacros.client.api.classes.render.IDraw2D

Since1.2.7

A 2D overlay that holds render elements; implemented by standalone overlays and screens.

Both implementations expose the same element API.

js
// a plain overlay, the usual implementation
const draw = Hud.createDraw2D();  
draw.addText("hello", 10, 10, Color.rgb(0xFF, 0xFF, 0xFF), true);  
draw.register();

Type Parameters ​

  • T: the type returned by removal methods

Methods ​

addDraw2D ​

addDraw2D(Draw2D draw2D, int x, int y, int width, int height): Draw2DElementSince1.8.4#
Adds another overlay as a child, or returns null if that would create a cycle.

Parameters:

  • draw2D: the overlay to draw inside this one
  • x: the x position on this draw2d
  • y: the y position on this draw2d
  • width: the nested overlay's width
  • height: the nested overlay's height
Returns: a wrapper for the nested overlay, or null if nesting would create a cycle
addDraw2D(Draw2D draw2D, int x, int y, int width, int height, int zIndex): Draw2DElementSince1.8.4#
Adds another overlay as a child with the specified draw order, or returns null if that would create a cycle.

Parameters:

  • draw2D: the overlay to draw inside this one
  • x: the x position on this draw2d
  • y: the y position on this draw2d
  • width: the nested overlay's width
  • height: the nested overlay's height
  • zIndex: the nested overlay's draw order among this overlay's elements
Returns: a wrapper for the nested overlay, or null if nesting would create a cycle

addImage ​

addImage(int x, int y, int width, int height, String id, int imageX, int imageY, int regionWidth, int regionHeight, int textureWidth, int textureHeight): ImageSince1.2.7#
Adds an unrotated texture region as an image with the default z-index and white tint.

Parameters:

  • x: image's screen-space left edge
  • y: image's screen-space top edge
  • width: displayed width in screen pixels
  • height: displayed height in screen pixels
  • id: texture identifier
  • imageX: region's left coordinate in the texture
  • imageY: region's top coordinate in the texture
  • regionWidth: region width in texture pixels
  • regionHeight: region height in texture pixels
  • textureWidth: full texture width in pixels
  • textureHeight: full texture height in pixels
Returns: added image
addImage(int x, int y, int width, int height, int zIndex, String id, int imageX, int imageY, int regionWidth, int regionHeight, int textureWidth, int textureHeight): ImageSince1.4.0#
Adds an unrotated texture region as an image with a specified z-index and white tint.

Parameters:

  • x: image's screen-space left edge
  • y: image's screen-space top edge
  • width: displayed width in screen pixels
  • height: displayed height in screen pixels
  • zIndex: ordering against elements on this overlay; lower values draw first
  • id: texture identifier
  • imageX: region's left coordinate in the texture
  • imageY: region's top coordinate in the texture
  • regionWidth: region width in texture pixels
  • regionHeight: region height in texture pixels
  • textureWidth: full texture width in pixels
  • textureHeight: full texture height in pixels
Returns: added image
addImage(int x, int y, int width, int height, String id, int imageX, int imageY, int regionWidth, int regionHeight, int textureWidth, int textureHeight, double rotation): ImageSince1.2.7#
Adds a rotated texture region as an image with the default z-index and white tint. Rotation is in degrees about the image's center.

Parameters:

  • x: image's screen-space left edge
  • y: image's screen-space top edge
  • width: displayed width in screen pixels
  • height: displayed height in screen pixels
  • id: texture identifier
  • imageX: region's left coordinate in the texture
  • imageY: region's top coordinate in the texture
  • regionWidth: region width in texture pixels
  • regionHeight: region height in texture pixels
  • textureWidth: full texture width in pixels
  • textureHeight: full texture height in pixels
  • rotation: rotation in degrees
Returns: added image
addImage(int x, int y, int width, int height, int zIndex, String id, int imageX, int imageY, int regionWidth, int regionHeight, int textureWidth, int textureHeight, double rotation): ImageSince1.4.0#
Adds a rotated texture region as an image with a specified z-index and white tint. Rotation is in degrees about the image's center.

Parameters:

  • x: image's screen-space left edge
  • y: image's screen-space top edge
  • width: displayed width in screen pixels
  • height: displayed height in screen pixels
  • zIndex: ordering against elements on this overlay; lower values draw first
  • id: texture identifier
  • imageX: region's left coordinate in the texture
  • imageY: region's top coordinate in the texture
  • regionWidth: region width in texture pixels
  • regionHeight: region height in texture pixels
  • textureWidth: full texture width in pixels
  • textureHeight: full texture height in pixels
  • rotation: rotation in degrees
Returns: added image
addImage(int x, int y, int width, int height, int zIndex, int color, String id, int imageX, int imageY, int regionWidth, int regionHeight, int textureWidth, int textureHeight, double rotation): ImageSince1.6.5#
Adds a rotated, tinted texture region as an image; its alpha is included in color. Rotation is in degrees about the image's center.

Parameters:

  • x: image's screen-space left edge
  • y: image's screen-space top edge
  • width: displayed width in screen pixels
  • height: displayed height in screen pixels
  • zIndex: ordering against elements on this overlay; lower values draw first
  • color: tint, packed with alpha in the top byte
  • id: texture identifier
  • imageX: region's left coordinate in the texture
  • imageY: region's top coordinate in the texture
  • regionWidth: region width in texture pixels
  • regionHeight: region height in texture pixels
  • textureWidth: full texture width in pixels
  • textureHeight: full texture height in pixels
  • rotation: rotation in degrees
Returns: added image
addImage(int x, int y, int width, int height, int zIndex, int alpha, int color, String id, int imageX, int imageY, int regionWidth, int regionHeight, int textureWidth, int textureHeight, double rotation): ImageSince1.6.5#
Adds a rotated, tinted texture region as an image, with alpha supplied separately from the tint. Rotation is in degrees about the image's center.

Parameters:

  • x: image's screen-space left edge
  • y: image's screen-space top edge
  • width: displayed width in screen pixels
  • height: displayed height in screen pixels
  • zIndex: ordering against elements on this overlay; lower values draw first
  • alpha: image alpha, used as the top byte of the packed color
  • color: tint, whose top byte is replaced by alpha
  • id: texture identifier
  • imageX: region's left coordinate in the texture
  • imageY: region's top coordinate in the texture
  • regionWidth: region width in texture pixels
  • regionHeight: region height in texture pixels
  • textureWidth: full texture width in pixels
  • textureHeight: full texture height in pixels
  • rotation: rotation in degrees
Returns: added image

addItem ​

addItem(int x, int y, String id): ItemSince1.2.7#
Adds an item icon with the default overlay enabled.

Parameters:

  • x: left coordinate
  • y: top coordinate
  • id: item identifier
Returns: the added item element
addItem(int x, int y, int zIndex, String id): ItemSince1.4.0#
Adds an item icon with the default overlay enabled and the specified draw order.

Parameters:

  • x: left coordinate
  • y: top coordinate
  • zIndex: draw order
  • id: item identifier
Returns: the added item element
addItem(int x, int y, String id, boolean overlay): ItemSince1.2.7#
Adds an item icon and controls whether its game-provided decorations are drawn.

Parameters:

  • x: left coordinate
  • y: top coordinate
  • id: item identifier
  • overlay: whether to draw item decorations, including durability and count
Returns: the added item element
addItem(int x, int y, int zIndex, String id, boolean overlay): ItemSince1.4.0#
Adds an item icon with a draw order and controls whether its game-provided decorations are drawn.

Parameters:

  • x: left coordinate
  • y: top coordinate
  • zIndex: draw order
  • id: item identifier
  • overlay: whether to draw item decorations, including durability and count
Returns: the added item element
addItem(int x, int y, String id, boolean overlay, double scale, double rotation): ItemSince1.2.7#
Adds a scaled and rotated item icon; rotation is in degrees about its center.

Parameters:

  • x: left coordinate
  • y: top coordinate
  • id: item identifier
  • overlay: whether to draw item decorations
  • scale: size multiplier
  • rotation: rotation in degrees
Returns: the added item element
addItem(int x, int y, int zIndex, String id, boolean overlay, double scale, double rotation): ItemSince1.4.0#
Adds a scaled and rotated item icon with the specified draw order; rotation is in degrees about its center.

Parameters:

  • x: left coordinate
  • y: top coordinate
  • zIndex: draw order
  • id: item identifier
  • overlay: whether to draw item decorations
  • scale: size multiplier
  • rotation: rotation in degrees
Returns: the added item element
addItem(int x, int y, ItemStackHelper item): ItemSince1.2.7#
Adds an item icon from a stack, with the default overlay enabled.

Parameters:

  • x: left coordinate
  • y: top coordinate
  • item: item stack helper
Returns: the added item element
addItem(int x, int y, int zIndex, ItemStackHelper item): ItemSince1.4.0#
Adds an item icon from a stack, with the default overlay and specified draw order.

Parameters:

  • x: left coordinate
  • y: top coordinate
  • zIndex: draw order
  • item: item stack helper
Returns: the added item element
addItem(int x, int y, ItemStackHelper item, boolean overlay): ItemSince1.2.7#
Adds an item icon from a stack and controls whether its game-provided decorations are drawn.

Parameters:

  • x: left coordinate
  • y: top coordinate
  • item: item stack helper
  • overlay: whether to draw item decorations, including durability and count
Returns: the added item element
addItem(int x, int y, int zIndex, ItemStackHelper item, boolean overlay): ItemSince1.4.0#
Adds an item icon from a stack with a draw order and control over its decorations.

Parameters:

  • x: left coordinate
  • y: top coordinate
  • zIndex: draw order
  • item: item stack helper
  • overlay: whether to draw item decorations, including durability and count
Returns: the added item element
addItem(int x, int y, ItemStackHelper item, boolean overlay, double scale, double rotation): ItemSince1.2.7#
Adds a scaled and rotated item icon from a stack; rotation is in degrees about its center.

Parameters:

  • x: left coordinate
  • y: top coordinate
  • item: item stack helper
  • overlay: whether to draw item decorations
  • scale: size multiplier
  • rotation: rotation in degrees
Returns: the added item element
addItem(int x, int y, int zIndex, ItemStackHelper item, boolean overlay, double scale, double rotation): ItemSince1.4.0#
Adds a scaled and rotated item icon from a stack with the specified draw order among this overlay's elements; rotation is in degrees about its center.

Parameters:

  • x: left coordinate
  • y: top coordinate
  • zIndex: draw order
  • item: item stack helper
  • overlay: whether to draw item decorations
  • scale: size multiplier
  • rotation: rotation in degrees
Returns: the added item element

addLine ​

addLine(int x1, int y1, int x2, int y2, int color): LineSince1.8.4#
Adds a one-pixel-wide line between its endpoints, at z-index 0.

Parameters:

  • x1: start x coordinate
  • y1: start y coordinate
  • x2: end x coordinate
  • y2: end y coordinate
  • color: line color, including alpha
Returns: the added line
addLine(int x1, int y1, int x2, int y2, int color, int zIndex): LineSince1.8.4#
Adds a one-pixel-wide line between its endpoints. Lower z-index elements draw first.

Parameters:

  • x1: start x coordinate
  • y1: start y coordinate
  • x2: end x coordinate
  • y2: end y coordinate
  • color: line color, including alpha
  • zIndex: draw order relative to other overlay elements
Returns: the added line
addLine(int x1, int y1, int x2, int y2, int color, double width): LineSince1.8.4#
Adds a line with the specified width, at z-index 0.

Parameters:

  • x1: start x coordinate
  • y1: start y coordinate
  • x2: end x coordinate
  • y2: end y coordinate
  • color: line color, including alpha
  • width: line width in screen pixels
Returns: the added line
addLine(int x1, int y1, int x2, int y2, int color, int zIndex, double width): LineSince1.8.4#
Adds a line with the specified z-index and width. Lower z-index elements draw first.

Parameters:

  • x1: start x coordinate
  • y1: start y coordinate
  • x2: end x coordinate
  • y2: end y coordinate
  • color: line color, including alpha
  • zIndex: draw order relative to other overlay elements
  • width: line width in screen pixels
Returns: the added line
addLine(int x1, int y1, int x2, int y2, int color, double width, double rotation): LineSince1.8.4#
Adds a line with the specified width and rotation about its midpoint, at z-index 0.

Parameters:

  • x1: start x coordinate
  • y1: start y coordinate
  • x2: end x coordinate
  • y2: end y coordinate
  • color: line color, including alpha
  • width: line width in screen pixels
  • rotation: rotation in degrees
Returns: the added line
addLine(int x1, int y1, int x2, int y2, int color, int zIndex, double width, double rotation): LineSince1.8.4#
Adds a line with the specified z-index, width, and rotation about its midpoint. Lower z-index elements draw first.

Parameters:

  • x1: start x coordinate
  • y1: start y coordinate
  • x2: end x coordinate
  • y2: end y coordinate
  • color: line color, including alpha
  • zIndex: draw order relative to other overlay elements
  • width: line width in screen pixels
  • rotation: rotation in degrees
Returns: the added line

addRect ​

addRect(int x1, int y1, int x2, int y2, int color): RectSince1.2.7#
Adds a filled rectangle between two corners, using the packed color's alpha.

Parameters:

  • x1: first corner's x coordinate
  • y1: first corner's y coordinate
  • x2: opposite corner's x coordinate
  • y2: opposite corner's y coordinate
  • color: packed color; alpha is in the top byte
Returns: added rect
addRect(int x1, int y1, int x2, int y2, int color, int alpha): RectSince1.2.7#
Adds a filled rectangle between two corners, with alpha supplied separately.

Parameters:

  • x1: first corner's x coordinate
  • y1: first corner's y coordinate
  • x2: opposite corner's x coordinate
  • y2: opposite corner's y coordinate
  • color: packed color; its top byte is replaced by alpha
  • alpha: alpha value used as the packed color's top byte
Returns: added rect
addRect(int x1, int y1, int x2, int y2, int color, int alpha, double rotation): RectSince1.2.7#
Adds a rectangle between two corners; in this overload, rotation is ignored.

Parameters:

  • x1: first corner's x coordinate
  • y1: first corner's y coordinate
  • x2: opposite corner's x coordinate
  • y2: opposite corner's y coordinate
  • color: rectangle color
  • alpha: alpha value from 0 (transparent) to 255 (opaque)
  • rotation: ignored
Returns: the added rectangle
addRect(int x1, int y1, int x2, int y2, int color, int alpha, double rotation, int zIndex): RectSince1.4.0#
Adds a rectangle between two corners; in this overload, rotation is ignored.

Parameters:

  • x1: first corner's x coordinate
  • y1: first corner's y coordinate
  • x2: opposite corner's x coordinate
  • y2: opposite corner's y coordinate
  • color: rectangle color
  • alpha: alpha value from 0 (transparent) to 255 (opaque)
  • rotation: ignored
  • zIndex: draw order relative to other overlay elements; lower values draw first
Returns: the added rectangle

addText ​

addText(String text, int x, int y, int color, boolean shadow): TextSince1.2.7#
Adds text at a position, with a color and optional shadow. Coordinates are screen pixels from the top left; color is packed with alpha in its top byte. This overload uses z-index 0, scale 1, and no rotation.

Parameters:

  • text: the text to display
  • x: screen x
  • y: screen y
  • color: text color
  • shadow: include shadow layer
Returns: added text
addText(String text, int x, int y, int color, int zIndex, boolean shadow): TextSince1.4.0#
Adds text at a position with a color and optional shadow. Coordinates are screen pixels from the top left; color is packed with alpha in its top byte. Although this overload accepts zIndex, it currently uses z-index 0. Scale is 1 and rotation is 0.

Parameters:

  • text: the text to display
  • x: screen x
  • y: screen y
  • color: text color
  • zIndex: currently ignored; the added text uses z-index 0
  • shadow: include shadow layer
Returns: added text
addText(String text, int x, int y, int color, boolean shadow, double scale, double rotation): TextSince1.2.7#
Adds text at a position, with a color, optional shadow, scale, and rotation. Coordinates are screen pixels from the top left; color is packed with alpha in its top byte. This overload uses z-index 0.

Parameters:

  • text: the text to display
  • x: screen x
  • y: screen y
  • color: text color
  • shadow: include shadow layer
  • scale: text scale (as double)
  • rotation: text rotation (as degrees)
Returns: added text
addText(String text, int x, int y, int color, int zIndex, boolean shadow, double scale, double rotation): TextSince1.4.0#
Adds text at a position, with a color, optional shadow, scale, and rotation, at the specified z-index. Coordinates are screen pixels from the top left; color is packed with alpha in its top byte.

Parameters:

  • text: the text to display
  • x: screen x
  • y: screen y
  • color: text color
  • zIndex: z-index
  • shadow: include shadow layer
  • scale: text scale (as double)
  • rotation: text rotation (as degrees)
Returns: added text
addText(TextHelper text, int x, int y, int color, boolean shadow): TextSince1.2.7#
Adds styled text at a position, with a color and optional shadow. Coordinates are screen pixels from the top left; color is packed with alpha in its top byte. This overload uses z-index 0, scale 1, and no rotation.

Parameters:

  • text: the styled text to display
  • x: screen x
  • y: screen y
  • color: text color
  • shadow: include shadow layer
Returns: added text
addText(TextHelper text, int x, int y, int color, int zIndex, boolean shadow): TextSince1.4.0#
Adds styled text from a TextHelper; color tints its existing styling. Coordinates are screen pixels from the top left. Scale is 1 and rotation is 0. The supplied z-index is applied.

Parameters:

  • text: the styled text to display
  • x: screen x
  • y: screen y
  • color: tint applied to the text's existing styling
  • zIndex: z-index
  • shadow: include shadow layer
Returns: added text
addText(TextHelper text, int x, int y, int color, boolean shadow, double scale, double rotation): TextSince1.2.7#
Adds styled text at a position, with a color, optional shadow, scale, and rotation. Coordinates are screen pixels from the top left; color is packed with alpha in its top byte. This overload uses z-index 0.

Parameters:

  • text: the styled text to display
  • x: screen x
  • y: screen y
  • color: text color
  • shadow: include shadow layer
  • scale: text scale (as double)
  • rotation: text rotation (as degrees)
Returns: added text
addText(TextHelper text, int x, int y, int color, int zIndex, boolean shadow, double scale, double rotation): TextSince1.4.0#
Adds styled text at a position, with a color, optional shadow, scale, and rotation, at the specified z-index. Coordinates are screen pixels from the top left; color is packed with alpha in its top byte.

Parameters:

  • text: the styled text to display
  • x: screen x
  • y: screen y
  • color: text color
  • zIndex: z-index
  • shadow: include shadow layer
  • scale: text scale (as double)
  • rotation: text rotation (as degrees)
Returns: added text

clear ​

clear(): voidSince2.1.0#
Removes all elements from this overlay without unregistering it or changing its other settings. The elements themselves are unaffected and can be added again with reAddElement(RenderElement).

draw2DBuilder ​

draw2DBuilder(Draw2D draw2D): Draw2DElement.BuilderSince1.8.4#
Returns a builder for nesting draw2D in this overlay. Adding an element that would create a cycle is rejected by the overlay.

Parameters:

  • draw2D: the draw2d to add
Returns: a builder for a Draw2D.

getDraw2Ds ​

getDraw2Ds(): List<Draw2DElement>Since1.8.4#
Returns a new, mutable list of nested-overlay wrappers in insertion order. Each wrapper carries the nested overlay's placement and displayed dimensions; nested overlays and their contents are not returned directly.
Returns: all registered draw2d elements.

getElements ​

getElements(): List<RenderElement>Since1.2.9#
Returns an immutable snapshot of all elements in insertion order. It does not reflect elements added or removed afterward; the elements themselves are not made immutable. Nested overlays appear as wrappers, and their contents are not included.
Returns: an immutable snapshot of this overlay's elements

getHeight ​

getHeight(): intSince1.2.7#
Returns the current height supplied by this overlay, in its element coordinate space. Plain overlays default to the window's GUI-scaled height; screens use their current screen height, nested overlays their supplied height, and surfaces surface pixels.
Returns: the supplied height

getLines ​

getLines(): List<Line>Since1.8.4#
Returns a new, mutable list of this overlay's line elements in insertion order. Nested overlays' contents are not included.
Returns: all registered line elements.

getWidth ​

getWidth(): intSince1.2.7#
Returns the current width supplied by this overlay, in its element coordinate space. Plain overlays default to the window's GUI-scaled width; screens use their current screen width, nested overlays their supplied width, and surfaces surface pixels. A screen's width can differ from the window's GUI-scaled width.
Returns: the supplied width

getZIndex ​

getZIndex(): intSince1.8.4#
Returns this overlay's draw order relative to other registered overlays, not the z-index of its elements.
Returns: this overlay's draw order

imageBuilder ​

imageBuilder(): Image.BuilderSince1.8.4#
Returns an image builder bound to this overlay. Building does not add an element; an image without a texture draws nothing.
Returns: a builder for an Image.
imageBuilder(String id): Image.BuilderSince1.8.4#
Returns an image builder bound to this overlay with its texture identifier set.

Parameters:

  • id: the id of the image
Returns: a builder for an Image.

itemBuilder ​

itemBuilder(): Item.BuilderSince1.8.4#
Returns an item builder bound to this overlay; building does not add an element, while buildAndAdd() does.
Returns: a builder for an Item.
itemBuilder(ItemStackHelper item): Item.BuilderSince1.8.4#
Returns an item builder with the supplied stack set, bound to this overlay.

Parameters:

  • item: the item to use
Returns: a builder for an Item.

lineBuilder ​

lineBuilder(): Line.BuilderSince1.8.4#
Returns a line builder bound to this overlay; buildAndAdd() adds the built line to it.
Returns: a builder for a Line.
lineBuilder(int x1, int y1, int x2, int y2): Line.BuilderSince1.8.4#
Returns a line builder with both endpoints set.

Parameters:

  • x1: the x position of the first point
  • y1: the y position of the first point
  • x2: the x position of the second point
  • y2: the y position of the second point
Returns: a builder for a Line.

reAddElement ​

reAddElement(T extends RenderElement e): T extends RenderElementSince1.2.9#
Adds an element to this overlay and returns it. This can restore an element removed with removeElement(RenderElement) or add one built without buildAndAdd(). For nested-overlay wrappers, returns null if the wrapped overlay is missing, is this overlay, or would create a cycle.

Parameters:

  • e: the element to put back

Type Parameters:

  • T: the type of element to add
Returns: the element, or null if it is a nested overlay that was refused

rectBuilder ​

rectBuilder(): Rect.BuilderSince1.8.4#
Returns a rectangle builder bound to this overlay; buildAndAdd() adds the built rectangle to it.
Returns: a builder for a Rect.
rectBuilder(int x, int y, int width, int height): Rect.BuilderSince1.8.4#
Returns a rectangle builder with its first corner and size set.

Parameters:

  • x: the x position of the rectangle
  • y: the y position of the rectangle
  • width: the width of the rectangle
  • height: the height of the rectangle
Returns: a builder for a Rect.

removeDraw2D ​

removeDraw2D(Draw2DElement draw2D): TSince1.8.4#
Removes the nested-overlay wrapper from this overlay without changing the nested overlay.

Parameters:

  • draw2D: the wrapper to remove
Returns: this overlay for chaining

removeElement ​

removeElement(RenderElement e): TSince1.2.9#
Removes an element of any type from this overlay. If absent, it has no effect; the element itself is unchanged and can be added again with reAddElement(RenderElement). The deprecated typed removals do the same.

Parameters:

  • e: the element to take off
Returns: self for chaining

removeLine ​

removeLine(Line l): TSince1.8.4#
Removes the line from this overlay without modifying it. It can be added again with reAddElement(RenderElement).

Parameters:

  • l: the line to remove
Returns: this overlay for chaining

setOnFailInit ​

setOnFailInit(MethodWrapper<String, Object, Object, ?> catchInit): TSince1.2.7#
Sets the callback that receives an initialization failure's toString() value. If unset, the failure is logged. This handles initialization failures only.

Parameters:

Returns: self for chaining

setOnInit ​

setOnInit(MethodWrapper<T, Object, Object, ?> onInit): TSince1.2.7#
Sets the callback run when this overlay initializes. If a callback is set, its elements are cleared first; nested overlays are initialized afterward. Callback failures are passed to the fail callback or logged.

Parameters:

  • onInit: calls your method as a Consumer<T>
Returns: self for chaining

setZIndex ​

setZIndex(int zIndex): voidSince1.8.4#
Sets this overlay's draw order relative to other registered overlays; lower values draw first. This orders whole overlays, not their elements, and does not affect screen overlays.

Parameters:

  • zIndex: the overlay's draw order

textBuilder ​

textBuilder(): Text.BuilderSince1.8.4#
Returns a text builder bound to this overlay; buildAndAdd() adds the built text to it.
Returns: a builder for a Text.
textBuilder(String text): Text.BuilderSince1.8.4#
Returns a text builder with its text set.

Parameters:

  • text: the text to display
Returns: a builder for a Text.
textBuilder(TextHelper text): Text.BuilderSince1.8.4#
Returns a text builder initialized with the supplied styled text.

Parameters:

  • text: the text to display
Returns: a builder for a Text.