Record Class SceneViewport.PlacedText
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.client.viewport.SceneViewport.PlacedText
- Enclosing class:
SceneViewport
public static record SceneViewport.PlacedText(net.minecraft.util.FormattedCharSequence text, float x, float y, int color, float scale)
extends Record
A line of text laid flat on the picture, in the texture's own pixels: its top left at (x, y), each font pixel
scale texture pixels. Drawn over the scene, unlit and facing out of the picture whatever the camera.-
Constructor Summary
ConstructorsConstructorDescriptionPlacedText(net.minecraft.util.FormattedCharSequence text, float x, float y, int color, float scale) Creates an instance of aPlacedTextrecord 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.floatscale()Returns the value of thescalerecord component.net.minecraft.util.FormattedCharSequencetext()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.floatx()Returns the value of thexrecord component.floaty()Returns the value of theyrecord component.
-
Constructor Details
-
PlacedText
public PlacedText(net.minecraft.util.FormattedCharSequence text, float x, float y, int color, float scale) Creates an instance of aPlacedTextrecord class.- Parameters:
text- the value for thetextrecord componentx- the value for thexrecord componenty- the value for theyrecord componentcolor- the value for thecolorrecord componentscale- the value for thescalerecord 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.util.FormattedCharSequence text()Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
x
public float x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public float y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
color
public int color()Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-
scale
public float scale()Returns the value of thescalerecord component.- Returns:
- the value of the
scalerecord component
-