Record Class GuiTextConstraints

java.lang.Object
java.lang.Record
com.render.api.gui.GuiTextConstraints
Record Components:
maxWidth - maximum logical width, or positive infinity
maxHeight - maximum logical height, or positive infinity
deviceScale - physical pixels per logical text pixel
fontPolicy - 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 Details

  • Constructor Details

    • GuiTextConstraints

      public GuiTextConstraints(float maxWidth, float maxHeight, float deviceScale)
      Creates resource-only constraints.
      Parameters:
      maxWidth - maximum logical width
      maxHeight - maximum logical height
      deviceScale - physical pixels per logical pixel
    • GuiTextConstraints

      public GuiTextConstraints(float maxWidth, float maxHeight, float deviceScale, GuiFontPolicy fontPolicy)
      Creates an instance of a GuiTextConstraints record class.
      Parameters:
      maxWidth - the value for the maxWidth record component
      maxHeight - the value for the maxHeight record component
      deviceScale - the value for the deviceScale record component
      fontPolicy - the value for the fontPolicy record component
  • Method Details

    • width

      public static GuiTextConstraints width(float maxWidth)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • maxWidth

      public float maxWidth()
      Returns the value of the maxWidth record component.
      Returns:
      the value of the maxWidth record component
    • maxHeight

      public float maxHeight()
      Returns the value of the maxHeight record component.
      Returns:
      the value of the maxHeight record component
    • deviceScale

      public float deviceScale()
      Returns the value of the deviceScale record component.
      Returns:
      the value of the deviceScale record component
    • fontPolicy

      public GuiFontPolicy fontPolicy()
      Returns the value of the fontPolicy record component.
      Returns:
      the value of the fontPolicy record component