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.TextWrappingdescribing the wrapping properties of this component ornullif this component should not be wrapped.color- The default display color 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
Nested ClassesModifier and TypeClassDescriptionstatic final recordSpecifies text-wrapping properties.Nested classes/interfaces inherited from interface TextScreenEntry
TextScreenEntry.Direct -
Constructor Summary
ConstructorsConstructorDescriptionAlignedComponent(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 aAlignedComponentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcolor()Returns the value of thecolorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intleft()Returns the value of theleftrecord component.booleanshadow()Returns the value of theshadowrecord component.net.minecraft.network.chat.Componenttext()Returns the value of thetextrecord component.inttop()Returns the value of thetoprecord component.final StringtoString()Returns a string representation of this record class.wrapping()Returns the value of thewrappingrecord 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 aAlignedComponentrecord class.- Parameters:
text- the value for thetextrecord componentleft- the value for theleftrecord componenttop- the value for thetoprecord componentwrapping- the value for thewrappingrecord componentcolor- the value for thecolorrecord componentshadow- the value for theshadowrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
text
-
left
public int left()Returns the value of theleftrecord component.- Specified by:
leftin interfaceTextScreenEntry- Returns:
- the value of the
leftrecord component
-
top
public int top()Returns the value of thetoprecord component.- Specified by:
topin interfaceTextScreenEntry- Returns:
- the value of the
toprecord component
-
wrapping
-
color
-
shadow
-