Class TextStyle.Builder

java.lang.Object
lol.trq.helios.text.TextStyle.Builder
Enclosing class:
TextStyle

public static final class TextStyle.Builder extends Object
Accumulates a TextStyle.
  • Method Details

    • size

      public TextStyle.Builder size(float size)
      Sets the size.
      Parameters:
      size - the em height in drawing units
      Returns:
      this builder
    • color

      public TextStyle.Builder color(int argb)
      Sets the colour.
      Parameters:
      argb - packed 0xAARRGGBB
      Returns:
      this builder
    • shadow

      public TextStyle.Builder shadow(TextStyle.Shadow shadow)
      Sets the shadow.
      Parameters:
      shadow - the kind
      Returns:
      this builder
    • shadowColor

      public TextStyle.Builder shadowColor(int argb)
      Sets a fixed shadow colour instead of one derived from the text colour.
      Parameters:
      argb - packed 0xAARRGGBB
      Returns:
      this builder
    • weight

      public TextStyle.Builder weight(float em)
      Sets extra stroke weight.
      Parameters:
      em - thickening in em, such as 0.02 for semibold; negative thins
      Returns:
      this builder
    • letterSpacing

      public TextStyle.Builder letterSpacing(float em)
      Sets extra space after every character.
      Parameters:
      em - spacing in em
      Returns:
      this builder
    • formatting

      public TextStyle.Builder formatting(boolean on)
      Sets whether § codes change colour and format, or are drawn as text.
      Parameters:
      on - whether codes apply
      Returns:
      this builder
    • build

      public TextStyle build()
      Builds the style.
      Returns:
      the style
      Throws:
      IllegalArgumentException - if the size is not positive