Class Text


public class Text extends Label
A text element that can be displayed on the map.
  • Constructor Details

    • Text

      public Text(Billboard baseBillboard, TextStyle style, String text)
      Constructs a Text object with the specified style and attaches it to a billboard element.
      Parameters:
      baseBillboard - The billboard this text label will be attached to.
      style - The style that defines what this text label looks like.
      text - The text to be displayed.
    • Text

      public Text(Geometry geometry, TextStyle style, String text)
      Constructs a Text object from a geometry object and a style.
      Parameters:
      geometry - The geometry object that defines the location of this text label.
      style - The style that defines what this text label looks like.
      text - The text to be displayed.
    • Text

      public Text(MapPos pos, TextStyle style, String text)
      Constructs a Text object from a map position and a style.
      Parameters:
      pos - The map position that defines the location of this text label.
      style - The style that defines what this text label looks like.
      text - The text to be displayed.
  • Method Details

    • drawBitmap

      public Bitmap drawBitmap(float dpToPX)
      Description copied from class: Label
      Draws a custom bitmap for this label that will be used for drawing the label on the map.
      The method is called each time the label gets reloaded internally.
      Overrides:
      drawBitmap in class Label
      Parameters:
      dpToPX - The value used for converting display independent pixels (dp) to pixels (px).
      Returns:
      The custom label bitmap.
    • getText

      public String getText()
      Returns the display text.
      Returns:
      The display text.
    • setText

      public void setText(String text)
      Sets the display text.
      Parameters:
      text - The text to be displayed.
    • getStyle

      public TextStyle getStyle()
      Returns the style of this text label.
      Overrides:
      getStyle in class Label
      Returns:
      The style that defines what this text label looks like.
    • setStyle

      public void setStyle(TextStyle style)
      Sets the style for this text label.
      Parameters:
      style - The new style that defines what this text label looks like.