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 named net/minecraft/client/gui/ScreenRectintermediary net/minecraft/class_8030official fmsnamed positionintermediary comp_1195official anamed widthintermediary comp_1196official bnamed heightintermediary comp_1197official c
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionScreenRect(int sameAxis, int otherAxis, int width, int height) ScreenRect(ScreenPos screenPos, int int2, int int3) -
Method Summary
Modifier and TypeMethodDescriptionadd(NavigationDirection direction) Returns a new rect of the same dimensions with the position incremented.booleancontains(int x, int y) 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
-
position
The field for thepositionrecord component. -
width
private final int widthThe field for thewidthrecord component. -
height
private final int heightThe field for theheightrecord component. -
EMPTY
- Mappings:
Namespace Name Mixin selector named EMPTYLnet/minecraft/client/gui/ScreenRect;EMPTY:Lnet/minecraft/client/gui/ScreenRect;intermediary field_41835Lnet/minecraft/class_8030;field_41835:Lnet/minecraft/class_8030;official dLfms;d:Lfms;
-
-
Constructor Details
-
ScreenRect
public ScreenRect(int sameAxis, int otherAxis, int width, int height) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/client/gui/ScreenRect;<init>(IIII)Vintermediary <init>Lnet/minecraft/class_8030;<init>(IIII)Vofficial <init>Lfms;<init>(IIII)V
-
ScreenRect
-
-
Method Details
-
empty
Returns an empty rect.- Returns:
- an empty rect
- Mappings:
Namespace Name Mixin selector named emptyLnet/minecraft/client/gui/ScreenRect;empty()Lnet/minecraft/client/gui/ScreenRect;intermediary method_48248Lnet/minecraft/class_8030;method_48248()Lnet/minecraft/class_8030;official aLfms;a()Lfms;
-
overlaps
Returns whether this rect overlaps withrectin both axes.- Returns:
- whether this rect overlaps with
rectin both axes - Mappings:
Namespace Name Mixin selector named overlapsLnet/minecraft/client/gui/ScreenRect;overlaps(Lnet/minecraft/client/gui/ScreenRect;)Zintermediary method_48252Lnet/minecraft/class_8030;method_48252(Lnet/minecraft/class_8030;)Zofficial aLfms;a(Lfms;)Z
-
intersection
Returns 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 named intersectionLnet/minecraft/client/gui/ScreenRect;intersection(Lnet/minecraft/client/gui/ScreenRect;)Lnet/minecraft/client/gui/ScreenRect;intermediary method_49701Lnet/minecraft/class_8030;method_49701(Lnet/minecraft/class_8030;)Lnet/minecraft/class_8030;official bLfms;b(Lfms;)Lfms;
-
getTop
public int getTop()- Mappings:
Namespace Name Mixin selector named getTopLnet/minecraft/client/gui/ScreenRect;getTop()Iintermediary method_49618Lnet/minecraft/class_8030;method_49618()Iofficial bLfms;b()I
-
getBottom
public int getBottom()- Mappings:
Namespace Name Mixin selector named getBottomLnet/minecraft/client/gui/ScreenRect;getBottom()Iintermediary method_49619Lnet/minecraft/class_8030;method_49619()Iofficial cLfms;c()I
-
getLeft
public int getLeft()- Mappings:
Namespace Name Mixin selector named getLeftLnet/minecraft/client/gui/ScreenRect;getLeft()Iintermediary method_49620Lnet/minecraft/class_8030;method_49620()Iofficial dLfms;d()I
-
getRight
public int getRight()- Mappings:
Namespace Name Mixin selector named getRightLnet/minecraft/client/gui/ScreenRect;getRight()Iintermediary method_49621Lnet/minecraft/class_8030;method_49621()Iofficial eLfms;e()I
-
contains
public boolean contains(int x, int y) - Mappings:
Namespace Name Mixin selector named containsLnet/minecraft/client/gui/ScreenRect;contains(II)Zintermediary method_58137Lnet/minecraft/class_8030;method_58137(II)Zofficial aLfms;a(II)Z
-
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. -
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. -
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 '=='. -
position
Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-