lexgui 0.5.2 → 0.5.4
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/build/components/audio.js +7 -7
- package/build/components/timeline.js +3 -3
- package/build/lexgui.css +484 -552
- package/build/lexgui.js +396 -182
- package/build/lexgui.min.css +4 -3
- package/build/lexgui.min.js +1 -1
- package/build/lexgui.module.js +396 -182
- package/build/lexgui.module.min.js +1 -1
- package/build/utilities.css +314 -0
- package/changelog.md +30 -1
- package/demo.js +434 -49
- package/examples/all_widgets.html +368 -0
- package/examples/area_tabs.html +94 -86
- package/examples/asset_view.html +183 -180
- package/examples/code_editor.html +62 -61
- package/examples/dialogs.html +97 -94
- package/examples/immediate_ui.html +44 -42
- package/examples/index.html +4 -7
- package/examples/node_graph.html +39 -36
- package/examples/previews/all_widgets.png +0 -0
- package/examples/side_bar.html +93 -90
- package/examples/timeline.html +4 -4
- package/examples/video_editor.html +38 -35
- package/examples/video_editor2.html +84 -79
- package/package.json +1 -1
package/examples/dialogs.html
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
3
|
+
|
|
3
4
|
<head>
|
|
4
5
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
5
6
|
<title>LexGUI Dialogs Demo</title>
|
|
@@ -14,101 +15,103 @@
|
|
|
14
15
|
}
|
|
15
16
|
</script>
|
|
16
17
|
</head>
|
|
18
|
+
|
|
17
19
|
<body></body>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
requestAnimationFrame(loop);
|
|
110
|
-
}
|
|
20
|
+
<script type="module">
|
|
21
|
+
|
|
22
|
+
import { LX } from 'lexgui';
|
|
23
|
+
|
|
24
|
+
// Init library and get main area
|
|
25
|
+
let area = LX.init({ skip_default_area: true });
|
|
26
|
+
|
|
27
|
+
LX.popup("Hello! I'm a popup dialog :)", null, { position: ["45%", "20%"] })
|
|
28
|
+
|
|
29
|
+
const pocketDialog = new LX.PocketDialog("Load Settings", p => {
|
|
30
|
+
p.branch("Canvas");
|
|
31
|
+
p.addColor("Background", "#b7a9b1");
|
|
32
|
+
p.addText("Text", "Pocket Dialog Lexgui.js @jxarco", null, { placeholder: "e.g. ColorPicker", icon: "fa fa-font" });
|
|
33
|
+
p.addColor("Font Color", [1, 0.1, 0.6], (value, event) => {
|
|
34
|
+
console.log("Font Color: ", value);
|
|
35
|
+
});
|
|
36
|
+
p.addNumber("Font Size", 36, (value, event) => {
|
|
37
|
+
console.log(value);
|
|
38
|
+
}, { min: 1, max: 48, step: 1 });
|
|
39
|
+
p.addVector2("2D Position", [250, 350], (value, event) => {
|
|
40
|
+
console.log(value);
|
|
41
|
+
}, { min: 0, max: 1024 });
|
|
42
|
+
|
|
43
|
+
p.branch("Project");
|
|
44
|
+
p.addText("Name", "Lexgui.js");
|
|
45
|
+
p.addButton(null, "Export");
|
|
46
|
+
p.merge();
|
|
47
|
+
}, { float: 'lt' });
|
|
48
|
+
|
|
49
|
+
const dialogClosable = new LX.Dialog("Closable Dialog", p => {
|
|
50
|
+
p.branch("Canvas");
|
|
51
|
+
p.addColor("Background", "#b7a9b1");
|
|
52
|
+
p.addText("Text", "Dialog Lexgui.js @jxarco", null, { placeholder: "e.g. ColorPicker", icon: "fa fa-font" });
|
|
53
|
+
p.addColor("Font Color", [1, 0.1, 0.6], (value, event) => {
|
|
54
|
+
console.log("Font Color: ", value);
|
|
55
|
+
});
|
|
56
|
+
p.addNumber("Font Size", 36, (value, event) => {
|
|
57
|
+
console.log(value);
|
|
58
|
+
}, { min: 1, max: 48, step: 1 });
|
|
59
|
+
p.addVector2("2D Position", [250, 350], (value, event) => {
|
|
60
|
+
console.log(value);
|
|
61
|
+
}, { min: 0, max: 1024 });
|
|
62
|
+
p.addSelect("Best Tool", ["@Engines", "Godot", "Unity", "Unreal Engine", "@Apps", "Visual Studio", "Visual Studio Code"], "Unity", (value, event) => {
|
|
63
|
+
console.log(value);
|
|
64
|
+
}, {filter: true, emptyMsg: "No engines found.", placeholder: "Search engines..."});
|
|
65
|
+
p.merge();
|
|
66
|
+
}, { size: ["350px", null], closable: true });
|
|
67
|
+
|
|
68
|
+
const draggablePocketDialog = new LX.PocketDialog("Draggable PocketDialog", p => {
|
|
69
|
+
p.branch("Canvas");
|
|
70
|
+
p.addColor("Background", "#b7a9b1");
|
|
71
|
+
p.addText("Text", "Pocket Dialog Lexgui.js @jxarco", null, { placeholder: "e.g. ColorPicker", icon: "fa fa-font" });
|
|
72
|
+
p.addSelect("Best Engine", ["Godot", "Unity", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Unreal Engine", "Pepe"], "Godot", (value, event) => {
|
|
73
|
+
console.log(value);
|
|
74
|
+
}, { filter: true });
|
|
75
|
+
p.addColor("Font Color", [1, 0.1, 0.6], (value, event) => {
|
|
76
|
+
console.log("Font Color: ", value);
|
|
77
|
+
});
|
|
78
|
+
p.addNumber("Font Size", 36, (value, event) => {
|
|
79
|
+
console.log(value);
|
|
80
|
+
}, { min: 1, max: 48, step: 1 });
|
|
81
|
+
p.addVector2("2D Position", [250, 350], (value, event) => {
|
|
82
|
+
console.log(value);
|
|
83
|
+
}, { min: 0, max: 1024 });
|
|
84
|
+
p.merge();
|
|
85
|
+
}, { size: ["350px", null], draggable: true });
|
|
86
|
+
|
|
87
|
+
// add canvas to left upper part
|
|
88
|
+
let canvas = document.createElement('canvas');
|
|
89
|
+
canvas.id = "mycanvas";
|
|
90
|
+
canvas.width = window.innerWidth;
|
|
91
|
+
canvas.height = window.innerHeight
|
|
92
|
+
canvas.style.width = "100%";
|
|
93
|
+
canvas.style.height = "100%";
|
|
94
|
+
document.body.appendChild(canvas);
|
|
95
|
+
|
|
96
|
+
function loop(dt) {
|
|
97
|
+
|
|
98
|
+
var ctx = canvas.getContext("2d");
|
|
99
|
+
|
|
100
|
+
// Get values from panel widgets (e.g. color value)
|
|
101
|
+
ctx.fillStyle = pocketDialog.panel.getValue('Background');
|
|
102
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
103
|
+
|
|
104
|
+
ctx.font = pocketDialog.panel.getValue('Font Size') + "px Monospace";
|
|
105
|
+
ctx.fillStyle = pocketDialog.panel.getValue('Font Color');
|
|
106
|
+
|
|
107
|
+
const text = pocketDialog.panel.getValue('Text');
|
|
108
|
+
const pos2D = pocketDialog.panel.getValue('2D Position');
|
|
109
|
+
ctx.fillText(text, pos2D[0], pos2D[1]);
|
|
111
110
|
|
|
112
111
|
requestAnimationFrame(loop);
|
|
113
|
-
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
requestAnimationFrame(loop);
|
|
115
|
+
</script>
|
|
116
|
+
|
|
114
117
|
</html>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
3
|
+
|
|
3
4
|
<head>
|
|
4
5
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
5
6
|
<title>LexGUI ImUI Demo</title>
|
|
@@ -14,64 +15,65 @@
|
|
|
14
15
|
}
|
|
15
16
|
</script>
|
|
16
17
|
</head>
|
|
18
|
+
|
|
17
19
|
<body></body>
|
|
18
|
-
|
|
20
|
+
<script type="module">
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
import { LX } from 'lexgui';
|
|
23
|
+
import 'lexgui/components/imui.js';
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
// init library and get main area
|
|
26
|
+
let area = LX.init();
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
// add canvas to area
|
|
29
|
+
var canvas = document.createElement('canvas');
|
|
30
|
+
canvas.id = "mycanvas";
|
|
31
|
+
canvas.width = area.root.clientWidth;
|
|
32
|
+
canvas.height = area.root.clientHeight;
|
|
33
|
+
canvas.style.width = "100%";
|
|
34
|
+
canvas.style.height = "100%";
|
|
35
|
+
area.attach(canvas);
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
// add on resize event to control canvas size
|
|
38
|
+
area.onresize = function (bounding) {
|
|
39
|
+
canvas.width = bounding.width;
|
|
40
|
+
canvas.height = bounding.height;
|
|
41
|
+
};
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
let im_ui = new LX.ImUI(canvas);
|
|
42
44
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var ctx = canvas.getContext("2d");
|
|
45
|
+
function loop(time) {
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
47
|
+
var ctx = canvas.getContext("2d");
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
ctx.fillStyle = "#b7a9b1";
|
|
50
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
ctx.font = "48px Monospace";
|
|
53
|
+
ctx.fillStyle = "#ff1999";
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
console.log("Button clicked!");
|
|
59
|
-
}
|
|
55
|
+
const text = "Lexgui.js @jxarco";
|
|
56
|
+
ctx.fillText(text, 300, 225);
|
|
60
57
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
if (im_ui.Button("First button", 50, 50)) {
|
|
59
|
+
console.log("Button clicked!");
|
|
60
|
+
}
|
|
64
61
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
im_ui.Slider("A very cool slider", 50, 100, false, (v) => {
|
|
63
|
+
console.log("Slider value: " + v);
|
|
64
|
+
});
|
|
68
65
|
|
|
69
|
-
|
|
66
|
+
im_ui.Checkbox("First checkbox", 50, 150, false, (v) => {
|
|
67
|
+
console.log("Checkbox value: " + v);
|
|
68
|
+
});
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
}
|
|
70
|
+
im_ui.endFrame();
|
|
73
71
|
|
|
74
72
|
requestAnimationFrame(loop);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
requestAnimationFrame(loop);
|
|
76
|
+
|
|
77
|
+
</script>
|
|
75
78
|
|
|
76
|
-
</script>
|
|
77
79
|
</html>
|
package/examples/index.html
CHANGED
|
@@ -2,15 +2,11 @@
|
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
5
|
-
<title>LexGUI
|
|
5
|
+
<title>Examples - LexGUI.js </title>
|
|
6
6
|
<link rel="stylesheet" href="../build/lexgui.css">
|
|
7
7
|
<link rel="icon" href="../images/icon.png">
|
|
8
8
|
<style>
|
|
9
9
|
iframe { border: none; }
|
|
10
|
-
.lexexamplespanel {
|
|
11
|
-
margin-left: 6px;
|
|
12
|
-
margin-top: 6px;
|
|
13
|
-
}
|
|
14
10
|
</style>
|
|
15
11
|
<script type="importmap">
|
|
16
12
|
{
|
|
@@ -41,6 +37,7 @@
|
|
|
41
37
|
});
|
|
42
38
|
|
|
43
39
|
const examples = [
|
|
40
|
+
'All Widgets',
|
|
44
41
|
'Area Tabs',
|
|
45
42
|
'Asset View',
|
|
46
43
|
'Code Editor',
|
|
@@ -51,7 +48,7 @@
|
|
|
51
48
|
"Timeline"
|
|
52
49
|
];
|
|
53
50
|
|
|
54
|
-
let panel = leftArea.addPanel(
|
|
51
|
+
let panel = leftArea.addPanel();
|
|
55
52
|
fillExamples( panel );
|
|
56
53
|
|
|
57
54
|
let iframe = document.createElement('iframe');
|
|
@@ -70,7 +67,7 @@
|
|
|
70
67
|
window.open("https://github.com/jxarco/lexgui.js/blob/master/examples/" + tokens[tokens.length - 1], '_blank')
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
|
-
], { float: "
|
|
70
|
+
], { float: "hbc" } );
|
|
74
71
|
|
|
75
72
|
// **** **** **** **** **** **** **** **** **** **** **** ****
|
|
76
73
|
|
package/examples/node_graph.html
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
3
|
+
|
|
3
4
|
<head>
|
|
4
5
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
5
6
|
<title>LexGUI Node Graph Demo</title>
|
|
@@ -14,56 +15,58 @@
|
|
|
14
15
|
}
|
|
15
16
|
</script>
|
|
16
17
|
</head>
|
|
18
|
+
|
|
17
19
|
<body></body>
|
|
18
|
-
|
|
20
|
+
<script type="module">
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
import { LX } from 'lexgui';
|
|
23
|
+
import 'lexgui/components/nodegraph.js';
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
// init library and get main area
|
|
26
|
+
let area = LX.init();
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
// split main area
|
|
29
|
+
var [topArea, bottomArea] = area.split({ type: 'vertical', sizes: ["25%", "75%"] });
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
// add canvas to topArea
|
|
32
|
+
var canvas = document.createElement('canvas');
|
|
33
|
+
canvas.id = "mycanvas";
|
|
34
|
+
canvas.width = topArea.root.clientWidth;
|
|
35
|
+
canvas.height = topArea.root.clientHeight;
|
|
36
|
+
canvas.style.width = "100%";
|
|
37
|
+
canvas.style.height = "100%";
|
|
38
|
+
topArea.attach(canvas);
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
// add on resize event to control canvas size
|
|
41
|
+
topArea.onresize = function (bounding) {
|
|
42
|
+
canvas.width = bounding.width;
|
|
43
|
+
canvas.height = bounding.height;
|
|
44
|
+
};
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} );
|
|
46
|
+
let graph_editor = new LX.GraphEditor(bottomArea, {
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
});
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var ctx = canvas.getContext("2d");
|
|
50
|
+
graph_editor.loadGraph("../data/graph_sample.json");
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
52
|
+
function loop(dt) {
|
|
56
53
|
|
|
57
|
-
|
|
58
|
-
ctx.fillStyle = "#ff1999";
|
|
54
|
+
var ctx = canvas.getContext("2d");
|
|
59
55
|
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
ctx.fillStyle = "#b7a9b1";
|
|
57
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
62
58
|
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
ctx.font = "48px Monospace";
|
|
60
|
+
ctx.fillStyle = "#ff1999";
|
|
61
|
+
|
|
62
|
+
const text = "Lexgui.js @jxarco";
|
|
63
|
+
ctx.fillText(text, 100, 125);
|
|
65
64
|
|
|
66
65
|
requestAnimationFrame(loop);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
requestAnimationFrame(loop);
|
|
69
|
+
|
|
70
|
+
</script>
|
|
67
71
|
|
|
68
|
-
</script>
|
|
69
72
|
</html>
|
|
Binary file
|