mirror of
https://github.com/Insality/druid.git
synced 2025-09-28 02:22:18 +02:00
Add more scroll examples
This commit is contained in:
@@ -1,8 +1,31 @@
|
||||
local M = {}
|
||||
|
||||
|
||||
local function init_grid(self)
|
||||
local prefab = gui.get_node("grid_prefab")
|
||||
|
||||
|
||||
local grid = self.druid:new_grid("grid_content", "grid_prefab", 20)
|
||||
grid:set_anchor(vmath.vector3(0, 0.5, 0))
|
||||
grid:set_offset(vmath.vector3(15, 100, 0))
|
||||
|
||||
for i = 1, 40 do
|
||||
local clone_prefab = gui.clone_tree(prefab)
|
||||
|
||||
grid:add(clone_prefab["grid_prefab"])
|
||||
gui.set_text(clone_prefab["grid_prefab_text"], "Node " .. i)
|
||||
end
|
||||
|
||||
gui.set_enabled(prefab, false)
|
||||
local grid_scroll = self.druid:new_scroll("grid_content", "scroll_with_grid_size")
|
||||
grid_scroll:set_border(grid:get_size())
|
||||
end
|
||||
|
||||
|
||||
function M.setup_page(self)
|
||||
self.druid:new_scroll("scroll_page_content", "scroll_page")
|
||||
self.druid:new_scroll("simple_scroll_content", "simple_scroll_input")
|
||||
init_grid(self)
|
||||
end
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user