addObjectText
Displays a text string on the pad, using the current properties.
wizCtl.addObjectText(id, x, y, text)
| Parameter | Description |
|---|---|
| id | String that identifies the text. Can be
|
| x, y | Position of the top-left corner of the object on the pad display.
|
| text | Text to display. Use \n for a line break. |
| Return values |
|---|
| The added text object. Throws an exception if an error occurs. |
The returned object has a rect property with the displayed area: upperLeftXpixel, upperLeftYpixel, lowerRightXpixel and lowerRightYpixel.
Use it to position other objects relative to the text.
The following example adds a title and a line underneath it:
wizCtl.setProperty({font: {name: "verdana", size: 20, color: "black"}});
const titleText = wizCtl.addObjectText("", "left", "top", "Wizard Demo");
wizCtl.addPrimitive(sigSDK.PrimitiveType.Line, "left", titleText.rect.lowerRightYpixel, "right", titleText.rect.lowerRightYpixel, 2);