Rich Text Label Operations

xIsValid2DRichTextLabelID

Validates 2D Rich Text label ID.

bool xIsValid2DRichTextLabelID(size_t iLabelID)

return

Returns True is it’s a valid 2D rich text label

iLabelID

Label ID

xIsValid3DRichTextLabelID

Validates 3D Rich Text label ID.

bool xIsValid3DRichTextLabelID(size_t iLabelID)

return

Returns True is it’s a valid 3D Rich text label

iLabelID

Label ID

xAddRichTextLabel2D

Adds 2D rich text label with the given input html data and attributes.

size_t xAddRichTextLabel2D(String htmlFilePath , List <float> relativePosition //posx,posy , List <float> dimension //w,h , List <float> backgroundData //size of 5 - on,r,g,b,a , List <float> borderData //size of 5- on,r,g,b,a , List <int> attributes)//index0-compact/actual,

return

Returns a non-zero integer of the generated rich text label.

Returns zero otherwise.

htmlFilePath

File path or a web url

relativePosition

array of size 2.

array[0] - relative x position value ( 0 < x <1 )

array[1] - relative y position value ( 0 < y <1 )

dimension

array of size 2.

array[0] - relative width of the window ( 0 < width <1 )

array[1] - relative height of the window ( 0 < height <1 )

backgroundData

array of size 5.

array[0] - a non-zero value refers to switch ON and zero refers to switch Off the background.

array[1] - red component value of background color ( 0 < value <1 )

array[2] - green component value of background color ( 0 < value <1 )

array[3] - blue component value of background color ( 0 < value <1 )

array[4] - alpha component value of background color ( 0 < value <1 )

borderData

array of size 5.

array[0] - a non-zero value refers to switch ON and zero refers to switch Off the border.

array[1] - red component value of border color ( 0 < value <1 )

array[2] - green component value of border color ( 0 < value <1 )

array[3] - blue component value of border color ( 0 < value <1 )

array[4] - alpha component value of border color ( 0 < value <1 )

attributes

array of size 1.

array[0] - a non-zero integer value refers to Compact mode ON and zero refers to Compact Mode Off.

xAddRichTextLabel3D

Adds 3D rich text label with the given input html data and attributes.

size_t xAddRichTextLabel3D(String htmlFilePath , String sModel, String sPart, float x, float y, float z , List <float> dimension //w,h , List <float> backgroundData //size of 5 - on,r,g,b,a , List <float> borderData //size of 5- on,r,g,b,a , List <int> attributes)//index0-compact/actual,

return

Returns a non-zero integer of the generated rich text label.

Returns zero otherwise.

htmlFilePath

File path or a web url

sModel

Model Name, which contains the part.

sPart

Part Name to which the label to be attached.

x,y,z

3D position in the given part.

dimension

array of size 2.

array[0] - relative width of the window ( 0 < width <1 )

array[1] - relative height of the window ( 0 < height <1 )

backgroundData

array of size 5.

array[0] - a non-zero value refers to switch ON and zero refers to switch Off the background.

array[1] - red component value of background color ( 0 < value <1 )

array[2] - green component value of background color ( 0 < value <1 )

array[3] - blue component value of background color ( 0 < value <1 )

array[4] - alpha component value of background color ( 0 < value <1 )

borderData

Array of size 5.

array[0] - a non-zero value refers to switch ON and zero refers to switch Off the border.

array[1] - red component value of border color ( 0 < value <1 )

array[2] - green component value of border color ( 0 < value <1 )

array[3] - blue component value of border color ( 0 < value <1 )

array[4] - alpha component value of border color ( 0 < value <1 )

attributes

array of size 1.

array[0] - a non-zero integer value refers to Compact mode ON and zero refers to Compact Mode Off.

xSetRichTextLabelPosition

Sets 2D screen position for the given richtext label ID.

bool xSetRichTextLabelPosition(size_t labelID, Vector<float> position)

return

Returns True if successfully sets the position.

Returns False otherwise.

labelID

Rich Text label point ID.

position

Array size of 2.

array[0]- X coordinate values; Screen left is the reference to this value.

array[1] - Y coordinate value. screen top is the reference to this value.

pxGetRichTextLabelPosition

Gets the 2D screen position in relative to viewport width or height or absolute values based on the last parameter.

Vector<float> pxGetRichTextLabelPosition(size_t labelID, bool bRelative=True)

return

Returns an array of size 2 if succeeds.

Returns empty array otherwise.

labelID

Rich Text label point ID.

bRelative

Boolean flag to get normalized values or absolute values.

True - Gets the normalized coordinate values in the range (0,1)

False - Gets the absolute values which varies X - (0, width of viewport); Y - (0, height of the viewport). :: Note:

y coordinate value is reference to the top of the viewport.

x coordinate value is reference to the left of the viewport.

pxGetRichTextLabelIDs

Gets Rich Text Label IDs of the given type.

Vector<size_t> pxGetRichTextLabelIDs(int iLabelType)

return

returns an array of IDs for the given type.

returns an empty array when there is no rich text labels.

returns an empty array if failed.

iLabelType

0 - all type rich text labels

1 - absolute position 2D rich text labels.

2 - relative position 2D rich text labels.

3 - 3D rich text labels.

xGetRichTextLabelImagePath

Gets image file path used in rich text label.

String xGetRichTextLabelImagePath(size_t iLabelID)

return

returns image file path if succeeds

returns an empty string if failed.

iLabelID

rich text label pointer id.

xSetRichTextLabelBackground

Sets background color and on/off switch to rich text label given.

bool xSetRichTextLabelBackground(size_t labelID, float r, float g, float b, bool bBackground)

return

returns True if succeeds

returns False otherwise.

labelID

label ID

r,g,b

color components of background.

bBackground

On/Off switch flag.

pxGetRichTextLabelBackground

Gets background color and on/off switch for the given rich text label.

Vector<float> pxGetRichTextLabelBackground(size_t labelID)

return

returns an array of size 4 if succeeds

array[0] = On/Off switch flag.

array[1]= red componentvalue.

array[2]= green componentvalue.

array[3]= blue componentvalue.

returns empty array otherwise.

labelID

label ID

xSetRichTextLabelBorder

Sets border color and on/off switch to rich text label given.

bool xSetRichTextLabelBorder(size_t labelID, float r, float g, float b, bool bBorder)

return

returns True if succeeds

returns False otherwise.

labelID

label ID

r,g,b

color components of border.

bBorder

On/Off switch flag.

pxGetRichTextLabelBorder

Gets border color and on/off switch for the given rich text label.

Vector<float> pxGetRichTextLabelBorder(size_t labelID)

return

returns an array of size 4 if succeeds

array[0] = On/Off switch flag.

array[1]= red componentvalue.

array[2]= green componentvalue.

array[3]= blue componentvalue.

returns empty array otherwise.

labelID

label ID

xSetRichTextLabelDimension

Sets width and height of the given rich text label.

bool xSetRichTextLabelDimension(size_t labelID,Vector<float> dimension);

return

returns True if Succeeds.

returns False otherwise.

labelID

label ID

dimension

an array of size 2.

array[0] - label Width

array[1] - label Height

pxGetRichTextLabelDimension

Gets width and height of the given rich text label.

Vector <float> pxGetRichTextLabelDimension(size_t labelID, bool bAbsolute);

return

returns an array of size 2 if Succeeds.

array[0] - label Width

array[1] - label Height

returns empty array otherwise.

labelID

label ID

bAbsolute

True - returns absolute values

False