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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Changing font color of 3d label

vivekse
14-Alexandrite

Changing font color of 3d label

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

ACCEPTED SOLUTION

Accepted Solutions
lgherman
14-Alexandrite
(To:vivekse)

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

4 REPLIES 4
lgherman
14-Alexandrite
(To:vivekse)

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

lgherman
14-Alexandrite
(To:lgherman)

Hello @vivekse ,

 

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

 

Kind regards,

Lorena

vivekse
14-Alexandrite
(To:lgherman)

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?

lgherman
14-Alexandrite
(To:vivekse)

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

Announcements

Top Tags