mirror of
https://github.com/Insality/druid
synced 2025-09-27 10:02:19 +02:00
Update
This commit is contained in:
@@ -95,6 +95,7 @@ function M:add_example(examples, druid_example)
|
||||
else
|
||||
instance = druid_example.druid:new(example_data.component_class, example_data.template)
|
||||
end
|
||||
---@cast instance druid.component|druid.widget
|
||||
|
||||
self.selected_example = {
|
||||
data = example_data,
|
||||
|
@@ -26,9 +26,9 @@ local druid_examples = require("example.examples.druid_examples")
|
||||
---@field container_output druid.container
|
||||
---@field container_center druid.container
|
||||
---@field container_status druid.container
|
||||
---@field druid_logo druid_logo
|
||||
---@field druid_logo examples.druid_logo
|
||||
---@field panel_information panel_information
|
||||
---@field example_scene example_scene
|
||||
---@field example_scene examples.example_scene
|
||||
---@field panel_druid_profiler panel_druid_profiler
|
||||
---@field examples_list_view examples_list_view
|
||||
---@field properties_panel properties_panel
|
||||
@@ -74,13 +74,13 @@ end
|
||||
|
||||
---@param self druid.example
|
||||
local function setup_components(self)
|
||||
self.druid_logo = self.druid:new(druid_logo, "druid_logo") --[[@as druid_logo]]
|
||||
self.druid_logo = self.druid:new(druid_logo, "druid_logo") --[[@as examples.druid_logo]]
|
||||
self.container_logo:add_container(self.druid_logo.root)
|
||||
|
||||
self.panel_information = self.druid:new(panel_information, "panel_information") --[[@as panel_information]]
|
||||
self.container_info:add_container(self.panel_information.root)
|
||||
|
||||
self.example_scene = self.druid:new(example_scene, "example_scene") --[[@as example_scene]]
|
||||
self.example_scene = self.druid:new(example_scene, "example_scene") --[[@as examples.example_scene]]
|
||||
self.container_center:add_container(self.example_scene.root)
|
||||
|
||||
self.panel_druid_profiler = self.druid:new(panel_druid_profiler, "panel_druid_profiler") --[[@as panel_druid_profiler]]
|
||||
|
@@ -36,6 +36,66 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_stick.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_left/root"
|
||||
parent: "stick_left"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_PIE
|
||||
id: "stick_left/background_mask"
|
||||
parent: "stick_left/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_left/background"
|
||||
parent: "stick_left/background_mask"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_left/stick_root"
|
||||
parent: "stick_left/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_left/stick_shadow"
|
||||
parent: "stick_left/stick_root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_left/stick"
|
||||
parent: "stick_left/stick_root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_left/dot_1"
|
||||
parent: "stick_left/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_left/dot_2"
|
||||
parent: "stick_left/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_left/dot_3"
|
||||
parent: "stick_left/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_left/dot_4"
|
||||
parent: "stick_left/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
x: 200.0
|
||||
@@ -47,6 +107,66 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_stick.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_right/root"
|
||||
parent: "stick_right"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_PIE
|
||||
id: "stick_right/background_mask"
|
||||
parent: "stick_right/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_right/background"
|
||||
parent: "stick_right/background_mask"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_right/stick_root"
|
||||
parent: "stick_right/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_right/stick_shadow"
|
||||
parent: "stick_right/stick_root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_right/stick"
|
||||
parent: "stick_right/stick_root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_right/dot_1"
|
||||
parent: "stick_right/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_right/dot_2"
|
||||
parent: "stick_right/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_right/dot_3"
|
||||
parent: "stick_right/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "stick_right/dot_4"
|
||||
parent: "stick_right/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
x: -330.0
|
||||
@@ -73,6 +193,30 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_button.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_left/button"
|
||||
parent: "button_left"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "button_left/text"
|
||||
parent: "button_left/button"
|
||||
overridden_fields: 45
|
||||
template_node_child: true
|
||||
enabled: false
|
||||
}
|
||||
nodes {
|
||||
rotation {
|
||||
z: 180.0
|
||||
}
|
||||
type: TYPE_BOX
|
||||
id: "button_left/icon"
|
||||
parent: "button_left/button"
|
||||
overridden_fields: 2
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
y: 100.0
|
||||
@@ -83,6 +227,30 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_button.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_up/button"
|
||||
parent: "button_up"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "button_up/text"
|
||||
parent: "button_up/button"
|
||||
overridden_fields: 45
|
||||
template_node_child: true
|
||||
enabled: false
|
||||
}
|
||||
nodes {
|
||||
rotation {
|
||||
z: 90.0
|
||||
}
|
||||
type: TYPE_BOX
|
||||
id: "button_up/icon"
|
||||
parent: "button_up/button"
|
||||
overridden_fields: 2
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
x: 100.0
|
||||
@@ -93,6 +261,26 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_button.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_right/button"
|
||||
parent: "button_right"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "button_right/text"
|
||||
parent: "button_right/button"
|
||||
overridden_fields: 45
|
||||
template_node_child: true
|
||||
enabled: false
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_right/icon"
|
||||
parent: "button_right/button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
y: -100.0
|
||||
@@ -103,6 +291,30 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_button.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_down/button"
|
||||
parent: "button_down"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "button_down/text"
|
||||
parent: "button_down/button"
|
||||
overridden_fields: 45
|
||||
template_node_child: true
|
||||
enabled: false
|
||||
}
|
||||
nodes {
|
||||
rotation {
|
||||
z: -90.0
|
||||
}
|
||||
type: TYPE_BOX
|
||||
id: "button_down/icon"
|
||||
parent: "button_down/button"
|
||||
overridden_fields: 2
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
x: 330.0
|
||||
@@ -129,6 +341,26 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_button.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_x/button"
|
||||
parent: "button_x"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "button_x/text"
|
||||
parent: "button_x/button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_x/icon"
|
||||
parent: "button_x/button"
|
||||
overridden_fields: 45
|
||||
template_node_child: true
|
||||
enabled: false
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
y: 100.0
|
||||
@@ -139,6 +371,28 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_button.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_y/button"
|
||||
parent: "button_y"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
text: "Y"
|
||||
id: "button_y/text"
|
||||
parent: "button_y/button"
|
||||
overridden_fields: 8
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_y/icon"
|
||||
parent: "button_y/button"
|
||||
overridden_fields: 45
|
||||
template_node_child: true
|
||||
enabled: false
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
x: 100.0
|
||||
@@ -149,6 +403,28 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_button.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_b/button"
|
||||
parent: "button_b"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
text: "B"
|
||||
id: "button_b/text"
|
||||
parent: "button_b/button"
|
||||
overridden_fields: 8
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_b/icon"
|
||||
parent: "button_b/button"
|
||||
overridden_fields: 45
|
||||
template_node_child: true
|
||||
enabled: false
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
y: -100.0
|
||||
@@ -159,6 +435,28 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_button.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_a/button"
|
||||
parent: "button_a"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
text: "A"
|
||||
id: "button_a/text"
|
||||
parent: "button_a/button"
|
||||
overridden_fields: 8
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_a/icon"
|
||||
parent: "button_a/button"
|
||||
overridden_fields: 45
|
||||
template_node_child: true
|
||||
enabled: false
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
y: 160.0
|
||||
@@ -184,6 +482,33 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_button.gui"
|
||||
}
|
||||
nodes {
|
||||
size {
|
||||
x: 170.0
|
||||
y: 90.0
|
||||
}
|
||||
type: TYPE_BOX
|
||||
id: "button_back/button"
|
||||
parent: "button_back"
|
||||
overridden_fields: 4
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
text: "Back"
|
||||
id: "button_back/text"
|
||||
parent: "button_back/button"
|
||||
overridden_fields: 8
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_back/icon"
|
||||
parent: "button_back/button"
|
||||
overridden_fields: 45
|
||||
template_node_child: true
|
||||
enabled: false
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
x: 110.0
|
||||
@@ -194,6 +519,33 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_button.gui"
|
||||
}
|
||||
nodes {
|
||||
size {
|
||||
x: 170.0
|
||||
y: 90.0
|
||||
}
|
||||
type: TYPE_BOX
|
||||
id: "button_start/button"
|
||||
parent: "button_start"
|
||||
overridden_fields: 4
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
text: "Start"
|
||||
id: "button_start/text"
|
||||
parent: "button_start/button"
|
||||
overridden_fields: 8
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_start/icon"
|
||||
parent: "button_start/button"
|
||||
overridden_fields: 45
|
||||
template_node_child: true
|
||||
enabled: false
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
x: -330.0
|
||||
@@ -221,6 +573,28 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_button.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_l1/button"
|
||||
parent: "button_l1"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
text: "L1"
|
||||
id: "button_l1/text"
|
||||
parent: "button_l1/button"
|
||||
overridden_fields: 8
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_l1/icon"
|
||||
parent: "button_l1/button"
|
||||
overridden_fields: 45
|
||||
template_node_child: true
|
||||
enabled: false
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
y: 60.0
|
||||
@@ -231,6 +605,26 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_trigger.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_l2/button"
|
||||
parent: "button_l2"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_l2/fill"
|
||||
parent: "button_l2/button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
text: "L2"
|
||||
id: "button_l2/text"
|
||||
parent: "button_l2/button"
|
||||
overridden_fields: 8
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
x: 330.0
|
||||
@@ -257,6 +651,28 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_button.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_r1/button"
|
||||
parent: "button_r1"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
text: "R1"
|
||||
id: "button_r1/text"
|
||||
parent: "button_r1/button"
|
||||
overridden_fields: 8
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_r1/icon"
|
||||
parent: "button_r1/button"
|
||||
overridden_fields: 45
|
||||
template_node_child: true
|
||||
enabled: false
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
y: 60.0
|
||||
@@ -267,5 +683,25 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_trigger.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_r2/button"
|
||||
parent: "button_r2"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_r2/fill"
|
||||
parent: "button_r2/button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
text: "R2"
|
||||
id: "button_r2/text"
|
||||
parent: "button_r2/button"
|
||||
overridden_fields: 8
|
||||
template_node_child: true
|
||||
}
|
||||
material: "/builtins/materials/gui.material"
|
||||
adjust_reference: ADJUST_REFERENCE_PARENT
|
||||
|
@@ -133,6 +133,66 @@ nodes {
|
||||
parent: "on_screen_input/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_input/on_screen_stick/root"
|
||||
parent: "on_screen_input/on_screen_stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_PIE
|
||||
id: "on_screen_input/on_screen_stick/background_mask"
|
||||
parent: "on_screen_input/on_screen_stick/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_input/on_screen_stick/background"
|
||||
parent: "on_screen_input/on_screen_stick/background_mask"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_input/on_screen_stick/stick_root"
|
||||
parent: "on_screen_input/on_screen_stick/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_input/on_screen_stick/stick_shadow"
|
||||
parent: "on_screen_input/on_screen_stick/stick_root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_input/on_screen_stick/stick"
|
||||
parent: "on_screen_input/on_screen_stick/stick_root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_input/on_screen_stick/dot_1"
|
||||
parent: "on_screen_input/on_screen_stick/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_input/on_screen_stick/dot_2"
|
||||
parent: "on_screen_input/on_screen_stick/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_input/on_screen_stick/dot_3"
|
||||
parent: "on_screen_input/on_screen_stick/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_input/on_screen_stick/dot_4"
|
||||
parent: "on_screen_input/on_screen_stick/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_input/on_screen_button"
|
||||
@@ -145,5 +205,23 @@ nodes {
|
||||
parent: "on_screen_input/on_screen_button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_input/button_action/button"
|
||||
parent: "on_screen_input/button_action"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "on_screen_input/button_action/text"
|
||||
parent: "on_screen_input/button_action/button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_input/button_action/icon"
|
||||
parent: "on_screen_input/button_action/button"
|
||||
template_node_child: true
|
||||
}
|
||||
material: "/builtins/materials/gui.material"
|
||||
adjust_reference: ADJUST_REFERENCE_PARENT
|
||||
|
@@ -22,6 +22,66 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_stick.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_stick/root"
|
||||
parent: "on_screen_stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_PIE
|
||||
id: "on_screen_stick/background_mask"
|
||||
parent: "on_screen_stick/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_stick/background"
|
||||
parent: "on_screen_stick/background_mask"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_stick/stick_root"
|
||||
parent: "on_screen_stick/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_stick/stick_shadow"
|
||||
parent: "on_screen_stick/stick_root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_stick/stick"
|
||||
parent: "on_screen_stick/stick_root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_stick/dot_1"
|
||||
parent: "on_screen_stick/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_stick/dot_2"
|
||||
parent: "on_screen_stick/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_stick/dot_3"
|
||||
parent: "on_screen_stick/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "on_screen_stick/dot_4"
|
||||
parent: "on_screen_stick/stick"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
x: 300.0
|
||||
@@ -43,5 +103,25 @@ nodes {
|
||||
inherit_alpha: true
|
||||
template: "/example/examples/gamepad/gamepad_tester/templates/gamepad_button.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_action/button"
|
||||
parent: "button_action"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "button_action/text"
|
||||
parent: "button_action/button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "button_action/icon"
|
||||
parent: "button_action/button"
|
||||
overridden_fields: 45
|
||||
template_node_child: true
|
||||
enabled: false
|
||||
}
|
||||
material: "/builtins/materials/gui.material"
|
||||
adjust_reference: ADJUST_REFERENCE_PARENT
|
||||
|
33
example/other/go_bindings/go_bindings.collection
Normal file
33
example/other/go_bindings/go_bindings.collection
Normal file
@@ -0,0 +1,33 @@
|
||||
name: "go_bindings"
|
||||
scale_along_z: 0
|
||||
embedded_instances {
|
||||
id: "go"
|
||||
data: "components {\n"
|
||||
" id: \"go_widget\"\n"
|
||||
" component: \"/example/other/go_bindings/go_widget.gui\"\n"
|
||||
"}\n"
|
||||
"components {\n"
|
||||
" id: \"go_bindings\"\n"
|
||||
" component: \"/example/other/go_bindings/go_bindings.script\"\n"
|
||||
"}\n"
|
||||
"embedded_components {\n"
|
||||
" id: \"sprite\"\n"
|
||||
" type: \"sprite\"\n"
|
||||
" data: \"default_animation: \\\"ui_circle_8\\\"\\n"
|
||||
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||
"textures {\\n"
|
||||
" sampler: \\\"texture_sampler\\\"\\n"
|
||||
" texture: \\\"/druid/druid.atlas\\\"\\n"
|
||||
"}\\n"
|
||||
"\"\n"
|
||||
" rotation {\n"
|
||||
" z: 0.70710677\n"
|
||||
" w: 0.70710677\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
""
|
||||
position {
|
||||
x: 776.0
|
||||
y: 366.0
|
||||
}
|
||||
}
|
25
example/other/go_bindings/go_bindings.script
Normal file
25
example/other/go_bindings/go_bindings.script
Normal file
@@ -0,0 +1,25 @@
|
||||
local panthera = require("panthera.panthera")
|
||||
|
||||
local animation = require("example.other.go_bindings.go_bindings_panthera")
|
||||
|
||||
local druid = require("druid.druid")
|
||||
local widget = require("example.other.go_bindings.go_widget")
|
||||
|
||||
function init(self)
|
||||
self.go_widget = druid.get_widget(widget, "#go_widget")
|
||||
self.go_widget:play_animation()
|
||||
self.go_widget:set_position(go.get_position())
|
||||
|
||||
self.animation = panthera.create_go(animation)
|
||||
panthera.play(self.animation, "default", {
|
||||
is_loop = true,
|
||||
})
|
||||
|
||||
msg.post(".", "acquire_input_focus")
|
||||
end
|
||||
|
||||
|
||||
function update(self, dt)
|
||||
self.go_widget:set_position(go.get_position())
|
||||
end
|
||||
|
79
example/other/go_bindings/go_bindings_panthera.lua
Normal file
79
example/other/go_bindings/go_bindings_panthera.lua
Normal file
@@ -0,0 +1,79 @@
|
||||
return {
|
||||
data = {
|
||||
animations = {
|
||||
{
|
||||
animation_id = "default",
|
||||
animation_keys = {
|
||||
{
|
||||
duration = 1.13,
|
||||
easing = "outback",
|
||||
end_value = 706,
|
||||
key_type = "tween",
|
||||
node_id = "go",
|
||||
property_id = "position_x",
|
||||
start_value = 776,
|
||||
},
|
||||
{
|
||||
duration = 1.46,
|
||||
easing = "outback",
|
||||
end_value = 271,
|
||||
key_type = "tween",
|
||||
node_id = "go",
|
||||
property_id = "position_y",
|
||||
start_time = 1.13,
|
||||
start_value = 366,
|
||||
},
|
||||
{
|
||||
duration = 1.44,
|
||||
easing = "outback",
|
||||
end_value = 826,
|
||||
key_type = "tween",
|
||||
node_id = "go",
|
||||
property_id = "position_x",
|
||||
start_time = 2.59,
|
||||
start_value = 706,
|
||||
},
|
||||
{
|
||||
duration = 1.17,
|
||||
easing = "outback",
|
||||
end_value = 366,
|
||||
key_type = "tween",
|
||||
node_id = "go",
|
||||
property_id = "position_y",
|
||||
start_time = 4.02,
|
||||
start_value = 271,
|
||||
},
|
||||
{
|
||||
duration = 0.81,
|
||||
easing = "outback",
|
||||
end_value = 776,
|
||||
key_type = "tween",
|
||||
node_id = "go",
|
||||
property_id = "position_x",
|
||||
start_time = 5.19,
|
||||
start_value = 826,
|
||||
},
|
||||
},
|
||||
duration = 6,
|
||||
},
|
||||
},
|
||||
metadata = {
|
||||
fps = 60,
|
||||
gizmo_steps = {
|
||||
},
|
||||
gui_path = "/example/other/go_bindings/go_bindings.collection",
|
||||
layers = {
|
||||
},
|
||||
settings = {
|
||||
font_size = 30,
|
||||
},
|
||||
template_animation_paths = {
|
||||
},
|
||||
},
|
||||
nodes = {
|
||||
},
|
||||
},
|
||||
format = "json",
|
||||
type = "animation_editor",
|
||||
version = 1,
|
||||
}
|
156
example/other/go_bindings/go_widget.gui
Normal file
156
example/other/go_bindings/go_widget.gui
Normal file
@@ -0,0 +1,156 @@
|
||||
script: "/druid/druid.gui_script"
|
||||
fonts {
|
||||
name: "druid_text_bold"
|
||||
font: "/druid/fonts/druid_text_bold.font"
|
||||
}
|
||||
textures {
|
||||
name: "druid"
|
||||
texture: "/druid/druid.atlas"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
texture: "druid/empty"
|
||||
id: "root"
|
||||
inherit_alpha: true
|
||||
size_mode: SIZE_MODE_AUTO
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
y: 20.0
|
||||
}
|
||||
size {
|
||||
x: 32.0
|
||||
y: 120.0
|
||||
}
|
||||
type: TYPE_BOX
|
||||
texture: "druid/ui_circle_32"
|
||||
id: "circle"
|
||||
pivot: PIVOT_S
|
||||
parent: "root"
|
||||
inherit_alpha: true
|
||||
slice9 {
|
||||
x: 16.0
|
||||
y: 16.0
|
||||
z: 16.0
|
||||
w: 16.0
|
||||
}
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
y: 190.0
|
||||
}
|
||||
size {
|
||||
x: 200.0
|
||||
y: 100.0
|
||||
}
|
||||
type: TYPE_TEXT
|
||||
text: "20"
|
||||
font: "druid_text_bold"
|
||||
id: "text"
|
||||
parent: "root"
|
||||
inherit_alpha: true
|
||||
outline_alpha: 0.0
|
||||
shadow_alpha: 0.0
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
x: 233.0
|
||||
y: 127.0
|
||||
}
|
||||
type: TYPE_TEMPLATE
|
||||
id: "memory_panel"
|
||||
inherit_alpha: true
|
||||
template: "/druid/widget/memory_panel/memory_panel.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "memory_panel/root"
|
||||
parent: "memory_panel"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEMPLATE
|
||||
id: "memory_panel/mini_graph"
|
||||
parent: "memory_panel/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "memory_panel/mini_graph/root"
|
||||
parent: "memory_panel/mini_graph"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "memory_panel/mini_graph/header"
|
||||
parent: "memory_panel/mini_graph/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "memory_panel/mini_graph/text_header"
|
||||
parent: "memory_panel/mini_graph/header"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "memory_panel/mini_graph/icon_drag"
|
||||
parent: "memory_panel/mini_graph/header"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "memory_panel/mini_graph/content"
|
||||
parent: "memory_panel/mini_graph/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "memory_panel/mini_graph/prefab_line"
|
||||
parent: "memory_panel/mini_graph/content"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "memory_panel/mini_graph/color_low"
|
||||
parent: "memory_panel/mini_graph/content"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
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
|
||||
}
|
||||
material: "/druid/materials/gui_world/gui_world.material"
|
||||
adjust_reference: ADJUST_REFERENCE_DISABLED
|
39
example/other/go_bindings/go_widget.lua
Normal file
39
example/other/go_bindings/go_widget.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
local panthera = require("panthera.panthera")
|
||||
|
||||
local animation = require("example.other.go_bindings.go_widget_panthera")
|
||||
local memory_panel = require("druid.widget.memory_panel.memory_panel")
|
||||
|
||||
---@class widget.go_widget: druid.widget
|
||||
local M = {}
|
||||
|
||||
|
||||
function M:init()
|
||||
print("init widget", msg.url())
|
||||
self.root = self:get_node("root")
|
||||
self.circle = self:get_node("circle")
|
||||
self.animation = panthera.create_gui(animation)
|
||||
self.counter = 0
|
||||
self.text_counter = self:get_node("text")
|
||||
gui.set_text(self.text_counter, 0)
|
||||
|
||||
self.memory_panel = self.druid:new_widget(memory_panel, "memory_panel")
|
||||
end
|
||||
|
||||
|
||||
function M:play_animation()
|
||||
panthera.play(self.animation, "default", {
|
||||
is_loop = true,
|
||||
callback = function()
|
||||
self.counter = self.counter + 1
|
||||
gui.set_text(self.text_counter, self.counter)
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
---@param position vector3 The position to set
|
||||
function M:set_position(position)
|
||||
gui.set_position(self.root, position)
|
||||
end
|
||||
|
||||
return M
|
186
example/other/go_bindings/go_widget_panthera.lua
Normal file
186
example/other/go_bindings/go_widget_panthera.lua
Normal file
@@ -0,0 +1,186 @@
|
||||
return {
|
||||
data = {
|
||||
animations = {
|
||||
{
|
||||
animation_id = "default",
|
||||
animation_keys = {
|
||||
{
|
||||
easing = "outsine",
|
||||
end_value = 1.6,
|
||||
key_type = "tween",
|
||||
node_id = "text",
|
||||
property_id = "scale_x",
|
||||
start_value = 1,
|
||||
},
|
||||
{
|
||||
easing = "outsine",
|
||||
end_value = 1.6,
|
||||
key_type = "tween",
|
||||
node_id = "text",
|
||||
property_id = "scale_y",
|
||||
start_value = 1,
|
||||
},
|
||||
{
|
||||
duration = 0.15,
|
||||
easing = "outsine",
|
||||
end_value = 1,
|
||||
key_type = "tween",
|
||||
node_id = "text",
|
||||
property_id = "scale_x",
|
||||
start_value = 1.6,
|
||||
},
|
||||
{
|
||||
duration = 0.15,
|
||||
easing = "outsine",
|
||||
end_value = 1,
|
||||
key_type = "tween",
|
||||
node_id = "text",
|
||||
property_id = "scale_y",
|
||||
start_value = 1.6,
|
||||
},
|
||||
{
|
||||
duration = 0.39,
|
||||
easing = "outsine",
|
||||
end_value = 400,
|
||||
key_type = "tween",
|
||||
node_id = "text",
|
||||
property_id = "position_y",
|
||||
start_value = 190,
|
||||
},
|
||||
{
|
||||
duration = 0.43,
|
||||
easing = "outsine",
|
||||
end_value = 300,
|
||||
key_type = "tween",
|
||||
node_id = "circle",
|
||||
property_id = "size_y",
|
||||
start_value = 120,
|
||||
},
|
||||
{
|
||||
duration = 1,
|
||||
easing = "inoutexpo",
|
||||
end_value = 720,
|
||||
key_type = "tween",
|
||||
node_id = "root",
|
||||
property_id = "rotation_z",
|
||||
},
|
||||
{
|
||||
duration = 0.24,
|
||||
easing = "outsine",
|
||||
end_value = 2,
|
||||
key_type = "tween",
|
||||
node_id = "text",
|
||||
property_id = "scale_x",
|
||||
start_time = 0.15,
|
||||
start_value = 1,
|
||||
},
|
||||
{
|
||||
duration = 0.24,
|
||||
easing = "outsine",
|
||||
end_value = 2,
|
||||
key_type = "tween",
|
||||
node_id = "text",
|
||||
property_id = "scale_y",
|
||||
start_time = 0.15,
|
||||
start_value = 1,
|
||||
},
|
||||
{
|
||||
duration = 0.3,
|
||||
easing = "outsine",
|
||||
key_type = "tween",
|
||||
node_id = "circle",
|
||||
property_id = "color_b",
|
||||
start_time = 0.31,
|
||||
start_value = 1,
|
||||
},
|
||||
{
|
||||
duration = 0.3,
|
||||
easing = "outsine",
|
||||
key_type = "tween",
|
||||
node_id = "circle",
|
||||
property_id = "color_g",
|
||||
start_time = 0.31,
|
||||
start_value = 1,
|
||||
},
|
||||
{
|
||||
duration = 0.61,
|
||||
easing = "outsine",
|
||||
end_value = 1,
|
||||
key_type = "tween",
|
||||
node_id = "text",
|
||||
property_id = "scale_x",
|
||||
start_time = 0.39,
|
||||
start_value = 2,
|
||||
},
|
||||
{
|
||||
duration = 0.61,
|
||||
easing = "outsine",
|
||||
end_value = 1,
|
||||
key_type = "tween",
|
||||
node_id = "text",
|
||||
property_id = "scale_y",
|
||||
start_time = 0.39,
|
||||
start_value = 2,
|
||||
},
|
||||
{
|
||||
duration = 0.26,
|
||||
easing = "insine",
|
||||
end_value = 1,
|
||||
key_type = "tween",
|
||||
node_id = "circle",
|
||||
property_id = "color_b",
|
||||
start_time = 0.61,
|
||||
},
|
||||
{
|
||||
duration = 0.26,
|
||||
easing = "insine",
|
||||
end_value = 1,
|
||||
key_type = "tween",
|
||||
node_id = "circle",
|
||||
property_id = "color_g",
|
||||
start_time = 0.61,
|
||||
},
|
||||
{
|
||||
duration = 0.36,
|
||||
easing = "outsine",
|
||||
end_value = 190,
|
||||
key_type = "tween",
|
||||
node_id = "text",
|
||||
property_id = "position_y",
|
||||
start_time = 0.62,
|
||||
start_value = 400,
|
||||
},
|
||||
{
|
||||
duration = 0.35,
|
||||
easing = "outsine",
|
||||
end_value = 120,
|
||||
key_type = "tween",
|
||||
node_id = "circle",
|
||||
property_id = "size_y",
|
||||
start_time = 0.65,
|
||||
start_value = 300,
|
||||
},
|
||||
},
|
||||
duration = 1,
|
||||
},
|
||||
},
|
||||
metadata = {
|
||||
fps = 60,
|
||||
gizmo_steps = {
|
||||
},
|
||||
gui_path = "/example/other/go_bindings/go_widget.gui",
|
||||
layers = {
|
||||
},
|
||||
settings = {
|
||||
font_size = 30,
|
||||
},
|
||||
template_animation_paths = {
|
||||
},
|
||||
},
|
||||
nodes = {
|
||||
},
|
||||
},
|
||||
format = "json",
|
||||
type = "animation_editor",
|
||||
version = 1,
|
||||
}
|
Reference in New Issue
Block a user