Record Class GuiTextConstraints
java.lang.Object
java.lang.Record
com.render.api.gui.GuiTextConstraints
- Record Components:
maxWidth- maximum logical width, or positive infinitymaxHeight- maximum logical height, or positive infinitydeviceScale- physical pixels per logical text pixelfontPolicy- external-font authorization policy
public record GuiTextConstraints(float maxWidth, float maxHeight, float deviceScale, GuiFontPolicy fontPolicy)
extends Record
Available inline/block space and device scale for a text layout.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGuiTextConstraints(float maxWidth, float maxHeight, float deviceScale) Creates resource-only constraints.GuiTextConstraints(float maxWidth, float maxHeight, float deviceScale, GuiFontPolicy fontPolicy) Creates an instance of aGuiTextConstraintsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the value of thedeviceScalerecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefontPolicyrecord component.final inthashCode()Returns a hash code value for this object.floatReturns the value of themaxHeightrecord component.floatmaxWidth()Returns the value of themaxWidthrecord component.final StringtoString()Returns a string representation of this record class.static GuiTextConstraintswidth(float maxWidth)
-
Field Details
-
UNBOUNDED
-
-
Constructor Details
-
GuiTextConstraints
public GuiTextConstraints(float maxWidth, float maxHeight, float deviceScale) Creates resource-only constraints.- Parameters:
maxWidth- maximum logical widthmaxHeight- maximum logical heightdeviceScale- physical pixels per logical pixel
-
GuiTextConstraints
public GuiTextConstraints(float maxWidth, float maxHeight, float deviceScale, GuiFontPolicy fontPolicy) Creates an instance of aGuiTextConstraintsrecord class.- Parameters:
maxWidth- the value for themaxWidthrecord componentmaxHeight- the value for themaxHeightrecord componentdeviceScale- the value for thedeviceScalerecord componentfontPolicy- the value for thefontPolicyrecord component
-
-
Method Details
-
width
-
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. -
maxWidth
-
maxHeight
-
deviceScale
public float deviceScale()Returns the value of thedeviceScalerecord component.- Returns:
- the value of the
deviceScalerecord component
-
fontPolicy
Returns the value of thefontPolicyrecord component.- Returns:
- the value of the
fontPolicyrecord component
-