cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Changing font color of 3d label

SOLVED
Amethyst

Changing font color of 3d label

How to change font color of 3d label using javascript?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Changing font color of 3d label

Hello @vivekse ,

 

The code should work if your experience has a 3D label widget that has the StudioID set to 3DLabel-1

 

An alternative is to create an application parameter (in my case, it is called labelColor) and set its value to the desired color. Figure 1Figure 1

Then, you will need to bind the application parameter with the font color property of your 3D label. In order to do that, you will have to click on the icon indicated by the yellow arrow and drag it onto your 3D label. The window shown bellow should appear. Here, select Font Color and click Bind.

Label2.PNG

You can change the value of your application parameter using javascript like this:

 

$scope.app.params.labelColor = #FF0000;

 

 

Kind regards,

Lorena

View solution in original post

Tags (2)
4 REPLIES 4
Highlighted

Re: Changing font color of 3d label

Hello vivekse,

 

You can change the font color of a 3D label by adding this to your Home.js file (where 3DLabel-1 is the StudioID of your 3D label and #00FF00 is its color (in this case, green):

 

angular.element(document).ready(function () { 
    $scope.view.wdg['3DLabel-1'].fontColor = "#00FF00";
});

 

 

 

Kind regards,

Lorena

Highlighted

Re: Changing font color of 3d label

Hello @vivekse ,

 

If the answear was what you expected, please mark that post as a solution.

 

Kind regards,

Lorena

Highlighted

Re: Changing font color of 3d label

Hi @lgherman. Thank you for the reply but the code does not work in my case. Even I used the same code. Is there any other way to do so like by creating application parameters?

Highlighted

Re: Changing font color of 3d label

Hello @vivekse ,

 

The code should work if your experience has a 3D label widget that has the StudioID set to 3DLabel-1

 

An alternative is to create an application parameter (in my case, it is called labelColor) and set its value to the desired color. Figure 1Figure 1

Then, you will need to bind the application parameter with the font color property of your 3D label. In order to do that, you will have to click on the icon indicated by the yellow arrow and drag it onto your 3D label. The window shown bellow should appear. Here, select Font Color and click Bind.

Label2.PNG

You can change the value of your application parameter using javascript like this:

 

$scope.app.params.labelColor = #FF0000;

 

 

Kind regards,

Lorena

View solution in original post

Tags (2)
Announcements
Topics available:
AR/VR for Data Optimization AR/VR for Security and Control AR/VR for Inspection