Record Class AlignedWidget
java.lang.Object
java.lang.Record
org.moddingx.libx.screen.text.entry.AlignedWidget
- Record Components:
widget
- The widget to display. The widgetsx
andy
coordinates are ignored and will be automatically set when the widget is placed on the screen.left
- The horizontal padding to the left edge of the screen.top
- The vertical padding to the bottom of the previous component.
- All Implemented Interfaces:
TextScreenEntry
,TextScreenEntry.Direct
public record AlignedWidget(net.minecraft.client.gui.components.AbstractWidget widget, int left, int top)
extends Record
implements TextScreenEntry.Direct
An
AbstractWidget
that has been aligned for display on a TextScreen
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.moddingx.libx.screen.text.entry.TextScreenEntry
TextScreenEntry.Direct
-
Constructor Summary
ConstructorDescriptionAlignedWidget
(net.minecraft.client.gui.components.AbstractWidget widget, int left, int top) Creates an instance of aAlignedWidget
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
left()
Returns the value of theleft
record component.int
top()
Returns the value of thetop
record component.final String
toString()
Returns a string representation of this record class.net.minecraft.client.gui.components.AbstractWidget
widget()
Returns the value of thewidget
record component.
-
Constructor Details
-
AlignedWidget
public AlignedWidget(net.minecraft.client.gui.components.AbstractWidget widget, int left, int top) Creates an instance of aAlignedWidget
record class.
-
-
Method Details
-
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 '=='. -
widget
public net.minecraft.client.gui.components.AbstractWidget widget()Returns the value of thewidget
record component.- Returns:
- the value of the
widget
record component
-
left
public int left()Returns the value of theleft
record component.- Specified by:
left
in interfaceTextScreenEntry
- Returns:
- the value of the
left
record component
-
top
public int top()Returns the value of thetop
record component.- Specified by:
top
in interfaceTextScreenEntry
- Returns:
- the value of the
top
record component
-