I am currently working on a drop-down menu using JavaScript. Below is the content of my JSON file:
{
"bg1":"assets/bg/people_bg.jpg",
"bg2":"assets/bg/people_bg.jpg"
}
My goal is to assign the names bg1 and bg2 to the backgrounds in the dropdown menu, allowing users to select different backgrounds. Here is the code snippet for using dat.GUI:
{
controller = new function() {
this.bg = '';
}
var gui = new dat.GUI();
f1 = gui.addFolder('Sphere');
f1.add( controller, 'bg', displayingNameOfBackground).onChange(function() {
//if change using their path to change background
);