0

Would anyone know how to change the name of the menu opacity to a name of my choice in Slice?

Thank's.

2 Answers2

1

This can be done with the .name function of dat.gui.

gui.add(volume, 'opacity').name('Transparency');
Neurovis
  • 11
  • 1
  • Welcome to Stack Overflow, user1563788 ! Please don't forget to mark the answer as accepted if it has solved your problem. – Axel Isouard Oct 04 '12 at 13:33
0

That's a dat.gui question and not really related to XTK. Basically you have to create a wrapper object:

var settings = {

  transparency: 1.0

}

transparency would be your new name.

Then, you define the controller using the settings object

var opacityController = lhgui.add(settings, 'transparency', 0, 1);

And in the callback, adjust the XTK opacity value:

opacityController.onChange(function() {

  mesh.opacity = settings.transparency;

});
haehn
  • 967
  • 1
  • 6
  • 19