dataarts / dat.gui

Lightweight controller library for JavaScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to set strings?

donadog opened this issue · comments

const saoFolder = gui.addFolder('SAO'); saoFolder.add(saoParams, 'enabled'); saoFolder.add(saoParams, 'bias', -2, 2); saoFolder.add(saoParams, 'intensity', 0, 1.0);

Fields that are created are named after property. Can i set them to a custom string?

I want to have string variable for different languages. I also need english string to be capitalized, Enabled, Bias, Intensity... without changing property names.

I think controller.name might be what you're looking for.

const saoFolder = gui.addFolder('SAO');
saoFolder.add(saoParams, 'enabled').name('Enabled');
saoFolder.add(saoParams, 'bias', -2, 2).name('Bias');
saoFolder.add(saoParams, 'intensity', 0, 1.0).name('Intensity');

⬆️ Does not work, name stays at property

Hmm, perhaps I'm misunderstanding the question, but appears to work for me on the latest dat.gui (0.7.9). Here's a JSFiddle example where I've renamed the gui params to Foo, Bar, Baz.

https://jsfiddle.net/Bates550/v9wL7of2/4/