Ets_Shape_Label_Create()
Note: Requires OPNET Development Kit
Abstract
Creates a new label shape.
Syntax
Ets_Shape_Label_Create (text_lines_lptr, label_box, font_str, fg_color, bg_color, line_spacing, alignment, angle)
| Argument | Type | Description |
|---|---|---|
text_lines_lptr |
PrgT_List * |
Pointer to list of text strings for the label. |
label_box |
EtsT_Shape_Rect |
A rectangle defining the area of the label. See Shape Data Types for details on the box coordinates. |
font_str |
EtsT_Shape_Font_Name |
The name of a font for the text. |
fg_color |
EtsT_Color |
Foreground color (used for text characters). See Shape Colors for details. |
bg_color |
EtsT_Color |
Background color (used to fill the label box). See Shape Colors for details. For no fill, use EtsT_Shape_Color_None. |
line_spacing |
double |
Spacing between lines, based on text size (as described in the Details section). |
alignment |
EtsT_Shape_Align |
Horizontal position of the text within the label box, either left, center, or right (use the text alignment constants in Table 26). |
angle |
double |
Rotation angle for the label, measured in degrees counter-clockwise from horizontal. 0.0 means no rotation. |
Return Type
EtsT_Shape_Handle
A handle to the new shape.
Header
ets_api_shapeset.h
Details
A label shape is one or more text strings displayed as a single object. The text can appear in a filled box and be rotated at an arbitrary angle. Text size and placement is determined as follows:
- If
label_boxdefines a rectangle, the text is scaled to fit within the specified area. - If
label_boxdefines a point (that is, the minimum and maximum values are the same), that point is used as the center of the label and the text size is determined by the specified font.
Line spacing is based on text size. For normal spacing, set line_spacing to 1.0. For double-spacing (one blank line between text lines), set line_spacing to 2.0, and so on.