Record Class GuiPaintContext.TextOptions

java.lang.Object
java.lang.Record
com.render.api.gui.GuiPaintContext.TextOptions
Record Components:
font - font configuration
color - text color
textScalePixels - text size in design-space pixels
letterSpacing - extra spacing between glyphs
lineHeightMultiplier - line-height multiplier
opacity - opacity multiplier from zero through one
shadow - whether to draw the standard Minecraft text shadow
effectShadow - optional custom text shadow
effectGlow - optional custom text glow
maxWidth - wrapping width, or zero to disable wrapping
Enclosing class:
GuiPaintContext

public static record GuiPaintContext.TextOptions(GuiFont font, RenderColor color, float textScalePixels, float letterSpacing, float lineHeightMultiplier, float opacity, boolean shadow, GuiShadow effectShadow, GuiGlow effectGlow, float maxWidth) extends Record
Immutable text drawing and measurement options.
  • Constructor Details

    • TextOptions

      public TextOptions(GuiFont font, RenderColor color, float textScalePixels, float letterSpacing, float lineHeightMultiplier, float opacity, boolean shadow, GuiShadow effectShadow, GuiGlow effectGlow, float maxWidth)
      Creates an instance of a TextOptions record class.
      Parameters:
      font - the value for the font record component
      color - the value for the color record component
      textScalePixels - the value for the textScalePixels record component
      letterSpacing - the value for the letterSpacing record component
      lineHeightMultiplier - the value for the lineHeightMultiplier record component
      opacity - the value for the opacity record component
      shadow - the value for the shadow record component
      effectShadow - the value for the effectShadow record component
      effectGlow - the value for the effectGlow record component
      maxWidth - the value for the maxWidth record component
  • Method Details

    • defaults

      public static GuiPaintContext.TextOptions defaults()
    • of

      public static GuiPaintContext.TextOptions of(RenderColor color, float textScalePixels)
    • withFont

      public GuiPaintContext.TextOptions withFont(GuiFont font)
    • withColor

      public GuiPaintContext.TextOptions withColor(RenderColor color)
    • withTextScale

      public GuiPaintContext.TextOptions withTextScale(float pixels)
    • withLetterSpacing

      public GuiPaintContext.TextOptions withLetterSpacing(float pixels)
    • withLineHeight

      public GuiPaintContext.TextOptions withLineHeight(float multiplier)
    • withOpacity

      public GuiPaintContext.TextOptions withOpacity(float opacity)
    • withShadow

      public GuiPaintContext.TextOptions withShadow(boolean shadow)
    • withEffectShadow

      public GuiPaintContext.TextOptions withEffectShadow(GuiShadow shadow)
    • withEffectGlow

      public GuiPaintContext.TextOptions withEffectGlow(GuiGlow glow)
    • withMaxWidth

      public GuiPaintContext.TextOptions withMaxWidth(float maxWidth)
    • effectShadow

      public GuiShadow effectShadow()
      Returns the value of the effectShadow record component.
      Returns:
      the value of the effectShadow record component
    • effectGlow

      public GuiGlow effectGlow()
      Returns the value of the effectGlow record component.
      Returns:
      the value of the effectGlow record component
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • font

      public GuiFont font()
      Returns the value of the font record component.
      Returns:
      the value of the font record component
    • color

      public RenderColor color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • textScalePixels

      public float textScalePixels()
      Returns the value of the textScalePixels record component.
      Returns:
      the value of the textScalePixels record component
    • letterSpacing

      public float letterSpacing()
      Returns the value of the letterSpacing record component.
      Returns:
      the value of the letterSpacing record component
    • lineHeightMultiplier

      public float lineHeightMultiplier()
      Returns the value of the lineHeightMultiplier record component.
      Returns:
      the value of the lineHeightMultiplier record component
    • opacity

      public float opacity()
      Returns the value of the opacity record component.
      Returns:
      the value of the opacity record component
    • shadow

      public boolean shadow()
      Returns the value of the shadow record component.
      Returns:
      the value of the shadow record component
    • maxWidth

      public float maxWidth()
      Returns the value of the maxWidth record component.
      Returns:
      the value of the maxWidth record component