Class Text
java.lang.Object
xyz.gmitch215.socketmc.util.render.text.Text
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
JsonText
,PaperText
,PlainText
,SpigotText
Represents a text element to be displayed on the client's screen.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Whether this text element has a drop shadow.static final int
The height of a single line of text, in pixels. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract int
getColor()
Gets the color as an ARGB integer.boolean
Gets whether this text element has a drop shadow.void
setDropShadow
(boolean dropShadow) Sets whether this text element should have a drop shadow.abstract String
toJSON()
Serializes this text element to a JSON string compatible with the Minecraft Component format.
-
Field Details
-
FONT_HEIGHT
public static final int FONT_HEIGHTThe height of a single line of text, in pixels.- See Also:
-
dropShadow
protected boolean dropShadowWhether this text element has a drop shadow.
-
-
Constructor Details
-
Text
protected Text()Constructs a new text element.
-
-
Method Details
-
isDropShadow
public boolean isDropShadow()Gets whether this text element has a drop shadow.- Returns:
- Drop Shadow
-
setDropShadow
public void setDropShadow(boolean dropShadow) Sets whether this text element should have a drop shadow.- Parameters:
dropShadow
- Drop Shadow
-
getColor
public abstract int getColor()Gets the color as an ARGB integer.- Returns:
- String Color
-
toJSON
Serializes this text element to a JSON string compatible with the Minecraft Component format.- Returns:
- JSON String
-