TextObjectMask

Returns or modifies the mask of a text object.

Syntax

Rhino.TextObjectMask (strObject [, intSource [, lngColor [, dblOffset]]])

Parameters

strObject

Required.  String.  The identifier of the object.

intSource

Optional. Number.  The mask color source. This determines where to get the color to draw a text mask.

Value

Description

-1

No text mask. Use this value to remove a text mask.

0

Use the background color of the viewport.

1

Use the RGB color specified by lngColor.

lngColor

Optional.  Number.  The RGB color of the mask. This is only applicable if intSource = 1.

dblOffset

Optional.  Number.  Offset for the border around text to the rectangle used to draw the mask. This number * TextObjectHeight for the text is the offset on each side of the tight rectangle around the text characters to the mask rectangle.

Returns

Array

If the text object has a mask, then the current or previous mask information, depending on whether or not intSource is specified, if successful. The array will contain the following information:

Element

Description

0

The mask color source.

1

The mask color. This is only applicable if the mask color source = 1.

2

The offset for the border around text.

Null

If the text object does not have a mask, if not successful, or on error.

Example

Dim strObject, arrMask

strObject = Rhino.GetObject

arrMask = Rhino.TextObjectMask(strObject, 1, RGB(128,0,128), 0.1)

If IsArray(arrMask) Then

  Rhino.Print arrMask(0)

  Rhino.Print arrMask(1)

  Rhino.Print arrMask(2)

End If

Also See

AddText

IsText

TextObjectFont

TextObjectFormula

TextObjectHeight

TextObjectJustification

TextObjectPlane

TextObjectPoint

TextObjectStyle

TextObjectText