mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 10:02:18 +02:00
Replace event with event library
This commit is contained in:
@@ -59,7 +59,15 @@ function M.get_examples()
|
||||
template = "example_memory_panel",
|
||||
root = "example_memory_panel/root",
|
||||
code_url = "example/examples/widgets/memory_panel/example_memory_panel.lua",
|
||||
component_class = require("example.examples.widgets.memory_panel.example_memory_panel"),
|
||||
widget_class = require("example.examples.widgets.memory_panel.example_memory_panel"),
|
||||
},
|
||||
{
|
||||
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"),
|
||||
},
|
||||
}
|
||||
end
|
||||
|
104
example/examples/widgets/fps_panel/example_fps_panel.gui
Normal file
104
example/examples/widgets/fps_panel/example_fps_panel.gui
Normal file
@@ -0,0 +1,104 @@
|
||||
nodes {
|
||||
size {
|
||||
x: 200.0
|
||||
y: 100.0
|
||||
}
|
||||
type: TYPE_BOX
|
||||
id: "root"
|
||||
inherit_alpha: true
|
||||
size_mode: SIZE_MODE_AUTO
|
||||
visible: false
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEMPLATE
|
||||
id: "memory_panel"
|
||||
parent: "root"
|
||||
inherit_alpha: true
|
||||
template: "/druid/widget/fps_panel/fps_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_min_fps"
|
||||
parent: "memory_panel/content"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "memory_panel/text_fps"
|
||||
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
|
||||
}
|
||||
material: "/builtins/materials/gui.material"
|
||||
adjust_reference: ADJUST_REFERENCE_PARENT
|
12
example/examples/widgets/fps_panel/example_fps_panel.lua
Normal file
12
example/examples/widgets/fps_panel/example_fps_panel.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
local fps_panel = require("druid.widget.fps_panel.fps_panel")
|
||||
|
||||
---@class widget.example_fps_panel: druid.widget
|
||||
local M = {}
|
||||
|
||||
|
||||
function M:init()
|
||||
self.fps_panel = self.druid:new_widget(fps_panel, "fps_panel")
|
||||
end
|
||||
|
||||
|
||||
return M
|
Reference in New Issue
Block a user