mirror of
https://github.com/Insality/druid
synced 2025-06-27 18:37:45 +02:00
Update
This commit is contained in:
parent
ea80c874f6
commit
e8dbc097d0
@ -36,7 +36,7 @@ Here is a list of [all releases](https://github.com/Insality/druid/releases).
|
|||||||
|
|
||||||
### Input Bindings
|
### Input Bindings
|
||||||
|
|
||||||
**Druid** utilizes the `/builtins/input/all.input_binding` input bindings. For custom input bindings, refer to the Input Binding section in the **_[Advanced Setup](docs_md/advanced-setup.md#input-bindings)_**.
|
**Druid** utilizes the `/builtins/input/all.input_binding` input bindings. Either use this file for your project by setting the `Runtime -> Input -> Game Binding` field in the `game.project` input section to `/builtins/input/all.input_binding`, or add the specific bindings you need to your game's input binding file. For custom input bindings, refer to the Input Binding section in the [Advanced Setup](https://github.com/Insality/druid/blob/master/docs_md/advanced-setup.md#input-bindings).
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
@ -17,3 +17,4 @@ date,sha,version,build_size,build_time,platform,mode,is_cache_using,commits_coun
|
|||||||
2023-08-05T16:31:19Z,37fff52aa59feb20f761ef4d340d9f677743d54b,0.11.693,2456,43,js-web,release,true,693
|
2023-08-05T16:31:19Z,37fff52aa59feb20f761ef4d340d9f677743d54b,0.11.693,2456,43,js-web,release,true,693
|
||||||
2023-08-05T16:41:25Z,d7dd4a86b81d73d345ad7e136de9c2c488bc4d8b,0.11.694,2452,43,js-web,release,true,694
|
2023-08-05T16:41:25Z,d7dd4a86b81d73d345ad7e136de9c2c488bc4d8b,0.11.694,2452,43,js-web,release,true,694
|
||||||
2023-10-20T08:23:33Z,9132dc477b645d674ec21efbfcf85f48ef0ea8a6,0.11.718,2544,47,js-web,release,true,718
|
2023-10-20T08:23:33Z,9132dc477b645d674ec21efbfcf85f48ef0ea8a6,0.11.718,2544,47,js-web,release,true,718
|
||||||
|
2024-10-15T16:54:05Z,ea80c874f6c0ea175b317d01ac45c567db9179c7,0.11.0,1840,24,js-web,release,true,796
|
||||||
|
|
@ -500,3 +500,28 @@ Thanks to the my supporters:
|
|||||||
Please support me if you like this project! It will help me keep engaged to update **Druid** and make it even better!
|
Please support me if you like this project! It will help me keep engaged to update **Druid** and make it even better!
|
||||||
|
|
||||||
[](https://github.com/sponsors/insality) [](https://ko-fi.com/insality) [](https://www.buymeacoffee.com/insality)
|
[](https://github.com/sponsors/insality) [](https://ko-fi.com/insality) [](https://www.buymeacoffee.com/insality)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Druid 0.12.0
|
||||||
|
|
||||||
|
**Changelog 0.12.0**
|
||||||
|
- Remove `middleclass.lua`
|
||||||
|
- The Rich Text now applied to the text node instead of Rich Text Template (contained 3 nodes before - root, text and image prefabs)
|
||||||
|
- New Logo!
|
||||||
|
- New Example Page with 40+ examples
|
||||||
|
- Updated and fixed annotations
|
||||||
|
- Add `self:get_druid(template, nodes)` to escape the `self:set_template(template)` and `self:set_nodes(nodes)` calls
|
||||||
|
- Update Rich Input. Now with selection and cursor navigation. Updated Input settings for Druid
|
||||||
|
- Rework Data List. Now only works with Static Grid only. Now the Data List more stable with extended API.
|
||||||
|
- Add Cached Data List option. This used less memory (it's really much optimized) but requires uses the `on_add_element` and `on_remove_element` events to setup your nodes. All components should be the same class.
|
||||||
|
- Now user can tap from one text input area to another with one click. Before first tap is closed the focus on selected input.
|
||||||
|
- Removed Layout component. Add new Layout component what do a some different things. It's like Dynamic Grid but with more control and settings.
|
||||||
|
- Deprecated Dynamic Grid. Layout will be instead of it.
|
||||||
|
- Add touch param to Drag callbacks, it's much easier to add custom logic with knowledge of input action data.
|
||||||
|
- Add `scroll.view_size`, `scroll:set_view_size(size)` and `scroll:update_view_size()` functions to manage with current scroll input area and scroll visible part
|
||||||
|
- Add `grid:set_item_size(size)`, `grid:sort_nodes(comparator)` functions
|
||||||
|
- Seems adjust by height for multiline text is workings good now
|
||||||
|
- Extended Rich Input API
|
||||||
|
- More accurate scaling for progress bars fow images with slice9 params
|
||||||
|
- Fix several slider issues
|
||||||
|
@ -505,7 +505,7 @@ end
|
|||||||
--- Bind the grid component (Static or Dynamic) to recalculate
|
--- Bind the grid component (Static or Dynamic) to recalculate
|
||||||
-- scroll size on grid changes
|
-- scroll size on grid changes
|
||||||
-- @tparam Scroll self @{Scroll}
|
-- @tparam Scroll self @{Scroll}
|
||||||
-- @tparam StaticGrid|DynamicGrid grid Druid grid component
|
-- @tparam StaticGrid grid Druid grid component
|
||||||
-- @treturn druid.scroll Current scroll instance
|
-- @treturn druid.scroll Current scroll instance
|
||||||
function Scroll.bind_grid(self, grid)
|
function Scroll.bind_grid(self, grid)
|
||||||
if self._grid_on_change then
|
if self._grid_on_change then
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
-- @tfield Scroll scroll @{Scroll}
|
-- @tfield Scroll scroll @{Scroll}
|
||||||
|
|
||||||
--- The Druid Grid component
|
--- The Druid Grid component
|
||||||
-- @tfield StaticGrid|DynamicGrid grid @{StaticGrid}, @{DynamicGrid}
|
-- @tfield StaticGrid grid @{StaticGrid}, @{DynamicGrid}
|
||||||
|
|
||||||
--- The current progress of scroll posititon
|
--- The current progress of scroll posititon
|
||||||
-- @tfield number scroll_progress
|
-- @tfield number scroll_progress
|
||||||
@ -46,7 +46,7 @@ local DataList = component.create("data_list")
|
|||||||
--- The @{DataList} constructor
|
--- The @{DataList} constructor
|
||||||
-- @tparam DataList self @{DataList}
|
-- @tparam DataList self @{DataList}
|
||||||
-- @tparam Scroll scroll The @{Scroll} instance for Data List component
|
-- @tparam Scroll scroll The @{Scroll} instance for Data List component
|
||||||
-- @tparam StaticGrid|DynamicGrid grid The @{StaticGrid} or @{DynamicGrid} instance for Data List component
|
-- @tparam StaticGrid grid The @{StaticGrid} or @{DynamicGrid} instance for Data List component
|
||||||
-- @tparam function create_function The create function callback(self, data, index, data_list). Function should return (node, [component])
|
-- @tparam function create_function The create function callback(self, data, index, data_list). Function should return (node, [component])
|
||||||
function DataList.init(self, scroll, grid, create_function)
|
function DataList.init(self, scroll, grid, create_function)
|
||||||
self.scroll = scroll
|
self.scroll = scroll
|
||||||
|
@ -730,7 +730,7 @@ end
|
|||||||
--- Create @{DataList} component
|
--- Create @{DataList} component
|
||||||
-- @tparam DruidInstance self
|
-- @tparam DruidInstance self
|
||||||
-- @tparam Scroll druid_scroll The Scroll instance for Data List component
|
-- @tparam Scroll druid_scroll The Scroll instance for Data List component
|
||||||
-- @tparam StaticGrid|DynamicGrid druid_grid The @{StaticGrid} or @{DynamicGrid} instance for Data List component
|
-- @tparam StaticGrid druid_grid The @{StaticGrid} or @{DynamicGrid} instance for Data List component
|
||||||
-- @tparam function create_function The create function callback(self, data, index, data_list). Function should return (node, [component])
|
-- @tparam function create_function The create function callback(self, data, index, data_list). Function should return (node, [component])
|
||||||
-- @treturn DataList @{DataList} component
|
-- @treturn DataList @{DataList} component
|
||||||
function DruidInstance.new_data_list(self, druid_scroll, druid_grid, create_function)
|
function DruidInstance.new_data_list(self, druid_scroll, druid_grid, create_function)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -52,7 +52,7 @@ end
|
|||||||
local function setup_slider(self)
|
local function setup_slider(self)
|
||||||
local slider = self.druid:new_slider("slider_pin", vmath.vector3(95, 0, 0), function(_, value)
|
local slider = self.druid:new_slider("slider_pin", vmath.vector3(95, 0, 0), function(_, value)
|
||||||
gui.set_text(gui.get_node("text_progress_slider"), math.ceil(value * 100) .. "%")
|
gui.set_text(gui.get_node("text_progress_slider"), math.ceil(value * 100) .. "%")
|
||||||
end) --[[@as druid.slider]]
|
end)
|
||||||
|
|
||||||
slider:set(0.2)
|
slider:set(0.2)
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
script: ""
|
|
||||||
fonts {
|
fonts {
|
||||||
name: "game"
|
name: "game"
|
||||||
font: "/example/assets/fonts/game.font"
|
font: "/example/assets/fonts/game.font"
|
||||||
@ -7,423 +6,67 @@ textures {
|
|||||||
name: "kenney"
|
name: "kenney"
|
||||||
texture: "/example/assets/images/kenney.atlas"
|
texture: "/example/assets/images/kenney.atlas"
|
||||||
}
|
}
|
||||||
background_color {
|
|
||||||
x: 0.0
|
|
||||||
y: 0.0
|
|
||||||
z: 0.0
|
|
||||||
w: 0.0
|
|
||||||
}
|
|
||||||
nodes {
|
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 {
|
size {
|
||||||
x: 600.0
|
x: 600.0
|
||||||
y: 200.0
|
y: 200.0
|
||||||
z: 0.0
|
|
||||||
w: 1.0
|
|
||||||
}
|
|
||||||
color {
|
|
||||||
x: 1.0
|
|
||||||
y: 1.0
|
|
||||||
z: 1.0
|
|
||||||
w: 1.0
|
|
||||||
}
|
}
|
||||||
type: TYPE_BOX
|
type: TYPE_BOX
|
||||||
blend_mode: BLEND_MODE_ALPHA
|
|
||||||
texture: "kenney/empty"
|
texture: "kenney/empty"
|
||||||
id: "root"
|
id: "root"
|
||||||
xanchor: XANCHOR_NONE
|
|
||||||
yanchor: YANCHOR_NONE
|
|
||||||
pivot: PIVOT_N
|
pivot: PIVOT_N
|
||||||
adjust_mode: ADJUST_MODE_FIT
|
|
||||||
layer: ""
|
|
||||||
inherit_alpha: true
|
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
|
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
nodes {
|
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 {
|
scale {
|
||||||
x: 0.8
|
x: 0.8
|
||||||
y: 0.8
|
y: 0.8
|
||||||
z: 1.0
|
|
||||||
w: 1.0
|
|
||||||
}
|
}
|
||||||
size {
|
size {
|
||||||
x: 750.0
|
x: 750.0
|
||||||
y: 100.0
|
y: 100.0
|
||||||
z: 0.0
|
|
||||||
w: 1.0
|
|
||||||
}
|
}
|
||||||
color {
|
color {
|
||||||
x: 1.0
|
|
||||||
y: 1.0
|
|
||||||
z: 0.9411765
|
z: 0.9411765
|
||||||
w: 1.0
|
|
||||||
}
|
}
|
||||||
type: TYPE_TEXT
|
type: TYPE_TEXT
|
||||||
blend_mode: BLEND_MODE_ALPHA
|
|
||||||
text: "Here is simple example with text"
|
text: "Here is simple example with text"
|
||||||
font: "game"
|
font: "game"
|
||||||
id: "hint"
|
id: "hint"
|
||||||
xanchor: XANCHOR_NONE
|
|
||||||
yanchor: YANCHOR_NONE
|
|
||||||
pivot: PIVOT_N
|
pivot: PIVOT_N
|
||||||
outline {
|
outline {
|
||||||
x: 0.101960786
|
x: 0.101960786
|
||||||
y: 0.101960786
|
y: 0.101960786
|
||||||
z: 0.101960786
|
z: 0.101960786
|
||||||
w: 1.0
|
|
||||||
}
|
}
|
||||||
shadow {
|
shadow {
|
||||||
x: 1.0
|
x: 1.0
|
||||||
y: 1.0
|
y: 1.0
|
||||||
z: 1.0
|
z: 1.0
|
||||||
w: 1.0
|
|
||||||
}
|
}
|
||||||
adjust_mode: ADJUST_MODE_FIT
|
|
||||||
line_break: true
|
line_break: true
|
||||||
parent: "root"
|
parent: "root"
|
||||||
layer: ""
|
|
||||||
inherit_alpha: true
|
inherit_alpha: true
|
||||||
alpha: 1.0
|
|
||||||
outline_alpha: 0.7
|
outline_alpha: 0.7
|
||||||
shadow_alpha: 0.0
|
shadow_alpha: 0.0
|
||||||
template_node_child: false
|
|
||||||
text_leading: 1.0
|
|
||||||
text_tracking: 0.0
|
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
x: 0.0
|
|
||||||
y: -60.0
|
y: -60.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 {
|
size {
|
||||||
x: 600.0
|
x: 600.0
|
||||||
y: 130.0
|
y: 130.0
|
||||||
z: 0.0
|
|
||||||
w: 1.0
|
|
||||||
}
|
}
|
||||||
color {
|
color {
|
||||||
x: 1.0
|
|
||||||
y: 1.0
|
|
||||||
z: 0.9411765
|
z: 0.9411765
|
||||||
w: 1.0
|
|
||||||
}
|
}
|
||||||
type: TYPE_BOX
|
type: TYPE_BOX
|
||||||
blend_mode: BLEND_MODE_ALPHA
|
|
||||||
texture: ""
|
|
||||||
id: "area"
|
id: "area"
|
||||||
xanchor: XANCHOR_NONE
|
|
||||||
yanchor: YANCHOR_NONE
|
|
||||||
pivot: PIVOT_N
|
pivot: PIVOT_N
|
||||||
adjust_mode: ADJUST_MODE_FIT
|
|
||||||
parent: "root"
|
parent: "root"
|
||||||
layer: ""
|
|
||||||
inherit_alpha: true
|
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
|
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
}
|
|
||||||
nodes {
|
|
||||||
position {
|
|
||||||
x: 0.0
|
|
||||||
y: -65.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
|
|
||||||
z: 0.0
|
|
||||||
w: 1.0
|
|
||||||
}
|
|
||||||
color {
|
|
||||||
x: 1.0
|
|
||||||
y: 1.0
|
|
||||||
z: 1.0
|
|
||||||
w: 1.0
|
|
||||||
}
|
|
||||||
type: TYPE_TEMPLATE
|
|
||||||
id: "rich_text"
|
|
||||||
parent: "area"
|
|
||||||
layer: ""
|
|
||||||
inherit_alpha: true
|
|
||||||
alpha: 1.0
|
|
||||||
template: "/druid/custom/rich_text/rich_text.gui"
|
|
||||||
template_node_child: false
|
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
}
|
|
||||||
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: 130.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: ""
|
|
||||||
id: "rich_text/root"
|
|
||||||
xanchor: XANCHOR_NONE
|
|
||||||
yanchor: YANCHOR_NONE
|
|
||||||
pivot: PIVOT_CENTER
|
|
||||||
adjust_mode: ADJUST_MODE_FIT
|
|
||||||
parent: "rich_text"
|
|
||||||
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
|
|
||||||
overridden_fields: 4
|
|
||||||
template_node_child: true
|
|
||||||
size_mode: SIZE_MODE_MANUAL
|
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: false
|
|
||||||
}
|
|
||||||
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: 300.0
|
|
||||||
y: 60.0
|
|
||||||
z: 0.0
|
|
||||||
w: 1.0
|
|
||||||
}
|
|
||||||
color {
|
|
||||||
x: 0.2
|
|
||||||
y: 0.2
|
|
||||||
z: 0.2
|
|
||||||
w: 1.0
|
|
||||||
}
|
|
||||||
type: TYPE_TEXT
|
|
||||||
blend_mode: BLEND_MODE_ALPHA
|
|
||||||
text: "Rich text"
|
|
||||||
font: "game"
|
|
||||||
id: "rich_text/text_prefab"
|
|
||||||
xanchor: XANCHOR_NONE
|
|
||||||
yanchor: YANCHOR_NONE
|
|
||||||
pivot: PIVOT_CENTER
|
|
||||||
outline {
|
|
||||||
x: 0.0
|
|
||||||
y: 0.0
|
|
||||||
z: 0.0
|
|
||||||
w: 1.0
|
|
||||||
}
|
|
||||||
shadow {
|
|
||||||
x: 0.0
|
|
||||||
y: 0.0
|
|
||||||
z: 0.0
|
|
||||||
w: 1.0
|
|
||||||
}
|
|
||||||
adjust_mode: ADJUST_MODE_FIT
|
|
||||||
line_break: true
|
|
||||||
parent: "rich_text/root"
|
|
||||||
layer: ""
|
|
||||||
inherit_alpha: true
|
|
||||||
alpha: 1.0
|
|
||||||
outline_alpha: 0.0
|
|
||||||
shadow_alpha: 0.0
|
|
||||||
overridden_fields: 1
|
|
||||||
overridden_fields: 4
|
|
||||||
overridden_fields: 5
|
|
||||||
overridden_fields: 14
|
|
||||||
overridden_fields: 18
|
|
||||||
template_node_child: true
|
|
||||||
text_leading: 1.0
|
|
||||||
text_tracking: 0.0
|
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
}
|
|
||||||
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
|
|
||||||
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: "items/checkmark"
|
|
||||||
id: "rich_text/icon_prefab"
|
|
||||||
xanchor: XANCHOR_NONE
|
|
||||||
yanchor: YANCHOR_NONE
|
|
||||||
pivot: PIVOT_CENTER
|
|
||||||
adjust_mode: ADJUST_MODE_FIT
|
|
||||||
parent: "rich_text/root"
|
|
||||||
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: true
|
|
||||||
size_mode: SIZE_MODE_AUTO
|
|
||||||
custom_type: 0
|
|
||||||
enabled: true
|
|
||||||
visible: true
|
|
||||||
}
|
}
|
||||||
material: "/builtins/materials/gui.material"
|
material: "/builtins/materials/gui.material"
|
||||||
adjust_reference: ADJUST_REFERENCE_PARENT
|
adjust_reference: ADJUST_REFERENCE_PARENT
|
||||||
max_nodes: 512
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
[bootstrap]
|
[bootstrap]
|
||||||
main_collection = /example/example.collectionc
|
main_collection = /test/test.collectionc
|
||||||
|
|
||||||
[script]
|
[script]
|
||||||
shared_state = 1
|
shared_state = 1
|
||||||
|
@ -63,7 +63,7 @@ return function()
|
|||||||
assert(on_long_click_mock.calls == 0)
|
assert(on_long_click_mock.calls == 0)
|
||||||
|
|
||||||
druid:on_input(mock_input.click_pressed(10, 10))
|
druid:on_input(mock_input.click_pressed(10, 10))
|
||||||
mock_time.elapse(0.5)
|
mock_time.elapse(1)
|
||||||
druid:on_input(mock_input.click_released(20, 10))
|
druid:on_input(mock_input.click_released(20, 10))
|
||||||
|
|
||||||
assert(on_click_mock.calls == 1)
|
assert(on_click_mock.calls == 1)
|
||||||
@ -144,14 +144,15 @@ return function()
|
|||||||
instance.on_hold_callback:subscribe(on_hold_callback)
|
instance.on_hold_callback:subscribe(on_hold_callback)
|
||||||
|
|
||||||
druid:on_input(mock_input.click_pressed(10, 10))
|
druid:on_input(mock_input.click_pressed(10, 10))
|
||||||
mock_time.elapse(0.5) -- time between hold treshold and autorelease hold time
|
mock_time.elapse(1) -- time between hold treshold and autorelease hold time
|
||||||
druid:on_input(mock_input.click_repeated(10, 10))
|
druid:on_input(mock_input.input_empty(10, 10))
|
||||||
|
|
||||||
|
pprint(on_long_click_mock)
|
||||||
assert(on_click_mock.calls == 0)
|
assert(on_click_mock.calls == 0)
|
||||||
assert(on_hold_callback_mock.calls == 1)
|
assert(on_long_click_mock.calls == 1)
|
||||||
assert(on_hold_callback_mock.params[1] == context)
|
assert(on_long_click_mock.params[1] == context)
|
||||||
assert(on_hold_callback_mock.params[2] == button_params)
|
assert(on_long_click_mock.params[2] == button_params)
|
||||||
assert(on_hold_callback_mock.params[3] == instance)
|
assert(on_long_click_mock.params[3] == instance)
|
||||||
|
|
||||||
druid:on_input(mock_input.click_released(10, 10))
|
druid:on_input(mock_input.click_released(10, 10))
|
||||||
|
|
||||||
@ -257,8 +258,8 @@ return function()
|
|||||||
instance:set_enabled(false)
|
instance:set_enabled(false)
|
||||||
local is_clicked_pressed = druid:on_input(mock_input.click_pressed(10, 10))
|
local is_clicked_pressed = druid:on_input(mock_input.click_pressed(10, 10))
|
||||||
local is_clicked_released = druid:on_input(mock_input.click_released(10, 10))
|
local is_clicked_released = druid:on_input(mock_input.click_released(10, 10))
|
||||||
assert(is_clicked_pressed == false)
|
assert(is_clicked_pressed == true)
|
||||||
assert(is_clicked_released == false)
|
assert(is_clicked_released == true)
|
||||||
assert(on_click_mock.calls == 0)
|
assert(on_click_mock.calls == 0)
|
||||||
assert(instance:is_enabled() == false)
|
assert(instance:is_enabled() == false)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user