Package net.minecraft.client.gui
Record Class ScreenRect
java.lang.Object
java.lang.Record
net.minecraft.client.gui.ScreenRect
- Record Components:
- position-
- width-
- height-
@Environment(CLIENT)
public record ScreenRect(ScreenPos position, int width, int height)
extends Record
A rectangle on the screen.
- Mappings:
- Namespace - Name - official - esz- intermediary - net/minecraft/class_8030- named - net/minecraft/client/gui/ScreenRect- official - a- intermediary - comp_1195- named - position- official - b- intermediary - comp_1196- named - width- official - c- intermediary - comp_1197- named - height
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionScreenRect(int sameAxis, int otherAxis, int width, int height) ScreenRect(ScreenPos screenPos, int int2, int int3) 
- 
Method SummaryModifier and TypeMethodDescriptionadd(NavigationDirection direction) Returns a new rect of the same dimensions with the position incremented.static ScreenRectempty()Returns an empty rect.final booleanIndicates whether some other object is "equal to" this one.getBorder(NavigationDirection direction) Returns a rect representing the border of this rect in the givendirection.intintgetBoundingCoordinate(NavigationDirection direction) Returns the coordinate of the bounding box in the givendirection.intgetCenter(NavigationAxis axis) Returns the center of this rect in the givenaxis.intgetLeft()intgetLength(NavigationAxis axis) Returns the length of the rect in the givenaxis.intgetRight()intgetTop()final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.intersection(ScreenRect other) Returns the rect that intersects withother, ornullif they do not intersect.static ScreenRectof(NavigationAxis axis, int sameAxisCoord, int otherAxisCoord, int sameAxisLength, int otherAxisLength) Returns a new rect.booleanoverlaps(ScreenRect other) Returns whether this rect overlaps withrectin both axes.booleanoverlaps(ScreenRect other, NavigationAxis axis) Returns whether this rect overlaps withrectinaxis.position()Returns the value of thepositionrecord component.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
- 
Field Details- 
positionThe field for thepositionrecord component.
- 
widthprivate final int widthThe field for thewidthrecord component.
- 
heightprivate final int heightThe field for theheightrecord component.
- 
EMPTY- Mappings:
- Namespace - Name - Mixin selector - official - d- Lesz;d:Lesz;- intermediary - field_41835- Lnet/minecraft/class_8030;field_41835:Lnet/minecraft/class_8030;- named - EMPTY- Lnet/minecraft/client/gui/ScreenRect;EMPTY:Lnet/minecraft/client/gui/ScreenRect;
 
 
- 
- 
Constructor Details- 
ScreenRectpublic ScreenRect(int sameAxis, int otherAxis, int width, int height) - Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lesz;<init>(IIII)V- intermediary - <init>- Lnet/minecraft/class_8030;<init>(IIII)V- named - <init>- Lnet/minecraft/client/gui/ScreenRect;<init>(IIII)V
 
- 
ScreenRect
 
- 
- 
Method Details- 
emptyReturns an empty rect.- Returns:
- an empty rect
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lesz;a()Lesz;- intermediary - method_48248- Lnet/minecraft/class_8030;method_48248()Lnet/minecraft/class_8030;- named - empty- Lnet/minecraft/client/gui/ScreenRect;empty()Lnet/minecraft/client/gui/ScreenRect;
 
- 
overlapsReturns whether this rect overlaps withrectin both axes.- Returns:
- whether this rect overlaps with rectin both axes
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lesz;a(Lesz;)Z- intermediary - method_48252- Lnet/minecraft/class_8030;method_48252(Lnet/minecraft/class_8030;)Z- named - overlaps- Lnet/minecraft/client/gui/ScreenRect;overlaps(Lnet/minecraft/client/gui/ScreenRect;)Z
 
- 
intersectionReturns the rect that intersects withother, ornullif they do not intersect.- Returns:
- the rect that intersects with other, ornullif they do not intersect
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lesz;b(Lesz;)Lesz;- intermediary - method_49701- Lnet/minecraft/class_8030;method_49701(Lnet/minecraft/class_8030;)Lnet/minecraft/class_8030;- named - intersection- Lnet/minecraft/client/gui/ScreenRect;intersection(Lnet/minecraft/client/gui/ScreenRect;)Lnet/minecraft/client/gui/ScreenRect;
 
- 
getToppublic int getTop()- Mappings:
- Namespace - Name - Mixin selector - official - b- Lesz;b()I- intermediary - method_49618- Lnet/minecraft/class_8030;method_49618()I- named - getTop- Lnet/minecraft/client/gui/ScreenRect;getTop()I
 
- 
getBottompublic int getBottom()- Mappings:
- Namespace - Name - Mixin selector - official - c- Lesz;c()I- intermediary - method_49619- Lnet/minecraft/class_8030;method_49619()I- named - getBottom- Lnet/minecraft/client/gui/ScreenRect;getBottom()I
 
- 
getLeftpublic int getLeft()- Mappings:
- Namespace - Name - Mixin selector - official - d- Lesz;d()I- intermediary - method_49620- Lnet/minecraft/class_8030;method_49620()I- named - getLeft- Lnet/minecraft/client/gui/ScreenRect;getLeft()I
 
- 
getRightpublic int getRight()- Mappings:
- Namespace - Name - Mixin selector - official - e- Lesz;e()I- intermediary - method_49621- Lnet/minecraft/class_8030;method_49621()I- named - getRight- Lnet/minecraft/client/gui/ScreenRect;getRight()I
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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 '=='.
- 
positionReturns the value of thepositionrecord component.- Returns:
- the value of the positionrecord component
 
- 
widthpublic int width()Returns the value of thewidthrecord component.- Returns:
- the value of the widthrecord component
 
- 
heightpublic int height()Returns the value of theheightrecord component.- Returns:
- the value of the heightrecord component
 
 
-