Record Class GuiRect
java.lang.Object
java.lang.Record
com.render.api.gui.GuiRect
- Record Components:
x- left coordinatey- top coordinatewidth- non-negative widthheight- non-negative height
Immutable rectangle in RenderLib design-space coordinates.
-
Constructor Summary
ConstructorsConstructorDescriptionGuiRect(float x, float y, float width, float height) Creates an instance of aGuiRectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatbottom()Returns the bottom edge.floatcenterX()floatcenterY()booleancontains(float pointX, float pointY) 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.inset(float amount) Returns a rectangle inset on every edge.inset(float horizontal, float vertical) Returns a rectangle inset horizontally and vertically.intersection(GuiRect other) Returns the overlapping area of this rectangle and another rectangle.floatright()Returns the right edge.final StringtoString()Returns a string representation of this record class.floatwidth()Returns the value of thewidthrecord component.floatx()Returns the value of thexrecord component.floaty()Returns the value of theyrecord component.
-
Constructor Details
-
GuiRect
public GuiRect(float x, float y, float width, float height) Creates an instance of aGuiRectrecord class.
-
-
Method Details
-
right
public float right()Returns the right edge.- Returns:
x + width
-
bottom
public float bottom()Returns the bottom edge.- Returns:
y + height
-
centerX
public float centerX() -
centerY
public float centerY() -
contains
public boolean contains(float pointX, float pointY) -
inset
Returns a rectangle inset on every edge. Negative values expand the rectangle.- Parameters:
amount- inset in design-space pixels- Returns:
- inset rectangle
-
inset
Returns a rectangle inset horizontally and vertically. Negative values expand it.- Parameters:
horizontal- horizontal inset per edgevertical- vertical inset per edge- Returns:
- inset rectangle
-
intersection
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
x
-
y
-
width
-
height
-