Record Class GuiTextMetrics
java.lang.Object
java.lang.Record
com.render.api.gui.GuiTextMetrics
- Record Components:
width- logical layout widthheight- logical layout heightascent- maximum line ascentdescent- maximum line descentleading- maximum line leadinginkBounds- aggregate logical ink boundslines- immutable per-line metricstruncated- whether height, max-lines, or ellipsis truncated the source
public record GuiTextMetrics(float width, float height, float ascent, float descent, float leading, GuiRect inkBounds, List<GuiTextMetrics.Line> lines, boolean truncated)
extends Record
Immutable aggregate and per-line geometry for a shaped text layout.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionGuiTextMetrics(float width, float height, float ascent, float descent, float leading, GuiRect inkBounds, List<GuiTextMetrics.Line> lines, boolean truncated) Creates an instance of aGuiTextMetricsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatascent()Returns the value of theascentrecord component.floatdescent()Returns the value of thedescentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatheight()Returns the value of theheightrecord component.Returns the value of theinkBoundsrecord component.floatleading()Returns the value of theleadingrecord component.intlines()Returns the value of thelinesrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of thetruncatedrecord component.floatwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
GuiTextMetrics
public GuiTextMetrics(float width, float height, float ascent, float descent, float leading, GuiRect inkBounds, List<GuiTextMetrics.Line> lines, boolean truncated) Creates an instance of aGuiTextMetricsrecord class.- Parameters:
width- the value for thewidthrecord componentheight- the value for theheightrecord componentascent- the value for theascentrecord componentdescent- the value for thedescentrecord componentleading- the value for theleadingrecord componentinkBounds- the value for theinkBoundsrecord componentlines- the value for thelinesrecord componenttruncated- the value for thetruncatedrecord component
-
-
Method Details
-
lineCount
public int lineCount() -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
width
-
height
-
ascent
-
descent
-
leading
-
inkBounds
-
lines
-
truncated
-