LabelTextObject
Extends
LabelObject
Constructor
constructor(options: LabelTextObjectOptions): LabelTextObject
Parameters:
Name | Type | Required | Description |
---|---|---|---|
options | LabelTextObjectOptions | object | Yes | The LabelTextObject options. Can be an LabelTextObjectOptions instance or directly the parameter to pass on the LabelTextObjectOptions constructor |
Properties
isLabelText
Used to check whether this or derived classes are label texts. Default is true.
You should not change this, as it used internally by the renderer for optimisation.
Type | Read-Only | Defaults | Description |
---|---|---|---|
boolean | YES | True |
style
Type | Read-Only | Defaults | Description |
---|---|---|---|
TextStyleOptions | YES | - | The style applied to the text |
text
Type | Read-Only | Defaults | Description |
---|---|---|---|
string | YES | - | The displayed text, used \n to introduce line break |
Inherited Properties
Inherited Properties
autoScale
Type | Read-Only | Defaults | Description |
---|---|---|---|
boolean | YES | False |
id
Type | Read-Only | Description |
---|---|---|
number | symbol | null | YES |
isAdsumObject
Used to check whether this or derived classes are Adsum object 3D. Default is true.
You should not change this, as it used internally by the renderer for optimisation.
Type | Read-Only | Defaults | Description |
---|---|---|---|
boolean | YES | True |
isLabel
Used to check whether this or derived classes are labels. Default is true.
You should not change this, as it used internally by the renderer for optimisation.
Type | Read-Only | Defaults | Description |
---|---|---|---|
boolean | YES | True |
isPermanentDisplay
Does the label is always visible or only on hover/selected state.
Type | Read-Only | Defaults | Description |
---|---|---|---|
boolean | YES | True |
levelOfDetails
The level of details associated to that object.
Type | Read-Only | Defaults | Description |
---|---|---|---|
LevelOfDetails | Yes | null |
offset
The label position offset in parent local system. This is in world unit.
Type | Read-Only | Defaults | Description |
---|---|---|---|
{x: number, y: number, z: number } | YES | { x: 0, y: 0, z: 0 } |
orientationMode
Type | Read-Only | Defaults | Description |
---|---|---|---|
LABEL_ORIENTATION_MODES.BILLBOARD | LABEL_ORIENTATION_MODES.STATIC | LABEL_ORIENTATION_MODES.FLIP | YES | LABEL_ORIENTATION_MODES.BILLBOARD |
opacity
Type | Read-Only | Defaults | Description |
---|---|---|---|
number | YES | 1 | A number in 0-1 range |
parent
Type | Read-Only | Defaults | Description |
---|---|---|---|
SiteObject | BuildingObject | FloorObject | SpaceObject | YES | - |
placeId
Type | Read-Only | Description |
---|---|---|
number | symbol | null | YES |
rotation
The rotation in degrees.
Note: rotation is only available when orientationMode is LABEL_ORIENTATION_MODES.STATIC
Type | Read-Only | Defaults | Description |
---|---|---|---|
number | YES | 0 |
scale
The label scale factor in each axes.
Type | Read-Only | Defaults | Description |
---|---|---|---|
{x: number, y: number, z: number } | YES | { x: 1, y: 1, z: 1 } |
selected
Type | Read-Only | Defaults | Description |
---|---|---|---|
boolean | YES | false |
Methods
setStyle
setStyle(style: TextStyleOptions|object): LabelTextObject
Update the text style. The given style will be merged with the current one, so you can change a single style property at once.
Please note that updating style & text is performance consuming, try to update them in a single call.
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
style | TextStyleOptions | object | Yes | - |
Returns:
Type: LabelTextObject
setText
setText(text: string, style: ?TextStyleOptions|object = null ): LabelTextObject
Please note that updating style & text is performance consuming, try to update them in a single call.
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
text | string | Yes | - | |
style | ?TextStyleOptions | object | No | null | Update the style in the same time (if not null). Check setStyle method for more details |
Returns:
Type: LabelTextObject
Overwritten Methods
getType
getType(): ADSUM_OBJECT_TYPES.LabelTextObject
Returns:
Type: ADSUM_OBJECT_TYPES.LabelTextObject
Inherited Methods
getPosition
getPosition(): { x: number, y: number, z: number }
Gets the position relative to parent.
Returns:
Type: { x: number, y: number, z: number }
setDisplayMode
setDisplayMode(displayMode: DISPLAY_MODES.NONE|DISPLAY_MODES.VISIBLE|DISPLAY_MODES.TRANSPARENT): void
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
displayMode | DISPLAY_MODES.NONE | DISPLAY_MODES.VISIBLE | DISPLAY_MODES.TRANSPARENT | Yes | - |
Returns:
Type: void
getDisplayMode
getDisplayMode(): DISPLAY_MODES.NONE|DISPLAY_MODES.VISIBLE|DISPLAY_MODES.TRANSPARENT
Returns:
Type: DISPLAY_MODES.NONE | DISPLAY_MODES.VISIBLE | DISPLAY_MODES.TRANSPARENT
forceDisplayMode
forceDisplayMode(displayMode: DISPLAY_MODES.NONE|DISPLAY_MODES.VISIBLE|DISPLAY_MODES.TRANSPARENT|null): LabelObject
Force the display mode visibility. See Label Visibility
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
displayMode | null | DISPLAY_MODES.NONE | DISPLAY_MODES.VISIBLE | DISPLAY_MODES.TRANSPARENT | Yes | - |
Returns:
Type: LabelObject
moveBy
moveBy(x: number, y: number, z: number): LabelObject
Move the label by incrementing the offset position. This method will set the offset property.
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
x | number | Yes | - | |
y | number | Yes | - | |
z | number | Yes | - |
Returns:
Type: LabelObject
moveTo
moveTo(x: number, y: number, z: number): LabelObject
Move the label to the given position. This method will set the offset property.
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
x | number | Yes | - | |
y | number | Yes | - | |
z | number | Yes | - |
Returns:
Type: LabelObject
resetForceDisplayMode
resetForceDisplayMode(): LabelObject
Equivalent to forceDisplayMode( null )
Returns:
Type: LabelObject
setAutoScale
setAutoScale(autoScale: boolean): LabelObject
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
autoScale | boolean | Yes | - |
Returns:
Type: LabelObject
setOrientationMode
setOrientationMode(orientationMode: LABEL_ORIENTATION_MODES.BILLBOARD | LABEL_ORIENTATION_MODES.STATIC): LabelObject
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
orientationMode | LABEL_ORIENTATION_MODES.BILLBOARD | LABEL_ORIENTATION_MODES.STATIC | Yes | - |
Returns:
Type: LabelObject
setOpacity
setOpacity(opacity: number): LabelObject
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
opacity | number | Yes | - |
Returns:
Type: LabelObject
setPermanentDisplay
setPermanentDisplay(permanentDisplay: boolean): LabelObject
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
permanentDisplay | boolean | Yes | - |
Returns:
Type: LabelObject
setRotation
setRotation(rotation: number): LabelObject
Note: rotation is only available when orientationMode is LABEL_ORIENTATION_MODES.STATIC
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
rotation | number | Yes | - | The rotation in degrees |
Returns:
Type: LabelObject
setScale
setScale(x: number, y: number, z: number): LabelObject
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
x | number | Yes | - | |
y | number | Yes | - | |
z | number | Yes | - |
Returns:
Type: LabelObject
select
select(): LabelObject
Mark this label as selected, this will affect the visibility behavior according to isPermanentDisplay property
Returns:
Type: LabelObject
unselect
unselect(): LabelObject
Mark this label as unselected, this will affect the visibility behavior according to isPermanentDisplay property
Returns:
Type: LabelObject