mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
Add clickable scroll nodes
This commit is contained in:
parent
2ec192d0f5
commit
296bf3dc2f
@ -5651,6 +5651,61 @@ nodes {
|
||||
z: 1.0
|
||||
w: 1.0
|
||||
}
|
||||
size {
|
||||
x: 240.0
|
||||
y: 150.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
color {
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
z: 1.0
|
||||
w: 1.0
|
||||
}
|
||||
type: TYPE_BOX
|
||||
blend_mode: BLEND_MODE_ALPHA
|
||||
texture: "kenney/empty"
|
||||
id: "grid_prefab"
|
||||
xanchor: XANCHOR_NONE
|
||||
yanchor: YANCHOR_NONE
|
||||
pivot: PIVOT_CENTER
|
||||
adjust_mode: ADJUST_MODE_FIT
|
||||
parent: "scroll_page_content"
|
||||
layer: ""
|
||||
inherit_alpha: true
|
||||
slice9 {
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
z: 0.0
|
||||
w: 0.0
|
||||
}
|
||||
clipping_mode: CLIPPING_MODE_NONE
|
||||
clipping_visible: true
|
||||
clipping_inverted: false
|
||||
alpha: 1.0
|
||||
template_node_child: false
|
||||
size_mode: SIZE_MODE_MANUAL
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
rotation {
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
scale {
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
z: 1.0
|
||||
w: 1.0
|
||||
}
|
||||
size {
|
||||
x: 200.0
|
||||
y: 100.0
|
||||
@ -5666,12 +5721,12 @@ nodes {
|
||||
type: TYPE_BOX
|
||||
blend_mode: BLEND_MODE_ALPHA
|
||||
texture: "kenney/button_blue"
|
||||
id: "grid_prefab"
|
||||
id: "grid_button"
|
||||
xanchor: XANCHOR_NONE
|
||||
yanchor: YANCHOR_NONE
|
||||
pivot: PIVOT_CENTER
|
||||
adjust_mode: ADJUST_MODE_FIT
|
||||
parent: "scroll_page_content"
|
||||
parent: "grid_prefab"
|
||||
layer: ""
|
||||
inherit_alpha: true
|
||||
slice9 {
|
||||
@ -5740,7 +5795,7 @@ nodes {
|
||||
}
|
||||
adjust_mode: ADJUST_MODE_FIT
|
||||
line_break: false
|
||||
parent: "grid_prefab"
|
||||
parent: "grid_button"
|
||||
layer: ""
|
||||
inherit_alpha: true
|
||||
alpha: 1.0
|
||||
|
@ -4,16 +4,16 @@ 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)
|
||||
|
||||
self.druid:new_button(clone_prefab["grid_button"])
|
||||
end
|
||||
|
||||
gui.set_enabled(prefab, false)
|
||||
|
Loading…
x
Reference in New Issue
Block a user