Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to set strings? #312

Open
donadog opened this issue Feb 3, 2022 · 3 comments
Open

Is there a way to set strings? #312

donadog opened this issue Feb 3, 2022 · 3 comments

Comments

@donadog
Copy link

donadog commented Feb 3, 2022

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.

@Bates550
Copy link

Bates550 commented May 6, 2022

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');

@autonomobil
Copy link

⬆️ Does not work, name stays at property

@Bates550
Copy link

Bates550 commented Aug 2, 2023

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants