public class Text extends TextBasedEntity<Text>
Represents a label on screen.
  • Method Details

    • getStrokeColor

      public int getStrokeColor()
      Returns the color of the stroke of this Text as an RGB integer.

      Default is 0 (black).

      Returns:
      the string of this Text.
    • setStrokeColor

      public Text setStrokeColor(int strokeColor)
      Sets the color of the stroke of this Text as an RGB integer.

      Default is 0 (black).

      Parameters:
      strokeColor - the color for the stroke of this Text.
      Returns:
      this Text.
      Throws:
      IllegalArgumentException - if strokeColor is not a valid RGB integer.
    • setStrokeColor

      public Text setStrokeColor(int strokeColor, Curve curve)
      Sets the color of the stroke of this Text as an RGB integer.

      Default is 0 (black).

      Parameters:
      strokeColor - the color for the stroke of this Text.
      curve - the transition to animate between values of this property.
      Returns:
      this Text.
      Throws:
      IllegalArgumentException - if strokeColor is not a valid RGB integer.
    • getFontFamily

      public String getFontFamily()
      Returns the name of the font of this Text in px.

      Default is "Lato".

      Returns:
      the size of the font of this Text.
    • setFontFamily

      public Text setFontFamily(String fontFamily)
      Sets the name of the font of this Text.

      Only fonts available to the browser can be displayed.

      Default is "Lato".

      Parameters:
      fontFamily - the size for the font of this Text.
      Returns:
      this Text.
    • getStrokeThickness

      public double getStrokeThickness()
      Returns the thickness of the stroke of this Text in pixels.

      Default is 0 (no stroke).

      Returns:
      the thickness of the stroke of this Text
    • setStrokeThickness

      public Text setStrokeThickness(double strokeThickness)
      Returns the thickness of the stroke of this Text in pixels.

      Default is 0 (no stroke).

      Parameters:
      strokeThickness - the thickness for the stroke of this Text.
      Returns:
      this Text
    • setStrokeThickness

      public Text setStrokeThickness(double strokeThickness, Curve curve)
      Returns the thickness of the stroke of this Text in pixels.

      Default is 0 (no stroke).

      Parameters:
      strokeThickness - the thickness for the stroke of this Text.
      curve - the transition to animate between values of this property.
      Returns:
      this Text
    • setFontWeight

      public Text setFontWeight(Text.FontWeight weight)
      Sets the weight of the font of this Text.

      Default is NORMAL.

      Parameters:
      weight - the FontWeight of the Text.
      Returns:
      this Text.
    • getFontWeight

      public Text.FontWeight getFontWeight()
      Returns the weight of the font of this Text.

      Default is NORMAL.

      Returns:
      the weight of the font of this Text.
    • getFillColor

      public int getFillColor()
      Returns the color of the fill of this Text as an RGB integer.

      Default is 0 (black).

      Returns:
      the color of the fill of this Text
    • setFillColor

      public Text setFillColor(int fillColor)
      Sets the color of the fill of this Text as an RGB integer.

      Default is 0 (black).

      Parameters:
      fillColor - the color for the fill of this Text.
      Returns:
      this Text.
      Throws:
      IllegalArgumentException - if fillColor is not a valid RGB integer.
    • setFillColor

      public Text setFillColor(int fillColor, Curve curve)
      Sets the color of the fill of this Text as an RGB integer.

      Default is 0 (black).

      Parameters:
      fillColor - the color for the fill of this Text.
      curve - the transition to animate between values of this property.
      Returns:
      this Text.
      Throws:
      IllegalArgumentException - if fillColor is not a valid RGB integer.