mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Add more widgets
This commit is contained in:
58
druid/widget/memory_panel/memory_panel.gui
Normal file
58
druid/widget/memory_panel/memory_panel.gui
Normal file
@@ -0,0 +1,58 @@
|
||||
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: "mini_graph"
|
||||
parent: "root"
|
||||
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_TEXT
|
||||
text: "Memory Panel"
|
||||
id: "mini_graph/text_header"
|
||||
parent: "mini_graph/root"
|
||||
overridden_fields: 8
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "mini_graph/icon_drag"
|
||||
parent: "mini_graph/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "mini_graph/panel_diagram"
|
||||
parent: "mini_graph/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "mini_graph/prefab_line"
|
||||
parent: "mini_graph/panel_diagram"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "mini_graph/text_value"
|
||||
parent: "mini_graph/root"
|
||||
template_node_child: true
|
||||
}
|
||||
material: "/builtins/materials/gui.material"
|
||||
adjust_reference: ADJUST_REFERENCE_PARENT
|
22
druid/widget/memory_panel/memory_panel.lua
Normal file
22
druid/widget/memory_panel/memory_panel.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
local mini_graph = require("druid.widget.mini_graph.mini_graph")
|
||||
|
||||
---@class widget.memory_panel: druid.widget
|
||||
---@field root node
|
||||
local M = {}
|
||||
|
||||
|
||||
function M:init()
|
||||
self.druid = self:get_druid()
|
||||
self.mini_graph = self.druid:new_widget(mini_graph, "mini_graph")
|
||||
|
||||
--for index = 1, 32 do
|
||||
-- self.mini_graph:set_line_value(index, 0)
|
||||
--end
|
||||
|
||||
timer.delay(0.1, true, function()
|
||||
self.mini_graph:push_line_value(math.random())
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
return M
|
Reference in New Issue
Block a user