mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Update example with new brand one
This commit is contained in:
21
example/examples/basic/scroll/scroll.lua
Normal file
21
example/examples/basic/scroll/scroll.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
local component = require("druid.component")
|
||||
|
||||
---@class scroll: druid.base_component
|
||||
---@field root node
|
||||
---@field scroll druid.scroll
|
||||
---@field druid druid_instance
|
||||
local M = component.create("scroll")
|
||||
|
||||
---@param template string
|
||||
---@param nodes table<hash, node>
|
||||
function M:init(template, nodes)
|
||||
self.druid = self:get_druid(template, nodes)
|
||||
|
||||
self.scroll = self.druid:new_scroll("scroll_view", "scroll_content")
|
||||
|
||||
self.button_tutorial = self.druid:new_button("button_tutorial/root")
|
||||
self.button_stencil = self.druid:new_button("button_stencil/root")
|
||||
end
|
||||
|
||||
|
||||
return M
|
Reference in New Issue
Block a user