Record Class GuiCornerRadii

java.lang.Object
java.lang.Record
com.render.api.gui.paint.GuiCornerRadii
Record Components:
topLeftX - top-left horizontal radius
topLeftY - top-left vertical radius
topRightX - top-right horizontal radius
topRightY - top-right vertical radius
bottomRightX - bottom-right horizontal radius
bottomRightY - bottom-right vertical radius
bottomLeftX - bottom-left horizontal radius
bottomLeftY - bottom-left vertical radius

public record GuiCornerRadii(float topLeftX, float topLeftY, float topRightX, float topRightY, float bottomRightX, float bottomRightY, float bottomLeftX, float bottomLeftY) extends Record
Independent elliptical radii for all four corners.
  • Field Details

  • Constructor Details

    • GuiCornerRadii

      public GuiCornerRadii(float topLeftX, float topLeftY, float topRightX, float topRightY, float bottomRightX, float bottomRightY, float bottomLeftX, float bottomLeftY)
      Creates an instance of a GuiCornerRadii record class.
      Parameters:
      topLeftX - the value for the topLeftX record component
      topLeftY - the value for the topLeftY record component
      topRightX - the value for the topRightX record component
      topRightY - the value for the topRightY record component
      bottomRightX - the value for the bottomRightX record component
      bottomRightY - the value for the bottomRightY record component
      bottomLeftX - the value for the bottomLeftX record component
      bottomLeftY - the value for the bottomLeftY record component
  • Method Details

    • uniform

      public static GuiCornerRadii uniform(float radius)
    • elliptical

      public static GuiCornerRadii elliptical(float horizontal, float vertical)
    • onlyTopLeft

      public static GuiCornerRadii onlyTopLeft(float radius)
      Creates a circular top-left corner and square remaining corners.
      Parameters:
      radius - top-left radius
      Returns:
      independent corner radii
    • onlyTopRight

      public static GuiCornerRadii onlyTopRight(float radius)
      Creates a circular top-right corner and square remaining corners.
      Parameters:
      radius - top-right radius
      Returns:
      independent corner radii
    • onlyBottomRight

      public static GuiCornerRadii onlyBottomRight(float radius)
      Creates a circular bottom-right corner and square remaining corners.
      Parameters:
      radius - bottom-right radius
      Returns:
      independent corner radii
    • onlyBottomLeft

      public static GuiCornerRadii onlyBottomLeft(float radius)
      Creates a circular bottom-left corner and square remaining corners.
      Parameters:
      radius - bottom-left radius
      Returns:
      independent corner radii
    • withTopLeft

      public GuiCornerRadii withTopLeft(float horizontal, float vertical)
      Replaces the top-left elliptical radii.
      Parameters:
      horizontal - horizontal radius
      vertical - vertical radius
      Returns:
      updated radii
    • withTopRight

      public GuiCornerRadii withTopRight(float horizontal, float vertical)
      Replaces the top-right elliptical radii.
      Parameters:
      horizontal - horizontal radius
      vertical - vertical radius
      Returns:
      updated radii
    • withBottomRight

      public GuiCornerRadii withBottomRight(float horizontal, float vertical)
      Replaces the bottom-right elliptical radii.
      Parameters:
      horizontal - horizontal radius
      vertical - vertical radius
      Returns:
      updated radii
    • withBottomLeft

      public GuiCornerRadii withBottomLeft(float horizontal, float vertical)
      Replaces the bottom-left elliptical radii.
      Parameters:
      horizontal - horizontal radius
      vertical - vertical radius
      Returns:
      updated radii
    • isUniformCircular

      public boolean isUniformCircular()
    • uniformRadius

      public float uniformRadius()
    • normalized

      public GuiCornerRadii normalized(float width, float height)
      Applies the CSS corner-overlap reduction rule for the supplied border box.

      All radii share one scale factor, so adjacent horizontal or vertical radii never overlap and the authored corner proportions are preserved.

      Parameters:
      width - border-box width
      height - border-box height
      Returns:
      normalized radii
    • 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. All components in this record class 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.
    • topLeftX

      public float topLeftX()
      Returns the value of the topLeftX record component.
      Returns:
      the value of the topLeftX record component
    • topLeftY

      public float topLeftY()
      Returns the value of the topLeftY record component.
      Returns:
      the value of the topLeftY record component
    • topRightX

      public float topRightX()
      Returns the value of the topRightX record component.
      Returns:
      the value of the topRightX record component
    • topRightY

      public float topRightY()
      Returns the value of the topRightY record component.
      Returns:
      the value of the topRightY record component
    • bottomRightX

      public float bottomRightX()
      Returns the value of the bottomRightX record component.
      Returns:
      the value of the bottomRightX record component
    • bottomRightY

      public float bottomRightY()
      Returns the value of the bottomRightY record component.
      Returns:
      the value of the bottomRightY record component
    • bottomLeftX

      public float bottomLeftX()
      Returns the value of the bottomLeftX record component.
      Returns:
      the value of the bottomLeftX record component
    • bottomLeftY

      public float bottomLeftY()
      Returns the value of the bottomLeftY record component.
      Returns:
      the value of the bottomLeftY record component