Skip to main content
1-Visitor
January 4, 2021
Solved

Change a color of the 3D label via .js

Hi,

How can I change a color of a 3D label by clicking on a button?

I tried to write the code below but it doesn't work:

 

$scope.SwitchConf = function () {
$scope.app.view.Home.wdg["3DLabel-2"].fontColor= 'red';

 

When I click on the button, the function "SwitchConf" is called but the color don't change.

Is it possible to do this by this way?

Thanks for your help...

Maxime.

16-Pearl
January 5, 2021

Hi, @MaximeDid 

 

Please try the attachment.

10 replies

16-Pearl
January 5, 2021

Hi, Maxime

 

What type of project did you create? Mobile or 3D eyewear?

 

I tried both codes below  and they work in my mobile project, in preview and on device.

$scope.setColorRGB = function(){
 $scope.view.wdg['3DLabel-1'].fontColor = "#ff0000";
}

or

$scope.setColorName = function(){
 $scope.view.wdg['3DLabel-1'].fontColor = "red";
}

 

Have you tried the code on device?

Sometimes it doesn't work in preview, but works on device.

Translate
MaximeDid1-VisitorAuthor
1-Visitor
January 5, 2021

Hi @dsgnrClarK ,

 

I created a mobile project.

I tried both code you send me, but in my app it doesn't works (in preview and on device).

I created also a new project and test the code but it doesn't work

 

I changed the code for check my function is called:

 

$scope.SwitchConf = function () {$scope.view.wdg['3DLabel-2'].visible = false;}

 

The result is OK.

Translate
16-Pearl
January 5, 2021

Hi, @MaximeDid 

 

Please try the attachment.

Translate