Record Class HudPlacement
java.lang.Object
java.lang.Record
com.render.api.HudPlacement
- Record Components:
x- absolute x position in design-space pixelsy- absolute y position in design-space pixelsscale- user-facing scale multipliertextOpacity- multiplier applied to text components inside the elementcontentOpacity- multiplier applied to non-text components inside the element
public record HudPlacement(float x, float y, float scale, float textOpacity, float contentOpacity)
extends Record
Default or saved absolute placement for a top-level managed HUD element.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatstatic final floatstatic final floatstatic final float -
Constructor Summary
ConstructorsConstructorDescriptionHudPlacement(float x, float y, float scale) HudPlacement(float x, float y, float scale, float textOpacity, float contentOpacity) Creates an instance of aHudPlacementrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic floatclampOpacity(float opacity) static floatclampScale(float scale) floatReturns the value of thecontentOpacityrecord 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.floatReturns the value of thetextOpacityrecord component.final StringtoString()Returns a string representation of this record class.withContentOpacity(float contentOpacity) withPosition(float x, float y) withScale(float scale) withTextOpacity(float textOpacity) floatx()Returns the value of thexrecord component.floaty()Returns the value of theyrecord component.
-
Field Details
-
MIN_SCALE
public static final float MIN_SCALE- See Also:
-
MAX_SCALE
public static final float MAX_SCALE- See Also:
-
MIN_OPACITY
public static final float MIN_OPACITY- See Also:
-
MAX_OPACITY
public static final float MAX_OPACITY- See Also:
-
-
Constructor Details
-
HudPlacement
public HudPlacement(float x, float y, float scale) -
HudPlacement
public HudPlacement(float x, float y, float scale, float textOpacity, float contentOpacity) Creates an instance of aHudPlacementrecord class.- Parameters:
x- the value for thexrecord componenty- the value for theyrecord componentscale- the value for thescalerecord componenttextOpacity- the value for thetextOpacityrecord componentcontentOpacity- the value for thecontentOpacityrecord component
-
-
Method Details
-
withPosition
-
withScale
-
withTextOpacity
-
withContentOpacity
-
clampScale
public static float clampScale(float scale) -
clampOpacity
public static float clampOpacity(float opacity) -
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
x
-
y
-
scale
-
textOpacity
public float textOpacity()Returns the value of thetextOpacityrecord component.- Returns:
- the value of the
textOpacityrecord component
-
contentOpacity
public float contentOpacity()Returns the value of thecontentOpacityrecord component.- Returns:
- the value of the
contentOpacityrecord component
-