Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

feat(examples): the UI controls demo authors its widgets

esenginedc3332fbd684
diff --git a/CHANGELOG.md b/CHANGELOG.md
index eb11c8ba0..ad11a20fa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,15 @@ published separately; it ships inside the editor.
### Added
+- **The UI controls demo authors its widgets instead of building them.** Every
+ built-in widget shipped twice — a factory a game calls, and a prefab the
+ editor's *Create → UI* menu drops, generated from that factory — and only the
+ first was ever exercised: no scene in the corpus carried a `UIToggle`, a
+ `UISlider`, a `UIDropdown`, a `UIDialog`, a `UIScroll` or a `TextInput`, so
+ "place one and it works" was a claim nobody had made twice. The demo now
+ places all nine, exclusivity included (a `UIToggleGroup` on the toggles'
+ common ancestor), and its code answers what they do rather than building them.
+
- **A ScrollView scrolls where the editor drops it.** The widget builds its
parts and its behaviour together in code, so the prefab behind *Create → UI →
ScrollView* carried only the parts: a box that clipped its content and never
diff --git a/desktop b/desktop
index 8b0145cc3..a86874285 160000
--- a/desktop
+++ b/desktop
@@ -1 +1 @@
-Subproject commit 8b0145cc3a6ebb6c995dc02e64f2bc82e81d6d1f
+Subproject commit a86874285b492d918ccffd3bf20d390567a95723
diff --git a/examples/README.md b/examples/README.md
index 284cfce57..b9cd8d6e7 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -39,7 +39,7 @@ for your own game.
| **drawing-demo** | Rendering | The three drawing tiers — immediate `Draw` radar overlay, retained `Graphics` vector star, procedural `Mesh2D` ribbon. |
| **video-playback** | Rendering | Play a video on a Sprite with the declarative `Video` component — "a Sprite whose texture is alive". |
| **tilemap-demo** | Tilemap | Two scenes: a Tiled `.tmj` import and an engine-native `.estileset` — multi-tileset, parallax, animated water, per-tile collision. |
-| **ui-controls** | UI | Buttons, sliders, toggles and progress bars. |
+| **ui-controls** | UI | Every built-in widget, authored in the scene: button, toggle, toggle group, slider, progress, dropdown, text input, a modal and a scroll view. |
| **ui-interaction** | UI | Dragging, focus and pointer interaction. |
| **ui-layout** | UI | Flexbox-style responsive UI layout. |
| **ui-list** | UI | A virtualized list and grid — `createListView`, live data, `scrollToIndex`. |
diff --git a/examples/ui-controls/assets/scenes/main.esscene b/examples/ui-controls/assets/scenes/main.esscene
index 129fa6612..3c1675d56 100644
--- a/examples/ui-controls/assets/scenes/main.esscene
+++ b/examples/ui-controls/assets/scenes/main.esscene
@@ -35,7 +35,8 @@
"name": "Canvas",
"parent": null,
"children": [
- 2
+ 2,
+ 44
],
"components": [
{
@@ -67,10 +68,12 @@
3,
4,
6,
+ 20,
8,
10,
12,
- 14
+ 14,
+ 41
],
"components": [
{
@@ -81,12 +84,30 @@
"type": "UINode",
"data": {
"position": 1,
- "width": { "value": 460, "unit": 0 },
- "height": { "value": 414, "unit": 0 },
- "insetLeft": { "value": 50, "unit": 1 },
- "insetTop": { "value": 50, "unit": 1 },
- "marginLeft": { "value": -230, "unit": 0 },
- "marginTop": { "value": -207, "unit": 0 }
+ "width": {
+ "value": 460,
+ "unit": 0
+ },
+ "height": {
+ "value": 526,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 50,
+ "unit": 1
+ },
+ "insetTop": {
+ "value": 50,
+ "unit": 1
+ },
+ "marginLeft": {
+ "value": -230,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": -263,
+ "unit": 0
+ }
}
},
{
@@ -95,15 +116,28 @@
"direction": 1,
"justifyContent": 0,
"alignItems": 3,
- "gap": { "x": 0, "y": 16 },
- "padding": { "left": 24, "top": 24, "right": 24, "bottom": 24 }
+ "gap": {
+ "x": 0,
+ "y": 16
+ },
+ "padding": {
+ "left": 24,
+ "top": 24,
+ "right": 24,
+ "bottom": 24
+ }
}
},
{
"type": "UIVisual",
"data": {
"visualType": 1,
- "color": { "r": 0.16, "g": 0.16, "b": 0.18, "a": 1 },
+ "color": {
+ "r": 0.16,
+ "g": 0.16,
+ "b": 0.18,
+ "a": 1
+ },
"enabled": true
}
}
@@ -116,10 +150,18 @@
"parent": 2,
"children": [],
"components": [
- { "type": "Transform", "data": {} },
+ {
+ "type": "Transform",
+ "data": {}
+ },
{
"type": "UINode",
- "data": { "height": { "value": 30, "unit": 0 } }
+ "data": {
+ "height": {
+ "value": 30,
+ "unit": 0
+ }
+ }
},
{
"type": "Text",
@@ -128,7 +170,12 @@
"i18nKey": "ui.title",
"fontSize": 20,
"bold": true,
- "color": { "r": 1, "g": 1, "b": 1, "a": 1 },
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
"align": 0,
"verticalAlign": 1
}
@@ -141,17 +188,30 @@
"name": "ClicksRow",
"parent": 2,
"children": [
- 5
+ 5,
+ 16
],
"components": [
- { "type": "Transform", "data": {} },
+ {
+ "type": "Transform",
+ "data": {}
+ },
{
"type": "UINode",
- "data": { "height": { "value": 40, "unit": 0 } }
+ "data": {
+ "height": {
+ "value": 40,
+ "unit": 0
+ }
+ }
},
{
"type": "FlexContainer",
- "data": { "direction": 0, "justifyContent": 3, "alignItems": 1 }
+ "data": {
+ "direction": 0,
+ "justifyContent": 3,
+ "alignItems": 1
+ }
}
],
"visible": true
@@ -162,17 +222,28 @@
"parent": 4,
"children": [],
"components": [
- { "type": "Transform", "data": {} },
+ {
+ "type": "Transform",
+ "data": {}
+ },
{
"type": "UINode",
- "data": { "flexGrow": 1, "alignSelf": 4 }
+ "data": {
+ "flexGrow": 1,
+ "alignSelf": 4
+ }
},
{
"type": "Text",
"data": {
"content": "Clicks: 0",
"fontSize": 14,
- "color": { "r": 1, "g": 1, "b": 1, "a": 1 },
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
"align": 0,
"verticalAlign": 1
}
@@ -185,17 +256,30 @@
"name": "AnimateRow",
"parent": 2,
"children": [
- 7
+ 7,
+ 18
],
"components": [
- { "type": "Transform", "data": {} },
+ {
+ "type": "Transform",
+ "data": {}
+ },
{
"type": "UINode",
- "data": { "height": { "value": 40, "unit": 0 } }
+ "data": {
+ "height": {
+ "value": 40,
+ "unit": 0
+ }
+ }
},
{
"type": "FlexContainer",
- "data": { "direction": 0, "justifyContent": 3, "alignItems": 1 }
+ "data": {
+ "direction": 0,
+ "justifyContent": 3,
+ "alignItems": 1
+ }
}
],
"visible": true
@@ -206,10 +290,16 @@
"parent": 6,
"children": [],
"components": [
- { "type": "Transform", "data": {} },
+ {
+ "type": "Transform",
+ "data": {}
+ },
{
"type": "UINode",
- "data": { "flexGrow": 1, "alignSelf": 4 }
+ "data": {
+ "flexGrow": 1,
+ "alignSelf": 4
+ }
},
{
"type": "Text",
@@ -217,7 +307,12 @@
"content": "Animate",
"i18nKey": "ui.animate",
"fontSize": 14,
- "color": { "r": 1, "g": 1, "b": 1, "a": 1 },
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
"align": 0,
"verticalAlign": 1
}
@@ -230,17 +325,30 @@
"name": "VolumeRow",
"parent": 2,
"children": [
- 9
+ 9,
+ 32
],
"components": [
- { "type": "Transform", "data": {} },
+ {
+ "type": "Transform",
+ "data": {}
+ },
{
"type": "UINode",
- "data": { "height": { "value": 40, "unit": 0 } }
+ "data": {
+ "height": {
+ "value": 40,
+ "unit": 0
+ }
+ }
},
{
"type": "FlexContainer",
- "data": { "direction": 0, "justifyContent": 3, "alignItems": 1 }
+ "data": {
+ "direction": 0,
+ "justifyContent": 3,
+ "alignItems": 1
+ }
}
],
"visible": true
@@ -251,17 +359,28 @@
"parent": 8,
"children": [],
"components": [
- { "type": "Transform", "data": {} },
+ {
+ "type": "Transform",
+ "data": {}
+ },
{
"type": "UINode",
- "data": { "flexGrow": 1, "alignSelf": 4 }
+ "data": {
+ "flexGrow": 1,
+ "alignSelf": 4
+ }
},
{
"type": "Text",
"data": {
"content": "Volume 60%",
"fontSize": 14,
- "color": { "r": 1, "g": 1, "b": 1, "a": 1 },
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
"align": 0,
"verticalAlign": 1
}
@@ -274,17 +393,30 @@
"name": "LoadingRow",
"parent": 2,
"children": [
- 11
+ 11,
+ 35
],
"components": [
- { "type": "Transform", "data": {} },
+ {
+ "type": "Transform",
+ "data": {}
+ },
{
"type": "UINode",
- "data": { "height": { "value": 40, "unit": 0 } }
+ "data": {
+ "height": {
+ "value": 40,
+ "unit": 0
+ }
+ }
},
{
"type": "FlexContainer",
- "data": { "direction": 0, "justifyContent": 3, "alignItems": 1 }
+ "data": {
+ "direction": 0,
+ "justifyContent": 3,
+ "alignItems": 1
+ }
}
],
"visible": true
@@ -295,10 +427,16 @@
"parent": 10,
"children": [],
"components": [
- { "type": "Transform", "data": {} },
+ {
+ "type": "Transform",
+ "data": {}
+ },
{
"type": "UINode",
- "data": { "flexGrow": 1, "alignSelf": 4 }
+ "data": {
+ "flexGrow": 1,
+ "alignSelf": 4
+ }
},
{
"type": "Text",
@@ -306,7 +444,12 @@
"content": "Loading",
"i18nKey": "ui.loading",
"fontSize": 14,
- "color": { "r": 1, "g": 1, "b": 1, "a": 1 },
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
"align": 0,
"verticalAlign": 1
}
@@ -319,17 +462,30 @@
"name": "ModalRow",
"parent": 2,
"children": [
- 13
+ 13,
+ 37
],
"components": [
- { "type": "Transform", "data": {} },
+ {
+ "type": "Transform",
+ "data": {}
+ },
{
"type": "UINode",
- "data": { "height": { "value": 40, "unit": 0 } }
+ "data": {
+ "height": {
+ "value": 40,
+ "unit": 0
+ }
+ }
},
{
"type": "FlexContainer",
- "data": { "direction": 0, "justifyContent": 3, "alignItems": 1 }
+ "data": {
+ "direction": 0,
+ "justifyContent": 3,
+ "alignItems": 1
+ }
}
],
"visible": true
@@ -340,10 +496,16 @@
"parent": 12,
"children": [],
"components": [
- { "type": "Transform", "data": {} },
+ {
+ "type": "Transform",
+ "data": {}
+ },
{
"type": "UINode",
- "data": { "flexGrow": 1, "alignSelf": 4 }
+ "data": {
+ "flexGrow": 1,
+ "alignSelf": 4
+ }
},
{
"type": "Text",
@@ -351,7 +513,12 @@
"content": "Modal",
"i18nKey": "ui.modal",
"fontSize": 14,
- "color": { "r": 1, "g": 1, "b": 1, "a": 1 },
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
"align": 0,
"verticalAlign": 1
}
@@ -364,17 +531,30 @@
"name": "AccentRow",
"parent": 2,
"children": [
- 15
+ 15,
+ 39
],
"components": [
- { "type": "Transform", "data": {} },
+ {
+ "type": "Transform",
+ "data": {}
+ },
{
"type": "UINode",
- "data": { "height": { "value": 40, "unit": 0 } }
+ "data": {
+ "height": {
+ "value": 40,
+ "unit": 0
+ }
+ }
},
{
"type": "FlexContainer",
- "data": { "direction": 0, "justifyContent": 3, "alignItems": 1 }
+ "data": {
+ "direction": 0,
+ "justifyContent": 3,
+ "alignItems": 1
+ }
}
],
"visible": true
@@ -385,10 +565,16 @@
"parent": 14,
"children": [],
"components": [
- { "type": "Transform", "data": {} },
+ {
+ "type": "Transform",
+ "data": {}
+ },
{
"type": "UINode",
- "data": { "flexGrow": 1, "alignSelf": 4 }
+ "data": {
+ "flexGrow": 1,
+ "alignSelf": 4
+ }
},
{
"type": "Text",
@@ -396,13 +582,4987 @@
"content": "Accent",
"i18nKey": "ui.accent",
"fontSize": 14,
- "color": { "r": 1, "g": 1, "b": 1, "a": 1 },
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
"align": 0,
"verticalAlign": 1
}
}
],
"visible": true
+ },
+ {
+ "id": 16,
+ "name": "ClickButton",
+ "parent": 4,
+ "children": [
+ 17
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 0,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 140,
+ "unit": 0
+ },
+ "height": {
+ "value": 34,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 2
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "Interactable",
+ "data": {
+ "enabled": true,
+ "blockRaycast": true,
+ "raycastTarget": true
+ }
+ },
+ {
+ "type": "Focusable",
+ "data": {
+ "tabIndex": 0,
+ "isFocused": false
+ }
+ },
+ {
+ "type": "UIController",
+ "data": {
+ "controllers": [
+ {
+ "name": "$interaction",
+ "pages": [
+ "normal",
+ "hover",
+ "pressed",
+ "disabled",
+ "focused"
+ ],
+ "current": "normal"
+ }
+ ]
+ }
+ },
+ {
+ "type": "UIGear",
+ "data": {
+ "bindings": [
+ {
+ "controller": "$interaction",
+ "component": "UIVisual",
+ "property": "color",
+ "pages": {
+ "normal": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 1
+ },
+ "hover": {
+ "r": 0.28,
+ "g": 0.28,
+ "b": 0.32,
+ "a": 1
+ },
+ "pressed": {
+ "r": 0.18,
+ "g": 0.18,
+ "b": 0.22,
+ "a": 1
+ },
+ "disabled": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 0.5
+ },
+ "focused": {
+ "r": 0.3,
+ "g": 0.34,
+ "b": 0.44,
+ "a": 1
+ }
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "states": {
+ "normal": "control",
+ "hover": "controlHover",
+ "pressed": "controlActive",
+ "disabled": "control",
+ "focused": "controlFocus"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "id": 17,
+ "name": "ClickButtonLabel",
+ "parent": 16,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 0,
+ "unit": 2
+ },
+ "height": {
+ "value": 0,
+ "unit": 2
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "Text",
+ "data": {
+ "content": "Click me",
+ "i18nKey": "",
+ "font": 0,
+ "fontFamily": "",
+ "fontSize": 14,
+ "color": {
+ "r": 0.92,
+ "g": 0.92,
+ "b": 0.94,
+ "a": 1
+ },
+ "align": 1,
+ "verticalAlign": 1,
+ "wordWrap": false,
+ "overflow": 0,
+ "lineHeight": 1.2,
+ "bold": false,
+ "italic": false,
+ "strokeColor": {
+ "r": 0,
+ "g": 0,
+ "b": 0,
+ "a": 1
+ },
+ "strokeWidth": 0,
+ "shadowColor": {
+ "r": 0,
+ "g": 0,
+ "b": 0,
+ "a": 1
+ },
+ "shadowBlur": 0,
+ "shadowOffsetX": 0,
+ "shadowOffsetY": 0,
+ "richText": false,
+ "renderMode": 0,
+ "layer": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "text": "text"
+ }
+ }
+ ]
+ },
+ {
+ "id": 18,
+ "name": "AnimateToggle",
+ "parent": 6,
+ "children": [
+ 19
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 0,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 28,
+ "unit": 0
+ },
+ "height": {
+ "value": 28,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 2
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "Interactable",
+ "data": {
+ "enabled": true,
+ "blockRaycast": true,
+ "raycastTarget": true
+ }
+ },
+ {
+ "type": "Focusable",
+ "data": {
+ "tabIndex": 0,
+ "isFocused": false
+ }
+ },
+ {
+ "type": "UIController",
+ "data": {
+ "controllers": [
+ {
+ "name": "$interaction",
+ "pages": [
+ "normal",
+ "hover",
+ "pressed",
+ "disabled",
+ "focused"
+ ],
+ "current": "normal"
+ }
+ ]
+ }
+ },
+ {
+ "type": "UIGear",
+ "data": {
+ "bindings": [
+ {
+ "controller": "$interaction",
+ "component": "UIVisual",
+ "property": "color",
+ "pages": {
+ "normal": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 1
+ },
+ "hover": {
+ "r": 0.28,
+ "g": 0.28,
+ "b": 0.32,
+ "a": 1
+ },
+ "pressed": {
+ "r": 0.18,
+ "g": 0.18,
+ "b": 0.22,
+ "a": 1
+ },
+ "disabled": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 0.5
+ },
+ "focused": {
+ "r": 0.3,
+ "g": 0.34,
+ "b": 0.44,
+ "a": 1
+ }
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "states": {
+ "normal": "control",
+ "hover": "controlHover",
+ "pressed": "controlActive",
+ "disabled": "control",
+ "focused": "controlFocus"
+ }
+ }
+ },
+ {
+ "type": "UIToggle",
+ "data": {
+ "isOn": true,
+ "check": 19
+ }
+ }
+ ]
+ },
+ {
+ "id": 19,
+ "name": "AnimateToggleNode",
+ "parent": 18,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 0,
+ "unit": 2
+ },
+ "height": {
+ "value": 0,
+ "unit": 2
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 0.25,
+ "g": 0.56,
+ "b": 0.96,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "visual": "primary"
+ }
+ }
+ ]
+ },
+ {
+ "id": 20,
+ "name": "DifficultyRow",
+ "parent": 2,
+ "children": [
+ 21,
+ 22
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {}
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "height": {
+ "value": 40,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "FlexContainer",
+ "data": {
+ "direction": 0,
+ "justifyContent": 3,
+ "alignItems": 1
+ }
+ }
+ ]
+ },
+ {
+ "id": 21,
+ "name": "DifficultyLabel",
+ "parent": 20,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {}
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "flexGrow": 1,
+ "alignSelf": 4
+ }
+ },
+ {
+ "type": "Text",
+ "data": {
+ "content": "Difficulty: Normal",
+ "fontSize": 14,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "align": 0,
+ "verticalAlign": 1
+ }
+ }
+ ]
+ },
+ {
+ "id": 22,
+ "name": "DifficultyGroup",
+ "parent": 20,
+ "children": [
+ 23,
+ 25,
+ 26,
+ 28,
+ 29,
+ 31
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {}
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "width": {
+ "value": 250,
+ "unit": 0
+ },
+ "height": {
+ "value": 28,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "FlexContainer",
+ "data": {
+ "direction": 0,
+ "justifyContent": 2,
+ "alignItems": 1,
+ "gap": {
+ "x": 6,
+ "y": 0
+ }
+ }
+ },
+ {
+ "type": "UIToggleGroup",
+ "data": {
+ "allowSwitchOff": false
+ }
+ }
+ ]
+ },
+ {
+ "id": 23,
+ "name": "EasyToggle",
+ "parent": 22,
+ "children": [
+ 24
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 0,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 28,
+ "unit": 0
+ },
+ "height": {
+ "value": 28,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 2
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "Interactable",
+ "data": {
+ "enabled": true,
+ "blockRaycast": true,
+ "raycastTarget": true
+ }
+ },
+ {
+ "type": "Focusable",
+ "data": {
+ "tabIndex": 0,
+ "isFocused": false
+ }
+ },
+ {
+ "type": "UIController",
+ "data": {
+ "controllers": [
+ {
+ "name": "$interaction",
+ "pages": [
+ "normal",
+ "hover",
+ "pressed",
+ "disabled",
+ "focused"
+ ],
+ "current": "normal"
+ }
+ ]
+ }
+ },
+ {
+ "type": "UIGear",
+ "data": {
+ "bindings": [
+ {
+ "controller": "$interaction",
+ "component": "UIVisual",
+ "property": "color",
+ "pages": {
+ "normal": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 1
+ },
+ "hover": {
+ "r": 0.28,
+ "g": 0.28,
+ "b": 0.32,
+ "a": 1
+ },
+ "pressed": {
+ "r": 0.18,
+ "g": 0.18,
+ "b": 0.22,
+ "a": 1
+ },
+ "disabled": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 0.5
+ },
+ "focused": {
+ "r": 0.3,
+ "g": 0.34,
+ "b": 0.44,
+ "a": 1
+ }
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "states": {
+ "normal": "control",
+ "hover": "controlHover",
+ "pressed": "controlActive",
+ "disabled": "control",
+ "focused": "controlFocus"
+ }
+ }
+ },
+ {
+ "type": "UIToggle",
+ "data": {
+ "isOn": false,
+ "check": 24
+ }
+ }
+ ]
+ },
+ {
+ "id": 24,
+ "name": "EasyToggleNode",
+ "parent": 23,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 0,
+ "unit": 2
+ },
+ "height": {
+ "value": 0,
+ "unit": 2
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 0.25,
+ "g": 0.56,
+ "b": 0.96,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "visual": "primary"
+ }
+ }
+ ]
+ },
+ {
+ "id": 25,
+ "name": "EasyText",
+ "parent": 22,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {}
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "width": {
+ "value": 52,
+ "unit": 0
+ },
+ "alignSelf": 4
+ }
+ },
+ {
+ "type": "Text",
+ "data": {
+ "content": "Easy",
+ "fontSize": 12,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "align": 0,
+ "verticalAlign": 1
+ }
+ }
+ ]
+ },
+ {
+ "id": 26,
+ "name": "NormalToggle",
+ "parent": 22,
+ "children": [
+ 27
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 0,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 28,
+ "unit": 0
+ },
+ "height": {
+ "value": 28,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 2
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "Interactable",
+ "data": {
+ "enabled": true,
+ "blockRaycast": true,
+ "raycastTarget": true
+ }
+ },
+ {
+ "type": "Focusable",
+ "data": {
+ "tabIndex": 0,
+ "isFocused": false
+ }
+ },
+ {
+ "type": "UIController",
+ "data": {
+ "controllers": [
+ {
+ "name": "$interaction",
+ "pages": [
+ "normal",
+ "hover",
+ "pressed",
+ "disabled",
+ "focused"
+ ],
+ "current": "normal"
+ }
+ ]
+ }
+ },
+ {
+ "type": "UIGear",
+ "data": {
+ "bindings": [
+ {
+ "controller": "$interaction",
+ "component": "UIVisual",
+ "property": "color",
+ "pages": {
+ "normal": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 1
+ },
+ "hover": {
+ "r": 0.28,
+ "g": 0.28,
+ "b": 0.32,
+ "a": 1
+ },
+ "pressed": {
+ "r": 0.18,
+ "g": 0.18,
+ "b": 0.22,
+ "a": 1
+ },
+ "disabled": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 0.5
+ },
+ "focused": {
+ "r": 0.3,
+ "g": 0.34,
+ "b": 0.44,
+ "a": 1
+ }
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "states": {
+ "normal": "control",
+ "hover": "controlHover",
+ "pressed": "controlActive",
+ "disabled": "control",
+ "focused": "controlFocus"
+ }
+ }
+ },
+ {
+ "type": "UIToggle",
+ "data": {
+ "isOn": true,
+ "check": 27
+ }
+ }
+ ]
+ },
+ {
+ "id": 27,
+ "name": "NormalToggleNode",
+ "parent": 26,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 0,
+ "unit": 2
+ },
+ "height": {
+ "value": 0,
+ "unit": 2
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 0.25,
+ "g": 0.56,
+ "b": 0.96,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "visual": "primary"
+ }
+ }
+ ]
+ },
+ {
+ "id": 28,
+ "name": "NormalText",
+ "parent": 22,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {}
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "width": {
+ "value": 52,
+ "unit": 0
+ },
+ "alignSelf": 4
+ }
+ },
+ {
+ "type": "Text",
+ "data": {
+ "content": "Normal",
+ "fontSize": 12,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "align": 0,
+ "verticalAlign": 1
+ }
+ }
+ ]
+ },
+ {
+ "id": 29,
+ "name": "HardToggle",
+ "parent": 22,
+ "children": [
+ 30
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 0,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 28,
+ "unit": 0
+ },
+ "height": {
+ "value": 28,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 2
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "Interactable",
+ "data": {
+ "enabled": true,
+ "blockRaycast": true,
+ "raycastTarget": true
+ }
+ },
+ {
+ "type": "Focusable",
+ "data": {
+ "tabIndex": 0,
+ "isFocused": false
+ }
+ },
+ {
+ "type": "UIController",
+ "data": {
+ "controllers": [
+ {
+ "name": "$interaction",
+ "pages": [
+ "normal",
+ "hover",
+ "pressed",
+ "disabled",
+ "focused"
+ ],
+ "current": "normal"
+ }
+ ]
+ }
+ },
+ {
+ "type": "UIGear",
+ "data": {
+ "bindings": [
+ {
+ "controller": "$interaction",
+ "component": "UIVisual",
+ "property": "color",
+ "pages": {
+ "normal": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 1
+ },
+ "hover": {
+ "r": 0.28,
+ "g": 0.28,
+ "b": 0.32,
+ "a": 1
+ },
+ "pressed": {
+ "r": 0.18,
+ "g": 0.18,
+ "b": 0.22,
+ "a": 1
+ },
+ "disabled": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 0.5
+ },
+ "focused": {
+ "r": 0.3,
+ "g": 0.34,
+ "b": 0.44,
+ "a": 1
+ }
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "states": {
+ "normal": "control",
+ "hover": "controlHover",
+ "pressed": "controlActive",
+ "disabled": "control",
+ "focused": "controlFocus"
+ }
+ }
+ },
+ {
+ "type": "UIToggle",
+ "data": {
+ "isOn": false,
+ "check": 30
+ }
+ }
+ ]
+ },
+ {
+ "id": 30,
+ "name": "HardToggleNode",
+ "parent": 29,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 0,
+ "unit": 2
+ },
+ "height": {
+ "value": 0,
+ "unit": 2
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 0.25,
+ "g": 0.56,
+ "b": 0.96,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "visual": "primary"
+ }
+ }
+ ]
+ },
+ {
+ "id": 31,
+ "name": "HardText",
+ "parent": 22,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {}
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "width": {
+ "value": 52,
+ "unit": 0
+ },
+ "alignSelf": 4
+ }
+ },
+ {
+ "type": "Text",
+ "data": {
+ "content": "Hard",
+ "fontSize": 12,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "align": 0,
+ "verticalAlign": 1
+ }
+ }
+ ]
+ },
+ {
+ "id": 32,
+ "name": "VolumeSlider",
+ "parent": 8,
+ "children": [
+ 34,
+ 33
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 0,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 244,
+ "unit": 0
+ },
+ "height": {
+ "value": 18,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 2
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 0.15,
+ "g": 0.15,
+ "b": 0.15,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "visual": "track"
+ }
+ },
+ {
+ "type": "Interactable",
+ "data": {
+ "enabled": true,
+ "blockRaycast": true,
+ "raycastTarget": true
+ }
+ },
+ {
+ "type": "Focusable",
+ "data": {
+ "tabIndex": 0,
+ "isFocused": false
+ }
+ },
+ {
+ "type": "UISlider",
+ "data": {
+ "min": 0,
+ "max": 100,
+ "step": 1,
+ "value": 60,
+ "fill": 34,
+ "handle": 33
+ }
+ }
+ ]
+ },
+ {
+ "id": 33,
+ "name": "VolumeSliderHandle",
+ "parent": 32,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 14,
+ "unit": 0
+ },
+ "height": {
+ "value": 0,
+ "unit": 2
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": -7,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 50,
+ "unit": 1
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "visual": "onPrimary"
+ }
+ }
+ ]
+ },
+ {
+ "id": 34,
+ "name": "VolumeSliderFill",
+ "parent": 32,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 0,
+ "unit": 2
+ },
+ "height": {
+ "value": 0,
+ "unit": 2
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 5,
+ "texture": 0,
+ "color": {
+ "r": 0.25,
+ "g": 0.56,
+ "b": 0.96,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 0.5,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "visual": "primary"
+ }
+ }
+ ]
+ },
+ {
+ "id": 35,
+ "name": "LoadingBar",
+ "parent": 10,
+ "children": [
+ 36
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 0,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 244,
+ "unit": 0
+ },
+ "height": {
+ "value": 14,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 2
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 0.15,
+ "g": 0.15,
+ "b": 0.15,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "visual": "track"
+ }
+ }
+ ]
+ },
+ {
+ "id": 36,
+ "name": "LoadingBarFill",
+ "parent": 35,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 0,
+ "unit": 2
+ },
+ "height": {
+ "value": 0,
+ "unit": 2
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 5,
+ "texture": 0,
+ "color": {
+ "r": 0.25,
+ "g": 0.56,
+ "b": 0.96,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 0.4,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "visual": "primary"
+ }
+ }
+ ]
+ },
+ {
+ "id": 37,
+ "name": "ModalButton",
+ "parent": 12,
+ "children": [
+ 38
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 0,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 140,
+ "unit": 0
+ },
+ "height": {
+ "value": 34,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 2
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "Interactable",
+ "data": {
+ "enabled": true,
+ "blockRaycast": true,
+ "raycastTarget": true
+ }
+ },
+ {
+ "type": "Focusable",
+ "data": {
+ "tabIndex": 0,
+ "isFocused": false
+ }
+ },
+ {
+ "type": "UIController",
+ "data": {
+ "controllers": [
+ {
+ "name": "$interaction",
+ "pages": [
+ "normal",
+ "hover",
+ "pressed",
+ "disabled",
+ "focused"
+ ],
+ "current": "normal"
+ }
+ ]
+ }
+ },
+ {
+ "type": "UIGear",
+ "data": {
+ "bindings": [
+ {
+ "controller": "$interaction",
+ "component": "UIVisual",
+ "property": "color",
+ "pages": {
+ "normal": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 1
+ },
+ "hover": {
+ "r": 0.28,
+ "g": 0.28,
+ "b": 0.32,
+ "a": 1
+ },
+ "pressed": {
+ "r": 0.18,
+ "g": 0.18,
+ "b": 0.22,
+ "a": 1
+ },
+ "disabled": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 0.5
+ },
+ "focused": {
+ "r": 0.3,
+ "g": 0.34,
+ "b": 0.44,
+ "a": 1
+ }
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "states": {
+ "normal": "control",
+ "hover": "controlHover",
+ "pressed": "controlActive",
+ "disabled": "control",
+ "focused": "controlFocus"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "id": 38,
+ "name": "ModalButtonLabel",
+ "parent": 37,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 0,
+ "unit": 2
+ },
+ "height": {
+ "value": 0,
+ "unit": 2
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "Text",
+ "data": {
+ "content": "Open…",
+ "i18nKey": "",
+ "font": 0,
+ "fontFamily": "",
+ "fontSize": 14,
+ "color": {
+ "r": 0.92,
+ "g": 0.92,
+ "b": 0.94,
+ "a": 1
+ },
+ "align": 1,
+ "verticalAlign": 1,
+ "wordWrap": false,
+ "overflow": 0,
+ "lineHeight": 1.2,
+ "bold": false,
+ "italic": false,
+ "strokeColor": {
+ "r": 0,
+ "g": 0,
+ "b": 0,
+ "a": 1
+ },
+ "strokeWidth": 0,
+ "shadowColor": {
+ "r": 0,
+ "g": 0,
+ "b": 0,
+ "a": 1
+ },
+ "shadowBlur": 0,
+ "shadowOffsetX": 0,
+ "shadowOffsetY": 0,
+ "richText": false,
+ "renderMode": 0,
+ "layer": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "text": "text"
+ }
+ }
+ ]
+ },
+ {
+ "id": 39,
+ "name": "AccentDropdown",
+ "parent": 14,
+ "children": [
+ 40
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 0,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 150,
+ "unit": 0
+ },
+ "height": {
+ "value": 34,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 2
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "Interactable",
+ "data": {
+ "enabled": true,
+ "blockRaycast": true,
+ "raycastTarget": true
+ }
+ },
+ {
+ "type": "Focusable",
+ "data": {
+ "tabIndex": 0,
+ "isFocused": false
+ }
+ },
+ {
+ "type": "UIController",
+ "data": {
+ "controllers": [
+ {
+ "name": "$interaction",
+ "pages": [
+ "normal",
+ "hover",
+ "pressed"
+ ],
+ "current": "normal"
+ }
+ ]
+ }
+ },
+ {
+ "type": "UIGear",
+ "data": {
+ "bindings": [
+ {
+ "controller": "$interaction",
+ "component": "UIVisual",
+ "property": "color",
+ "pages": {
+ "normal": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 1
+ },
+ "hover": {
+ "r": 0.28,
+ "g": 0.28,
+ "b": 0.32,
+ "a": 1
+ },
+ "pressed": {
+ "r": 0.18,
+ "g": 0.18,
+ "b": 0.22,
+ "a": 1
+ }
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "states": {
+ "normal": "control",
+ "hover": "controlHover",
+ "pressed": "controlActive"
+ }
+ }
+ },
+ {
+ "type": "UIDropdown",
+ "data": {
+ "options": [
+ "Azure",
+ "Emerald",
+ "Amber",
+ "Rose"
+ ],
+ "selectedIndex": 0,
+ "optionHeight": 30,
+ "label": 40
+ }
+ }
+ ]
+ },
+ {
+ "id": 40,
+ "name": "AccentDropdownLabel",
+ "parent": 39,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 0,
+ "unit": 2
+ },
+ "height": {
+ "value": 0,
+ "unit": 2
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "Text",
+ "data": {
+ "content": "Azure",
+ "i18nKey": "",
+ "font": 0,
+ "fontFamily": "",
+ "fontSize": 14,
+ "color": {
+ "r": 0.92,
+ "g": 0.92,
+ "b": 0.94,
+ "a": 1
+ },
+ "align": 1,
+ "verticalAlign": 1,
+ "wordWrap": false,
+ "overflow": 0,
+ "lineHeight": 1.2,
+ "bold": false,
+ "italic": false,
+ "strokeColor": {
+ "r": 0,
+ "g": 0,
+ "b": 0,
+ "a": 1
+ },
+ "strokeWidth": 0,
+ "shadowColor": {
+ "r": 0,
+ "g": 0,
+ "b": 0,
+ "a": 1
+ },
+ "shadowBlur": 0,
+ "shadowOffsetX": 0,
+ "shadowOffsetY": 0,
+ "richText": false,
+ "renderMode": 0,
+ "layer": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "text": "text"
+ }
+ }
+ ]
+ },
+ {
+ "id": 41,
+ "name": "NameRow",
+ "parent": 2,
+ "children": [
+ 42,
+ 43
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {}
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "height": {
+ "value": 40,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "FlexContainer",
+ "data": {
+ "direction": 0,
+ "justifyContent": 3,
+ "alignItems": 1
+ }
+ }
+ ]
+ },
+ {
+ "id": 42,
+ "name": "NameLabel",
+ "parent": 41,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {}
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "flexGrow": 1,
+ "alignSelf": 4
+ }
+ },
+ {
+ "type": "Text",
+ "data": {
+ "content": "Name",
+ "fontSize": 14,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "align": 0,
+ "verticalAlign": 1
+ }
+ }
+ ]
+ },
+ {
+ "id": 43,
+ "name": "NameField",
+ "parent": 41,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 0,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 244,
+ "unit": 0
+ },
+ "height": {
+ "value": 32,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 2
+ }
+ }
+ },
+ {
+ "type": "Interactable",
+ "data": {
+ "enabled": true,
+ "blockRaycast": true,
+ "raycastTarget": true
+ }
+ },
+ {
+ "type": "Focusable",
+ "data": {
+ "tabIndex": 0,
+ "isFocused": false
+ }
+ },
+ {
+ "type": "TextInput",
+ "data": {
+ "value": "",
+ "placeholder": "Your name",
+ "placeholderColor": {
+ "r": 0.92,
+ "g": 0.92,
+ "b": 0.94,
+ "a": 0.5
+ },
+ "fontFamily": "",
+ "fontSize": 14,
+ "color": {
+ "r": 0.92,
+ "g": 0.92,
+ "b": 0.94,
+ "a": 1
+ },
+ "backgroundColor": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 1
+ },
+ "padding": 6,
+ "maxLength": 0,
+ "multiline": false,
+ "password": false,
+ "readOnly": false,
+ "focused": false,
+ "cursorPos": 0,
+ "renderMode": 0
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "input": {
+ "background": "control",
+ "text": "text",
+ "placeholder": "text"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "id": 44,
+ "name": "Modal",
+ "parent": 1,
+ "children": [
+ 45
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 1,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 0,
+ "unit": 2
+ },
+ "height": {
+ "value": 0,
+ "unit": 2
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 0,
+ "g": 0,
+ "b": 0,
+ "a": 0.5
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "visual": "backdrop"
+ }
+ },
+ {
+ "type": "Interactable",
+ "data": {
+ "enabled": true,
+ "blockRaycast": true,
+ "raycastTarget": true
+ }
+ },
+ {
+ "type": "UIDialog",
+ "data": {
+ "closeOnEscape": true,
+ "closeOnBackdrop": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 45,
+ "name": "ModalPanel",
+ "parent": 44,
+ "children": [
+ 46,
+ 47,
+ 50
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 400,
+ "unit": 0
+ },
+ "height": {
+ "value": 260,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": -200,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": -150,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 50,
+ "unit": 1
+ },
+ "insetTop": {
+ "value": 50,
+ "unit": 1
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 2
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 0.16,
+ "g": 0.16,
+ "b": 0.18,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "visual": "surface"
+ }
+ },
+ {
+ "type": "Interactable",
+ "data": {
+ "enabled": true,
+ "blockRaycast": true,
+ "raycastTarget": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 46,
+ "name": "ModalTitle",
+ "parent": 45,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {}
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "insetLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 22,
+ "unit": 0
+ },
+ "height": {
+ "value": 26,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "Text",
+ "data": {
+ "content": "Hello from a modal",
+ "fontSize": 18,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "align": 1,
+ "verticalAlign": 1,
+ "bold": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 47,
+ "name": "ModalScroll",
+ "parent": 45,
+ "children": [
+ 48
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 344,
+ "unit": 0
+ },
+ "height": {
+ "value": 120,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 28,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 62,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 2
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "visual": "control"
+ }
+ },
+ {
+ "type": "UIMask",
+ "data": {
+ "enabled": true,
+ "mode": 0
+ }
+ },
+ {
+ "type": "Interactable",
+ "data": {
+ "enabled": true,
+ "blockRaycast": true,
+ "raycastTarget": true
+ }
+ },
+ {
+ "type": "UIScroll",
+ "data": {
+ "enabled": true,
+ "content": 48,
+ "horizontal": false,
+ "vertical": true,
+ "movement": 0,
+ "wheelSpeed": 1,
+ "dragScroll": true,
+ "decelerationRate": 0.135
+ }
+ }
+ ]
+ },
+ {
+ "id": 48,
+ "name": "ModalScrollContent",
+ "parent": 47,
+ "children": [
+ 49
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 344,
+ "unit": 0
+ },
+ "height": {
+ "value": 260,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 2
+ }
+ }
+ }
+ ]
+ },
+ {
+ "id": 49,
+ "name": "ModalBody",
+ "parent": 48,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {}
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "insetLeft": {
+ "value": 12,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 12,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 10,
+ "unit": 0
+ },
+ "height": {
+ "value": 240,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "Text",
+ "data": {
+ "content": "A dialog is a backdrop plus a panel you fill with children — Escape and a click on the scrim both close it, with no code to hook up.\n\nThis panel is a ScrollView: drag it, or roll the wheel over it. The viewport clips with a UIMask and the frame behind it moves, which is what the UIScroll component on the viewport asks for.\n\nEvery control on the panel behind this one is authored the same way — dropped into the scene, wired by name.",
+ "fontSize": 13,
+ "color": {
+ "r": 0.85,
+ "g": 0.87,
+ "b": 0.92,
+ "a": 1
+ },
+ "align": 0,
+ "verticalAlign": 0,
+ "wordWrap": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 50,
+ "name": "ModalClose",
+ "parent": 45,
+ "children": [
+ 51
+ ],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 120,
+ "unit": 0
+ },
+ "height": {
+ "value": 34,
+ "unit": 0
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": -60,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 50,
+ "unit": 1
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 2
+ },
+ "insetBottom": {
+ "value": 22,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "UIVisual",
+ "data": {
+ "visualType": 1,
+ "texture": 0,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "fit": 0,
+ "uvOffset": {
+ "x": 0,
+ "y": 0
+ },
+ "uvScale": {
+ "x": 1,
+ "y": 1
+ },
+ "sliceBorder": {
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "w": 0
+ },
+ "tileSize": {
+ "x": 32,
+ "y": 32
+ },
+ "fillMethod": 0,
+ "fillOrigin": 0,
+ "fillAmount": 1,
+ "material": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "Interactable",
+ "data": {
+ "enabled": true,
+ "blockRaycast": true,
+ "raycastTarget": true
+ }
+ },
+ {
+ "type": "Focusable",
+ "data": {
+ "tabIndex": 0,
+ "isFocused": false
+ }
+ },
+ {
+ "type": "UIController",
+ "data": {
+ "controllers": [
+ {
+ "name": "$interaction",
+ "pages": [
+ "normal",
+ "hover",
+ "pressed",
+ "disabled",
+ "focused"
+ ],
+ "current": "normal"
+ }
+ ]
+ }
+ },
+ {
+ "type": "UIGear",
+ "data": {
+ "bindings": [
+ {
+ "controller": "$interaction",
+ "component": "UIVisual",
+ "property": "color",
+ "pages": {
+ "normal": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 1
+ },
+ "hover": {
+ "r": 0.28,
+ "g": 0.28,
+ "b": 0.32,
+ "a": 1
+ },
+ "pressed": {
+ "r": 0.18,
+ "g": 0.18,
+ "b": 0.22,
+ "a": 1
+ },
+ "disabled": {
+ "r": 0.22,
+ "g": 0.22,
+ "b": 0.26,
+ "a": 0.5
+ },
+ "focused": {
+ "r": 0.3,
+ "g": 0.34,
+ "b": 0.44,
+ "a": 1
+ }
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "states": {
+ "normal": "control",
+ "hover": "controlHover",
+ "pressed": "controlActive",
+ "disabled": "control",
+ "focused": "controlFocus"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "id": 51,
+ "name": "ModalCloseLabel",
+ "parent": 50,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "w": 1,
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 1,
+ "y": 1,
+ "z": 1
+ }
+ }
+ },
+ {
+ "type": "UINode",
+ "data": {
+ "position": 1,
+ "display": 0,
+ "opacity": 1,
+ "pointerEvents": 0,
+ "width": {
+ "value": 0,
+ "unit": 2
+ },
+ "height": {
+ "value": 0,
+ "unit": 2
+ },
+ "minWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "minHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxWidth": {
+ "value": 0,
+ "unit": 2
+ },
+ "maxHeight": {
+ "value": 0,
+ "unit": 2
+ },
+ "flexGrow": 0,
+ "flexShrink": 1,
+ "flexBasis": {
+ "value": 0,
+ "unit": 2
+ },
+ "alignSelf": 0,
+ "marginLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "marginBottom": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetLeft": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetTop": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetRight": {
+ "value": 0,
+ "unit": 0
+ },
+ "insetBottom": {
+ "value": 0,
+ "unit": 0
+ }
+ }
+ },
+ {
+ "type": "Text",
+ "data": {
+ "content": "Close",
+ "i18nKey": "",
+ "font": 0,
+ "fontFamily": "",
+ "fontSize": 14,
+ "color": {
+ "r": 0.92,
+ "g": 0.92,
+ "b": 0.94,
+ "a": 1
+ },
+ "align": 1,
+ "verticalAlign": 1,
+ "wordWrap": false,
+ "overflow": 0,
+ "lineHeight": 1.2,
+ "bold": false,
+ "italic": false,
+ "strokeColor": {
+ "r": 0,
+ "g": 0,
+ "b": 0,
+ "a": 1
+ },
+ "strokeWidth": 0,
+ "shadowColor": {
+ "r": 0,
+ "g": 0,
+ "b": 0,
+ "a": 1
+ },
+ "shadowBlur": 0,
+ "shadowOffsetX": 0,
+ "shadowOffsetY": 0,
+ "richText": false,
+ "renderMode": 0,
+ "layer": 0,
+ "enabled": true
+ }
+ },
+ {
+ "type": "ThemeStyle",
+ "data": {
+ "text": "text"
+ }
+ }
+ ]
}
]
}
diff --git a/examples/ui-controls/src/config.ts b/examples/ui-controls/src/config.ts
index e20b42cfe..eff43e61f 100644
--- a/examples/ui-controls/src/config.ts
+++ b/examples/ui-controls/src/config.ts
@@ -1,16 +1,14 @@
import type { Color } from 'esengine';
-// Widget sizes for the code-instantiated factories (px == world units at canvas
-// scale 1); the panel + row geometry lives in the scene.
-export const SLIDER_W = 244;
-export const SLIDER_H = 18;
-export const PROGRESS_H = 14;
-export const CONTROL_H = 34;
-
// Progress bar auto-animation speed, in progress-fraction per second.
export const PROGRESS_SPEED = 0.5;
+// The difficulty toggles, in the order the group lists them. A UIToggleGroup on
+// their common ancestor is what makes them exclusive — no code decides that.
+export const DIFFICULTIES = ['Easy', 'Normal', 'Hard'] as const;
+
// Dropdown accent choices — selecting one re-tints the slider + progress fill.
+// The names are authored on the UIDropdown; these are the colours they mean.
export interface Accent {
name: string;
color: Color;
@@ -22,3 +20,15 @@ export const ACCENTS: Accent[] = [
{ name: 'Amber', color: { r: 0.98, g: 0.72, b: 0.22, a: 1 } },
{ name: 'Rose', color: { r: 0.96, g: 0.36, b: 0.52, a: 1 } },
];
+
+// Every scene entity the systems address, by the name it carries there.
+export const NAMED = [
+ 'ClickButton', 'ClicksLabel',
+ 'AnimateToggle',
+ 'EasyToggle', 'NormalToggle', 'HardToggle', 'DifficultyLabel',
+ 'VolumeSlider', 'VolumeSliderFill', 'VolumeLabel',
+ 'LoadingBarFill',
+ 'ModalButton', 'ModalClose', 'Modal',
+ 'AccentDropdown',
+ 'NameField', 'NameLabel',
+] as const;
diff --git a/examples/ui-controls/src/main.ts b/examples/ui-controls/src/main.ts
index e117cef41..5ba15ccea 100644
--- a/examples/ui-controls/src/main.ts
+++ b/examples/ui-controls/src/main.ts
@@ -1,9 +1,10 @@
-// UI Controls — widget factories (button/slider/toggle/progress/dropdown/dialog)
-// slotted into a scene-authored FlexContainer panel.
+// UI Controls — button, toggle, toggle group, slider, progress, dropdown, text
+// input, a modal and a scroll view, every one of them authored in the scene the
+// way the editor's Create → UI menu drops it. The code only answers what they do.
import { addStartupSystem, addSystemToSchedule, Schedule } from 'esengine';
-import { buildSystem } from './systems/build';
+import { wireSystem } from './systems/wire';
import { controlsSystem } from './systems/controls';
-addStartupSystem(buildSystem);
+addSystemToSchedule(Schedule.Update, wireSystem);
addSystemToSchedule(Schedule.Update, controlsSystem);
diff --git a/examples/ui-controls/src/state.ts b/examples/ui-controls/src/state.ts
index c95f43f23..1c2ff159d 100644
--- a/examples/ui-controls/src/state.ts
+++ b/examples/ui-controls/src/state.ts
@@ -1,9 +1,14 @@
-import type { SliderHandle, ProgressHandle } from 'esengine';
+import type { Entity } from 'esengine';
+
+// Every control the systems talk to, looked up once by the name it carries in
+// the scene. A null here means the scene stopped carrying that entity, which is
+// the only way this demo can break.
+export const ids: Record<string, Entity | null> = {};
export const state = {
- slider: null as SliderHandle | null,
- progress: null as ProgressHandle | null,
+ wired: false,
+ clicks: 0,
+ paused: false,
progressT: 0,
progressDir: 1,
- paused: false,
};
diff --git a/examples/ui-controls/src/systems/build.ts b/examples/ui-controls/src/systems/build.ts
deleted file mode 100644
index 08d3d2ce3..000000000
--- a/examples/ui-controls/src/systems/build.ts
+++ /dev/null
@@ -1,165 +0,0 @@
-import {
- defineSystem, Res, GetWorld,
- UIEvents,
- Text, UIVisual,
- spawnUIEntity,
- createButton, createToggle, createSlider, createProgress, createDropdown, createDialog,
- themeColors, px, percent,
- UIPositionType, TextVerticalAlign,
-} from 'esengine';
-import type {
- Entity, World, Color, ThemeColors, UIEventQueue, TextData, UIVisualData,
-} from 'esengine';
-
-import { SLIDER_W, SLIDER_H, PROGRESS_H, CONTROL_H, ACCENTS, type Accent } from '../config';
-import { state } from '../state';
-
-export const buildSystem = defineSystem(
- [Res(UIEvents), GetWorld()],
- (events: UIEventQueue, world: World) => {
- if (state.slider) return;
-
- const canvas = world.findEntityByName('Canvas');
- if (canvas === null) return;
-
- const c = themeColors();
-
- // Dialog content is built ONCE: closing sets display:none on the
- // backdrop root, which hides the whole subtree (text included) and
- // removes it from input. Escape / a scrim click also close it.
- const dialog = createDialog({
- world, events, parent: canvas, startHidden: true,
- panelNode: {
- position: UIPositionType.Absolute,
- width: px(360), height: px(190),
- insetLeft: percent(50), insetTop: percent(50),
- marginLeft: px(-180), marginTop: px(-95),
- },
- panelVisual: { color: c.surfaceElevated },
- });
- spawnUIEntity({
- world, parent: dialog.panelEntity,
- node: { position: UIPositionType.Absolute, insetLeft: px(0), insetRight: px(0),
- insetTop: px(26), height: px(26) },
- text: { content: 'Hello from a modal', fontSize: 18, bold: true, color: c.onPrimary },
- });
- spawnUIEntity({
- world, parent: dialog.panelEntity,
- node: { position: UIPositionType.Absolute, insetLeft: px(28), insetRight: px(28),
- insetTop: px(66), height: px(48) },
- text: { content: 'A dialog is just a backdrop plus a panel you fill with children.',
- fontSize: 13, color: c.onPrimary, wordWrap: true,
- verticalAlign: TextVerticalAlign.Top },
- });
- createButton({
- world, events, parent: dialog.panelEntity,
- node: { position: UIPositionType.Absolute, width: px(120), height: px(CONTROL_H),
- insetLeft: percent(50), marginLeft: px(-60), insetBottom: px(22) },
- states: controlStates(c),
- text: { content: 'Close', color: c.onPrimary, fontSize: 14 },
- onClick: () => dialog.close(),
- });
-
- withRow(world, 'ClicksRow', (row) => {
- const label = world.findEntityByName('ClicksLabel');
- let clicks = 0;
- createButton({
- world, events, parent: row,
- node: slot(140, CONTROL_H),
- states: primaryStates(c),
- text: { content: 'Click me', color: c.onPrimary, fontSize: 14 },
- onClick: () => { clicks += 1; if (label !== null) setText(world, label, `Clicks: ${clicks}`); },
- });
- });
-
- withRow(world, 'AnimateRow', (row) => {
- createToggle({
- world, events, parent: row,
- node: slot(28, 28),
- background: { color: c.control },
- interactionStates: controlStates(c),
- check: { node: { fill: true, marginLeft: px(6), marginTop: px(6),
- marginRight: px(6), marginBottom: px(6) }, color: c.primary },
- isOn: true,
- onChange: (isOn) => { state.paused = !isOn; },
- });
- });
-
- withRow(world, 'VolumeRow', (row) => {
- const label = world.findEntityByName('VolumeLabel');
- // Input is built in: drag the track, or Tab to it and use the
- // arrow keys.
- state.slider = createSlider({
- world, events, parent: row,
- node: slot(SLIDER_W, SLIDER_H),
- min: 0, max: 100, step: 1, value: 60, handleWidth: 14,
- onChange: (v) => { if (label !== null) setText(world, label, `Volume ${Math.round(v)}%`); },
- });
- });
-
- withRow(world, 'LoadingRow', (row) => {
- state.progress = createProgress({
- world, parent: row,
- node: slot(SLIDER_W, PROGRESS_H),
- fill: { color: ACCENTS[0]!.color },
- value: 0,
- });
- });
-
- withRow(world, 'ModalRow', (row) => {
- createButton({
- world, events, parent: row,
- node: slot(140, CONTROL_H),
- states: controlStates(c),
- text: { content: 'Open…', color: c.onPrimary, fontSize: 14 },
- onClick: () => dialog.open(),
- });
- });
-
- withRow(world, 'AccentRow', (row) => {
- createDropdown<Accent>({
- world, events, parent: row,
- node: slot(150, CONTROL_H),
- options: ACCENTS,
- optionToLabel: (a) => a.name,
- optionHeight: 30,
- onSelect: (_i, accent) => {
- if (state.slider) setColor(world, state.slider.fillEntity, accent.color);
- if (state.progress) setColor(world, state.progress.fillEntity, accent.color);
- },
- });
- });
- },
- { name: 'BuildSystem' },
-);
-
-function withRow(world: World, name: string, fill: (row: Entity) => void): void {
- const row = world.findEntityByName(name);
- if (row !== null) fill(row);
-}
-
-function slot(w: number, h: number) {
- return { width: px(w), height: px(h) };
-}
-
-function controlStates(c: ThemeColors): Record<string, { color: Color }> {
- return { normal: { color: c.control }, hover: { color: c.controlHover }, pressed: { color: c.controlActive } };
-}
-
-function primaryStates(c: ThemeColors): Record<string, { color: Color }> {
- return { normal: { color: c.primary }, hover: { color: c.primaryHover }, pressed: { color: c.primaryActive } };
-}
-
-function setText(world: World, entity: Entity, content: string): void {
- if (!world.valid(entity) || !world.has(entity, Text)) return;
- const t = world.get(entity, Text) as TextData;
- t.content = content;
- world.insert(entity, Text, t);
-}
-
-function setColor(world: World, entity: Entity, color: Color): void {
- if (!world.valid(entity) || !world.has(entity, UIVisual)) return;
- const v = world.get(entity, UIVisual) as UIVisualData;
- v.color = { ...color };
- world.insert(entity, UIVisual, v);
-}
diff --git a/examples/ui-controls/src/systems/controls.ts b/examples/ui-controls/src/systems/controls.ts
index e4e00724b..a73bf46e5 100644
--- a/examples/ui-controls/src/systems/controls.ts
+++ b/examples/ui-controls/src/systems/controls.ts
@@ -1,19 +1,57 @@
-import { defineSystem, Res, Time } from 'esengine';
+import {
+ defineSystem, Res, GetWorld, Time, UIEvents, UIEventType,
+ TextInput, openDialog, closeDialog,
+} from 'esengine';
+import type { World, UIEventQueue, TimeData, TextInputData } from 'esengine';
-import { PROGRESS_SPEED } from '../config';
-import { state } from '../state';
+import { ACCENTS, DIFFICULTIES, PROGRESS_SPEED } from '../config';
+import { ids, state } from '../state';
+import { setColor, setFill, setText, dropdownIndex, sliderValue, toggleOn } from '../ui';
export const controlsSystem = defineSystem(
- [Res(Time)],
- (time) => {
- // Slider input (drag + arrow keys) is built into the UISlider system.
- const progress = state.progress;
- if (progress && !state.paused) {
- state.progressT += time.delta * PROGRESS_SPEED * state.progressDir;
- if (state.progressT >= 1) { state.progressT = 1; state.progressDir = -1; }
- else if (state.progressT <= 0) { state.progressT = 0; state.progressDir = 1; }
- progress.setValue(state.progressT);
+ [Res(UIEvents), Res(Time), GetWorld()],
+ (events: UIEventQueue, time: TimeData, world: World) => {
+ if (!state.wired) return;
+ const hit = (list: readonly { target: number }[], entity: number | null) =>
+ entity !== null && list.some((e) => e.target === entity);
+
+ const clicks = events.query(UIEventType.Click);
+ if (hit(clicks, ids.ClickButton ?? null)) {
+ state.clicks += 1;
+ setText(world, ids.ClicksLabel, `Clicks: ${state.clicks}`);
+ }
+ // A dialog dismisses itself on Escape and on a scrim click — the UIDialog
+ // component carries both — so only OPENING needs saying.
+ if (hit(clicks, ids.ModalButton ?? null)) openDialog(world, events, ids.Modal!);
+ if (hit(clicks, ids.ModalClose ?? null)) closeDialog(world, events, ids.Modal!);
+
+ for (const ev of events.query(UIEventType.Change)) {
+ if (ev.target === ids.AnimateToggle) {
+ state.paused = !toggleOn(world, ids.AnimateToggle ?? null);
+ } else if (ev.target === ids.VolumeSlider) {
+ setText(world, ids.VolumeLabel, `Volume ${Math.round(sliderValue(world, ids.VolumeSlider))}%`);
+ } else if (ev.target === ids.AccentDropdown) {
+ const accent = ACCENTS[dropdownIndex(world, ids.AccentDropdown ?? null)];
+ if (accent) {
+ setColor(world, ids.VolumeSliderFill, accent.color);
+ setColor(world, ids.LoadingBarFill, accent.color);
+ }
+ } else if (ev.target === ids.NameField) {
+ const value = (world.get(ids.NameField!, TextInput) as TextInputData).value;
+ setText(world, ids.NameLabel, value ? `Name — ${value}` : 'Name');
+ } else {
+ // The group keeps exactly one of the three on; the label just
+ // reports which, so any of their changes is the same question.
+ const picked = DIFFICULTIES.find((d) => toggleOn(world, ids[`${d}Toggle`] ?? null));
+ if (picked) setText(world, ids.DifficultyLabel, `Difficulty: ${picked}`);
+ }
}
+
+ if (state.paused) return;
+ state.progressT += time.delta * PROGRESS_SPEED * state.progressDir;
+ if (state.progressT >= 1) { state.progressT = 1; state.progressDir = -1; }
+ else if (state.progressT <= 0) { state.progressT = 0; state.progressDir = 1; }
+ setFill(world, ids.LoadingBarFill, state.progressT);
},
{ name: 'ControlsSystem' },
);
diff --git a/examples/ui-controls/src/systems/wire.ts b/examples/ui-controls/src/systems/wire.ts
new file mode 100644
index 000000000..d56f798c5
--- /dev/null
+++ b/examples/ui-controls/src/systems/wire.ts
@@ -0,0 +1,26 @@
+import { defineSystem, GetWorld } from 'esengine';
+import type { World } from 'esengine';
+
+import { NAMED, DIFFICULTIES } from '../config';
+import { ids, state } from '../state';
+import { setText, sliderValue, toggleOn } from '../ui';
+
+// Resolve every control by the name it carries in the scene, once. Nothing here
+// builds UI: the panel, the modal and all nine controls are authored, dropped
+// from the editor's Create → UI menu, and a system's whole job is what they DO.
+export const wireSystem = defineSystem(
+ [GetWorld()],
+ (world: World) => {
+ if (state.wired) return;
+ for (const name of NAMED) ids[name] = world.findEntityByName(name);
+ // The scene loads asynchronously; without its entities there is nothing
+ // to wire and the next frame tries again.
+ if (ids.ClickButton == null) return;
+ state.wired = true;
+
+ const picked = DIFFICULTIES.find((d) => toggleOn(world, ids[`${d}Toggle`] ?? null));
+ setText(world, ids.DifficultyLabel, `Difficulty: ${picked ?? 'none'}`);
+ setText(world, ids.VolumeLabel, `Volume ${Math.round(sliderValue(world, ids.VolumeSlider))}%`);
+ },
+ { name: 'WireSystem' },
+);
diff --git a/examples/ui-controls/src/ui.ts b/examples/ui-controls/src/ui.ts
new file mode 100644
index 000000000..c64665a4f
--- /dev/null
+++ b/examples/ui-controls/src/ui.ts
@@ -0,0 +1,43 @@
+import { Text, UIVisual, UIToggle, UISlider, UIDropdown } from 'esengine';
+import type { Color, Entity, TextData, UIVisualData, World } from 'esengine';
+
+// Reading and writing an authored control is reading and writing its component.
+// A widget built in code hands back a handle; one dropped in the scene is found
+// by name, and its state lives where the scene put it.
+
+export function setText(world: World, entity: Entity | null, content: string): void {
+ if (entity === null || !world.valid(entity) || !world.has(entity, Text)) return;
+ const t = world.get(entity, Text) as TextData;
+ t.content = content;
+ world.insert(entity, Text, t);
+}
+
+export function setColor(world: World, entity: Entity | null, color: Color): void {
+ if (entity === null || !world.valid(entity) || !world.has(entity, UIVisual)) return;
+ const v = world.get(entity, UIVisual) as UIVisualData;
+ v.color = { ...color };
+ world.insert(entity, UIVisual, v);
+}
+
+/** How much of a Filled visual is painted — what a progress bar's value IS. */
+export function setFill(world: World, entity: Entity | null, amount: number): void {
+ if (entity === null || !world.valid(entity) || !world.has(entity, UIVisual)) return;
+ const v = world.get(entity, UIVisual) as UIVisualData;
+ v.fillAmount = amount;
+ world.insert(entity, UIVisual, v);
+}
+
+export function toggleOn(world: World, entity: Entity | null): boolean {
+ if (entity === null || !world.valid(entity) || !world.has(entity, UIToggle)) return false;
+ return (world.get(entity, UIToggle) as { isOn: boolean }).isOn;
+}
+
+export function sliderValue(world: World, entity: Entity | null): number {
+ if (entity === null || !world.valid(entity) || !world.has(entity, UISlider)) return 0;
+ return (world.get(entity, UISlider) as { value: number }).value;
+}
+
+export function dropdownIndex(world: World, entity: Entity | null): number {
+ if (entity === null || !world.valid(entity) || !world.has(entity, UIDropdown)) return 0;
+ return (world.get(entity, UIDropdown) as { selectedIndex: number }).selectedIndex;
+}
diff --git a/tools/check-corpus-authoring.mjs b/tools/check-corpus-authoring.mjs
index 2462a1dde..d80d56dbd 100644
--- a/tools/check-corpus-authoring.mjs
+++ b/tools/check-corpus-authoring.mjs
@@ -117,15 +117,6 @@ const DISPOSITION = {
// — owed: a creator-facing component nothing in the shipped corpus authors.
// Each reason names where the coverage belongs. —
- UIDialog: ['owed', 'the Create picker builds a Dialog in one click and its own header promises a prefab dialog works "without any code hookup" — ui-controls calls createDialog() from code instead, so the promise has no witness'],
- UIToggle: ['owed', 'Create > UI > Toggle exists; ui-controls builds toggles with createToggle() and no scene carries one'],
- UIToggleGroup: ['owed', 'exclusive toggles (tab bar, difficulty picker) sit on the common ancestor — a relationship only an authored hierarchy demonstrates'],
- UISlider: ['owed', 'ui-controls drives sliders from code; the widget prefab the editor drops has never been in a shipped scene'],
- UIDropdown: ['owed', 'same picker, same silence — and a dropdown is the widget whose authored structure (list, item template) is hardest to get right from a screenshot'],
- UIScroll: ['owed', 'no corpus scene scrolls anything; ui-list virtualizes from code'],
- UIMask: ['owed', 'clipping a subtree is authored geometry, and nothing in the corpus clips one'],
- TextInput: ['owed', 'chat and rich-text create inputs in code; the editor offers TextInput as a one-click widget that no scene has ever held'],
- ThemeStyle: ['owed', 'the widget factories mark entities with theme roles so re-theming reaches them; a hand-authored UI gets none of that, and no corpus scene shows how to tag one'],
CapsuleCollider2D: ['owed', 'physics-playground and physics-spinner build capsules in code; the Inspector shape and its gizmo have no authored instance'],
ChainCollider2D: ['owed', 'physics-spinner builds its chain in code — the one 2D shape whose authored form (a point list) the editor actually has an editing mode for'],