# TextBox

class `Markup.Shapes.``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.

  ## Index

  Constructors

  - `constructor`

  Methods

  - `getBoxPortion`
  - `getPadding`
  - `getPosition`
  - `getTextPortion`
  - `getTextString`
  - `setPadding`
  - `setPosition`
  - `setTextString`

## Constructors

`Markup.Shapes.TextBox.``constructor`()
  TextBox(position: `Point2`, text: string): `TextBox`

  Creates a new TextBox Markup Shape.

  Parameters

  > position: `Point2`

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

  > text: string

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

  Returns: `TextBox`

## Methods

`Markup.Shapes.TextBox.``getBoxPortion`()

  inherited

  getBoxPortion(): `RectangleBase`

  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.

`Markup.Shapes.TextBox.``getPadding`()

  inherited

  getPadding(): number

  Gets the Pixel distance between the text and outer rectangle

  Returns: number

  > the padding value.

`Markup.Shapes.TextBox.``getPosition`()
  getPosition(): `Point2`

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

  Returns: `Point2`

  > the TextBox position

`Markup.Shapes.TextBox.``getTextPortion`()

  inherited

  getTextPortion(): `TextMarkupBase`

  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

`Markup.Shapes.TextBox.``getTextString`()
  getTextString(): string

  Gets the text string for this box

  Returns: string

  > the text string

`Markup.Shapes.TextBox.``setPadding`()

  inherited

  setPadding(padding: number): void

  Sets the Pixel distance between the text and outer rectangle

  Parameters

  > padding: number

  > > the padding value.

  Returns: void

`Markup.Shapes.TextBox.``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

`Markup.Shapes.TextBox.``setTextString`()
  setTextString(text: string): void

  Sets the text string for this box

  Parameters

  > text: string

  > > the text string

  Returns: void

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Visualize Web or choose a sample question below to start a conversation:

What is HOOPS Visualize Web?
What are the latest release notes for HOOPS Visualize Web?
How do I start evaluating HOOPS Visualize Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...