perfect-gui 3.4.5 → 3.4.6
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 +4 -6
- package/package.json +1 -1
- package/src/index.js +8 -7
- package/test/src/index.js +2 -2
- package/test/src/js/basics.js +1 -1
- package/test/src/js/{full_featured.js → demo.js} +3 -3
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ const gui = new GUI({
|
|
|
61
61
|
// Defines if the panel can be manually moved across the screen.
|
|
62
62
|
// Default is false.
|
|
63
63
|
|
|
64
|
-
autoRepositioning: true
|
|
64
|
+
autoRepositioning: true,
|
|
65
65
|
// If set to true, the panel position will be reset when the screen is resized.
|
|
66
66
|
// If a panel has been dragged, it won't be be affected.
|
|
67
67
|
// Default is true.
|
|
@@ -77,15 +77,13 @@ const gui = new GUI({
|
|
|
77
77
|
<tr><td>button</td><td>
|
|
78
78
|
|
|
79
79
|
```javascript
|
|
80
|
-
gui.button('Click me!',
|
|
81
|
-
...
|
|
82
|
-
});
|
|
80
|
+
gui.button('Click me!', callback);
|
|
83
81
|
```
|
|
84
82
|
</td></tr>
|
|
85
83
|
<tr><td>image</td><td>
|
|
86
84
|
|
|
87
85
|
```javascript
|
|
88
|
-
gui.image('Click this', 'path/to/image', () => {
|
|
86
|
+
gui.image('Click this', 'path/to/image', (path) => {
|
|
89
87
|
...
|
|
90
88
|
});
|
|
91
89
|
```
|
|
@@ -168,4 +166,4 @@ gui.toggleClose();
|
|
|
168
166
|
## To do
|
|
169
167
|
- Color palette component
|
|
170
168
|
- Vector2 drag & drop
|
|
171
|
-
|
|
169
|
+
- Style list component
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -246,13 +246,14 @@ export default class GUI {
|
|
|
246
246
|
value: 'number'
|
|
247
247
|
}, params);
|
|
248
248
|
} else {
|
|
249
|
+
object = params.obj || params.object;
|
|
250
|
+
prop = params.prop || params.property;
|
|
251
|
+
|
|
249
252
|
this._checkMandatoryParams({
|
|
250
253
|
object: 'object',
|
|
251
254
|
prop: 'string'
|
|
252
|
-
},
|
|
255
|
+
}, {object, prop});
|
|
253
256
|
|
|
254
|
-
object = params.object;
|
|
255
|
-
prop = params.prop;
|
|
256
257
|
propReferenceIndex = this.propReferences.push(object[prop]) - 1;
|
|
257
258
|
isObject = true;
|
|
258
259
|
}
|
|
@@ -399,12 +400,12 @@ export default class GUI {
|
|
|
399
400
|
const minY = data.y.min ?? 0;
|
|
400
401
|
const maxY = data.y.max ?? 1;
|
|
401
402
|
|
|
402
|
-
const objectX = data.x.object;
|
|
403
|
-
const propX = data.x.prop;
|
|
403
|
+
const objectX = data.x.obj || data.x.object;
|
|
404
|
+
const propX = data.x.prop || data.x.property;
|
|
404
405
|
const propXReferenceIndex = this.propReferences.push(objectX[propX]) - 1;
|
|
405
406
|
|
|
406
|
-
const objectY = data.y.object;
|
|
407
|
-
const propY = data.y.prop;
|
|
407
|
+
const objectY = data.y.obj || data.y.object;
|
|
408
|
+
const propY = data.y.prop || data.y.property;
|
|
408
409
|
const propYReferenceIndex = this.propReferences.push(objectY[propY]) - 1;
|
|
409
410
|
|
|
410
411
|
this.imageContainer = null;
|
package/test/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './styles/main.scss';
|
|
2
|
-
import
|
|
2
|
+
//import demo from './js/demo';
|
|
3
3
|
import basics from './js/basics';
|
|
4
4
|
import vectors from './js/vectors';
|
|
5
5
|
import multiple from './js/multiple';
|
|
@@ -7,7 +7,7 @@ import folders from './js/folders';
|
|
|
7
7
|
import other from './js/other';
|
|
8
8
|
import kill_create from './js/kill_create';
|
|
9
9
|
|
|
10
|
-
//
|
|
10
|
+
//demo();
|
|
11
11
|
|
|
12
12
|
basics();
|
|
13
13
|
|
package/test/src/js/basics.js
CHANGED
|
@@ -25,7 +25,7 @@ export default function basics() {
|
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
27
|
|
|
28
|
-
gui.slider({ name: 'Slider 2 (object binding)',
|
|
28
|
+
gui.slider({ name: 'Slider 2 (object binding)', obj: position, prop: 'x', min: -30, max: 30, step: .1 }
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
gui.toggle('Switch', true, state => {
|
|
@@ -28,17 +28,17 @@ export default function()
|
|
|
28
28
|
|
|
29
29
|
folder1.image(
|
|
30
30
|
'The officer',
|
|
31
|
-
require('../img/DALL·E
|
|
31
|
+
require('../img/DALL·E-2022-11-13-20.11.16---portrait-of-a-squirrel-in-an-officier-suit,-style-of-a-Rembrandt-painting.jpg'),
|
|
32
32
|
() => {}
|
|
33
33
|
);
|
|
34
34
|
folder1.image(
|
|
35
35
|
'Weird dream',
|
|
36
|
-
require('../img/DALL·E
|
|
36
|
+
require('../img/DALL·E-2022-11-13-20.11.52---a-blonde-girl-riding-a-whale-in-the-style-of-hopper.jpg'),
|
|
37
37
|
() => {}
|
|
38
38
|
);
|
|
39
39
|
folder1.image(
|
|
40
40
|
'Friends',
|
|
41
|
-
require('../img/DALL·E
|
|
41
|
+
require('../img/DALL·E-2022-11-13-20.13.55---1-blonde-haired-girl-with-her-orange-cat,-watching-the-whales-in-Tadoussac,-Canada.-In-the-style-of-an-oil-painting..jpg'),
|
|
42
42
|
() => {}
|
|
43
43
|
);
|
|
44
44
|
|