perfect-gui 4.12.10 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/perfect-gui.js +378 -280
- package/package.json +1 -1
- package/src/components/Button.js +33 -20
- package/src/components/Color.js +64 -68
- package/src/components/Image.js +32 -16
- package/src/components/List.js +80 -76
- package/src/components/Slider.js +82 -54
- package/src/components/Toggle.js +59 -55
- package/src/components/Vector2.js +157 -72
- package/src/index.js +16 -17
package/README.md
CHANGED
|
@@ -60,13 +60,13 @@ const gui = new GUI({
|
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
// 2. Add a simple button
|
|
63
|
-
gui.button('Click me'
|
|
63
|
+
gui.button({ label: 'Click me' }).onClick(() => {
|
|
64
64
|
console.log('Button clicked!');
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
// 3. Add a slider connected to an object value natively
|
|
68
68
|
const params = { opacity: 0.5 };
|
|
69
|
-
gui.slider(
|
|
69
|
+
gui.slider(params, 'opacity', { min: 0, max: 1 }).onChange((val) => {
|
|
70
70
|
document.body.style.opacity = val;
|
|
71
71
|
});
|
|
72
72
|
|