diff --git a/druid/editor_scripts/widget.lua_template b/druid/editor_scripts/widget.lua_template
index 9d0f2c6..dfbc7ed 100644
--- a/druid/editor_scripts/widget.lua_template
+++ b/druid/editor_scripts/widget.lua_template
@@ -7,6 +7,12 @@ local M = {}
function M:init()
+ -- Now we have next functions to use here:
+ -- self:get_node([node_id]) -- Get node inside widget by id
+ -- self.druid to access Druid Instance API, like:
+ -- self.druid:new_button([node_id], [callback])
+ -- self.druid:new_text([node_id], [text])
+ -- And all functions from component.lua file
self.root = self:get_node("root")
self.button = self.druid:new_button("button", self.on_button, self)
end
diff --git a/example/druid.gui b/example/druid.gui
index 3f325af..5c805e3 100644
--- a/example/druid.gui
+++ b/example/druid.gui
@@ -367,189 +367,189 @@ nodes {
y: -175.0
}
type: TYPE_TEMPLATE
- id: "properties_panel"
+ id: "example_properties_panel"
parent: "container_settings"
inherit_alpha: true
template: "/example/components/properties_panel/properties_panel.gui"
}
nodes {
type: TYPE_BOX
- id: "properties_panel/root"
- parent: "properties_panel"
+ id: "example_properties_panel/root"
+ parent: "example_properties_panel"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "properties_panel/text_header"
- parent: "properties_panel/root"
+ id: "example_properties_panel/text_header"
+ parent: "example_properties_panel/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/scroll_view"
- parent: "properties_panel/root"
+ id: "example_properties_panel/scroll_view"
+ parent: "example_properties_panel/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/scroll_content"
- parent: "properties_panel/scroll_view"
+ id: "example_properties_panel/scroll_content"
+ parent: "example_properties_panel/scroll_view"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/item_size"
- parent: "properties_panel/scroll_content"
+ id: "example_properties_panel/item_size"
+ parent: "example_properties_panel/scroll_content"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/separator"
- parent: "properties_panel/root"
+ id: "example_properties_panel/separator"
+ parent: "example_properties_panel/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/propeties"
- parent: "properties_panel/root"
+ id: "example_properties_panel/propeties"
+ parent: "example_properties_panel/root"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
- id: "properties_panel/property_slider"
- parent: "properties_panel/propeties"
+ id: "example_properties_panel/property_slider"
+ parent: "example_properties_panel/propeties"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_slider/root"
- parent: "properties_panel/property_slider"
+ id: "example_properties_panel/property_slider/root"
+ parent: "example_properties_panel/property_slider"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "properties_panel/property_slider/text_name"
- parent: "properties_panel/property_slider/root"
+ id: "example_properties_panel/property_slider/text_name"
+ parent: "example_properties_panel/property_slider/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_slider/E_Anchor"
- parent: "properties_panel/property_slider/root"
+ id: "example_properties_panel/property_slider/E_Anchor"
+ parent: "example_properties_panel/property_slider/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_slider/button"
- parent: "properties_panel/property_slider/E_Anchor"
+ id: "example_properties_panel/property_slider/button"
+ parent: "example_properties_panel/property_slider/E_Anchor"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_slider/selected"
- parent: "properties_panel/property_slider/button"
+ id: "example_properties_panel/property_slider/selected"
+ parent: "example_properties_panel/property_slider/button"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "properties_panel/property_slider/text_value"
- parent: "properties_panel/property_slider/button"
+ id: "example_properties_panel/property_slider/text_value"
+ parent: "example_properties_panel/property_slider/button"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_slider/slider"
- parent: "properties_panel/property_slider/root"
+ id: "example_properties_panel/property_slider/slider"
+ parent: "example_properties_panel/property_slider/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_slider/slider_back"
- parent: "properties_panel/property_slider/slider"
+ id: "example_properties_panel/property_slider/slider_back"
+ parent: "example_properties_panel/property_slider/slider"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_slider/slider_pin"
- parent: "properties_panel/property_slider/slider"
+ id: "example_properties_panel/property_slider/slider_pin"
+ parent: "example_properties_panel/property_slider/slider"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
- id: "properties_panel/property_checkbox"
- parent: "properties_panel/propeties"
+ id: "example_properties_panel/property_checkbox"
+ parent: "example_properties_panel/propeties"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_checkbox/root"
- parent: "properties_panel/property_checkbox"
+ id: "example_properties_panel/property_checkbox/root"
+ parent: "example_properties_panel/property_checkbox"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "properties_panel/property_checkbox/text_name"
- parent: "properties_panel/property_checkbox/root"
+ id: "example_properties_panel/property_checkbox/text_name"
+ parent: "example_properties_panel/property_checkbox/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_checkbox/button"
- parent: "properties_panel/property_checkbox/root"
+ id: "example_properties_panel/property_checkbox/button"
+ parent: "example_properties_panel/property_checkbox/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_checkbox/icon"
- parent: "properties_panel/property_checkbox/button"
+ id: "example_properties_panel/property_checkbox/icon"
+ parent: "example_properties_panel/property_checkbox/button"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_checkbox/selected"
- parent: "properties_panel/property_checkbox/button"
+ id: "example_properties_panel/property_checkbox/selected"
+ parent: "example_properties_panel/property_checkbox/button"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
- id: "properties_panel/property_button"
- parent: "properties_panel/propeties"
+ id: "example_properties_panel/property_button"
+ parent: "example_properties_panel/propeties"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_button/root"
- parent: "properties_panel/property_button"
+ id: "example_properties_panel/property_button/root"
+ parent: "example_properties_panel/property_button"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "properties_panel/property_button/text_name"
- parent: "properties_panel/property_button/root"
+ id: "example_properties_panel/property_button/text_name"
+ parent: "example_properties_panel/property_button/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_button/button"
- parent: "properties_panel/property_button/root"
+ id: "example_properties_panel/property_button/button"
+ parent: "example_properties_panel/property_button/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "properties_panel/property_button/selected"
- parent: "properties_panel/property_button/button"
+ id: "example_properties_panel/property_button/selected"
+ parent: "example_properties_panel/property_button/button"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "properties_panel/property_button/text_button"
- parent: "properties_panel/property_button/button"
+ id: "example_properties_panel/property_button/text_button"
+ parent: "example_properties_panel/property_button/button"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "properties_panel/text_no_properties"
- parent: "properties_panel/root"
+ id: "example_properties_panel/text_no_properties"
+ parent: "example_properties_panel/root"
template_node_child: true
}
nodes {
@@ -3918,785 +3918,874 @@ nodes {
}
nodes {
type: TYPE_TEMPLATE
- id: "example_memory_panel"
+ id: "fps_panel"
parent: "widgets"
inherit_alpha: true
- template: "/example/examples/widgets/memory_panel/example_memory_panel.gui"
+ template: "/druid/widget/fps_panel/fps_panel.gui"
}
nodes {
type: TYPE_BOX
- id: "example_memory_panel/root"
- parent: "example_memory_panel"
+ id: "fps_panel/root"
+ parent: "fps_panel"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
- id: "example_memory_panel/memory_panel"
- parent: "example_memory_panel/root"
+ id: "fps_panel/mini_graph"
+ parent: "fps_panel/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_memory_panel/memory_panel/root"
- parent: "example_memory_panel/memory_panel"
+ id: "fps_panel/mini_graph/root"
+ parent: "fps_panel/mini_graph"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "fps_panel/mini_graph/header"
+ parent: "fps_panel/mini_graph/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "fps_panel/mini_graph/text_header"
+ parent: "fps_panel/mini_graph/header"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "fps_panel/mini_graph/icon_drag"
+ parent: "fps_panel/mini_graph/header"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "fps_panel/mini_graph/content"
+ parent: "fps_panel/mini_graph/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "fps_panel/mini_graph/prefab_line"
+ parent: "fps_panel/mini_graph/content"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "fps_panel/mini_graph/color_low"
+ parent: "fps_panel/mini_graph/content"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "fps_panel/content"
+ parent: "fps_panel/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "fps_panel/text_min_fps"
+ parent: "fps_panel/content"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "fps_panel/text_fps"
+ parent: "fps_panel/content"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "fps_panel/line_second_1"
+ parent: "fps_panel/content"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "fps_panel/line_second_2"
+ parent: "fps_panel/content"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
- id: "example_memory_panel/memory_panel/mini_graph"
- parent: "example_memory_panel/memory_panel/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_memory_panel/memory_panel/mini_graph/root"
- parent: "example_memory_panel/memory_panel/mini_graph"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_memory_panel/memory_panel/mini_graph/header"
- parent: "example_memory_panel/memory_panel/mini_graph/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_memory_panel/memory_panel/mini_graph/text_header"
- parent: "example_memory_panel/memory_panel/mini_graph/header"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_memory_panel/memory_panel/mini_graph/icon_drag"
- parent: "example_memory_panel/memory_panel/mini_graph/header"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_memory_panel/memory_panel/mini_graph/content"
- parent: "example_memory_panel/memory_panel/mini_graph/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_memory_panel/memory_panel/mini_graph/prefab_line"
- parent: "example_memory_panel/memory_panel/mini_graph/content"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_memory_panel/memory_panel/mini_graph/color_low"
- parent: "example_memory_panel/memory_panel/mini_graph/content"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_memory_panel/memory_panel/content"
- parent: "example_memory_panel/memory_panel/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_memory_panel/memory_panel/text_max_value"
- parent: "example_memory_panel/memory_panel/content"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_memory_panel/memory_panel/text_per_second"
- parent: "example_memory_panel/memory_panel/content"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_memory_panel/memory_panel/line_second_1"
- parent: "example_memory_panel/memory_panel/content"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_memory_panel/memory_panel/line_second_2"
- parent: "example_memory_panel/memory_panel/content"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_memory_panel/memory_panel/text_memory"
- parent: "example_memory_panel/memory_panel/content"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEMPLATE
- id: "example_fps_panel"
+ id: "properties_panel"
parent: "widgets"
inherit_alpha: true
- template: "/example/examples/widgets/fps_panel/example_fps_panel.gui"
+ template: "/druid/widget/properties_panel/properties_panel.gui"
}
nodes {
type: TYPE_BOX
- id: "example_fps_panel/root"
- parent: "example_fps_panel"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEMPLATE
- id: "example_fps_panel/fps_panel"
- parent: "example_fps_panel/root"
+ id: "properties_panel/root"
+ parent: "properties_panel"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_fps_panel/fps_panel/root"
- parent: "example_fps_panel/fps_panel"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEMPLATE
- id: "example_fps_panel/fps_panel/mini_graph"
- parent: "example_fps_panel/fps_panel/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_fps_panel/fps_panel/mini_graph/root"
- parent: "example_fps_panel/fps_panel/mini_graph"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_fps_panel/fps_panel/mini_graph/header"
- parent: "example_fps_panel/fps_panel/mini_graph/root"
+ id: "properties_panel/header"
+ parent: "properties_panel/root"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "example_fps_panel/fps_panel/mini_graph/text_header"
- parent: "example_fps_panel/fps_panel/mini_graph/header"
+ id: "properties_panel/text_header"
+ parent: "properties_panel/header"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_fps_panel/fps_panel/mini_graph/icon_drag"
- parent: "example_fps_panel/fps_panel/mini_graph/header"
+ id: "properties_panel/icon_drag"
+ parent: "properties_panel/header"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_fps_panel/fps_panel/mini_graph/content"
- parent: "example_fps_panel/fps_panel/mini_graph/root"
+ id: "properties_panel/content"
+ parent: "properties_panel/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_fps_panel/fps_panel/mini_graph/prefab_line"
- parent: "example_fps_panel/fps_panel/mini_graph/content"
+ id: "properties_panel/scroll_view"
+ parent: "properties_panel/content"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_fps_panel/fps_panel/mini_graph/color_low"
- parent: "example_fps_panel/fps_panel/mini_graph/content"
+ id: "properties_panel/scroll_content"
+ parent: "properties_panel/scroll_view"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_fps_panel/fps_panel/content"
- parent: "example_fps_panel/fps_panel/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_fps_panel/fps_panel/text_min_fps"
- parent: "example_fps_panel/fps_panel/content"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_fps_panel/fps_panel/text_fps"
- parent: "example_fps_panel/fps_panel/content"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_fps_panel/fps_panel/line_second_1"
- parent: "example_fps_panel/fps_panel/content"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_fps_panel/fps_panel/line_second_2"
- parent: "example_fps_panel/fps_panel/content"
+ id: "properties_panel/propeties"
+ parent: "properties_panel/content"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
- id: "example_properties_panel"
+ id: "properties_panel/property_slider"
+ parent: "properties_panel/propeties"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_slider/root"
+ parent: "properties_panel/property_slider"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_slider/text_name"
+ parent: "properties_panel/property_slider/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_slider/E_Anchor"
+ parent: "properties_panel/property_slider/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_slider/slider"
+ parent: "properties_panel/property_slider/E_Anchor"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_slider/slider_back"
+ parent: "properties_panel/property_slider/slider"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_slider/slider_pin"
+ parent: "properties_panel/property_slider/slider"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_slider/button"
+ parent: "properties_panel/property_slider/E_Anchor"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_slider/selected"
+ parent: "properties_panel/property_slider/button"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_slider/text_value"
+ parent: "properties_panel/property_slider/button"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEMPLATE
+ id: "properties_panel/property_checkbox"
+ parent: "properties_panel/propeties"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_checkbox/root"
+ parent: "properties_panel/property_checkbox"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_checkbox/text_name"
+ parent: "properties_panel/property_checkbox/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_checkbox/E_Anchor"
+ parent: "properties_panel/property_checkbox/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_checkbox/button"
+ parent: "properties_panel/property_checkbox/E_Anchor"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_checkbox/icon"
+ parent: "properties_panel/property_checkbox/button"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_checkbox/selected"
+ parent: "properties_panel/property_checkbox/button"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEMPLATE
+ id: "properties_panel/property_button"
+ parent: "properties_panel/propeties"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_button/root"
+ parent: "properties_panel/property_button"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_button/text_name"
+ parent: "properties_panel/property_button/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_button/E_Anchor"
+ parent: "properties_panel/property_button/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_button/button"
+ parent: "properties_panel/property_button/E_Anchor"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_button/selected"
+ parent: "properties_panel/property_button/button"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_button/text_button"
+ parent: "properties_panel/property_button/button"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEMPLATE
+ id: "properties_panel/property_input"
+ parent: "properties_panel/propeties"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_input/root"
+ parent: "properties_panel/property_input"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_input/text_name"
+ parent: "properties_panel/property_input/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_input/E_Anchor"
+ parent: "properties_panel/property_input/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEMPLATE
+ id: "properties_panel/property_input/rich_input"
+ parent: "properties_panel/property_input/E_Anchor"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_input/rich_input/root"
+ parent: "properties_panel/property_input/rich_input"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_input/rich_input/button"
+ parent: "properties_panel/property_input/rich_input/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_input/rich_input/placeholder_text"
+ parent: "properties_panel/property_input/rich_input/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_input/rich_input/input_text"
+ parent: "properties_panel/property_input/rich_input/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_input/rich_input/cursor_node"
+ parent: "properties_panel/property_input/rich_input/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_input/rich_input/cursor_text"
+ parent: "properties_panel/property_input/rich_input/cursor_node"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_input/selected"
+ parent: "properties_panel/property_input/E_Anchor"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEMPLATE
+ id: "properties_panel/property_text"
+ parent: "properties_panel/propeties"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_text/root"
+ parent: "properties_panel/property_text"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_text/text_name"
+ parent: "properties_panel/property_text/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_text/text_right"
+ parent: "properties_panel/property_text/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEMPLATE
+ id: "properties_panel/property_left_right_selector"
+ parent: "properties_panel/propeties"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_left_right_selector/root"
+ parent: "properties_panel/property_left_right_selector"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_left_right_selector/text_name"
+ parent: "properties_panel/property_left_right_selector/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_left_right_selector/E_Anchor"
+ parent: "properties_panel/property_left_right_selector/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_left_right_selector/button_left"
+ parent: "properties_panel/property_left_right_selector/E_Anchor"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_left_right_selector/icon_left"
+ parent: "properties_panel/property_left_right_selector/button_left"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_left_right_selector/button_right"
+ parent: "properties_panel/property_left_right_selector/E_Anchor"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_left_right_selector/icon_right"
+ parent: "properties_panel/property_left_right_selector/button_right"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_left_right_selector/selected"
+ parent: "properties_panel/property_left_right_selector/E_Anchor"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_left_right_selector/text_value"
+ parent: "properties_panel/property_left_right_selector/E_Anchor"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEMPLATE
+ id: "properties_panel/property_vector3"
+ parent: "properties_panel/propeties"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/root"
+ parent: "properties_panel/property_vector3"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_vector3/text_name"
+ parent: "properties_panel/property_vector3/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/E_Anchor"
+ parent: "properties_panel/property_vector3/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/field_x"
+ parent: "properties_panel/property_vector3/E_Anchor"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_vector3/text_x"
+ parent: "properties_panel/property_vector3/field_x"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEMPLATE
+ id: "properties_panel/property_vector3/rich_input_x"
+ parent: "properties_panel/property_vector3/field_x"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/rich_input_x/root"
+ parent: "properties_panel/property_vector3/rich_input_x"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/rich_input_x/button"
+ parent: "properties_panel/property_vector3/rich_input_x/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_vector3/rich_input_x/placeholder_text"
+ parent: "properties_panel/property_vector3/rich_input_x/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_vector3/rich_input_x/input_text"
+ parent: "properties_panel/property_vector3/rich_input_x/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/rich_input_x/cursor_node"
+ parent: "properties_panel/property_vector3/rich_input_x/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_vector3/rich_input_x/cursor_text"
+ parent: "properties_panel/property_vector3/rich_input_x/cursor_node"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/selected_x"
+ parent: "properties_panel/property_vector3/field_x"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/field_y"
+ parent: "properties_panel/property_vector3/E_Anchor"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_vector3/text_y"
+ parent: "properties_panel/property_vector3/field_y"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEMPLATE
+ id: "properties_panel/property_vector3/rich_input_y"
+ parent: "properties_panel/property_vector3/field_y"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/rich_input_y/root"
+ parent: "properties_panel/property_vector3/rich_input_y"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/rich_input_y/button"
+ parent: "properties_panel/property_vector3/rich_input_y/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_vector3/rich_input_y/placeholder_text"
+ parent: "properties_panel/property_vector3/rich_input_y/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_vector3/rich_input_y/input_text"
+ parent: "properties_panel/property_vector3/rich_input_y/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/rich_input_y/cursor_node"
+ parent: "properties_panel/property_vector3/rich_input_y/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_vector3/rich_input_y/cursor_text"
+ parent: "properties_panel/property_vector3/rich_input_y/cursor_node"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/selected_y"
+ parent: "properties_panel/property_vector3/field_y"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/field_z"
+ parent: "properties_panel/property_vector3/E_Anchor"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_vector3/text_z"
+ parent: "properties_panel/property_vector3/field_z"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEMPLATE
+ id: "properties_panel/property_vector3/rich_input_z"
+ parent: "properties_panel/property_vector3/field_z"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/rich_input_z/root"
+ parent: "properties_panel/property_vector3/rich_input_z"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/rich_input_z/button"
+ parent: "properties_panel/property_vector3/rich_input_z/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_vector3/rich_input_z/placeholder_text"
+ parent: "properties_panel/property_vector3/rich_input_z/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_vector3/rich_input_z/input_text"
+ parent: "properties_panel/property_vector3/rich_input_z/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/rich_input_z/cursor_node"
+ parent: "properties_panel/property_vector3/rich_input_z/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "properties_panel/property_vector3/rich_input_z/cursor_text"
+ parent: "properties_panel/property_vector3/rich_input_z/cursor_node"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "properties_panel/property_vector3/selected_z"
+ parent: "properties_panel/property_vector3/field_z"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEMPLATE
+ id: "memory_panel"
parent: "widgets"
inherit_alpha: true
- template: "/example/examples/widgets/properties_panel/example_properties_panel.gui"
+ template: "/druid/widget/memory_panel/memory_panel.gui"
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/root"
- parent: "example_properties_panel"
+ id: "memory_panel/root"
+ parent: "memory_panel"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
- id: "example_properties_panel/properties_panel"
- parent: "example_properties_panel/root"
+ id: "memory_panel/mini_graph"
+ parent: "memory_panel/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/root"
- parent: "example_properties_panel/properties_panel"
+ id: "memory_panel/mini_graph/root"
+ parent: "memory_panel/mini_graph"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/header"
- parent: "example_properties_panel/properties_panel/root"
+ id: "memory_panel/mini_graph/header"
+ parent: "memory_panel/mini_graph/root"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/text_header"
- parent: "example_properties_panel/properties_panel/header"
+ id: "memory_panel/mini_graph/text_header"
+ parent: "memory_panel/mini_graph/header"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/icon_drag"
- parent: "example_properties_panel/properties_panel/header"
+ id: "memory_panel/mini_graph/icon_drag"
+ parent: "memory_panel/mini_graph/header"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/content"
- parent: "example_properties_panel/properties_panel/root"
+ id: "memory_panel/mini_graph/content"
+ parent: "memory_panel/mini_graph/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/scroll_view"
- parent: "example_properties_panel/properties_panel/content"
+ id: "memory_panel/mini_graph/prefab_line"
+ parent: "memory_panel/mini_graph/content"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/scroll_content"
- parent: "example_properties_panel/properties_panel/scroll_view"
+ id: "memory_panel/mini_graph/color_low"
+ parent: "memory_panel/mini_graph/content"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/propeties"
- parent: "example_properties_panel/properties_panel/content"
+ id: "memory_panel/content"
+ parent: "memory_panel/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "memory_panel/text_max_value"
+ parent: "memory_panel/content"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "memory_panel/text_per_second"
+ parent: "memory_panel/content"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "memory_panel/line_second_1"
+ parent: "memory_panel/content"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "memory_panel/line_second_2"
+ parent: "memory_panel/content"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_TEXT
+ id: "memory_panel/text_memory"
+ parent: "memory_panel/content"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
- id: "example_properties_panel/properties_panel/property_slider"
- parent: "example_properties_panel/properties_panel/propeties"
+ id: "mini_graph"
+ parent: "widgets"
+ inherit_alpha: true
+ template: "/druid/widget/mini_graph/mini_graph.gui"
+}
+nodes {
+ type: TYPE_BOX
+ id: "mini_graph/root"
+ parent: "mini_graph"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_slider/root"
- parent: "example_properties_panel/properties_panel/property_slider"
+ id: "mini_graph/header"
+ parent: "mini_graph/root"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_slider/text_name"
- parent: "example_properties_panel/properties_panel/property_slider/root"
+ id: "mini_graph/text_header"
+ parent: "mini_graph/header"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_slider/E_Anchor"
- parent: "example_properties_panel/properties_panel/property_slider/root"
+ id: "mini_graph/icon_drag"
+ parent: "mini_graph/header"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_slider/slider"
- parent: "example_properties_panel/properties_panel/property_slider/E_Anchor"
+ id: "mini_graph/content"
+ parent: "mini_graph/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_slider/slider_back"
- parent: "example_properties_panel/properties_panel/property_slider/slider"
+ id: "mini_graph/prefab_line"
+ parent: "mini_graph/content"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_slider/slider_pin"
- parent: "example_properties_panel/properties_panel/property_slider/slider"
+ id: "mini_graph/color_low"
+ parent: "mini_graph/content"
template_node_child: true
}
nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_slider/button"
- parent: "example_properties_panel/properties_panel/property_slider/E_Anchor"
- template_node_child: true
+ position {
+ x: -200.0
+ }
+ type: TYPE_TEMPLATE
+ id: "property_input"
+ parent: "widgets"
+ inherit_alpha: true
+ template: "/druid/widget/properties_panel/properties/property_input.gui"
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_slider/selected"
- parent: "example_properties_panel/properties_panel/property_slider/button"
+ id: "property_input/root"
+ parent: "property_input"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_slider/text_value"
- parent: "example_properties_panel/properties_panel/property_slider/button"
+ id: "property_input/text_name"
+ parent: "property_input/root"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "property_input/E_Anchor"
+ parent: "property_input/root"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
- id: "example_properties_panel/properties_panel/property_checkbox"
- parent: "example_properties_panel/properties_panel/propeties"
+ id: "property_input/rich_input"
+ parent: "property_input/E_Anchor"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_checkbox/root"
- parent: "example_properties_panel/properties_panel/property_checkbox"
+ id: "property_input/rich_input/root"
+ parent: "property_input/rich_input"
+ template_node_child: true
+}
+nodes {
+ type: TYPE_BOX
+ id: "property_input/rich_input/button"
+ parent: "property_input/rich_input/root"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_checkbox/text_name"
- parent: "example_properties_panel/properties_panel/property_checkbox/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_checkbox/E_Anchor"
- parent: "example_properties_panel/properties_panel/property_checkbox/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_checkbox/button"
- parent: "example_properties_panel/properties_panel/property_checkbox/E_Anchor"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_checkbox/icon"
- parent: "example_properties_panel/properties_panel/property_checkbox/button"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_checkbox/selected"
- parent: "example_properties_panel/properties_panel/property_checkbox/button"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEMPLATE
- id: "example_properties_panel/properties_panel/property_button"
- parent: "example_properties_panel/properties_panel/propeties"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_button/root"
- parent: "example_properties_panel/properties_panel/property_button"
+ id: "property_input/rich_input/placeholder_text"
+ parent: "property_input/rich_input/root"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_button/text_name"
- parent: "example_properties_panel/properties_panel/property_button/root"
+ id: "property_input/rich_input/input_text"
+ parent: "property_input/rich_input/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_button/E_Anchor"
- parent: "example_properties_panel/properties_panel/property_button/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_button/button"
- parent: "example_properties_panel/properties_panel/property_button/E_Anchor"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_button/selected"
- parent: "example_properties_panel/properties_panel/property_button/button"
+ id: "property_input/rich_input/cursor_node"
+ parent: "property_input/rich_input/root"
template_node_child: true
}
nodes {
type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_button/text_button"
- parent: "example_properties_panel/properties_panel/property_button/button"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEMPLATE
- id: "example_properties_panel/properties_panel/property_input"
- parent: "example_properties_panel/properties_panel/propeties"
+ id: "property_input/rich_input/cursor_text"
+ parent: "property_input/rich_input/cursor_node"
template_node_child: true
}
nodes {
type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_input/root"
- parent: "example_properties_panel/properties_panel/property_input"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_input/text_name"
- parent: "example_properties_panel/properties_panel/property_input/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_input/E_Anchor"
- parent: "example_properties_panel/properties_panel/property_input/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEMPLATE
- id: "example_properties_panel/properties_panel/property_input/rich_input"
- parent: "example_properties_panel/properties_panel/property_input/E_Anchor"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_input/rich_input/root"
- parent: "example_properties_panel/properties_panel/property_input/rich_input"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_input/rich_input/button"
- parent: "example_properties_panel/properties_panel/property_input/rich_input/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_input/rich_input/placeholder_text"
- parent: "example_properties_panel/properties_panel/property_input/rich_input/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_input/rich_input/input_text"
- parent: "example_properties_panel/properties_panel/property_input/rich_input/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_input/rich_input/cursor_node"
- parent: "example_properties_panel/properties_panel/property_input/rich_input/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_input/rich_input/cursor_text"
- parent: "example_properties_panel/properties_panel/property_input/rich_input/cursor_node"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_input/selected"
- parent: "example_properties_panel/properties_panel/property_input/E_Anchor"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEMPLATE
- id: "example_properties_panel/properties_panel/property_text"
- parent: "example_properties_panel/properties_panel/propeties"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_text/root"
- parent: "example_properties_panel/properties_panel/property_text"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_text/text_name"
- parent: "example_properties_panel/properties_panel/property_text/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_text/text_right"
- parent: "example_properties_panel/properties_panel/property_text/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEMPLATE
- id: "example_properties_panel/properties_panel/property_left_right_selector"
- parent: "example_properties_panel/properties_panel/propeties"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_left_right_selector/root"
- parent: "example_properties_panel/properties_panel/property_left_right_selector"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_left_right_selector/text_name"
- parent: "example_properties_panel/properties_panel/property_left_right_selector/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_left_right_selector/E_Anchor"
- parent: "example_properties_panel/properties_panel/property_left_right_selector/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_left_right_selector/button_left"
- parent: "example_properties_panel/properties_panel/property_left_right_selector/E_Anchor"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_left_right_selector/icon_left"
- parent: "example_properties_panel/properties_panel/property_left_right_selector/button_left"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_left_right_selector/button_right"
- parent: "example_properties_panel/properties_panel/property_left_right_selector/E_Anchor"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_left_right_selector/icon_right"
- parent: "example_properties_panel/properties_panel/property_left_right_selector/button_right"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_left_right_selector/selected"
- parent: "example_properties_panel/properties_panel/property_left_right_selector/E_Anchor"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_left_right_selector/text_value"
- parent: "example_properties_panel/properties_panel/property_left_right_selector/E_Anchor"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEMPLATE
- id: "example_properties_panel/properties_panel/property_vector3"
- parent: "example_properties_panel/properties_panel/propeties"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/root"
- parent: "example_properties_panel/properties_panel/property_vector3"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_vector3/text_name"
- parent: "example_properties_panel/properties_panel/property_vector3/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/E_Anchor"
- parent: "example_properties_panel/properties_panel/property_vector3/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/field_x"
- parent: "example_properties_panel/properties_panel/property_vector3/E_Anchor"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_vector3/text_x"
- parent: "example_properties_panel/properties_panel/property_vector3/field_x"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEMPLATE
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_x"
- parent: "example_properties_panel/properties_panel/property_vector3/field_x"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_x/root"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_x"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_x/button"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_x/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_x/placeholder_text"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_x/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_x/input_text"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_x/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_x/cursor_node"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_x/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_x/cursor_text"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_x/cursor_node"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/selected_x"
- parent: "example_properties_panel/properties_panel/property_vector3/field_x"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/field_y"
- parent: "example_properties_panel/properties_panel/property_vector3/E_Anchor"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_vector3/text_y"
- parent: "example_properties_panel/properties_panel/property_vector3/field_y"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEMPLATE
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_y"
- parent: "example_properties_panel/properties_panel/property_vector3/field_y"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_y/root"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_y"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_y/button"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_y/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_y/placeholder_text"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_y/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_y/input_text"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_y/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_y/cursor_node"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_y/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_y/cursor_text"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_y/cursor_node"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/selected_y"
- parent: "example_properties_panel/properties_panel/property_vector3/field_y"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/field_z"
- parent: "example_properties_panel/properties_panel/property_vector3/E_Anchor"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_vector3/text_z"
- parent: "example_properties_panel/properties_panel/property_vector3/field_z"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEMPLATE
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_z"
- parent: "example_properties_panel/properties_panel/property_vector3/field_z"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_z/root"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_z"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_z/button"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_z/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_z/placeholder_text"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_z/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_z/input_text"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_z/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_z/cursor_node"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_z/root"
- template_node_child: true
-}
-nodes {
- type: TYPE_TEXT
- id: "example_properties_panel/properties_panel/property_vector3/rich_input_z/cursor_text"
- parent: "example_properties_panel/properties_panel/property_vector3/rich_input_z/cursor_node"
- template_node_child: true
-}
-nodes {
- type: TYPE_BOX
- id: "example_properties_panel/properties_panel/property_vector3/selected_z"
- parent: "example_properties_panel/properties_panel/property_vector3/field_z"
+ id: "property_input/selected"
+ parent: "property_input/E_Anchor"
template_node_child: true
}
nodes {
diff --git a/example/druid.gui_script b/example/druid.gui_script
index 1a7eb7c..4b5c865 100644
--- a/example/druid.gui_script
+++ b/example/druid.gui_script
@@ -89,7 +89,7 @@ local function setup_components(self)
self.examples_list_view = self.druid:new(examples_list_view, "examples_list_view") --[[@as examples_list_view]]
self.container_examples:add_container(self.examples_list_view.root)
- self.properties_panel = self.druid:new(properties_panel, "properties_panel") --[[@as properties_panel]]
+ self.properties_panel = self.druid:new(properties_panel, "example_properties_panel") --[[@as properties_panel]]
self.container_settings:add_container(self.properties_panel.root)
self.output_list = self.druid:new(output_list, "output_list") --[[@as output_list]]
diff --git a/example/examples/basic/rich_text/rich_text_tags.lua b/example/examples/basic/rich_text/rich_text_tags.lua
index dc8f6c7..3e92a8f 100644
--- a/example/examples/basic/rich_text/rich_text_tags.lua
+++ b/example/examples/basic/rich_text/rich_text_tags.lua
@@ -25,7 +25,7 @@ function M:init(template, nodes)
self.rich_text_breaks:set_text("Hello, I'm Rich Text
With \"Line Breaks\"\nEnabled in GUI")
self.rich_text_image = self.druid:new_rich_text("rich_text_image") --[[@as druid.rich_text]]
- self.rich_text_image:set_text("Hello, I'm
Rich Text
")
+ self.rich_text_image:set_text("Hello, I'm
Rich Text
")
self.position = {
[self.rich_text_color] = gui.get_position(self.rich_text_color.root),
diff --git a/example/examples/intro/examples_list.lua b/example/examples/intro/examples_list.lua
index 0366886..0618863 100644
--- a/example/examples/intro/examples_list.lua
+++ b/example/examples/intro/examples_list.lua
@@ -12,6 +12,14 @@ function M.get_examples()
code_url = "example/examples/intro/intro/intro.lua",
component_class = require("example.examples.intro.intro.intro"),
},
+ --{
+ -- name_id = "ui_example_how_to_use_example",
+ -- information_text_id = "ui_example_how_to_use_example_description",
+ -- template = "how_to_use_example",
+ -- root = "how_to_use_example/root",
+ -- code_url = "example/examples/intro/how_to_use_example/how_to_use_example.lua",
+ -- component_class = require("example.examples.intro.how_to_use_example.how_to_use_example"),
+ --}
}
end
diff --git a/example/examples/intro/how_to_use_example/how_to_use_example.gui b/example/examples/intro/how_to_use_example/how_to_use_example.gui
new file mode 100644
index 0000000..78283a9
--- /dev/null
+++ b/example/examples/intro/how_to_use_example/how_to_use_example.gui
@@ -0,0 +1,257 @@
+fonts {
+ name: "text_bold"
+ font: "/example/assets/fonts/text_bold.font"
+}
+fonts {
+ name: "text_regular"
+ font: "/example/assets/fonts/text_regular.font"
+}
+textures {
+ name: "druid_example"
+ texture: "/example/assets/druid_example.atlas"
+}
+textures {
+ name: "druid_logo"
+ texture: "/example/assets/druid_logo.atlas"
+}
+nodes {
+ size {
+ x: 600.0
+ y: 1000.0
+ }
+ color {
+ x: 0.173
+ y: 0.184
+ z: 0.204
+ }
+ type: TYPE_BOX
+ texture: "druid_example/ui_circle_64"
+ id: "root"
+ inherit_alpha: true
+ slice9 {
+ x: 32.0
+ y: 32.0
+ z: 32.0
+ w: 32.0
+ }
+}
+nodes {
+ position {
+ x: -180.0
+ y: 375.0
+ }
+ type: TYPE_BOX
+ texture: "druid_logo/icon_druid"
+ id: "icon_druid_left"
+ parent: "root"
+ layer: "druid_logo"
+ inherit_alpha: true
+ alpha: 0.75
+ size_mode: SIZE_MODE_AUTO
+}
+nodes {
+ position {
+ x: 180.0
+ y: 375.0
+ }
+ type: TYPE_BOX
+ texture: "druid_logo/icon_druid"
+ id: "icon_druid_right"
+ parent: "root"
+ layer: "druid_logo"
+ inherit_alpha: true
+ alpha: 0.75
+ size_mode: SIZE_MODE_AUTO
+}
+nodes {
+ position {
+ y: 255.0
+ }
+ scale {
+ x: 2.0
+ y: 2.0
+ }
+ size {
+ x: 200.0
+ y: 40.0
+ }
+ color {
+ x: 0.941
+ y: 0.984
+ }
+ type: TYPE_TEXT
+ text: "Hello!"
+ font: "text_bold"
+ id: "text_hello"
+ parent: "root"
+ inherit_alpha: true
+ outline_alpha: 0.0
+ shadow_alpha: 0.0
+}
+nodes {
+ position {
+ x: -210.0
+ y: 191.0
+ }
+ scale {
+ x: 0.7
+ y: 0.7
+ }
+ size {
+ x: 600.0
+ y: 400.0
+ }
+ color {
+ x: 0.525
+ y: 0.525
+ z: 0.525
+ }
+ type: TYPE_TEXT
+ text: "Welcome to Druid Example Page\n"
+ "\n"
+ "Navigate over examples on the left\n"
+ "\n"
+ "Check example info on the right"
+ font: "text_bold"
+ id: "text_description"
+ pivot: PIVOT_NW
+ line_break: true
+ parent: "root"
+ inherit_alpha: true
+ outline_alpha: 0.0
+ shadow_alpha: 0.0
+}
+nodes {
+ position {
+ x: -210.0
+ y: -189.0
+ }
+ scale {
+ x: 0.7
+ y: 0.7
+ }
+ size {
+ x: 600.0
+ y: 300.0
+ }
+ color {
+ x: 0.525
+ y: 0.525
+ z: 0.525
+ }
+ type: TYPE_TEXT
+ text: "Your donation helps me stay engaged in creating valuable projects for Defold.\n"
+ "\n"
+ "If you appreciate what I\'m doing, please consider supporting me!"
+ font: "text_bold"
+ id: "text_support"
+ pivot: PIVOT_W
+ line_break: true
+ parent: "root"
+ inherit_alpha: true
+ outline_alpha: 0.0
+ shadow_alpha: 0.0
+}
+nodes {
+ position {
+ x: -170.0
+ y: -364.0
+ }
+ type: TYPE_BOX
+ texture: "druid_example/icon_heart"
+ id: "icon_heart1"
+ parent: "root"
+ inherit_alpha: true
+ alpha: 0.75
+ size_mode: SIZE_MODE_AUTO
+}
+nodes {
+ position {
+ y: -364.0
+ }
+ type: TYPE_BOX
+ texture: "druid_example/icon_heart"
+ id: "icon_heart2"
+ parent: "root"
+ inherit_alpha: true
+ alpha: 0.75
+ size_mode: SIZE_MODE_AUTO
+}
+nodes {
+ position {
+ x: 170.0
+ y: -364.0
+ }
+ type: TYPE_BOX
+ texture: "druid_example/icon_heart"
+ id: "icon_heart3"
+ parent: "root"
+ inherit_alpha: true
+ alpha: 0.75
+ size_mode: SIZE_MODE_AUTO
+}
+nodes {
+ position {
+ y: -450.0
+ }
+ size {
+ x: 500.0
+ y: 80.0
+ }
+ type: TYPE_BOX
+ id: "sponsor"
+ parent: "root"
+ inherit_alpha: true
+ size_mode: SIZE_MODE_AUTO
+ visible: false
+}
+nodes {
+ position {
+ x: -196.0
+ y: -3.0
+ }
+ type: TYPE_BOX
+ texture: "druid_logo/sponsor_github"
+ id: "sponsor_github"
+ parent: "sponsor"
+ layer: "druid_logo"
+ inherit_alpha: true
+ alpha: 0.75
+ size_mode: SIZE_MODE_AUTO
+}
+nodes {
+ position {
+ x: 21.0
+ y: -3.0
+ }
+ type: TYPE_BOX
+ texture: "druid_logo/sponsor_coffee"
+ id: "sponsor_coffee"
+ parent: "sponsor"
+ layer: "druid_logo"
+ inherit_alpha: true
+ alpha: 0.75
+ size_mode: SIZE_MODE_AUTO
+}
+nodes {
+ position {
+ x: 217.0
+ y: -3.0
+ }
+ type: TYPE_BOX
+ texture: "druid_logo/sponsor_kofi"
+ id: "sponsor_kofi"
+ parent: "sponsor"
+ layer: "druid_logo"
+ inherit_alpha: true
+ alpha: 0.75
+ size_mode: SIZE_MODE_AUTO
+}
+layers {
+ name: "druid_logo"
+}
+layers {
+ name: "text_regular"
+}
+material: "/builtins/materials/gui.material"
+adjust_reference: ADJUST_REFERENCE_PARENT
diff --git a/example/examples/intro/how_to_use_example/how_to_use_example.lua b/example/examples/intro/how_to_use_example/how_to_use_example.lua
new file mode 100644
index 0000000..b797f98
--- /dev/null
+++ b/example/examples/intro/how_to_use_example/how_to_use_example.lua
@@ -0,0 +1,33 @@
+local component = require("druid.component")
+local panthera = require("panthera.panthera")
+
+---@class how_to_use_example: druid.base_component
+---@field root node
+local M = component.create("how_to_use_example")
+
+---@param template string
+---@param nodes table
+function M:init(template, nodes)
+ self.druid = self:get_druid(template, nodes)
+ self.root = self:get_node("root")
+
+ self.druid:new_rich_text("text_hello", "Hello!")
+
+ self.druid:new_button("sponsor_github", self.open_link, "https://github.com/sponsors/insality")
+ self.druid:new_button("sponsor_coffee", self.open_link, "https://www.buymeacoffee.com/insality")
+ self.druid:new_button("sponsor_kofi", self.open_link, "https://ko-fi.com/insality")
+
+ self.druid:new_layout("sponsor")
+ :add("sponsor_github")
+ :add("sponsor_coffee")
+ :add("sponsor_kofi")
+ :set_margin(8, 0)
+end
+
+
+function M:open_link(link)
+ sys.open_url(link, { target = "_blank" })
+end
+
+
+return M
diff --git a/example/examples/intro/intro/intro.lua b/example/examples/intro/intro/intro.lua
index abeee0e..10ea849 100644
--- a/example/examples/intro/intro/intro.lua
+++ b/example/examples/intro/intro/intro.lua
@@ -3,7 +3,6 @@ local panthera = require("panthera.panthera")
local intro_panthera = require("example.examples.intro.intro.intro_panthera")
---@class intro: druid.base_component
----@field druid druid_instance
---@field root node
local M = component.create("intro")
@@ -35,4 +34,9 @@ function M:open_link(link)
end
+function M:on_remove()
+ panthera.stop(self.animation)
+end
+
+
return M
diff --git a/example/examples/widgets/examples_list.lua b/example/examples/widgets/examples_list.lua
index 14c7728..d127fb0 100644
--- a/example/examples/widgets/examples_list.lua
+++ b/example/examples/widgets/examples_list.lua
@@ -11,6 +11,72 @@ function M.get_examples()
code_url = "example/examples/widgets/hover_hint/hover_hint_example.lua",
component_class = require("example.examples.widgets.hover_hint.hover_hint_example"),
},
+ {
+ name_id = "ui_example_widget_properties_panel",
+ information_text_id = "ui_example_widget_properties_panel_description",
+ template = "properties_panel",
+ root = "properties_panel/root",
+ code_url = "example/examples/widgets/properties_panel/properties_panel.lua",
+ widget_class = require("druid.widget.properties_panel.properties_panel"),
+ on_create = function(instance, output_list)
+ ---@cast instance widget.properties_panel
+
+ instance:add_button(function(button)
+ button:set_text_button("Button")
+ button.button.on_click:subscribe(function()
+ print("Button clicked")
+ end)
+ end)
+
+ instance:add_checkbox(function(checkbox)
+ --print("Checkbox clicked", value)
+ checkbox:set_text_property("Checkbox")
+ checkbox.on_change_value:subscribe(function(value)
+ print("Checkbox clicked", value)
+ end)
+ checkbox:set_value(false)
+ end)
+
+ instance:add_input(function(input)
+ input:set_text_property("Input")
+ input:set_text_value("Initial")
+ input:on_change(function(text)
+ print("Input changed", text)
+ end)
+ end)
+
+ instance:add_left_right_selector(function(selector)
+ selector:set_template("Arrows Number")
+ selector.on_change_value:subscribe(function(value)
+ print("Left Right Selector changed", value)
+ end)
+ selector:set_number_type(0, 42, true, 1)
+ selector:set_value(0)
+ end)
+
+ instance:add_left_right_selector(function(selector)
+ selector:set_template("Arrows Array")
+ selector.on_change_value:subscribe(function(value)
+ print("Left Right Array value", value)
+ end)
+ selector:set_array_type({"Zero", "One", "Two", "Three", "Four", "Five"}, false, 1)
+ selector:set_value("Zero")
+ end)
+
+ instance:add_slider(function(slider)
+ slider:set_text_property("Slider")
+ slider:set_value(0.5)
+ slider:on_change(function(value)
+ print("Slider changed", value)
+ end)
+ end)
+
+ instance:add_text(function(text)
+ text:set_text_property("Text")
+ text:set_text_value("Hello, World!")
+ end)
+ end,
+ },
{
name_id = "ui_example_widget_property_button",
information_text_id = "ui_example_widget_property_button_description",
@@ -25,6 +91,14 @@ function M.get_examples()
end)
end,
},
+ {
+ name_id = "ui_example_widget_property_input",
+ information_text_id = "ui_example_widget_property_input_description",
+ template = "property_input",
+ root = "property_input/root",
+ code_url = "druid/widget/properties_panel/properties/property_input.lua",
+ widget_class = require("druid.widget.properties_panel.properties.property_input"),
+ },
{
name_id = "ui_example_widget_property_slider",
information_text_id = "ui_example_widget_property_slider_description",
@@ -56,27 +130,54 @@ function M.get_examples()
{
name_id = "ui_example_widget_memory_panel",
information_text_id = "ui_example_widget_memory_panel_description",
- template = "example_memory_panel",
- root = "example_memory_panel/root",
- code_url = "example/examples/widgets/memory_panel/example_memory_panel.lua",
- widget_class = require("example.examples.widgets.memory_panel.example_memory_panel"),
+ template = "memory_panel",
+ root = "memory_panel/root",
+ code_url = "druid.widget.memory_panel.memory_panel.lua",
+ widget_class = require("druid.widget.memory_panel.memory_panel"),
+ on_create = function(instance, output_list)
+ ---@cast instance widget.memory_panel
+ print("Memory panel created")
+ end,
},
{
name_id = "ui_example_widget_fps_panel",
information_text_id = "ui_example_widget_fps_panel_description",
- template = "example_fps_panel",
- root = "example_fps_panel/root",
- code_url = "example/examples/widgets/fps_panel/example_fps_panel.lua",
- widget_class = require("example.examples.widgets.fps_panel.example_fps_panel"),
+ template = "fps_panel",
+ root = "fps_panel/root",
+ code_url = "druid.widget.fps_panel.fps_panel.lua",
+ widget_class = require("druid.widget.fps_panel.fps_panel"),
+ on_create = function(instance, output_list)
+ ---@cast instance widget.fps_panel
+ print("FPS panel created")
+ end,
},
{
- name_id = "ui_example_widget_properties_panel",
- information_text_id = "ui_example_widget_properties_panel_description",
- template = "example_properties_panel",
- root = "example_properties_panel/root",
- code_url = "example/examples/widgets/properties_panel/example_properties_panel.lua",
- widget_class = require("example.examples.widgets.properties_panel.example_properties_panel"),
- },
+ name_id = "ui_example_widget_mini_graph",
+ information_text_id = "ui_example_widget_mini_graph_description",
+ template = "mini_graph",
+ root = "mini_graph/root",
+ code_url = "druid.widget.mini_graph.mini_graph.lua",
+ widget_class = require("druid.widget.mini_graph.mini_graph"),
+ on_create = function(instance, output_list)
+ ---@cast instance widget.mini_graph
+ instance:set_samples(50)
+ end,
+ properties_control = function(instance, properties_panel)
+ ---@cast instance widget.mini_graph
+ properties_panel:add_slider("value", 0.5, function(value)
+ -- Remap to -1, 2
+ value = value * 3 - 1
+ for index = 1, 50 do
+ -- Take value each 0.1 step, the higher value at argument value
+ local x = index * (1 / 50)
+ local distance = math.abs(x - value)
+ local line_v = 1 - distance^2
+
+ instance:set_line_value(index, line_v)
+ end
+ end)
+ end,
+ }
}
end