Communicator.Markup.Shape.TextBox

 TextBox

This object encapsulates a text and rectangle object into one entity. Sizing of the box and positioning of the string is handled by the system. This class consists of two portions which control the look and feel of the markup. The text portion controls the styling of the text, while the box portion controls the styling of the outer rectangle.

Constructors

constructor

  • Creates a new TextBox Markup Shape.

    Parameters

    • Optional position: Point2

      the screen space point of the top left of the box. Default value is (0,0).

    • Optional text: string

      the text string for the box. Default value is empty string.

    Returns TextBox

Methods

getBoxPortion

  • Gets the Box portion of the TextBox. Use the methods on this object to modify the appearance of the rectangle around the text string

    Returns RectangleBase

    the rectangle markup object.

getPadding

  • getPadding(): number
  • Gets the Pixel distance between the text and outer rectangle

    Returns number

    the padding value.

getPosition

  • Gets the position in screen space of the top-left corner of the TextBox rectangle

    Returns Point2

    the TextBox position

getTextPortion

  • Gets the Text portion of the TextBox. Use the methods on this object to modify the appearance of the text string

    Returns TextMarkupBase

    the text markup object

getTextString

  • getTextString(): string
  • Gets the text string for this box

    Returns string

    the text string

setPadding

  • setPadding(padding: number): void
  • Sets the Pixel distance between the text and outer rectangle

    Parameters

    • padding: number

      the padding value.

    Returns void

setPosition

  • setPosition(position: Point2): void
  • Sets the position in screen space of the top-left corner of the TextBox rectangle

    Parameters

    • position: Point2

      the TextBox position

    Returns void

setTextString

  • setTextString(text: string): void
  • Sets the text string for this box

    Parameters

    • text: string

      the text string

    Returns void