Would anyone know how to change the name of the menu opacity to a name of my choice in Slice?
Thank's.
Would anyone know how to change the name of the menu opacity to a name of my choice in Slice?
Thank's.
This can be done with the .name function of dat.gui.
gui.add(volume, 'opacity').name('Transparency');
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;
});