Comments (6)
This looks like a limitation of THREE.HTMLMesh—it's not capturing every update to the DOM.
You may want to open an issue in that repo. I would continue to use your setAttribute edit in the meantime.
from lil-gui.
Hi, that method is a stub that is overridden by the actual controller classes. I would need to see your code to help.
from lil-gui.
Yup ok sorry about that. Here is the code I have.
This is the GUI I create in the init()
function:
// status parameters
const status = {
countSpheres: 0,
};
init(){
...
const statusGUI = new GUI( { width: 300, title: 'Status' } );
const igHUD = new InteractiveGroup(renderer, camera);
statusGUI.add(status, 'countSpheres').name('Current number of spheres').listen();
const meshHUD = new HTMLMesh(statusGUI.domElement);
igHUD.add(meshHUD);
camera.add(igHUD);
igHUD.position.set(0, 0, -0.5);
igHUD.lookAt(camera.position);
...
}
For debug purposes, I increment the countSpheres
property in the render function
status.countSpheres++;
The incrementation is working and the object of the controller is also updated with the right value. Only the display is not refreshed. I tried calling setValue
from the controller but it's not changing anything.
I've just observed that when I'm closing and opening the GUI, the value is refreshed.
Edit
The problem might come from the fact that the DOM is not modified thus, HTMLMesh does not trigger an update.
from lil-gui.
It looks like adding this.$input.setAttribute("value", t);
into the updateDisplay()
method of NumberController does the trick.
from lil-gui.
Do you still have this problem without HTMLMesh?
Number controller already updates $input.value in updateDisplay. I’m not sure what t
is here. Are you using a modified version of the library?
from lil-gui.
The problem only arises with using HTMLMesh.
The t
is in the minified versioned. It's the equivalent of value
.
I think the setAttribute
works because it updates the HTML code which then triggers the update call in HTMLMesh that only observes the DOM.
from lil-gui.
Related Issues (20)
- Folders have touchStyles although I pass {touchStyles: false} to its parent. HOT 2
- Cannot copy/paste values from the color picker HOT 4
- [Feature request] display units HOT 1
- Transparent --background-color not layered correctly HOT 8
- [Feature request] labels HOT 1
- Folder Toggle Functionality Not Working Properly HOT 2
- gui.reset error: Uncaught TypeError: t.match is not a function HOT 3
- Astro + lil-gui leads an error during build HOT 4
- Dropdown search (input completions) HOT 2
- Support for predefined input/output color spaces HOT 4
- Android Firefox: Slider shows visible arrows HOT 2
- Stepped number controllers generating extra onChange events HOT 6
- Way to set the option state (disabled/enabled) for individual options? HOT 1
- Step value is 1 and why is the mouse wheel not 1? HOT 1
- [Howto request]: add onto document HOT 2
- .add(document,..) HOT 1
- Possibility to add <hr> between GUI Elements HOT 2
- BooleanController.setValue does not coerce non-boolean values HOT 4
- Feature request: input spinner HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lil-gui.