uil 1.0.0 → 4.0.2

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 CHANGED
@@ -1,40 +1,57 @@
1
- <img src="http://lo-th.github.io/uil/examples/img/uil.png"/> uil v1.0
1
+ <p align="center"><a href="http://lo-th.github.io/uil/"><img src="http://lo-th.github.io/uil/examples/assets/uil.jpg"/></a><br>UIL v4.0</p>
2
2
 
3
- uil.js is a lightweight ui for javascript with some svg.
4
- [**example**](http://lo-th.github.io/uil/index.html)
3
+ uil.js is a lightweight ui for javascript with a complete 3d display support.<br>
4
+ totally customizable, only 6 events, auto resize<br>
5
+ [**Main example**](http://lo-th.github.io/uil/index.html)
5
6
 
6
7
  **1 - init engine**
7
8
  ```sh
8
- var ui = new UIL.Gui( { css:'top:145px; left:50%;', size:300, center:true } );
9
+ var ui = new UIL.Gui( { w:300 } )
9
10
  ```
10
11
  **2 - add value**
11
12
  ```sh
12
- ui.add('title', { name:'Title'});
13
- ui.add('bool', { name:'Bool', callback:callback});
14
- ui.add('color', { name:'Color', callback:callback, type:'html', value:0xff0000});
15
- ui.add('color', { name:'Color', callback:callback, type:'rgba', value:[0,1,1,1]});
16
- ui.add('slide', { name:'Slide', callback:callback, value:50});
17
- ui.add('string', { name:'String', callback:callback, value:'welcome to uil'});
18
- ui.add('list', { name:'List', callback:callback, list:['item1', 'item2', ...]});
19
- ui.add('number', { name:'Number', callback:callback, value:20, min:0, max:10, precision:2, step:0.01 });
20
- ui.add('number', { name:'Vector2', callback:callback, value:[0,0] });
21
- ui.add('number', { name:'Vector3', callback:callback, value:[0,0,0] });
22
- ui.add('number', { name:'Vector4', callback:callback, value:[0,0,0,0] });
13
+ ui.add('title', { name:'Title'})
14
+ ui.add('bool', { name:'Bool' })
15
+ ui.add('color', { name:'Color', type:'rgba', value:[0,1,1,1]})
16
+ ui.add('slide', { name:'Slide', value:50})
17
+ let myList = ui.add('list', { name:'List', list:['i1', 'i2', ...]})
23
18
  ```
24
- **3 - callback is simple function easy to define**
19
+ **3 - add value with object reference**
25
20
  ```sh
26
- var callback = function(value){ debug.innerHTML = value; }
27
- // you can also set like that
28
- ui.add('number', { name:'Vector4', value:[0,0,0,0] }).onChange( function(v){ debug.innerHTML = v; } );
21
+ const obj = {
22
+ name:'welcome to uil',
23
+ value: 2,
24
+ slider: 30,
25
+ vector: { x:10, y:-30 }
26
+ }
27
+
28
+ ui.add( obj, 'string', { type:'string' })
29
+ ui.add( obj, 'value', { type:'number', min:0, max:10, precision:2, step:0.01 })
30
+ ui.add( obj, 'slider', { type:'slide' })
31
+ ui.add( obj, 'vector', { type:'number' })
32
+ ```
33
+ **4 - callback return the value**
34
+ ```sh
35
+ ui.add('number', { name:'Vector4', value:[0,0,0,0] }).onChange( function(v){ debug.innerHTML = v; } )
29
36
  ```
30
- **4 - you can reset all value**
37
+ **5 - you can reset all value**
31
38
  ```sh
32
39
  ui.clear();
33
40
  ```
34
- **5 - other examples**
41
+ **6 - other examples**
42
+
43
+ [**uil module**](http://lo-th.github.io/uil/examples/index_module.html)
35
44
 
36
45
  [**uil listen**](http://lo-th.github.io/uil/examples/uil_listen.html)
37
46
 
47
+ [**uil color**](http://lo-th.github.io/uil/examples/uil_color.html)
48
+
38
49
  [**uil stresstest**](http://lo-th.github.io/uil/examples/uil_stresstest.html)
39
50
 
40
- [**uil advanced**](http://lo-th.github.io/uil/examples/uil_test.html)
51
+ [**uil group**](http://lo-th.github.io/uil/examples/uil_group.html)
52
+
53
+ [**uil to canvas**](http://lo-th.github.io/uil/examples/uil_to_canvas.html)
54
+
55
+ [**uil to three**](http://lo-th.github.io/uil/examples/uil_3d.html)
56
+
57
+ [**uil to three 2**](http://lo-th.github.io/uil/examples/uil_3d_2.html)