Update grid example

This commit is contained in:
Insality 2020-09-28 22:11:09 +03:00
parent 67b43ca800
commit e00ab4f0a1
2 changed files with 542 additions and 248 deletions

View File

@ -37,9 +37,9 @@ local text = require("druid.base.text")
local checkbox = require("druid.extended.checkbox") local checkbox = require("druid.extended.checkbox")
local checkbox_group = require("druid.extended.checkbox_group") local checkbox_group = require("druid.extended.checkbox_group")
local dynamic_grid = require("druid.base.dynamic_grid") local dynamic_grid = require("druid.extended.dynamic_grid")
local input = require("druid.extended.input") local input = require("druid.extended.input")
local lang_text = require("druid.base.lang_text") local lang_text = require("druid.extended.lang_text")
local progress = require("druid.extended.progress") local progress = require("druid.extended.progress")
local radio_group = require("druid.extended.radio_group") local radio_group = require("druid.extended.radio_group")
local slider = require("druid.extended.slider") local slider = require("druid.extended.slider")

View File

@ -9659,7 +9659,7 @@ nodes {
} }
size { size {
x: 600.0 x: 600.0
y: 1800.0 y: 2000.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -9693,6 +9693,125 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_MANUAL size_mode: SIZE_MODE_MANUAL
} }
nodes {
position {
x: 0.0
y: -190.0
z: 0.0
w: 1.0
}
rotation {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
scale {
x: 0.6
y: 0.6
z: 1.0
w: 1.0
}
size {
x: 700.0
y: 200.0
z: 0.0
w: 1.0
}
color {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
type: TYPE_TEXT
blend_mode: BLEND_MODE_ALPHA
text: "Tap on node for remove\n"
"Long tap on node for remove without node shift"
font: "game"
id: "text_grid_hint"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_CENTER
outline {
x: 1.0
y: 1.0
z: 1.0
w: 1.0
}
shadow {
x: 1.0
y: 1.0
z: 1.0
w: 1.0
}
adjust_mode: ADJUST_MODE_FIT
line_break: true
parent: "grid_page_content"
layer: ""
inherit_alpha: true
alpha: 1.0
outline_alpha: 0.0
shadow_alpha: 0.0
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
}
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: 1.0
y: 1.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: "info_grid_static"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_CENTER
adjust_mode: ADJUST_MODE_FIT
parent: "grid_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_AUTO
}
nodes { nodes {
position { position {
x: 0.0 x: 0.0
@ -9732,7 +9851,7 @@ nodes {
yanchor: YANCHOR_NONE yanchor: YANCHOR_NONE
pivot: PIVOT_N pivot: PIVOT_N
adjust_mode: ADJUST_MODE_FIT adjust_mode: ADJUST_MODE_FIT
parent: "grid_page_content" parent: "info_grid_static"
layer: "" layer: ""
inherit_alpha: true inherit_alpha: true
slice9 { slice9 {
@ -9836,7 +9955,7 @@ nodes {
} }
type: TYPE_TEMPLATE type: TYPE_TEMPLATE
id: "button_add" id: "button_add"
parent: "grid_page_content" parent: "info_grid_static"
layer: "" layer: ""
inherit_alpha: true inherit_alpha: true
alpha: 1.0 alpha: 1.0
@ -9995,7 +10114,7 @@ nodes {
} }
type: TYPE_TEMPLATE type: TYPE_TEMPLATE
id: "button_clear" id: "button_clear"
parent: "grid_page_content" parent: "info_grid_static"
layer: "" layer: ""
inherit_alpha: true inherit_alpha: true
alpha: 1.0 alpha: 1.0
@ -10160,7 +10279,7 @@ nodes {
yanchor: YANCHOR_NONE yanchor: YANCHOR_NONE
pivot: PIVOT_CENTER pivot: PIVOT_CENTER
adjust_mode: ADJUST_MODE_FIT adjust_mode: ADJUST_MODE_FIT
parent: "grid_page_content" parent: "info_grid_static"
layer: "" layer: ""
inherit_alpha: true inherit_alpha: true
slice9 { slice9 {
@ -10297,7 +10416,127 @@ nodes {
nodes { nodes {
position { position {
x: 0.0 x: 0.0
y: -1320.0 y: -853.0
z: 0.0
w: 1.0
}
rotation {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
scale {
x: 0.6
y: 0.6
z: 1.0
w: 1.0
}
size {
x: 800.0
y: 200.0
z: 0.0
w: 1.0
}
color {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
type: TYPE_TEXT
blend_mode: BLEND_MODE_ALPHA
text: "This Dynamic Grid have pivot on South\n"
"\n"
"Nodes closer to the bottom, like in message app"
font: "game"
id: "text_grid_hint1"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_CENTER
outline {
x: 1.0
y: 1.0
z: 1.0
w: 1.0
}
shadow {
x: 1.0
y: 1.0
z: 1.0
w: 1.0
}
adjust_mode: ADJUST_MODE_FIT
line_break: true
parent: "grid_page_content"
layer: ""
inherit_alpha: true
alpha: 1.0
outline_alpha: 0.0
shadow_alpha: 0.0
template_node_child: false
text_leading: 0.7
text_tracking: 0.0
}
nodes {
position {
x: 0.0
y: -935.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: 1.0
y: 1.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: "info_grid_dynamic"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_CENTER
adjust_mode: ADJUST_MODE_FIT
parent: "grid_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_AUTO
}
nodes {
position {
x: 0.0
y: -567.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -10333,7 +10572,7 @@ nodes {
yanchor: YANCHOR_NONE yanchor: YANCHOR_NONE
pivot: PIVOT_S pivot: PIVOT_S
adjust_mode: ADJUST_MODE_FIT adjust_mode: ADJUST_MODE_FIT
parent: "grid_page_content" parent: "info_grid_dynamic"
layer: "" layer: ""
inherit_alpha: true inherit_alpha: true
slice9 { slice9 {
@ -10407,7 +10646,7 @@ nodes {
nodes { nodes {
position { position {
x: 0.0 x: 0.0
y: -864.0 y: -111.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -10443,172 +10682,7 @@ nodes {
yanchor: YANCHOR_NONE yanchor: YANCHOR_NONE
pivot: PIVOT_CENTER pivot: PIVOT_CENTER
adjust_mode: ADJUST_MODE_FIT adjust_mode: ADJUST_MODE_FIT
parent: "grid_page_content" parent: "info_grid_dynamic"
layer: ""
inherit_alpha: true
slice9 {
x: 20.0
y: 20.0
z: 20.0
w: 20.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: -250.0
y: -1464.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: 500.0
y: 100.0
z: 0.0
w: 1.0
}
color {
x: 0.9019608
y: 0.9019608
z: 0.7019608
w: 1.0
}
type: TYPE_BOX
blend_mode: BLEND_MODE_ALPHA
texture: ""
id: "grid_dynamic_hor_view"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_W
adjust_mode: ADJUST_MODE_FIT
parent: "grid_page_content"
layer: ""
inherit_alpha: true
slice9 {
x: 0.0
y: 0.0
z: 0.0
w: 0.0
}
clipping_mode: CLIPPING_MODE_STENCIL
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: 500.0
y: 100.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_dynamic_hor_nodes"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_W
adjust_mode: ADJUST_MODE_FIT
parent: "grid_dynamic_hor_view"
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: -1473.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: 100.0
y: 80.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/button_red"
id: "grid_dynamic_hor_prefab"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_CENTER
adjust_mode: ADJUST_MODE_FIT
parent: "grid_page_content"
layer: "" layer: ""
inherit_alpha: true inherit_alpha: true
slice9 { slice9 {
@ -10627,7 +10701,7 @@ nodes {
nodes { nodes {
position { position {
x: -60.0 x: -60.0
y: -784.0 y: -31.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -10657,7 +10731,7 @@ nodes {
} }
type: TYPE_TEMPLATE type: TYPE_TEMPLATE
id: "button_add_start_dynamic" id: "button_add_start_dynamic"
parent: "grid_page_content" parent: "info_grid_dynamic"
layer: "" layer: ""
inherit_alpha: true inherit_alpha: true
alpha: 1.0 alpha: 1.0
@ -10786,7 +10860,7 @@ nodes {
nodes { nodes {
position { position {
x: 60.0 x: 60.0
y: -784.0 y: -31.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -10816,7 +10890,7 @@ nodes {
} }
type: TYPE_TEMPLATE type: TYPE_TEMPLATE
id: "button_add_end_dynamic" id: "button_add_end_dynamic"
parent: "grid_page_content" parent: "info_grid_dynamic"
layer: "" layer: ""
inherit_alpha: true inherit_alpha: true
alpha: 1.0 alpha: 1.0
@ -10942,10 +11016,294 @@ nodes {
text_leading: 1.0 text_leading: 1.0
text_tracking: 0.0 text_tracking: 0.0
} }
nodes {
position {
x: 0.0
y: -1583.0
z: 0.0
w: 1.0
}
rotation {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
scale {
x: 0.6
y: 0.6
z: 1.0
w: 1.0
}
size {
x: 700.0
y: 200.0
z: 0.0
w: 1.0
}
color {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
type: TYPE_TEXT
blend_mode: BLEND_MODE_ALPHA
text: "Horizontal Dynamic Grid Example\n"
"Pivot point at West"
font: "game"
id: "text_grid_hint2"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_CENTER
outline {
x: 1.0
y: 1.0
z: 1.0
w: 1.0
}
shadow {
x: 1.0
y: 1.0
z: 1.0
w: 1.0
}
adjust_mode: ADJUST_MODE_FIT
line_break: true
parent: "grid_page_content"
layer: ""
inherit_alpha: true
alpha: 1.0
outline_alpha: 0.0
shadow_alpha: 0.0
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
}
nodes {
position {
x: 0.0
y: -1637.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: 1.0
y: 1.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: "info_grid_dynamic_hor"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_CENTER
adjust_mode: ADJUST_MODE_FIT
parent: "grid_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_AUTO
}
nodes {
position {
x: -250.0
y: -126.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: 500.0
y: 100.0
z: 0.0
w: 1.0
}
color {
x: 0.9019608
y: 0.9019608
z: 0.7019608
w: 1.0
}
type: TYPE_BOX
blend_mode: BLEND_MODE_ALPHA
texture: ""
id: "grid_dynamic_hor_view"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_W
adjust_mode: ADJUST_MODE_FIT
parent: "info_grid_dynamic_hor"
layer: ""
inherit_alpha: true
slice9 {
x: 0.0
y: 0.0
z: 0.0
w: 0.0
}
clipping_mode: CLIPPING_MODE_STENCIL
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: 500.0
y: 100.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_dynamic_hor_nodes"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_W
adjust_mode: ADJUST_MODE_FIT
parent: "grid_dynamic_hor_view"
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: -135.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: 100.0
y: 80.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/button_red"
id: "grid_dynamic_hor_prefab"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_CENTER
adjust_mode: ADJUST_MODE_FIT
parent: "info_grid_dynamic_hor"
layer: ""
inherit_alpha: true
slice9 {
x: 20.0
y: 20.0
z: 20.0
w: 20.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 { nodes {
position { position {
x: -60.0 x: -60.0
y: -1375.0 y: -37.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -10975,7 +11333,7 @@ nodes {
} }
type: TYPE_TEMPLATE type: TYPE_TEMPLATE
id: "button_add_start_dynamic_hor" id: "button_add_start_dynamic_hor"
parent: "grid_page_content" parent: "info_grid_dynamic_hor"
layer: "" layer: ""
inherit_alpha: true inherit_alpha: true
alpha: 1.0 alpha: 1.0
@ -11104,7 +11462,7 @@ nodes {
nodes { nodes {
position { position {
x: 60.0 x: 60.0
y: -1375.0 y: -37.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -11134,7 +11492,7 @@ nodes {
} }
type: TYPE_TEMPLATE type: TYPE_TEMPLATE
id: "button_add_end_dynamic_hor" id: "button_add_end_dynamic_hor"
parent: "grid_page_content" parent: "info_grid_dynamic_hor"
layer: "" layer: ""
inherit_alpha: true inherit_alpha: true
alpha: 1.0 alpha: 1.0
@ -11260,70 +11618,6 @@ nodes {
text_leading: 1.0 text_leading: 1.0
text_tracking: 0.0 text_tracking: 0.0
} }
nodes {
position {
x: -200.0
y: -180.0
z: 0.0
w: 1.0
}
rotation {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
scale {
x: 0.75
y: 0.75
z: 1.0
w: 1.0
}
size {
x: 533.33
y: 200.0
z: 0.0
w: 1.0
}
color {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
type: TYPE_TEXT
blend_mode: BLEND_MODE_ALPHA
text: "Tap on node for remove\n"
"Long tap on node for remove without node shift"
font: "game"
id: "text_grid_hint"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_W
outline {
x: 1.0
y: 1.0
z: 1.0
w: 1.0
}
shadow {
x: 1.0
y: 1.0
z: 1.0
w: 1.0
}
adjust_mode: ADJUST_MODE_FIT
line_break: true
parent: "grid_page_content"
layer: ""
inherit_alpha: true
alpha: 1.0
outline_alpha: 0.0
shadow_alpha: 0.0
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
}
nodes { nodes {
position { position {
x: 0.0 x: 0.0