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.

Constructors


Constructors

TextBox.constructor([position[, text]])
Arguments
  • position (Point2()) – optional the screen space point of the top left of the box. Default value is (0,0).

  • text (string()) – optional the text string for the box. Default value is empty string.

Creates a new TextBox Markup Shape.

Return type

TextBox

Methods

getBoxPortion

TextBox.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

the rectangle markup object.

Return type

RectangleBase

getPadding

TextBox.getPadding()

Gets the Pixel distance between the text and outer rectangle

Returns

the padding value.

Return type

number

getPosition

TextBox.getPosition()

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

Returns

the TextBox position

Return type

Point2

getTextPortion

TextBox.getTextPortion()

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

Returns

the text markup object

Return type

TextMarkupBase

getTextString

TextBox.getTextString()

Gets the text string for this box

Returns

the text string

Return type

string

setPadding

TextBox.setPadding(padding)
Arguments
  • padding (number()) – the padding value.

Sets the Pixel distance between the text and outer rectangle

Return type

void

setPosition

TextBox.setPosition(position)
Arguments
  • position (Point2()) – the TextBox position

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

Return type

void

setTextString

TextBox.setTextString(text)
Arguments
  • text (string()) – the text string

Sets the text string for this box

Return type

void