Package dev.twilite.client.ui.overlay
Record Class OverlayScreenTextLabel
java.lang.Object
java.lang.Record
dev.twilite.client.ui.overlay.OverlayScreenTextLabel
public record OverlayScreenTextLabel(String text, int x, int y, int argb, boolean rightAligned)
extends Record
A single screen-space overlay text label.
-
Constructor Summary
ConstructorsConstructorDescriptionOverlayScreenTextLabel(String text, int x, int y, int argb) Creates a left-aligned label.OverlayScreenTextLabel(String text, int x, int y, int argb, boolean rightAligned) Creates an instance of aOverlayScreenTextLabelrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintargb()Returns the value of theargbrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of therightAlignedrecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.intx()Returns the value of thexrecord component.inty()Returns the value of theyrecord component.
-
Constructor Details
-
OverlayScreenTextLabel
Creates a left-aligned label. -
OverlayScreenTextLabel
Creates an instance of aOverlayScreenTextLabelrecord class.- Parameters:
text- the value for thetextrecord componentx- the value for thexrecord componenty- the value for theyrecord componentargb- the value for theargbrecord componentrightAligned- the value for therightAlignedrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
x
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public int y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
argb
public int argb()Returns the value of theargbrecord component.- Returns:
- the value of the
argbrecord component
-
rightAligned
public boolean rightAligned()Returns the value of therightAlignedrecord component.- Returns:
- the value of the
rightAlignedrecord component
-