Record Class AlignedComponent
java.lang.Object
java.lang.Record
org.moddingx.libx.screen.text.entry.AlignedComponent
- Record Components:
text
- The component to display.left
- The horizontal padding to the left edge of the screen.top
- The vertical padding to the bottom of the previous component.wrapping
- AAlignedComponent.TextWrapping
describing the wrapping properties of this component ornull
if this component should not be wrapped.color
- The default display colour for the component. This can be altered by the style.shadow
- Whether the component should be drawn with a shadow.
- All Implemented Interfaces:
TextScreenEntry
,TextScreenEntry.Direct
public record AlignedComponent(net.minecraft.network.chat.Component text, int left, int top, @Nullable AlignedComponent.TextWrapping wrapping, int color, boolean shadow)
extends Record
implements TextScreenEntry.Direct
A
Component
that has been aligned for display on a TextScreen
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
Specifies text-wrapping properties.Nested classes/interfaces inherited from interface org.moddingx.libx.screen.text.entry.TextScreenEntry
TextScreenEntry.Direct
-
Constructor Summary
ConstructorDescriptionAlignedComponent
(net.minecraft.network.chat.Component text, int left, int top) AlignedComponent
(net.minecraft.network.chat.Component text, int left, int top, boolean wrap) AlignedComponent
(net.minecraft.network.chat.Component text, int left, int top, AlignedComponent.TextWrapping wrap) AlignedComponent
(net.minecraft.network.chat.Component text, int left, int top, AlignedComponent.TextWrapping wrapping, int color, boolean shadow) Creates an instance of aAlignedComponent
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
color()
Returns the value of thecolor
record component.final 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.boolean
shadow()
Returns the value of theshadow
record component.net.minecraft.network.chat.Component
text()
Returns the value of thetext
record component.int
top()
Returns the value of thetop
record component.final String
toString()
Returns a string representation of this record class.wrapping()
Returns the value of thewrapping
record component.
-
Constructor Details
-
AlignedComponent
public AlignedComponent(net.minecraft.network.chat.Component text, int left, int top, AlignedComponent.TextWrapping wrap) -
AlignedComponent
public AlignedComponent(net.minecraft.network.chat.Component text, int left, int top, boolean wrap) -
AlignedComponent
public AlignedComponent(net.minecraft.network.chat.Component text, int left, int top) -
AlignedComponent
public AlignedComponent(net.minecraft.network.chat.Component text, int left, int top, @Nullable AlignedComponent.TextWrapping wrapping, int color, boolean shadow) Creates an instance of aAlignedComponent
record class.- Parameters:
text
- the value for thetext
record componentleft
- the value for theleft
record componenttop
- the value for thetop
record componentwrapping
- the value for thewrapping
record componentcolor
- the value for thecolor
record componentshadow
- the value for theshadow
record component
-
-
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 '=='. -
text
public net.minecraft.network.chat.Component text()Returns the value of thetext
record component.- Returns:
- the value of the
text
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
-
wrapping
Returns the value of thewrapping
record component.- Returns:
- the value of the
wrapping
record component
-
color
public int color()Returns the value of thecolor
record component.- Returns:
- the value of the
color
record component
-
shadow
public boolean shadow()Returns the value of theshadow
record component.- Returns:
- the value of the
shadow
record component
-