Compare commits

...

696 Commits

Author SHA1 Message Date
Insality
616c513fbd Use tagged releases of dependencies 2025-06-19 20:28:45 +03:00
Insality
61111536a8 Release 1.1.4 2025-05-20 00:51:34 +03:00
Maksim Tuprikov
b5d2f313cc
Merge pull request #312 from polivanni/master
Reset width and leading of the reusable table TEXT_METRICS_OPTIONS by default
2025-05-20 00:50:09 +03:00
Ivan Polovyi
d0067e5496 Reset width and leading of the reusable table TEXT_METRICS_OPTIONS by default 2025-05-18 23:33:40 +03:00
Insality
58f14d0a64 Return hack to keep cloned node_ids consistent 2025-05-13 21:43:05 +03:00
Insality
6572da3b14 Release 1.1.2 2025-05-07 23:54:30 +03:00
Insality
d7c26358a0 Fix for data list element amounts issue 2025-05-07 21:43:48 +03:00
Maksim Tuprikov
f007a28ab7
Merge pull request #310 from rigo128/example_data_list_matrix_basic
Add data_list_matrix_basic example
2025-05-07 18:50:53 +03:00
Yury Grigoryev
d98c3c2ef1 Add data_list_matrix_basic example 2025-05-07 17:07:58 +03:00
Insality
c87f1331ed Release 1.1.1 2025-05-05 21:33:32 +03:00
Maksim Tuprikov
efc38672c9
Merge pull request #309 from astrochili/container-max-size
Added `max_size_x` and `max_size_y` to `container`
2025-05-05 21:31:59 +03:00
Roman Silin
df516a08c6 Added max_size_x and max_size_y to container 2025-05-05 20:48:51 +03:00
Insality
a2b273762d Add on_change_value to input property widget 2025-05-02 13:36:36 +03:00
Insality
2b68117527 Update properties API docs 2025-05-02 12:53:32 +03:00
Insality
336694cd1d Update docs 2025-04-26 12:42:30 +03:00
Insality
4f8be6ebdb Return live example files 2025-04-26 12:19:37 +03:00
Insality
fc9706774f Removed example to change case of filenames 2025-04-26 12:19:10 +03:00
Maksim Tuprikov
423a523903
Merge pull request #300 from Insality/develop
Release 1.1.0
2025-04-26 12:09:37 +03:00
Insality
6d7556b5a0 Update live example 2025-04-26 12:07:28 +03:00
Insality
9fe8763c7f Update changelog MD 2025-04-26 12:00:10 +03:00
Insality
89595b022a Merge branch 'master' into develop 2025-04-26 11:57:18 +03:00
Insality
6d0a853d41 Update 2025-04-26 11:55:57 +03:00
Insality
ec39242fb1 Update docs 2025-04-25 20:53:58 +03:00
Insality
6795934a1f Update docs, add Editor script: Create Druid GUI Script, add simple using widgets example 2025-04-25 20:37:00 +03:00
Maksim Tuprikov
db8cdc1650
Merge pull request #305 from boruok/fix-remove-link 2025-04-25 16:43:53 +03:00
Alexandr Xenofontov
52ffca53e3 fix link 2025-04-25 22:40:35 +09:00
Insality
749666a4a5 Update with container examples 2025-04-25 01:13:04 +03:00
Insality
8155d649ab Fix for drag end touch fro mobule, update contributing, update input examples to make better for mobile (move up) 2025-04-24 23:46:39 +03:00
Insality
4e71fee9ba Add Bind layout and hotkey node bind 2025-04-21 19:53:44 +03:00
Insality
c33dbd5942 Update API pages 2025-04-20 12:15:31 +03:00
Insality
6e1998b822 Update changelog 2025-04-19 22:46:47 +03:00
Insality
225fa0aa8d Try to return discarded GUI properties, oh 2025-04-19 22:30:38 +03:00
Insality
c7b11562d5 Update 2025-04-19 22:25:58 +03:00
Insality
4cb16de782 Merge branch 'master' into develop 2025-04-19 19:49:51 +03:00
Insality
8d35dc0b20 Update 2025-04-19 19:46:25 +03:00
Insality
013d61771f Update docs 2025-04-19 19:36:07 +03:00
Insality
74ddc67469 Update 2025-04-19 19:01:39 +03:00
Insality
50e59d9469 Update editor scripts 2025-04-19 18:03:50 +03:00
Insality
8d2b8c25a0 Update tests 2025-04-18 19:36:52 +03:00
Insality
b7fd33bf3b Missing texture 2025-04-18 02:32:35 +03:00
Insality
ebd604b29b Update tests 2025-04-18 02:31:28 +03:00
Insality
f42211782a Update 2025-04-18 01:24:39 +03:00
Insality
0d0581b108 Update tests 2025-04-17 19:18:40 +03:00
Insality
d1d54896fb Update Docs 2025-04-16 01:01:00 +03:00
Insality
9e2a14c6dd Update docs 2025-04-15 21:49:22 +03:00
Insality
e2c9a7d9d6 Update README 2025-04-10 01:07:12 +03:00
Maksim Tuprikov
afdcbe1dd4
Merge pull request #304 from Insality/fix_input
Fix input issues
2025-04-07 22:02:47 +03:00
Insality
326ce8bbbb Prepare v1.0.1 2025-04-07 22:01:47 +03:00
Insality
be1a3d3788 Fix input issues 2025-04-07 21:59:50 +03:00
Insality
34be76777b Update 2025-04-05 15:00:41 +03:00
Insality
0504496975 Set code links to master until release 2025-03-30 20:21:06 +03:00
Insality
ed7ab908ac Update color 2025-03-30 20:09:39 +03:00
Maksim Tuprikov
6c6e2c64ee
Merge pull request #303 from Insality/update_docs
Docs, widgets and code refactor
2025-03-30 16:16:42 +03:00
Insality
f6acbe291f Fix 2025-03-30 16:16:31 +03:00
Maksim Tuprikov
2f70905c59
Merge branch 'develop' into update_docs 2025-03-30 16:16:10 +03:00
Insality
67aba26544 Update 2025-03-30 16:02:54 +03:00
Insality
b5f2ae253d Update docs 2025-03-30 14:57:54 +03:00
Insality
ec194e8441 Add luacov 2025-03-30 14:33:45 +03:00
Insality
90c3f81373 Update 2025-03-30 14:30:47 +03:00
Insality
026ec03803 Update tests 2025-03-30 14:19:59 +03:00
Insality
fed6fec193 Okay zulu is required? 2025-03-30 13:46:08 +03:00
Insality
4138061975 Update 2025-03-30 13:44:36 +03:00
Insality
316b182106 Update 2025-03-30 13:43:25 +03:00
Insality
50079e0838 Update 2025-03-30 13:33:52 +03:00
Insality
e4a8a85c39 Next/Prev example by arrows 2025-03-30 13:16:03 +03:00
Insality
c4694b421b Update 2025-03-30 13:01:54 +03:00
Insality
d182bcef7c Fix code url in widgets examples 2025-03-29 20:07:52 +02:00
Insality
f2b930ba68 Other updated 2025-03-29 20:06:08 +02:00
Insality
45493bc9dd Basic examples done 2025-03-29 20:00:55 +02:00
Insality
e1339a2ca8 Start update examples to move control things to example itself 2025-03-29 19:53:11 +02:00
Insality
d6fb8cad09 Tiling node to component, add way to move examples properties code to example itself 2025-03-29 19:29:08 +02:00
Insality
3f22e9c542 Update 2025-03-29 14:03:03 +02:00
Insality
b053b5044b Update examples 2025-03-27 00:30:37 +02:00
Insality
7640e207a4 Update examples to widgets instead components 2025-03-27 00:19:32 +02:00
Insality
dee77ab313 Remove uncompleted stuff 2025-03-26 23:30:29 +02:00
Insality
91f2d593d2 Update 2025-03-26 22:59:27 +02:00
Insality
65234ec8d2 Update 2025-03-26 22:57:34 +02:00
Insality
e83e5a6c84 Update 2025-03-25 22:56:47 +02:00
Insality
fb9c80b284 Update 2025-03-20 09:59:45 +02:00
Insality
330dabda09 Update 2025-03-20 09:46:13 +02:00
Insality
10556ba31a Remove html api, update docs 2025-03-20 00:26:29 +02:00
Insality
f786b20951 Update docs 2025-03-18 22:58:13 +02:00
Insality
44b735adda Reimport docs 2025-03-18 22:00:51 +02:00
Insality
3c063313de Update private annotations 2025-03-18 21:41:09 +02:00
Insality
19ea7fcff9 Add private annotation 2025-03-18 21:32:11 +02:00
Insality
1bc916e187 Update docs 2025-03-18 21:23:30 +02:00
Insality
5348561d68 widget.* to druid.widget lls class 2025-03-16 17:44:08 +02:00
Insality
ad0447b649 Update 2025-03-16 02:24:47 +02:00
Insality
a2bb93a03b Update 2025-03-14 23:35:24 +02:00
Insality
b30cf9109e Test new markdown api generator 2025-03-14 20:29:05 +02:00
Insality
11aeb377c2 Update 2025-03-14 01:06:20 +02:00
Insality
1aa96d8dbc Update 2025-03-13 23:39:43 +02:00
Insality
c13a31711f Update 2025-03-10 22:40:12 +02:00
Insality
6c5210a0fa Update 2025-03-07 23:17:04 +02:00
Insality
69cf28e408 Update 2025-03-07 21:30:55 +02:00
Insality
f36986ed1f Update deployer sha 2025-03-07 21:15:18 +02:00
Insality
be03a5bd50 LLS refactor 2025-03-07 21:09:01 +02:00
Insality
3bb8705444 Update 2025-03-06 01:50:31 +02:00
Insality
ea4ff7eafc Update 2025-03-06 01:13:04 +02:00
Insality
1a138f7020 Update 2025-03-06 00:27:51 +02:00
Insality
9bb7c6e8bd Update 2025-03-05 22:17:06 +02:00
Insality
72692f5efc Update 2025-03-05 22:10:37 +02:00
Insality
46223f0bb8 Update 2025-03-05 22:06:06 +02:00
Insality
d6bec60ba9 Update 2025-03-05 21:52:18 +02:00
Insality
c3b132187a Update 2025-03-05 21:42:54 +02:00
Insality
2c2789f1f9 Update 2025-03-05 21:28:56 +02:00
Insality
94d1d64dc3 Update button docs 2025-03-05 21:19:03 +02:00
Insality
ef86b387c2 Rename type druid.base_component -> druid.component 2025-03-05 21:02:46 +02:00
Insality
3a559d7ac2 Rename type druid_instance to druid.instance 2025-03-01 15:54:14 +02:00
Insality
dd5f619345 Move bindings to druid, update widgets 2025-02-18 21:12:56 +02:00
Insality
5eaa50552a Update 2025-02-09 22:28:58 +02:00
Maksim Tuprikov
86fbe83265
Merge pull request #298 from itmurker/master
Fix Y position calculation for layouts with nodes of different height for 'horizontal_wrap' mode
2025-02-09 20:59:00 +02:00
Alexey Shnigir
6aacb28a73 Fix Y position calculation for layouts with nodes of different height 2025-02-09 17:58:26 +03:00
Insality
8407932236 Update docs, add stub for quick api reference 2025-02-09 15:12:25 +02:00
Maksim Tuprikov
197118c229
Merge pull request #292 from Insality/shaders
All changes to Develop
2025-02-09 14:43:19 +02:00
Insality
d06ebd53f9 Update 2025-02-09 14:42:25 +02:00
Insality
16d20da5ab Update 2025-02-08 00:31:35 +02:00
Insality
7a6f529c82 Update 2025-02-08 00:28:20 +02:00
Insality
96ce3eee95 Update 2025-02-08 00:11:29 +02:00
Insality
b6c0e1556a Update the panel druid profiler, remove events counter 2025-01-30 19:30:56 +02:00
Insality
0514625f9a Progress with widget examples 2025-01-30 01:44:03 +02:00
Insality
c51a00ad80 Revert "Remove HTML API from this branch"
This reverts commit 0972c53c700caf32354463a0734798891aa20635.
2025-01-29 23:35:46 +02:00
Insality
da5c6b9a54 Fix for examples 2025-01-29 23:13:09 +02:00
Insality
db0c4c8ee5 Fix components inner table typo 2025-01-11 15:32:36 +01:00
Insality
ae33b08a6b Decrease default drag dead zone to 4 pixels 2024-12-24 01:23:20 +02:00
Insality
6b8bbe1970 Refactor text setting methods and remove ldoc files 2024-12-08 13:35:41 +02:00
Insality
9a1cd795b8 Test shaders 2024-12-03 20:42:33 +02:00
Insality
917a84fc94 Update 2024-11-30 22:52:27 +02:00
Insality
e59a2b0bcb Update 2024-11-30 15:04:05 +02:00
Insality
cb36625836 Add vector3 property 2024-11-29 00:49:56 +02:00
Insality
434dce55ce Update 2024-11-27 23:34:50 +02:00
Insality
06f682e8e4 Update 2024-11-23 12:39:55 +02:00
Insality
28bd165cee Update 2024-11-22 02:22:21 +02:00
Insality
af44d0d26e Update components interests link 2024-11-21 22:38:40 +02:00
Insality
5a1668a8af Update 2024-11-21 22:00:05 +02:00
Insality
69ebb252e1 Remove no_auto_template and no_stencil_check settings 2024-11-21 00:53:06 +02:00
Insality
9c03c950ad Remove on_message_input functional 2024-11-21 00:51:35 +02:00
Insality
bc0ada7098 Remove register and update examples 2024-11-21 00:28:53 +02:00
Insality
4ef65579a6 Update 2024-11-21 00:18:43 +02:00
Insality
c0abfd350e Update examples 2024-11-21 00:01:16 +02:00
Insality
c00fb3590c Replace event with event library 2024-11-20 23:52:48 +02:00
Insality
6552ea5cac Update example assets 2024-11-20 23:43:39 +02:00
Insality
7ea8691fc5 Update 2024-11-20 23:36:04 +02:00
Insality
f2fa5320d2 Update 2024-11-20 02:44:45 +02:00
Insality
606f400719 Update widgets 2024-11-20 01:55:58 +02:00
Insality
37d7168bd6 More widgets, additional adjusts for text 2024-11-20 01:42:12 +02:00
Insality
c35dfc7066 More widgets stuff, cleaning code 2024-11-19 23:06:57 +02:00
Insality
37190684c4 Add more widgets 2024-11-19 00:48:15 +02:00
Insality
6cb2c9ca9a Widgets WIP 2024-11-18 23:28:34 +02:00
Insality
dc8f3b99bb Widgets WIP 2024-11-18 23:06:04 +02:00
Insality
299f8501e8 Widgets WIP 2024-11-18 22:50:42 +02:00
Insality
99f75dd626 Update widgets 2024-11-18 22:03:04 +02:00
Insality
3fca582197 All components now included 2024-11-18 21:51:26 +02:00
Insality
f3fad8bd92 Add test widget stubs 2024-11-18 21:48:08 +02:00
Insality
56ef92a1b5 Update annotations 2024-11-10 20:34:30 +01:00
Insality
b5ccd80215 Replace treturn 2024-11-07 18:35:06 +01:00
Insality
620facbe1f replace all tparam 2024-11-07 18:34:27 +01:00
Insality
999c6222a0 Update annotations 2024-11-07 18:32:46 +01:00
Insality
60ef641276 Update 2024-11-02 17:16:09 +01:00
Insality
0972c53c70 Remove HTML API from this branch 2024-10-30 23:46:55 +02:00
Insality
6ccf58d527 Update docs 2024-10-30 23:46:39 +02:00
Insality
72cf310d6c Update 2024-10-30 23:37:43 +02:00
Insality
00b8b192a7 Add test "new_widget" 2024-10-30 01:29:46 +02:00
Insality
91bdcb6678 Update 2024-10-30 00:34:43 +02:00
Insality
c85d66fdca Update annotations P.1 2024-10-29 20:31:45 +02:00
Insality
a46f38734e Fix for editor script luacheck 2024-10-24 09:59:40 +03:00
Insality
62384f36b3 Add generics annotations to component set_style/nodes/template 2024-10-23 00:43:03 +03:00
Insality
aff4412677 Fix example is_selected 2024-10-22 22:28:19 +03:00
Insality
7aa24dba2e Update changelog 2024-10-19 12:36:11 +03:00
Insality
eb83a69dc5 Update changelog 2024-10-19 12:00:23 +03:00
Maksim Tuprikov
d2b617a14f
Merge pull request #283 from Insality/develop
Release 1.0
2024-10-19 11:56:13 +03:00
Insality
2e6168d518 Update characters in default font 2024-10-19 11:29:42 +03:00
Insality
be1f470dbe Update annotations 2024-10-19 11:25:30 +03:00
Insality
86189d6e3e Update docs, annotations 2024-10-19 11:22:24 +03:00
Insality
13fb109ef0 Use gifs instead of mp4 2024-10-19 11:11:21 +03:00
Insality
45c81aa9a0 Add new preview videos 2024-10-19 11:01:07 +03:00
Insality
ebd7f94354 Add new examples 2024-10-19 10:59:13 +03:00
Insality
8d409b8062 Update docs 2024-10-19 10:58:51 +03:00
Insality
0a5bb248d7 Remove checkbox, checkbox group, radio group and old default templates 2024-10-19 10:58:46 +03:00
Insality
d73835a2d5 Update Druid components 2024-10-19 10:58:24 +03:00
Insality
ad339508cf Update example app 2024-10-19 10:57:55 +03:00
Insality
c787ed860e Update example build 2024-10-17 02:13:32 +03:00
Insality
2ea635fc56 Update example build 2024-10-17 02:09:19 +03:00
Maksim Tuprikov
4d29363678
Merge pull request #282 from Insality/example_rework
Example rework
2024-10-17 02:03:35 +03:00
Insality
dd41aab962 Update docs and example page 2024-10-17 02:02:07 +03:00
Insality
3579370287 Update 2024-10-17 01:48:30 +03:00
Insality
91879509a0 Update example with new brand one 2024-10-17 01:24:15 +03:00
Insality
2c762716bb Remove current Druid example 2024-10-17 01:10:21 +03:00
Maksim Tuprikov
032eb4aac5
Merge pull request #275 from Insality/update
Prepare for release 12
2024-10-17 01:07:21 +03:00
Insality
40bda1b0eb Fix deleted knob 2024-10-16 21:30:32 +03:00
Insality
3ccfe2c306 Remove pin knob component 2024-10-16 21:15:16 +03:00
Insality
c0c1870ac5 Solve #239 Remove button style 2024-10-16 20:58:55 +03:00
Insality
aa6310db91 Update 2024-10-16 20:30:55 +03:00
Insality
6e4490a3a7 Fix test.ini 2024-10-15 21:38:40 +03:00
Insality
e8dbc097d0 Update 2024-10-15 21:35:51 +03:00
Insality
ea80c874f6 Update annotations 2024-10-15 19:43:36 +03:00
Insality
5848921cba Update docs, config generations, fix linter 2024-10-15 19:34:07 +03:00
Insality
2f5336fa4f Remove annotations 2024-10-15 02:49:56 +03:00
Insality
a5e579ddaa Update button hold callback 2024-10-15 02:48:41 +03:00
Insality
067b650838 Get rid of middleclass 2024-10-15 01:59:25 +03:00
Insality
54345b924b Update timer & text 2024-10-15 01:30:28 +03:00
Insality
a0113d3356 Update druid component template 2024-10-15 00:56:19 +03:00
Insality
87f52551e2 Update rich text 2024-10-15 00:56:06 +03:00
Insality
66f4a1c8d5 WIP 2024-10-14 23:03:45 +03:00
Insality
a4fa0f0348 WIP 2024-10-14 22:24:57 +03:00
Insality
5d5fe7f374 Rich text based only on text node 2024-10-14 22:13:57 +03:00
Insality
59d3b116ac Add figma layout for druid 1.6.3 2024-10-14 11:33:05 +03:00
Insality
d11aeb6b18 Update 2024-10-14 11:32:53 +03:00
Insality
3c9f539376 Update annotations 2024-10-05 02:27:30 +03:00
Insality
4a8bb214d2 Update 2024-10-05 02:07:53 +03:00
Insality
d39f4715f3 Update annotations, fix rare errors 2024-10-05 01:40:46 +03:00
Insality
b9b74736a7 Merge remote-tracking branch 'origin/update' into update 2024-09-12 21:03:42 +03:00
Insality
ab90927d32 Update Druid logos 2024-09-12 21:03:31 +03:00
Insality
b2a88146e5 Update input and rich input 2024-09-12 20:59:50 +03:00
Insality
d533e5ee2d Fix scroll events while animating
Fix slider issue with negative distance
Add bunch of new functions to grid
More accurate progress bar scaling with 9-slice images
2024-09-10 21:46:29 +03:00
Insality
986a4695f6 Update Rich Input with selection/arrows control. Add template and nodes to self:get_druid 2024-09-07 17:15:40 +03:00
Insality
f93d0c7d40 Add hover on_mouse_hover callback in constructor
Add ON_HOVER_CURSOR and ON_MOUSE_HOVER_CURSOR in hover component in styles
2024-09-04 01:58:20 +03:00
Insality
4a095a2a24 Update README
Button key trigger will not consume input
Update scroll position while animate
Add scroll:set_view_size
Better static grid get_index function
Rework Data List (only static grid)
Update Default style
Remove a component from parent if exists on druid:remove
2024-09-03 21:48:43 +03:00
Insality
0aeb0b3fea Update event to remove middleclass, using defold-event as a base 2024-08-29 09:51:09 +03:00
Insality
ba1ab07e0d Update new component template, replace component name with M as module name 2024-08-29 09:28:54 +03:00
Insality
7e16dacbc2 Update helper to use gui.get to reduce memory footprint 2024-08-29 09:27:34 +03:00
Insality
cece44f2d1 Fix #264 Use pip or pip3 instead only pip3 2024-08-27 18:13:15 +03:00
Insality
678f542bdb Fix #273 Update appmanifest 2024-08-27 17:55:36 +03:00
Maksim Tuprikov
341d1721d1
Merge pull request #274 from mozok/develop
Fixes for annotations
2024-08-27 17:52:48 +03:00
Maksim Tuprikov
5e2a3bdb4b
Merge branch 'update' into develop 2024-08-27 17:52:36 +03:00
Insality
45718325a1 Update luacheck 2024-08-27 17:48:46 +03:00
Insality
11ae63a9f6 Update annotations 2024-08-27 17:45:09 +03:00
Insality
5f2ae1eb0d Add Defold annotations 2024-08-27 17:18:55 +03:00
Insality
7f90ae99e6 Update docs 2024-08-27 17:16:33 +03:00
Maksim Tuprikov
731e5f6627
Merge pull request #271 from JustAPotota/patch-1
Fix password input events returning masked text
2024-08-27 17:12:58 +03:00
Insality
217b90163a Merge branch 'master' into develop 2024-08-27 17:08:25 +03:00
Mozok Evgen
15a2450437 Fix LangText annotations 2024-08-24 21:35:48 +03:00
Mozok Evgen
f54347ef6c Fix Slider annotations 2024-08-24 21:27:59 +03:00
Mozok Evgen
2cef65ed40 Fix scroll annotations 2024-08-24 21:22:34 +03:00
Mozok Evgen
32aa760386 Fix "any" type annotation to lowercase 2024-08-24 21:15:55 +03:00
Mozok Evgen
c4a4221841 Fix Grid methods annotations 2024-08-24 21:12:26 +03:00
Mozok Evgen
8a3cff17ab Fix "node" type annotation to lowercase 2024-08-24 20:59:55 +03:00
Mozok Evgen
63c2e8ea93 Fix new_ annotations 2024-08-24 20:53:28 +03:00
Maksim Tuprikov
d7e1174162
Merge pull request #272 from boruok/fix-style-links
fix style docs
2024-07-16 10:28:46 +03:00
boruok
93cbb99cdf fix style docs 2024-07-16 12:10:57 +09:00
JustAPotota
80f60c6e74
Fix password input events returning masked text 2024-07-06 21:42:03 -05:00
Maksim Tuprikov
152ff189ff
Merge pull request #269 from boruok/fix-codelinks
Fix wrong code links
2024-07-01 10:01:52 +03:00
boruok
04b7323be2 fixed wrong codelinks 2024-07-01 10:57:36 +09:00
Maksim Tuprikov
1b42824912
Merge pull request #267 from astrochili/annotations-fix-3
Fix sender type for `druid_instance.on_message()`
2024-06-13 10:16:05 +01:00
Roman Silin
3bf50660b3 Fixed sender type for druid_instance.on_message() 2024-06-13 12:15:05 +03:00
Maksim Tuprikov
e2108a5f1e
Merge pull request #263 from ivolff/master
fix for DynamicGrid.get_all_pos
2024-04-23 17:49:03 +03:00
ivolff
8741e6cb74
get_all_pos fix 2024-04-23 18:25:03 +04:00
Maksim Tuprikov
0e9445b1a8
Merge pull request #260 from Fossean1/patch-2 2024-03-25 09:32:31 +02:00
Fossean1
9c37582f2b
Fix init function in 03-styles.md 2024-03-25 10:59:15 +05:00
Insality
07101355c8 Merge remote-tracking branch 'origin/develop' into develop 2024-03-21 17:47:46 +02:00
Insality
13919fdb04 Update README 2024-03-21 17:47:33 +02:00
Maksim Tuprikov
2dcbb6ad92
Merge pull request #259 from marnason/master
Fixed lang_text URL in example.gui_script
2024-02-28 20:54:28 +02:00
marnason
f47631cae9
Fixed lang_text URL in example.gui_script 2024-02-27 12:13:05 +00:00
Maksim Tuprikov
9b69b65add
Merge pull request #252 from astrochili/drag_screen_x_y
Added the screen position to the Drag component
2023-12-12 19:40:17 +02:00
Roman Silin
aa7e62e3f1 Added screen_x and screen_y to the Drag component 2023-12-12 18:43:18 +02:00
Insality
bdd9efb892 Update annotations 2023-12-05 14:55:58 +02:00
Insality
01d1445511 Update annotations, add set_repeat to hotkey component 2023-12-05 14:49:56 +02:00
Insality
97ff6154eb Update wrong links in documentation 2023-12-05 14:28:04 +02:00
Insality
2c083f6a71 Update wrong links in documentation 2023-12-05 14:27:53 +02:00
Maksim Tuprikov
5d4039da4f
Merge pull request #247 from Insality/update_annotations
Update Druid annotations
2023-10-20 11:26:19 +03:00
Insality
85e6d41f56 Update HTML5 example 2023-10-20 11:25:06 +03:00
Insality
9132dc477b Update java version for CI 2023-10-20 11:21:30 +03:00
Insality
00a7852225 Update example to 1.6.0 Defold version 2023-10-20 11:19:15 +03:00
Insality
d1d20d73ff Fix wrong link to lang_text example 2023-10-20 11:14:58 +03:00
Insality
88154b2269 Fix scrolls.gui stencil nodes 2023-10-20 11:03:30 +03:00
Insality
4a16a8bc07 Annotations update [5] 2023-10-18 10:40:08 +03:00
Insality
24bb39481d Annotations update [4] 2023-10-17 23:18:25 +03:00
Insality
c99b97f392 Annotations update [3] 2023-10-17 22:32:22 +03:00
Insality
50c9b6bad5 Annotations update [2] 2023-10-17 22:00:43 +03:00
Insality
86b92f90a7 Annotations update 2023-10-17 21:09:45 +03:00
Insality
7fc76ed8c0 Fix #245 Lang Text on_change trigger on language change 2023-09-06 14:48:46 +02:00
Insality
5ed9bdd814 Return width from helper.centrate_nodes 2023-09-02 21:25:58 +03:00
Insality
ca8c4e2425 Rich Text add on layout change 2023-08-27 13:40:49 +03:00
Insality
73ed0c8cd0 Fix #242 Text component metrics zero width issue 2023-08-25 11:07:33 +03:00
Insality
2d8d3cffbb Late scripts require in tests 2023-08-06 14:17:12 +03:00
Insality
3219b280e7 Test with late require 2023-08-06 14:12:57 +03:00
Insality
65fe2521f4 Another way to require druid in test scripts 2023-08-06 14:07:45 +03:00
Insality
b7e16e4321 Test init luacover earlier 2023-08-06 14:02:31 +03:00
Insality
d1195a47a2 Add require test file directly in deftest.add 2023-08-06 10:59:50 +03:00
Insality
300fbf1309 Update docs 2023-08-05 20:10:32 +03:00
Insality
69b3383dc4 Remove all docs 2023-08-05 20:10:11 +03:00
Maksim Tuprikov
03ffd943df
Merge pull request #233 from Insality/develop
Merge Druid 0.11 to Master
2023-08-05 19:44:01 +03:00
Insality
646cf5a4b4 Update example 2023-08-05 19:43:09 +03:00
Insality
d7dd4a86b8 Update docs 2023-08-05 19:32:47 +03:00
Insality
37fff52aa5 Fix HTML5 button 2023-08-05 19:27:51 +03:00
Insality
628723386e Update Rich text style params 2023-08-05 19:01:06 +03:00
Insality
5a0cf42e3d Update README, move emmylua section to Advanced Setup manual 2023-07-16 12:28:46 +03:00
Insality
556e1a9bae Small optimization && refactoring 2023-07-15 15:56:06 +03:00
Insality
337090e74c Update docs, little optimizations, inline style anims 2023-07-15 12:35:05 +03:00
Insality
38c117b9d8 Inline helper.is_enabled, remove unused code, documentation fixes, remove formats and druid_input files, add more tests 2023-07-15 11:53:07 +03:00
Insality
c01ee189b4 Prepare for release 0.11 2023-07-13 22:42:23 +03:00
Insality
ea18562270 Update docs 2023-07-13 22:00:52 +03:00
Insality
f910db985c Update README 2023-07-13 21:52:41 +03:00
Maksim Tuprikov
706b5d094a
Merge pull request #232 from Insality/rich_text
Rich text
2023-07-13 21:40:51 +03:00
Insality
32d184ca81 Update Docs & Example 2023-07-13 21:39:02 +03:00
Maksim Tuprikov
1cbe573763
Merge pull request #231 from Insality/docs
Update documentation
2023-07-13 21:35:20 +03:00
Insality
5ecd67d8ef Update docs 2023-07-13 21:32:04 +03:00
Insality
23ac068f51 Update docs 2023-07-11 22:23:48 +03:00
Insality
6ed48772a3 Update docs 2023-07-11 21:46:56 +03:00
Insality
bdacd4a440 Update docs 2023-07-11 21:29:12 +03:00
Insality
894b62b888 Update docs 2023-07-09 22:56:44 +03:00
Insality
eca76b12d1 Update docs 2023-07-09 21:47:14 +03:00
Insality
15cf72df27 Update docs 2023-07-09 11:11:30 +03:00
Insality
4896f38e09 Update readme and docs 2023-07-08 09:59:35 +03:00
Maksim Tuprikov
862b61281d
Merge pull request #230 from Insality/docs
Docs update
2023-07-05 23:20:58 +03:00
Insality
487851302b Update Bob version to 1.4.7 2023-07-05 23:20:17 +03:00
Insality
d0062c2a78 Update changelog 2023-07-05 23:14:27 +03:00
Insality
fb5508b083 Update docs 2023-06-10 19:18:12 +03:00
Insality
7bf479e6c0 Update Helper docs 2023-06-08 00:06:05 +03:00
Insality
65974e0b30 Update docs 2023-06-07 23:30:37 +03:00
Insality
b22808f585 Remove debug log messages, update docs 2023-06-07 01:41:47 +03:00
Insality
e14f68bc90 Move swipe to extended, update docs 2023-06-07 00:41:05 +03:00
Insality
99fc4ccc31 Start update docs 2023-06-06 23:01:46 +03:00
Insality
76ab3811fa Update rich text texts example 2023-05-31 23:51:57 +03:00
Insality
b628212c58 Update examples 2023-05-31 21:54:55 +03:00
Insality
a01eae3d89 Solve #156 Input field now show keyboard in html5 mobile 2023-05-03 01:13:16 +03:00
Insality
7b40af9a33 Solve #219 Add utf8 native library support 2023-05-03 01:05:31 +03:00
Insality
7aa2da11f6 Update docs, wrong links 2023-05-03 00:51:56 +03:00
Insality
807168d850 Solve #227 Update current URL to match with current example 2023-05-02 21:30:11 +03:00
Insality
c815b6b240 Update rich text examples 2023-05-02 21:08:37 +03:00
Insality
a1d138522e Update rich text example 2023-02-08 21:54:32 +02:00
Insality
5e92cf5ffc Rich Text example progress 2023-02-08 21:01:37 +02:00
Insality
547b10d097 Update rich text for last version 2023-02-07 19:37:05 +02:00
Insality
6ea5ed0b97 Merge branch 'develop' into rich_text 2023-02-07 19:09:38 +02:00
Maksim Tuprikov
2733c88655
Merge pull request #222 from Insality/tests
Initial tests for Druid GUI
2023-02-07 19:05:48 +02:00
Insality
96d1b8c068 Typo fix 2023-02-07 19:04:39 +02:00
Insality
cfaeff1516 Fix tests 2023-02-07 18:58:24 +02:00
Insality
bd9b4ad58f Merge branch 'develop' into tests 2023-02-07 18:45:35 +02:00
Insality
2196cc3e17 Add text_metrics args on change text scale text event 2022-12-03 17:53:57 +02:00
Insality
0368260d16 Schedule late_init if component have on_input 2022-12-03 17:43:08 +02:00
Insality
6d75d61fd5 Add lang text example 2022-12-03 16:59:04 +02:00
Insality
5accec45c3 Solve #216 Button also can be pressed via multitouch action_id (not still simultaneously but can capture the event) 2022-12-03 16:41:28 +02:00
Insality
a983d5e72a Solve #126 Update input bindings according to Defold defaults 2022-12-03 16:40:15 +02:00
Insality
8fb41ea8e9 Solve #214 Fix hover on_input return value. Add hover example. Add hover_instance to hover callback 2022-12-03 16:26:28 +02:00
Insality
d93823ae6a Solve #215 Better late init interest support 2022-12-03 16:16:55 +02:00
Insality
4f7dbf49d3 Progress #210 Add set_max_gui_upscale for layout component 2022-12-03 16:15:48 +02:00
Insality
dad54d8de3 Update #199 rename IS_CONSUME_INPUT_WHILE_SELECTED to NO_CONSUME_INPUT_WHILE_SELECTED. Change default value 2022-12-01 21:05:14 +02:00
Insality
7f5be3ffb0 Solve #217 Fix error font argument, remove deprecated gui.get_text_metrics 2022-12-01 21:02:31 +02:00
Insality
5d3625e2a8 Solve #199 Add input consume flag while input is selected. With false value it's allow to interact with other input components while input is selected (current input will be unselected if this case) 2022-11-12 12:50:19 +02:00
Insality
ec15ac053a Merge remote-tracking branch 'origin/develop' into develop 2022-11-09 20:21:42 +02:00
Insality
337a43ae08 Solve #213 remove late init for progress bar 2022-11-09 20:21:06 +02:00
Insality
fadd0c4c4b Fix progress late init 2022-11-09 17:40:45 +02:00
Insality
66abd3bd31 Update rich text with Druid component and content adjust into root size 2022-11-04 20:09:46 +02:00
Insality
fae7e4afa4 Initial commit with rich text 2022-11-04 20:09:13 +02:00
Maksim Tuprikov
5480f175bf
Merge pull request #211 from dmi7ry/patch-1
Fixed wrong link to Text API
2022-11-03 08:53:27 +01:00
Maksim Tuprikov
c766dc7ba4
Merge pull request #212 from dmi7ry/patch-2
misprint in new_text() documentation (Tet → Text)
2022-11-03 08:53:13 +01:00
Dmitry
13f0922ccc
misprint (Tet → Text) 2022-11-02 00:43:19 +07:00
Dmitry
dac1218809
Fixed wrong link to Text API 2022-11-02 00:18:59 +07:00
Insality
9b53314fa7 Fix drag node scene koefs 2022-10-20 21:44:04 +03:00
Insality
999789c1c8 Move FUNDING.yml file 2022-10-16 12:59:27 +03:00
Insality
253ea36817 Add FUNDING.yml 2022-10-16 12:58:38 +03:00
Insality
b5b07cb8d9 Update README 2022-10-16 12:51:13 +03:00
Insality
4de50591f8 Update drag/slider scene node koefs, add layout max gui upscale 2022-10-15 16:11:12 +03:00
Insality
9cd1769c37 Fix extended components in example 2022-10-09 17:20:40 +03:00
Insality
92d9e2e5e4 Remove unexists preview 2022-10-09 17:10:04 +03:00
Insality
4c130a68bb Move all extended component out of default bundle 2022-10-09 17:02:54 +03:00
Insality
561fdc7b38 Update README 2022-10-09 16:58:35 +03:00
Insality
674eefd70b Update README 2022-10-09 16:57:57 +03:00
Insality
441c6e3dc4 Update README 2022-10-09 16:55:32 +03:00
Insality
edde50ccb6 Update preview gifs 2022-10-09 16:53:55 +03:00
Insality
9d75af2eb9 Replace gui.get_text_metrics with resource.get_text_metrics 2022-10-09 16:40:23 +03:00
Insality
09ecc45921 Add preview for Druid components, change the README component section 2022-10-09 14:38:29 +03:00
Insality
9e92cf295b Add tests for drag component 2022-10-08 19:11:57 +03:00
Insality
51dc34613b Add tests for hover component 2022-10-08 16:11:45 +03:00
Insality
a87f775ac7 Merge branch 'master' into tests 2022-10-08 15:43:11 +03:00
Maksim Tuprikov
bbd41659f9
Merge pull request #208 from Insality/develop
Solve #207 fix scroll + data_list issue
2022-10-02 14:15:44 +03:00
Insality
2e9353afeb Solve #207 fix scroll + data_list issue 2022-10-02 14:15:17 +03:00
Insality
d92be1cfa7 Update button tests 2022-09-11 14:19:07 +03:00
Insality
79a711fa01 Add button basic tests 2022-09-11 13:10:05 +03:00
Insality
a6de0128bd Add initial Druid tests 2022-09-11 12:16:20 +03:00
Maksim Tuprikov
ad9ed801aa
Merge pull request #205 from Insality/develop
Merge release 0.10.0 to develop
2022-09-09 21:02:13 +03:00
Insality
cb5df2b5bc Update docs, html example 2022-09-09 21:01:33 +03:00
Insality
072507cc9e Fix progress bar example 2022-09-09 20:46:26 +03:00
Insality
32e5fdb669 Update progress bar component, add progress bar example 2022-09-09 20:45:27 +03:00
Insality
ba383261b0 Update layout component, add layout fit example 2022-09-09 20:45:08 +03:00
Insality
25a17773e7 Solve #198 move input init and late init to Druid instance init function 2022-09-06 22:09:32 +03:00
Insality
e683eed90f Solve #202 set check stencil node enabled by default 2022-09-06 21:35:43 +03:00
Insality
2c92a792f7 Fix the HTML logo stretch 2022-08-29 22:18:20 +03:00
Insality
a3f109123e Update the changelog for 0.10.0 2022-08-29 21:58:29 +03:00
Insality
2f844a31c4 Update the Druid logo 2022-08-29 21:50:58 +03:00
Insality
9e2648e998 Merge branch 'master' into develop 2022-08-29 21:50:46 +03:00
Insality
8cd954e2dc Update HTML example 2022-08-29 21:47:59 +03:00
Insality
65f5d2db01 Solve #204 fix code url from direct example url open 2022-08-29 21:47:11 +03:00
Insality
13003e4721 Merge branch 'data_list_control' 2022-08-29 21:31:25 +03:00
Maksim Tuprikov
f471013e90
Merge pull request #203 from Insality/data_list_control
Solve #200 #201 Add DataList access functions, example with custom co…
2022-08-29 21:30:49 +03:00
Insality
55cc1c713e Update docs and HTML example project 2022-08-29 21:29:57 +03:00
Insality
b2643ebd26 Solve #200 #201 Add DataList access functions, example with custom component + DataList 2022-08-29 21:27:37 +03:00
Insality
0c47828d96 Add changelog for 0.10.0 2022-07-17 19:38:19 +03:00
Insality
2f964c6ed3 Update docs 2022-07-17 19:22:36 +03:00
Insality
847bee2e6b Update docs 2022-07-17 19:19:25 +03:00
Insality
77e56e8747 Add hotkey example 2022-07-17 19:07:35 +03:00
Insality
3e5a90920e Update drag screen koef value 2022-07-17 18:41:02 +03:00
Insality
46bcbb596d Fix drag is_enabled, add to example 2022-07-17 18:27:38 +03:00
Insality
d237eaec59 Merge branch 'layout' into develop 2022-07-17 18:23:22 +03:00
Insality
45b4843887 Layout component update 2022-07-17 18:23:07 +03:00
Insality
43f75cd820 Solve #195 Add set_enabled to Drag component 2022-07-17 18:08:03 +03:00
Insality
0107c015a1 Update layout component 2022-06-15 10:37:45 +05:00
Insality
e029d1eac3 Solve #133 Add hotkey component 2022-06-15 10:35:56 +05:00
Insality
53f305734c Solve #189 Add temporary set input priority 2022-06-15 10:34:47 +05:00
Insality
c9f862ac03 Solve #188 Add drag component total_x/total_y 2022-06-15 10:34:19 +05:00
Insality
415869e2bf Update layout component 2022-06-15 10:29:27 +05:00
Insality
4d47b6e656 Solve #186 fix set in row static grid zero offset 2022-04-18 15:52:50 +03:00
Insality
13fd4babb1 Solve #187 Temporary removed default gui templates 2022-04-16 10:16:29 +03:00
Insality
decb9fd9fd Solve #73 fix scroll drag on stretch/zoom nodes 2022-04-10 15:20:57 +03:00
Insality
f7e6888c5a Revert "Solve #182 add table pool for events"
This reverts commit dff522fbaa8775ed983f6a2b83409addef7d112d.
2022-04-05 23:18:39 +03:00
Insality
70e94ec14a Fix event table pool 2022-04-05 19:20:03 +03:00
Insality
dff522fbaa Solve #182 add table pool for events 2022-04-05 18:57:40 +03:00
Insality
2779f9cf7a Start implement druid layout component 2022-04-05 18:17:39 +03:00
Insality
c263c60de8 Fix changelog type 2022-03-12 12:18:33 +02:00
Maxim Tuprikov
b5a77391a4
Merge pull request #180 from Insality/develop
Release 0.9.0
2022-03-12 12:07:50 +02:00
Insality
8054ad84f9 Update version to 0.9.0 update live example 2022-03-12 12:03:39 +02:00
Insality
d0f3d6641a Add reproducable ldoc generation 2022-03-12 11:58:00 +02:00
Insality
9c2b442c50 Update md docs of custom components 2022-03-12 11:54:45 +02:00
Insality
102d8ca579 Update druid editor scripts to run from dependency 2022-03-12 10:50:25 +02:00
Insality
e1ce982043 Revert "Move editor scripts to druid folder"
This reverts commit 007e715009550fc1b4bdbaa51c5be4cda6deda58.
2022-03-12 09:04:25 +02:00
Insality
58a877f8a7 Update docs 2022-03-12 09:03:45 +02:00
Insality
18eb52b92b Update changelogs 2022-03-11 20:43:20 +02:00
Insality
c5c335d17c Optimize component and event creation, add cache for interests, optimize scroll 2022-03-11 20:37:18 +02:00
Insality
cc35fe208c Force disable dynamic node poses of static grid in data_list 2022-03-11 19:41:05 +02:00
Insality
db1e7ec502 Add reinit data_list example, add debug mode for druid/components. Refactor scroll is_in_view. Use late remove while scroll update 2022-03-11 19:20:33 +02:00
Insality
4166fbe089 Now can pass node (not string) even if component nodes is defined 2022-03-11 14:33:36 +02:00
Insality
d44e196b96 Move Emmylua annotations to Druid folder 2022-03-11 14:26:31 +02:00
Insality
1cfec9df15 Update changelog 2022-03-11 14:24:35 +02:00
Insality
ea5b3dcea3 Solve #178 Update get_text_width -> get_text_size 2022-03-11 10:08:41 +02:00
Insality
007e715009 Move editor scripts to druid folder 2022-03-11 10:02:04 +02:00
Insality
b1b44b412e Update changelogs 2022-03-11 10:00:16 +02:00
Insality
02601c142d Add checkboxes example 2022-03-11 01:06:13 +02:00
Insality
fbe5db7875 Add general swipe and drag examples 2022-03-11 00:21:50 +02:00
Insality
760946765c Update generate component script 2022-03-10 21:45:23 +02:00
Maxim Tuprikov
6bb5ee59a8
Merge pull request #177 from Insality/custom_components
Update with custom components issues scope
2022-03-10 20:32:13 +02:00
Insality
70d4f0f1f8 Rename component template for autogenerate 2022-03-10 20:23:55 +02:00
Insality
8256fc9d92 Update defold version to 1.3.0 2022-03-10 20:21:27 +02:00
Insality
7465212cf0 Don't process layouting node inside templates 2022-03-10 20:00:33 +02:00
Insality
505ff9a540 Solve #159 Add auto layouting for generate custom Druid component 2022-03-10 19:50:16 +02:00
Insality
b84b6c461d Solve #119 Add script for create custom component 2022-03-09 21:17:24 +02:00
Insality
7b8dfb1ef0 Solve #114 Add default component templates for fast usage 2022-03-09 19:13:00 +02:00
Insality
57b9770419 Solve #44 Add slider drag not only by pin, but can additional add input zone 2022-03-09 18:54:58 +02:00
Insality
a8fcb9a25c Add cache last_scene and last scroll position to druid example. Fix scroll_to_percent by y (again) 2022-03-09 18:36:19 +02:00
Insality
fc2d93c34f Update README md 2022-03-09 18:19:36 +02:00
Insality
669b525c15 Add self:get_node assert, add no_auto_template flag, fix idents 2022-03-09 18:14:40 +02:00
Insality
a3e5ff1116 Resolve #171 #158 Don't need to pass full template name, correct work with inner clone_tree and inner templates 2022-03-09 18:06:41 +02:00
Insality
a4e8e9fb3a Add pin knob custom component 2022-03-09 00:34:04 +02:00
Insality
6e2fe4de83 Add protected field to annotations 2022-03-08 22:06:39 +02:00
Insality
2e9ab69001 Add rich input component and example 2022-03-08 21:31:44 +02:00
Insality
81c8e4aa00 Update workspace, update templates 2022-03-08 20:41:55 +02:00
Insality
dc76d3b3d4 Update docs, update custom component templates 2022-03-08 20:32:10 +02:00
Insality
f801bb6862 Update doc links, update emmylua generator 2022-03-08 20:21:39 +02:00
Insality
a846adf97b Update docs 2022-03-08 18:38:17 +02:00
Insality
a87a576ded Update #168 Remove unused global on_layout_change 2022-03-01 02:09:28 +02:00
Insality
129a102cc8 Solve #165 Add set_in_row function for StaticGrid 2022-02-28 22:18:07 +02:00
Insality
bd0c5545ae Solve #168 Added button to open the source code of current example 2022-02-28 22:02:13 +02:00
Maxim Tuprikov
2a0998d236
Merge pull request #170 from Insality/develop
Merge 0.8.1 to master
2022-02-28 21:41:41 +02:00
Insality
ac72c172fe Update version to 0.8.1 2022-02-28 21:37:49 +02:00
Insality
2d78bcb5e9 Solve #169 Fix on_layout_change 2022-02-28 21:37:23 +02:00
Maxim Tuprikov
10fad9c871
Merge pull request #167 from Insality/develop
Release 0.8.0
2022-02-12 17:22:52 +02:00
Insality
3b329f9c25 Update docs, annotations and style for checkbox 2022-02-12 17:17:36 +02:00
Insality
4e0fd264b1 Prepare for release 0.8.0 2022-02-12 17:02:27 +02:00
Insality
a75dd5a6f9 Merge branch 'master' into develop 2022-02-12 16:20:48 +02:00
Maxim Tuprikov
c12bfe63a5
Merge pull request #166 from SalavatR/patch-1 2022-02-02 16:19:18 +02:00
SalavatR
21830d9886
Update input.lua
function set_allowed_characters(NAME_PATTERN) isn't working with Cyrillic symbols  in range "[А-я]", string.match includes chars №, ₽ and may be more
2022-02-02 19:51:15 +06:00
Insality
3ac2986171 #162 Add static grid last row alignment 2022-01-27 22:29:13 +02:00
Insality
97e7631d22 #155 Add margin to total width in centrate_nodes 2022-01-27 19:35:29 +02:00
Insality
f534baf2ee #163 Default locale id from text node for lang_text component 2022-01-27 18:31:33 +02:00
Insality
54f80aeccd #160 Remove component interests, now setup it with function declaring 2022-01-27 01:48:05 +02:00
Insality
7a5faa2b85 #164 Fix scroll_to_percent wrong Y position 2022-01-27 01:15:12 +02:00
Insality
b7d2891fed #153 Add Druid acquire input to late_init step 2022-01-27 01:13:23 +02:00
Insality
ef455a71eb #00 Add more self chaining to Lang text component 2022-01-27 01:12:49 +02:00
Insality
30f48f1d27 #00 Add text arg to on_input_unselect event 2022-01-27 01:11:34 +02:00
Insality
b42d16d999 #152 Add instans set_state for Checkbox component 2022-01-27 01:09:24 +02:00
Insality
8d0f9e5070 #154 Change text adjust const to strings 2022-01-27 01:06:35 +02:00
Insality
43adb5f52d #147 Remove ... from lang_text to fixed arguments, add lang_text:format additional functions 2021-11-20 11:14:04 +02:00
Insality
d0c91c9cb5 #151 Fix text adjust by height 2021-11-20 11:12:34 +02:00
Insality
098df24265 #150 Fix scroll to percentage on Y position 2021-11-20 11:11:52 +02:00
Insality
154d9fc166 #148 remove scroll inertion after scroll animate or set_to 2021-11-20 11:11:24 +02:00
Insality
dbb883b1b8 #149 Call button style functions after actual callback 2021-11-20 11:10:29 +02:00
Maxim Tuprikov
9459ecc6b2
Merge pull request #145 from Insality/release/0.7.0
Release/0.7.0 to master
2021-10-23 17:48:53 +03:00
Insality
c16c3e4074 Update docs 2021-10-23 17:45:46 +03:00
Insality
d2e4362f48 Update example app 2021-10-23 17:39:24 +03:00
Insality
1ae77e727f Increase version to 0.7.0 2021-10-23 17:33:14 +03:00
Insality
e6f0a86f12 Update docs 2021-10-23 17:32:52 +03:00
Insality
db0196f55e Update changelog 2021-10-23 17:32:35 +03:00
Insality
009c3999c4 #142 Add WHEEL_SCROLL_BY_INERTION Scroll style param 2021-10-23 17:10:15 +03:00
Insality
d24301cd13 #144 Add checks for is scroll available to check POI in that intertion side 2021-10-23 16:34:14 +03:00
Insality
ba312742d2 #107 Better scale text adjust by height for multiline text nodes 2021-10-23 16:18:43 +03:00
Insality
ab3f5f8e31 #104 Add is_instant flag to add/remove Static and Dynamic Grid components 2021-10-23 15:16:38 +03:00
Insality
a4a03db813 #110 Add set_check_function for Buttom component 2021-10-23 15:04:12 +03:00
Insality
273dd33843 #111 Fix game.project field compare type 2021-10-23 14:11:26 +03:00
Insality
91fb8ced52 #111 Add druid.stencil_check for auto stencil check to call set_click_zone 2021-10-23 14:08:24 +03:00
Insality
063e4f4a31 Add message input TEXT_SET, update docs/changelog 2021-10-23 13:30:50 +03:00
Insality
0179e68887 #91 Add license comments 2021-10-23 13:08:39 +03:00
Insality
1da5476837 #81 Add simple input control via messages 2021-10-22 00:56:46 +03:00
Insality
bbdf2b405d Add #143 to changelog 2021-10-21 00:40:19 +03:00
Insality
a8c2185d20 #143 Update all lang components on set_text_function 2021-10-21 00:38:23 +03:00
Insality
94197391a5 Update docs for #78 text update 2021-10-20 20:52:14 +03:00
Insality
4ef8316949 #78 Add text different adjust types 2021-10-20 20:24:31 +03:00
Insality
a501d3418b Add #125 to changelog 2021-10-17 18:28:55 +03:00
Insality
19ece205f8 #125 Now set_input_priority affects on all children of component 2021-10-17 18:28:11 +03:00
Insality
a014fca1a1 #66 Add set_whitelist and set_blacklist functions 2021-10-17 17:50:49 +03:00
Insality
a9de3771e3 #112 Add allow remap default Druid input bindings 2021-10-17 16:55:23 +03:00
Insality
087ca36d12 Add 132 to changelog 2021-10-17 16:43:59 +03:00
Insality
1219b02c10 #131 Add dynamic_poses for static grid 2021-10-17 16:36:45 +03:00
Maxim Tuprikov
b4560daa69
Merge pull request #136 from SalavatR/develop
Update scroll.lua
2021-08-07 13:03:45 +03:00
Maxim Tuprikov
ecc6e27057
Merge pull request #134 from astrochili/develop
Update README.md
2021-08-07 13:03:15 +03:00
SalavatR
732dad747c
Update scroll.lua 2021-08-04 20:44:36 +06:00
Roman Silin
b3dc9581d1
Update README.md 2021-07-18 16:48:01 +03:00
Insality
5d74531b4a Merge branch 'develop', add .gitattributes 2021-05-30 12:09:22 +03:00
Insality
8d3332204b Add git attributes for syntax highlight 2021-05-30 12:06:27 +03:00
Insality
105f672676 Merge branch 'develop': add example for grid animations 2021-05-30 11:54:20 +03:00
Insality
305c300f31 Update example 2021-05-30 11:52:56 +03:00
Insality
ffa3bafa00 Add deep linking for exampes in html 2021-05-30 11:50:37 +03:00
Insality
271fdd2b57 #132 Add example: add/remove grid with animations 2021-05-23 21:10:09 +03:00
Insality
63a6af3faa Fix typo 2021-04-08 00:29:57 +03:00
Insality
40c3609162 Update docs 2021-04-08 00:29:16 +03:00
Insality
d2fcb1aa85 Update changelogs 2021-04-06 00:34:29 +03:00
Maxim Tuprikov
c34ce714b1
Merge pull request #130 from Insality/develop
Release 0.6.0
2021-04-06 00:12:26 +03:00
Insality
9ff97b98ea Update docs, changelogs, example. Prepare to 0.6.0 release 2021-04-06 00:03:55 +03:00
Insality
015564f5b3 Add dynamic grid to navigate example 2021-04-05 23:16:52 +03:00
Insality
63d9d0260f Add disabled add/remove nodes example 2021-04-05 23:05:57 +03:00
Insality
c3f1b38a8a Fix scroll_to_index in data_list 2021-04-05 22:50:20 +03:00
Insality
4f621274c1 Update navigate example 2021-04-05 21:57:54 +03:00
Insality
b3e7f63e64 Add DataList scroll progress 2021-04-05 21:57:30 +03:00
Insality
077a84d7b1 Update examples, fix scroll params 2021-04-05 01:05:38 +03:00
Insality
f8458f8554 Update examples 2021-04-05 00:57:33 +03:00
Insality
29f4d6f47a Update data list examples 2021-04-05 00:52:19 +03:00
Insality
8a8a5e22a0 Add data_list_static_grid example 2021-04-05 00:21:06 +03:00
Insality
3a1cd8d210 Update changelog 2021-04-04 13:53:09 +03:00
Insality
4ea9f18e10 #127 Rename druid:create() to druid:new(). Create deprecated 2021-04-04 13:52:12 +03:00
Insality
20e65d8ff6 Update changelog 2021-04-04 13:48:04 +03:00
Maxim Tuprikov
c27ba03a77
Merge pull request #128 from Insality/117-update-examples
117 update examples
2021-04-04 13:46:08 +03:00
Insality
74a238a6bb Examples update 2021-04-04 13:45:20 +03:00
Insality
ebabb37761 Move all examples to separate collections 2021-04-04 13:39:08 +03:00
Insality
04d6babdff Move examples to new collections 2021-04-04 13:21:34 +03:00
Insality
24237899af Start rework examples system 2021-04-04 12:46:28 +03:00
Insality
995b16ad37 Merge branch 'develop' into 117-update-examples 2021-04-04 11:44:27 +03:00
Insality
a631f261d9 #101 Fix scroll to other node instead of swipe direction with scroll's points of intereset (without inert settings) 2021-04-04 11:30:39 +03:00
Insality
0472e5d6db Little code refactor, update changelog 2021-04-02 10:07:22 +03:00
Insality
12dcdd970b Update docs and changelog 2021-04-02 09:15:17 +03:00
Insality
c903000f83 Update changelog 2021-04-01 23:33:58 +03:00
Maxim Tuprikov
b19dc33b4a
Merge pull request #113 from Insality/43-infinity-scroll
43 infinity scroll
2021-04-01 23:17:30 +03:00
Insality
295aca26a3 Update docs 2021-04-01 23:16:16 +03:00
Insality
001fc163ea Update changelog 2021-04-01 23:03:28 +03:00
Insality
227d809c83 Update default page, update changelogs 2021-04-01 22:52:03 +03:00
Insality
2917affe5e #123 Add mouse scroll for Scroll component 2021-04-01 22:47:12 +03:00
Insality
72efdc13bf Rename Infinity list to Data list 2021-04-01 22:02:15 +03:00
Insality
03a00fe3d2 Update infinity list 2021-04-01 21:58:46 +03:00
Insality
6a44a7dcff Replace spaces with tabs 2021-04-01 21:29:28 +03:00
Insality
ac7d090cf0 Merge branch 'develop' into 43-infinity-scroll 2021-04-01 21:14:29 +03:00
Maxim Tuprikov
c5782b5cc2
Merge pull request #122 from Insality/102-input-priority
WIP #102 Add separate input priority component value
2021-04-01 21:11:31 +03:00
Insality
d6941994c5 Update Defold on 180 version 2021-04-01 21:10:07 +03:00
Insality
1bceadff71 Update changelog 2021-04-01 21:06:35 +03:00
Insality
58163caf25 Merge branch 'develop' into 102-input-priority 2021-04-01 21:00:13 +03:00
Insality
14dccea799 Update set/reset input priority functions. Remove increase_input_priority function 2021-04-01 20:59:47 +03:00
Maxim Tuprikov
eb1b03bd8b
Merge pull request #121 from Insality/116-input-component-arg
#116 Add ability to pass text component instead of text node name
2021-04-01 20:35:36 +03:00
Insality
4bf3363d8b Merge branch 'develop' into 116-input-component-arg
# Conflicts:
#	docs_md/changelog.md
2021-04-01 20:35:16 +03:00
Insality
87a5700587 Add changelog for changes 2021-04-01 20:34:55 +03:00
Insality
7c79985be6 #124 Add set_click_zone to scroll component 2021-04-01 20:32:29 +03:00
Insality
fe3ac2e985 Add locale_id in Lang Text component optional 2021-04-01 20:28:09 +03:00
Insality
44842f78dc Add set/reset input priority functions 2021-02-13 20:10:30 +05:00
Maxim Tuprikov
b254448e54
Merge pull request #120 from aglitchman/patch-2
Optimize Mobile/Web detection
2021-02-12 21:34:32 +05:00
Artsiom Trubchyk
fa559a2a28 Add sys info consts 2021-02-11 12:33:32 +03:00
Insality
731a47e01d Add separate input priority component value 2021-02-07 14:57:39 +05:00
Insality
2bafc0a140 Add ability to pass text component instead of text node name 2021-02-07 13:21:22 +05:00
Insality
8a173305de Better on end touch events 2021-02-07 13:14:30 +05:00
Artsiom Trubchyk
cfd654c1b2
Optimize helper.lua 2021-02-05 21:07:40 +03:00
Insality
7ac6c9b02b Add outside scroll vector, add correct check for is in view zone 2021-01-30 20:16:54 +05:00
Insality
2b5c5bf6fa Infinity scroll progress 2020-11-29 23:01:12 +03:00
Insality
897d401142 Add more annotations, update grid_page example 2020-11-29 22:17:51 +03:00
Insality
14a4e4365e Fix infinity list elements render count, little optimize scroll 2020-11-29 21:51:09 +03:00
Insality
dd3058db83 Add toggle stencil in infinity scroll example 2020-11-29 21:37:56 +03:00
Insality
de5dad8874 Update infinity_list, add optional context to druid event 2020-11-29 21:37:42 +03:00
Insality
e9a8dd0795 Optimize main example gui scene 2020-11-29 20:52:04 +03:00
Insality
834d0714e0 Fix static poses calculation 2020-11-09 01:11:22 +03:00
Insality
e038d70039 Return grid binding 2020-11-08 23:22:33 +03:00
Insality
74efdbfe71 Add shift policy to grids 2020-11-08 23:20:16 +03:00
Insality
560c6cb95f Start implement new check elements (for both dynamic and static grids). Add dynnamic infinityi scroll to example 2020-11-08 13:58:05 +03:00
Insality
ad59c30a89 Add scroll is_node_in_view function 2020-11-08 13:34:15 +03:00
Insality
4730da768f Update infinity page example script 2020-11-08 00:54:20 +03:00
Insality
7da1e1fab0 Infinity scroll works for static grid 2020-11-08 00:53:52 +03:00
Insality
6ec46545ec Add static grid get_size_for function 2020-11-08 00:53:35 +03:00
Insality
00aff86840 #86 set minimal step for scroll free intertion 2020-11-07 22:16:40 +03:00
Insality
3bbb4129c6 Add get_offset for grids, add offset for scroll content 2020-11-07 22:15:46 +03:00
Maxim Tuprikov
4e65895966
Merge pull request #109 from Insality/fix/several-improvements
Fix/several improvements
2020-11-07 17:29:15 +03:00
Insality
da085238cc #108 Move component interests const from const.lua to component.lua 2020-11-07 17:28:07 +03:00
Insality
86c7170053 #106 Add IS UNSELECT ON RESELECT style for Input component 2020-11-06 23:12:10 +03:00
Insality
23c0853d0a #105 make input.select and input.unselect public methods 2020-11-06 22:58:29 +03:00
Insality
8d0138c770 #103 add helper.centrate_nodes 2020-11-06 22:42:30 +03:00
Insality
2ef2a61dfa Merge fixes 2020-11-03 23:25:59 +03:00
Insality
90d8e6c57f Merge branch 'develop' into 43-infinity-scroll
# Conflicts:
#	druid/base/grid.lua
#	druid/const.lua
#	druid/system/druid_instance.lua
2020-11-03 23:25:02 +03:00
Insality
f7b8593465 Rename input.selected to input.is_selected (according to the docs) 2020-11-03 19:49:00 +03:00
Insality
5d9951e03f Add return node on grid's remove function 2020-11-03 19:46:20 +03:00
Insality
7bbfbab45e Update druid_instance component creating docs 2020-11-02 19:25:37 +03:00
Maxim Tuprikov
36109139fb
Merge pull request #97 from Insality/92-setup-actions
92 setup actions
2020-10-16 10:49:36 +03:00
Insality
9ecb7daa45 Add github actions badges 2020-10-16 10:47:59 +03:00
Insality
f45617be5b Return push test result step 2020-10-16 10:43:46 +03:00
Insality
b5e5d0fed0 Add test collection 2020-10-16 10:41:11 +03:00
Insality
281d42682e Remove liveupdate settings paths 2020-10-16 10:36:02 +03:00
Insality
92abfb3d73 Add github actions 2020-10-16 10:34:01 +03:00
Insality
cecd8c9d5a Typo fix 2020-10-15 22:16:15 +03:00
Insality
89830a830e Fix remove several children components 2020-10-15 22:09:29 +03:00
Insality
283f2957ff Rename faq.md -> FAQ.md 2020-10-14 11:10:19 +03:00
Maxim Tuprikov
8215806af8
Merge pull request #96 from marconett/marconett-patch-1
readme update
2020-10-14 10:55:12 +03:00
Maxim Tuprikov
7af156cb62
Merge branch 'develop' into marconett-patch-1 2020-10-14 10:53:42 +03:00
Insality
e21823407f Update annotations 2020-10-12 22:08:05 +03:00
Marco
6dfbb8d8df
readme update
grammar, fixed links
2020-10-12 14:05:44 +02:00
Insality
67ecca4448 Fix slider args typo 2020-10-12 01:44:25 +03:00
Insality
22f947859a Add update docs scripts, updated docs 2020-10-12 00:45:42 +03:00
Insality
cebba9a1a3 Update documentation 2020-10-12 00:30:03 +03:00
Maxim Tuprikov
50d0293097
Merge pull request #95 from Insality/75-emmylua-annotations
75 emmylua annotations
2020-10-12 00:28:17 +03:00
Insality
56d42d6949 Update annotations: dynamic_grid, input, lang_text, progress, radio_roup, slider, timer 2020-10-12 00:18:37 +03:00
Insality
bea8e3b329 Update annotations: swipe, text, checkbox, checkbox_group, druid_instance 2020-10-12 00:03:58 +03:00
Insality
248b9c30f9 Update annotations: scroll, static_grid, events, druid_instance 2020-10-11 23:53:30 +03:00
Insality
082aa454c6 Update annotations: scroll, hover and drag 2020-10-11 23:40:16 +03:00
Insality
99a5c87560 Add initial druid emmylua annotations 2020-10-11 23:25:58 +03:00
Insality
5ff6b69dd4 Update annotations: back_handler and blocker 2020-10-11 23:25:23 +03:00
Insality
62cca31b28 Update BaseComponent annotations 2020-10-11 23:18:53 +03:00
Insality
fbef0cbe54 Add button correct annotations 2020-10-11 22:47:05 +03:00
Insality
3933d53c07 Update README 2020-10-04 00:28:40 +03:00
Insality
9ab9e7b21a Merge branch 'develop' 2020-09-29 23:49:38 +03:00
Insality
88dbdf4511 Update example app 2020-09-29 23:48:58 +03:00
Insality
29c22d5d45 Increment Druid version 2020-09-29 23:46:56 +03:00
Insality
d2aff432f0 Update ldoc 2020-09-29 23:46:32 +03:00
Insality
3e7baa896b Update changelog 2020-09-29 23:40:15 +03:00
Insality
5002ac1a20 Update README.md 2020-09-29 23:28:26 +03:00
Insality
f1aa5e91a1 #83 update documentation 2020-09-29 23:26:27 +03:00
Maxim Tuprikov
327bc48086
Merge pull request #94 from Insality/feature/93-name-refactor
Renamed class functions
2020-09-29 23:10:21 +03:00
Insality
0d07deb23a Renamed class functions 2020-09-29 23:09:37 +03:00
Maxim Tuprikov
b9f8fc95f5
Merge pull request #90 from Insality/feature/77-grid-update
Feature/77 grid update
2020-09-28 22:25:40 +03:00
Insality
0b56a18578 Add more annotations 2020-09-28 22:22:46 +03:00
Insality
e00ab4f0a1 Update grid example 2020-09-28 22:11:09 +03:00
Insality
67b43ca800 Fix new lines in markdown 2020-09-28 22:01:55 +03:00
Insality
e97b0d22c8 Add dynamic_grid and lang_text to the extended components 2020-09-28 21:58:52 +03:00
Insality
59aed96d33 Update README and components documentation 2020-09-28 21:56:46 +03:00
Insality
453c8327c8 Update FAQ 2020-09-28 21:40:09 +03:00
Insality
a36ba5ab1c Add more available pivots for dynamic grid 2020-09-28 02:58:43 +03:00
Insality
af61d4561a Update changelogs 2020-09-28 02:52:38 +03:00
Insality
0e96c582c9 Better grid example hints 2020-09-28 02:33:47 +03:00
Insality
1c292f44b7 Remove grid and scroll from main page in example 2020-09-28 02:24:20 +03:00
Insality
c4589857db Remove set_offset grid functions 2020-09-28 02:23:10 +03:00
Insality
246574c86b Update grid and scroll documentation 2020-09-28 02:21:44 +03:00
Insality
0b1051b5b2 Add scroll:bind_grid function 2020-09-28 01:56:43 +03:00
Insality
c0bd3e599b Add correct static grid node spawn 2020-09-28 01:42:49 +03:00
Insality
40af3f6181 Remove scroll offset 2020-09-28 01:36:14 +03:00
Insality
caeb3bbf2f Add offset to grid components to center nodes 2020-09-28 01:35:44 +03:00
Insality
a6963f1055 Refactor dynamic_gri remove 2020-09-27 23:19:35 +03:00
Insality
954e4c0d6e Remove scroll node color (debug mode) 2020-09-27 22:33:37 +03:00
Insality
ea0e7366d0 Refactor dynamic grid add 2020-09-27 22:33:26 +03:00
Insality
f6b7aba87f Start implement correct add/remove for dynamic grid with node shifts 2020-09-27 22:14:19 +03:00
Insality
5db669218d Add dynamic grid horizontal example. Add control buttons for gris 2020-09-27 22:13:34 +03:00
Insality
19139ca0ef Add dirty add_scroll_offset to scroll component 2020-09-27 22:13:15 +03:00
Insality
5c4497330c Add vertical dynamic grid to example 2020-09-27 18:59:54 +03:00
Insality
f25a8acd95 Remove side from dynamic_grid, move it to node pivot 2020-09-24 09:32:39 +03:00
Insality
d0385a3c03 FIx dynamic grid sides 2020-09-24 09:23:45 +03:00
Insality
4e476d7e67 Merge branch 'develop' into feature/77-grid-update
# Conflicts:
#	docs_md/changelog.md
#	druid/component.lua
2020-09-23 23:15:37 +03:00
Maxim Tuprikov
b5779f5984
Merge pull request #89 from Insality/feature/88-input-disabling
Feature/88 input disabling
2020-09-23 01:54:16 +03:00
Insality
b7eb7a6782 Update changelog 2020-09-23 01:52:58 +03:00
Insality
c8bf57ecd3 Move several component functions to private scope 2020-09-23 01:51:10 +03:00
Insality
3c32a5f75e Add set_input_state for component to enable/disable input 2020-09-23 01:29:16 +03:00
Insality
71b393b2c2 Add children list to the component 2020-09-23 01:28:54 +03:00
Insality
54a1eda738 Refactor Component to class notation 2020-09-23 01:22:27 +03:00
Insality
ba12a9868a Add __tostring to component class 2020-09-23 01:21:44 +03:00
Insality
28087da814 Update grid changelogs 2020-09-22 08:31:16 +03:00
Insality
fab60a3783 Add FAQ documentation stub 2020-09-22 08:20:36 +03:00
Insality
034abda460 Refactor scroll component (renamed functions) 2020-09-22 00:30:41 +03:00
Insality
7b1feee341 Add scroll:set_horizontal/vertical_scroll functions 2020-09-22 00:25:14 +03:00
Insality
47562de78a Add scroll to grid examples 2020-09-22 00:13:59 +03:00
Insality
63186823e9 Merge branch 'develop' into feature/77-grid-update
# Conflicts:
#	druid/helper.lua
#	druid/system/druid_instance.lua
2020-09-22 00:13:44 +03:00
Maxim Tuprikov
e9720d1676
Merge pull request #87 from Insality/feature/85-extended-components
Move components to extended. Make stubs for ready to make it requirable
2020-09-21 23:30:39 +03:00
Insality
23e2846a60 Move components to extended. Make stubs for ready to make it requirable 2020-09-21 23:28:20 +03:00
Insality
f8731b2640 Add initial progress on dynamic grid 2020-09-21 23:00:51 +03:00
Insality
6ce14a7a1c Add dynamic grid component stub 2020-09-21 01:47:00 +03:00
Insality
15a94173d2 Refactor StaticGrid component. Change component:get_nodes -> component:get_component_nodes 2020-09-21 01:25:26 +03:00
Insality
442ea090d3 Add grid:get_nodes function 2020-09-21 01:12:31 +03:00
Insality
94099e0a3e Add annotations to static grid 2020-09-21 01:05:37 +03:00
Insality
fbcb620a8a Fix get_index by pos grid function 2020-09-21 01:01:00 +03:00
Insality
07c57d5cc6 Add border offset fixes 2020-09-21 00:47:08 +03:00
Insality
ace1fc6cb1 Add node shift at add/remove for static grid 2020-09-21 00:37:44 +03:00
Insality
cf87c89cff Update grid usage at grid example page 2020-09-21 00:00:00 +03:00
Insality
0dc9f32b7a Add druid:new instead of druid:create 2020-09-20 23:51:22 +03:00
Insality
9230f9545c Change annotations grid -> static_grid 2020-09-20 23:49:42 +03:00
Insality
cded2b153c Remove const.grid_type 2020-09-20 23:11:09 +03:00
Insality
d410192669 Add helper.deprecated function. Renamed grid to static_grid 2020-09-20 23:09:11 +03:00
Insality
02e238348b Copy grid from infinity scroll tests 2020-09-20 23:03:59 +03:00
Insality
1b9901edd9 Merge branch 'develop' into feature/77-grid-update
# Conflicts:
#	druid/base/grid.lua
2020-09-20 23:03:33 +03:00
Insality
2d2790f760 Add more infinity scroll example 2020-09-16 01:23:11 +03:00
Insality
f027d4ac96 Add grid node anchor correct for calculate borders 2020-09-16 00:47:24 +03:00
Insality
7a6e8bbef3 Add example of infinity scroll 2020-09-16 00:34:38 +03:00
Insality
f0a9d5818f Add infinity list component 2020-09-16 00:34:00 +03:00
Insality
04c39f1ce2 Add on layout change initial support 2020-09-16 00:31:05 +03:00
Insality
bce68d9c35 Merge branch 'develop' 2020-07-19 13:11:15 +03:00
Insality
40b2837608 Add changelog 2020-07-19 13:10:54 +03:00
Insality
f182439f2a #76 add params for lang text string.format 2020-07-18 22:16:24 +03:00
Insality
a561892fb6 #80 fix hover function call set_enabled 2020-07-18 21:47:15 +03:00
Insality
3ba51f3e9d #79 fix remove in on_input, add grid page example 2020-07-18 21:42:51 +03:00
Insality
32c3316a53 Add get_pos and get_index methods 2020-07-12 12:39:15 +03:00
Insality
a92e4e6ae0 Add grid update position function 2020-07-12 12:30:13 +03:00
Insality
69dd2ce9e3 Add my editor scripts for gui 2020-06-18 01:58:42 +03:00
568 changed files with 58511 additions and 28016 deletions

2
.defignore Normal file
View File

@ -0,0 +1,2 @@
/dist
/.deployer_cache

18
.gitattributes vendored Normal file
View File

@ -0,0 +1,18 @@
# Defold GLSL Shaders
*.fp linguist-language=GLSL
*.vp linguist-language=GLSL
# Defold Lua Files
*.editor_script linguist-language=Lua
*.render_script linguist-language=Lua
*.script linguist-language=Lua
*.gui_script linguist-language=Lua
# Defold Files
*.atlas linguist-language=JSON5
*.collection linguist-language=JSON5
*.font linguist-language=JSON5
*.go linguist-language=JSON5
*.gui linguist-language=JSON5
*.tilemap linguist-language=JSON5
*.tilesource linguist-language=JSON5

5
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,5 @@
# These are supported funding model platforms
github: insality
ko_fi: insality
buy_me_a_coffee: insality

28
.github/workflows/ci-workflow.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: Run tests
on: [push]
jobs:
build_and_run:
name: Build and run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '21'
- name: Build && Run
run: |
deployer_url="https://raw.githubusercontent.com/Insality/defold-deployer/1/deployer.sh"
curl -s ${deployer_url} | bash -s lbd --headless --settings ./test/test.ini
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: insality/druid

8
.gitignore vendored
View File

@ -9,3 +9,11 @@ Thumbs.db
.cproject
builtins
dist
deployer_version_settings.txt
.deployer_cache
bob*.jar
manifest.private.der
manifest.public.der
/.editor_settings
/.deployer_cache

View File

@ -1,51 +0,0 @@
std = "max"
files['.luacheckrc'].global = false
unused_args = false
max_code_line_length = 90
max_comment_line_length = false
globals = {
"sys",
"go",
"gui",
"label",
"render",
"crash",
"sprite",
"sound",
"tilemap",
"spine",
"particlefx",
"physics",
"factory",
"collectionfactory",
"iac",
"msg",
"vmath",
"url",
"http",
"image",
"json",
"zlib",
"iap",
"push",
"facebook",
"hash",
"hash_to_hex",
"pprint",
"init",
"final",
"update",
"on_input",
"on_message",
"on_reload",
"socket",
"table",
"debug",
"timer",
"window",
"buffer",
"resource",
"defos",
}

76
.luacov Normal file
View File

@ -0,0 +1,76 @@
local reporter = require("luacov.reporter.defold")
--- Default values for configuration options.
-- For project specific configuration create '.luacov' file in your project
-- folder. It should be a Lua script setting various options as globals
-- or returning table of options.
-- @class module
-- @name deftest.coverage.configuration
return {
--- Reporter class to use when creating a report. Default: DefaultReporter from reporter.lua
reporter = reporter,
--- Filename to store collected stats. Default: "luacov.stats.out".
statsfile = "luacov.stats.out",
--- Filename to store report. Default: "luacov.report.out".
reportfile = "luacov.report.out",
--- Enable saving coverage data after every `savestepsize` lines?
-- Setting this flag to `true` in config is equivalent to running LuaCov
-- using `luacov.tick` module. Default: false.
tick = false,
--- Stats file updating frequency for `luacov.tick`.
-- The lower this value - the more frequently results will be written out to the stats file.
-- You may want to reduce this value (to, for example, 2) to avoid losing coverage data in
-- case your program may terminate without triggering luacov exit hooks that are supposed
-- to save the data. Default: 100.
savestepsize = 100,
--- Run reporter on completion? Default: true.
runreport = true,
--- Delete stats file after reporting? Default: false.
deletestats = true,
--- Process Lua code loaded from raw strings?
-- That is, when the 'source' field in the debug info
-- does not start with '@'. Default: true.
codefromstrings = true,
--- Lua patterns for files to include when reporting.
-- All will be included if nothing is listed.
-- Do not include the '.lua' extension. Path separator is always '/'.
-- Overruled by `exclude`.
-- @usage
-- include = {
-- "mymodule$", -- the main module
-- "mymodule%/.+$", -- and everything namespaced underneath it
-- }
include = {},
--- Lua patterns for files to exclude when reporting.
-- Nothing will be excluded if nothing is listed.
-- Do not include the '.lua' extension. Path separator is always '/'.
-- Overrules `include`.
exclude = {
"^test%/.+$",
"^druid/system/utf8.lua$",
},
--- Table mapping names of modules to be included to their filenames.
-- Has no effect if empty.
-- Real filenames mentioned here will be used for reporting
-- even if the modules have been installed elsewhere.
-- Module name can contain '*' wildcard to match groups of modules,
-- in this case corresponding path will be used as a prefix directory
-- where modules from the group are located.
-- @usage
-- modules = {
-- ["some_rock"] = "src/some_rock.lua",
-- ["some_rock.*"] = "src"
-- }
modules = {},
}

41
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,41 @@
{
"Lua.diagnostics.globals": [
"init",
"final",
"update",
"on_message",
"on_input",
"describe",
"before",
"after",
"it",
"utf8",
"defos",
"clipboard",
"editor"
],
"Lua.workspace.checkThirdParty": false,
"Lua.diagnostics.neededFileStatus": {
"undefined-field": "Any",
"assign-type-mismatch": "Any",
"missing-return": "Any",
"missing-fields": "Any",
"return-type-mismatch": "Any",
"lowercase-global": "Any"
},
"Lua.workspace.ignoreDir": [
".vscode",
"test/tests/*.lua",
"utils/annotations_manual.lua"
],
"Lua.runtime.pathStrict": true,
"Lua.diagnostics.libraryFiles": "Disable",
"Lua.runtime.version": "Lua 5.1",
"Lua.workspace.library": [
"~/Library/Application Support/Cursor/User/globalStorage/astronachos.defold",
"~/Library/Application Support/Cursor/User/workspaceStorage/1446075a23c89451a63f0e82b2291def/astronachos.defold"
],
"files.exclude": {
"**/*.gui": true
}
}

116
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,116 @@
# Contributing to Druid
Thank you for your interest in contributing to **Druid**! We welcome contributions of all sizes - even small fixes make a big difference.
## Table of Contents
- [How to Report Issues](#how-to-report-issues)
- [Small Fixes](#small-fixes)
- [Larger Contributions](#larger-contributions)
- [Documentation Updates](#documentation-updates)
- [Adding or Updating Examples](#adding-or-updating-examples)
- [Unit Tests](#unit-tests)
## How to Report Issues
Found a bug? Please report it to our [issue tracker](https://github.com/druid-js/druid/issues) with:
- A clear description of the problem
- Steps to reproduce the issue
- Expected vs. actual behavior
- Your environment (Defold version, OS, etc.)
## Small Fixes
**We highly encourage small improvements!** For bug fixes, typo corrections, or minor improvements, you can create a pull request directly to the `master` or `develop` branch.
When making these contributions, you **must**:
1. Update the patch version number in both:
- `README.md` file (in the dependency section)
- `game.project` file (in the project section)
2. Add your changes to `wiki/changelog.md`
3. These steps are required to properly tag a new release
**Example of version updates:**
For README.md:
```
# Before
https://github.com/Insality/druid/archive/refs/tags/1.1.0.zip
# After (patch version increased)
https://github.com/Insality/druid/archive/refs/tags/1.1.1.zip
```
For game.project:
```
# Before
[project]
title = Druid
version = 1.1.0
# After (patch version increased)
[project]
title = Druid
version = 1.1.1
```
## Larger Contributions
For new features, major improvements, or complex fixes:
1. Fork the repository
2. Create a branch from `develop`
3. Make your changes
4. Ensure code follows project style guidelines
5. Test your changes thoroughly
6. Submit a pull request to the `develop` branch
7. Include references to any related issues (e.g., "Fixes #123")
Please keep changes focused on addressing specific issues or features, and maintain the existing code style.
## Documentation Updates
To improve documentation:
1. Fork the repository
2. Create a branch for your changes
3. Update the relevant documentation files
4. Submit a pull request to the `master` or `develop` branch
Clear, accurate documentation helps everyone, so documentation improvements are always appreciated!
## Adding or Updating Examples
Examples are vital for helping users understand how to use Druid. Each example should include:
1. A GUI scene with a Druid widget
2. Information about the example in `examples_list.lua`
To add a new example:
1. Create a new GUI file in the `/example/examples` directory
2. Add the example information to `examples_list.lua`
3. Include your GUI template in `/example/druid.gui`
- Place it inside the proper hierarchy: `root -> container_center -> examples -> widgets`
4. Test your example by running the game
5. Submit a pull request to the `develop` branch
## Unit Tests
Unit tests help ensure Druid works correctly. If you're facing an issue, unit tests can be a good starting point to understand or reproduce it.
All tests are located in the `/test/tests` directory.
To run tests:
1. Set the bootstrap collection to `/test/test.collection`
2. Run the project
To submit new or updated tests:
1. Create a branch for your changes
2. Add or modify tests
3. Verify your tests pass
4. Submit a pull request to the `develop` branch
---
Thank you for contributing to making Druid better for everyone! ❤️

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020 Maxim Tuprikov
Copyright (c) 2025 Maxim Tuprikov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

338
README.md
View File

@ -1,165 +1,79 @@
[![](media/druid_logo.png)](https://insality.github.io/druid/)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/insality/druid)](https://github.com/Insality/druid/releases)
[![GitHub release (latest by date)](https://img.shields.io/github/v/tag/insality/druid?style=for-the-badge&label=Release)](https://github.com/Insality/druid/tags)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/insality/druid/ci-workflow.yml?branch=master&style=for-the-badge)](https://github.com/Insality/druid/actions)
[![codecov](https://img.shields.io/codecov/c/github/Insality/druid?style=for-the-badge)](https://codecov.io/gh/Insality/druid)
**Druid** - powerful Defold component UI library. Use basic **Druid** components or make your own game-specific components to make amazing GUI in your games.
[![Github-sponsors](https://img.shields.io/badge/sponsor-30363D?style=for-the-badge&logo=GitHub-Sponsors&logoColor=#EA4AAA)](https://github.com/sponsors/insality) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/insality) [![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/insality)
**Druid** - a powerful, flexible and easy to use **Defold** component UI framework. Contains a wide range of UI components that you can use to create a beautiful, responsive and customizable GUIs. Provides a powerful way to create, compose and manage your custom components and scenes.
## Druid Example
Check the [**HTML5 version**](https://insality.github.io/druid/) of the **Druid** example app.
In this example you can inspect a variety of **Druid** components and see how they work. Each example page provides a direct link to the corresponding example code, making it easier for you to understand how to use **Druid**.
## Features
- **Components Rich** - Provides a extensive set of components, from basic buttons to infinity data lists and rich texts
- **Customizable** - You can customize components appearance and behaviour with their API and styles
- **Widgets** - Powerful way to create your own reusable components
- **Input Handling** - Handles input in a stack-based manner and manage input priority
- **Event Based** - Uses [Defold Event](https://github.com/Insality/defold-event) for components callbacks and communication between components
## Quick Links
- [Basic Usage](wiki/basic_usage.md)
- [Quick API Reference](api/quick_api_reference.md)
- [List of Components](#druid-components)
- [Contributors](#contributors)
## Setup
### Dependency
### [Dependency](https://defold.com/manuals/libraries/#setting-up-library-dependencies)
You can use the **Druid** extension in your own project by adding this project as a [Defold library dependency](https://www.defold.com/manuals/libraries/). Open your game.project file and in the dependencies field under project add:
> [https://github.com/Insality/druid/archive/master.zip](https://github.com/Insality/druid/archive/master.zip)
Or point to the ZIP file of a [specific release](https://github.com/Insality/druid/releases).
### Input bindings
For **Druid** to work requires next input bindings:
- Mouse trigger - `Button 1` -> `touch` _For basic input components_
- Key trigger - `Backspace` -> `key_backspace` _For back_handler component, input component_
- Key trigger - `Back` -> `key_back` _For back_handler component, Android back button, input component_
- Key trigger - `Enter` -> `key_enter` _For input component, optional_
- Key trigger - `Esc` -> `key_esc` _For input component, optional_
- Touch triggers - `Touch multi` -> `multitouch` _For scroll component_
![](media/input_binding_2.png)
![](media/input_binding_1.png)
Open your `game.project` file and add the following lines to the dependencies field under the project section:
### Input capturing [optional]
**[Druid](https://github.com/Insality/druid/)**
By default, **Druid** will auto-capture input focus, if any input component will be created. So you don't need to call `msg.post(".", "acquire_input_focus)"`
If you not need this behaviour, you can disable it by settings `druid.no_auto_input` field in _game.project_:
```
[druid]
no_auto_input = 1
https://github.com/Insality/druid/archive/refs/tags/1.1.4.zip
```
### Code [optional]
**[Defold Event](https://github.com/Insality/defold-event)**
Adjust **Druid** settings, if needed:
```lua
local druid = require("druid.druid")
-- Used for button component and custom components
-- Callback should play sound by name
druid.set_sound_function(callback)
-- Used for lang_text component
-- Callback should return localized string by locale id
druid.set_text_function(callback)
-- Used for change default druid style
druid.set_default_style(your_style)
-- Call this function on language changing in the game,
-- to retranslate all lang_text components:
druid.on_language_change()
-- Call this function on layout changing in the game,
-- to reapply layouts
druid.on_layout_change()
-- Call this function inside window.set_listener
-- to catch game focus lost/gained callbacks:
druid.on_window_callback(event)
```
https://github.com/Insality/defold-event/archive/refs/tags/11.zip
```
After that, select `Project ▸ Fetch Libraries` to update [library dependencies]((https://defold.com/manuals/libraries/#setting-up-library-dependencies)). This happens automatically whenever you open a project so you will only need to do this if the dependencies change without re-opening the project.
## Components
**Druid** provides next basic components:
- **[Button](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#button)** - Basic Druid input component
- **[Text](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#text)** - Basic Druid text component
- **[Lang text](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#lang-text)** - Wrap on Text component to handle localization
- **[Scroll](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#scroll)** - Basic Druid scroll component
- **[Progress](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#progress)** - Basic Druid progress bar component
- **[Slider](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#slider)** - Basic Druid slider component
- **[Input](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#input)** - Basic Druid text input component (unimplemented)
- **[Checkbox](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#checkbox)** - Basic Druid checkbox component
- **[Checkbox group](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#checkbox-group)** - Several checkboxes in one group
- **[Radio group](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#radio-group)** - Several checkboxes in one group with single choice
- **[Blocker](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#blocker)** - Block input in node zone component
- **[Back Handler](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#back-handler)** - Handle back button (Android back, backspace)
- **[Timer](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#timer)** - Handle timer work on gui text node
- **[Grid](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#grid)** - Component for manage node positions
- **[Hover](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#hover)** - System Druid component, handle hover node state
- **[Swipe](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#swipe)** - System Druid component, handle swipe gestures on node
- **[Drag](https://github.com/Insality/druid/blob/master/docs_md/01-components.md#drag)** - System Druid component, handle drag input on node
Full info see on _[components.md](https://github.com/Insality/druid/blob/master/docs_md/01-components.md)_
Here is a list of [all releases](https://github.com/Insality/druid/releases).
## Basic usage
### Library Size
For using **Druid**, first you should create Druid instance to spawn components. Pass to new Druid instance main engine functions: *update*, *on_message* and *on_input*
> **Note:** The library size is calculated based on the build report per platform. Full size contains all components, they can be stripped out in the build process if you don't need them.
All **Druid** components as arguments can apply node name string, you can don't do `gui.get_node()` before
All **Druid** and component methods calling with `:` like `self.druid:new_button()`
```lua
local druid = require("druid.druid")
local function button_callback(self)
print("Button was clicked!")
end
function init(self)
self.druid = druid.new(self)
self.druid:new_button("button_node_name", button_callback)
end
function final(self)
self.druid:final()
end
function on_input(self, action_id, action)
return self.druid:on_input(action_id, action)
end
```
## Druid Events
Any **Druid** components as callbacks uses [Druid Events](https://insality.github.io/druid/modules/druid_event.html). In component API ([button example](https://insality.github.io/druid/modules/druid.button.html#Events)) pointed list of component events. You can manually subscribe on this events by next API:
- **event:subscribe**(callback)
- **event:unsubscribe**(callback)
- **event:clear**()
Any events can handle several callbacks, if needed.
| Platform | Full Size |
| ---------------- | ------------- |
| HTML5 | **84.52 KB** |
| Desktop / Mobile | **141.03 KB** |
## Druid lifecycle
### 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/wiki/advanced-setup.md#input-bindings).
## Usage
### Basic usage
The basic template for `gui_script` is:
Here is full druid lifecycle setup in your ***.gui_script** file:
```lua
local druid = require("druid.druid")
@ -175,65 +89,145 @@ function update(self, dt)
self.druid:update(dt)
end
function on_input(self, action_id, action)
return self.druid:on_input(action_id, action)
end
function on_message(self, message_id, message, sender)
self.druid:on_message(message_id, message, sender)
end
function on_input(self, action_id, action)
return self.druid:on_input(action_id, action)
end
```
- *final* required function for correct druid lifecycle
- *on_input* used for almost all basic druid components
- *update* used for progress bar, scroll and timer base components
- *on_message* used for specific druid events, like language change or layout change
Recommended is fully integrate all druid lifecycles functions
Read the [Basic Usage](wiki/basic_usage.md) to learn how to use **Druid**, how to create your own components and how to use widgets.
## Features
### API Documentation
- Druid input goes as stack. Last created button will checked first. So create your GUI from back
- Don't forget about `return` in `on_input`: `return self.druid:on_input()`. It need, if you have more than 1 acquire inputs (several druid, other input system, etc)
- Druid by default do _acquire_input_focus_. So you don't need do it manually. Buy only if you have components, which requires _on_input_
Best start is from the [Quick API Reference](api/quick_api_reference.md)
With next quick links:
- [Druid Instance](api/druid_instance_api.md) - **Druid** instance returned from `druid.new(self)`
- [Helper](api/druid_helper_api.md) - A lot of useful functions
- [Widgets](wiki/widgets.md) - About widgets and how to use them
## Druid Components
Here is full **Druid** components list.
### Components
| Name | Description | Example | <div style="width:200px">Preview</div> |
|------|-------------|---------|---------|
| **[Button](/api/components/base/button_api.md)** | Logic over GUI Node. Handle the user click interactions: click, long click, double click, etc. | [Button Example](https://insality.github.io/druid/?example=ui_example_basic_button) | <img src="media/preview/button.gif" width="200" height="100"> |
| **[Text](/api/components/base/text_api.md)** | Logic over GUI Text. By default Text component fit the text inside text node size area with different adjust modes. | [Text Example](https://insality.github.io/druid/?example=ui_example_basic_text) | <img src="media/preview/text.gif" width="200" height="100"> |
| **[Scroll](/api/components/base/scroll_api.md)** | Logic over two GUI Nodes: input and content. Provides basic behaviour for scrollable content. | [Scroll Example](https://insality.github.io/druid/?example=ui_example_basic_scroll) | <img src="media/preview/scroll.gif" width="200" height="100"> |
| **[Blocker](/api/components/base/blocker_api.md)** | Logic over GUI Node. Don't pass any user input below node area size. | [Blocker Example](https://insality.github.io/druid/?example=ui_example_basic_blocker) | <img src="media/preview/blocker.gif" width="200" height="100"> |
| **[Back Handler](/api/components/base/back_handler_api.md)** | Call callback on user "Back" action. It's a Android back button or keyboard backspace key | [Back Handler Example](https://insality.github.io/druid/?example=ui_example_basic_back_handler) | <img src="media/preview/back_handler.gif" width="200" height="100"> |
| **[Static Grid](/api/components/base/static_grid_api.md)** | Logic over GUI Node. Component to manage node positions with all equal node sizes. | [Static Gid Example](https://insality.github.io/druid/?example=ui_example_basic_grid) | <img src="media/preview/static_grid.gif" width="200" height="100"> |
| **[Hover](/api/components/base/hover_api.md)** | Logic over GUI Node. Handle hover action over node. For both: mobile touch and mouse cursor. | [Hover Example](https://insality.github.io/druid/?example=ui_example_basic_hover) | <img src="media/preview/hover.gif" width="200" height="100"> |
| **[Swipe](/api/components/extended/swipe_api.md)** | Logic over GUI Node. Handle swipe gestures over node. | [Swipe Example](https://insality.github.io/druid/?example=ui_example_basic_swipe) | <img src="media/preview/swipe.gif" width="200" height="100"> |
| **[Drag](/api/components/base/drag_api.md)** | Logic over GUI Node. Handle drag input actions. Can be useful to make on screen controlls. | [Drag Example](https://insality.github.io/druid/?example=ui_example_basic_drag) | <img src="media/preview/drag.gif" width="200" height="100"> |
| **[Data List](/api/components/extended/data_list_api.md)** | Logic over Scroll and Grid components. Create only visible GUI nodes or components to make "infinity" scroll befaviour | [Data List Example](https://insality.github.io/druid/?example=ui_example_data_list_basic) | <img src="media/preview/data_list.gif" width="200" height="100"> |
| **[Input](/api/components/extended/input_api.md)** | Logic over GUI Node and GUI Text (or Text component). Provides basic user text input. | [Input Example](https://insality.github.io/druid/?example=ui_example_basic_input) | <img src="media/preview/input.gif" width="200" height="100"> |
| **[Lang text](/api/components/extended/lang_text_api.md)** | Logic over Text component to handle localization. Can be translated in real-time with `druid.on_language_change` | [Lang Text Example](https://insality.github.io/druid/?example=ui_example_window_language) | <img src="media/preview/lang_text.gif" width="200" height="100"> |
| **[Progress](/api/components/extended/progress_api.md)** | Logic over GUI Node. Handle node size and scale to handle progress node size. | [Progress Example](https://insality.github.io/druid/?example=ui_example_basic_progress_bar) | <img src="media/preview/progress.gif" width="200" height="100"> |
| **[Slider](/api/components/extended/slider_api.md)** | Logic over GUI Node. Handle draggable node with position restrictions. | [Slider Example](https://insality.github.io/druid/?example=ui_example_basic_slider) | <img src="media/preview/slider.gif" width="200" height="100"> |
| **[Timer](/api/components/extended/timer_api.md)** | Logic over GUI Text. Handle basic timer functions. | [Timer Example](https://insality.github.io/druid/?example=ui_example_basic_timer) | <img src="media/preview/timer.gif" width="200" height="100"> |
| **[Hotkey](/api/components/extended/hotkey_api.md)** | Allow to set callbacks for keyboard hotkeys with key modificators. | [Hotkey Example](https://insality.github.io/druid/?example=ui_example_basic_hotkey) | <img src="media/preview/hotkey.gif" width="200" height="100"> |
| **[Layout](/api/components/extended/layout_api.md)** | Logic over GUI Node. Arrange nodes inside layout node with margin/paddings settings. | [Layout Example](https://insality.github.io/druid/?example=ui_example_layout_basic) | <img src="media/preview/layout.gif" width="200" height="100"> |
| **[Rich Input](/api/components/custom/rich_input_api.md)** | Logic over GUI Node and GUI Text (or Text component). Provides rich text input with different styles and text formatting. | [Rich Input Example](https://insality.github.io/druid/?example=ui_example_basic_rich_input) | <img src="media/preview/rich_input.gif" width="200" height="100"> |
| **[Rich Text](/api/components/custom/rich_text_api.md)** | Logic over GUI Text. Provides rich text formatting with different styles and text formatting. | [Rich Text Example](https://insality.github.io/druid/?example=ui_example_basic_rich_text) | <img src="media/preview/rich_text.gif" width="200" height="100"> |
## Druid Events
All **Druid** components using [Defold Event](https://github.com/Insality/defold-event) for components callbacks. In component API ([button example](/api/components/base/button_api.md#fields)) pointed list of component events. You can manually subscribe to these events with the following API:
- **event:subscribe**(callback)
- **event:unsubscribe**(callback)
You can subscribe several callbacks to a single event.
Examples:
```lua
button.on_click:subscribe(function(self, args)
print("Button clicked!")
end)
scroll.on_scroll:subscribe(function(self, position)
print("Scroll scrolled!")
end)
input.on_input_unselect:subscribe(function(self, text)
print("User enter input:", text)
end)
```
## Details
- **Druid** processes input in a stack-based manner. The most recently created button will be checked first. Create your input GUI components from back to front.
- Remember to include `return` in the `on_input` function: `return self.druid:on_input()`. This is necessary if you have multiple input sources (multiple Druid instances, other input systems, etc.).
- Druid automatically calls `acquire_input_focus` if you have input components. Therefore, manual calling of `acquire_input_focus` is not required.
- When deleting a **Druid** component node, make sure to remove it using `druid:remove(component)`.
## Examples
See the [example folder](https://github.com/Insality/druid/tree/develop/example) for examples of how to use **Druid**
Try the [**HTML5 version**](https://insality.github.io/druid/) of the **Druid** example app.
See the [druid-assets repository](https://github.com/insality/druid-assets) for examples of how to create custom components and styles
Each example page provides a direct link to the corresponding example code, making it easier for you to understand how to use **Druid**.
Try the [HTML5 version](https://insality.github.io/druid/druid/) of the example app
Or refer directly to the [**example folder**](https://github.com/Insality/druid/tree/develop/example) for code examples demonstrating how to use **Druid**.
## Documentation
To learn **Druid** better, read next documentation:
- [Druid components](https://github.com/Insality/druid/blob/master/docs_md/01-components.md)
- [Create custom components](https://github.com/Insality/druid/blob/master/docs_md/02-creating_custom_components.md)
- [Druid styles](https://github.com/Insality/druid/blob/master/docs_md/03-styles.md)
- [Druid asset store](https://github.com/Insality/druid/blob/master/docs_md/04-druid_assets.md)
You can find the full **Druid** functions at [Quick API Reference](api/quick_api_reference.md)
Full **Druid** documentation you can find here:
https://insality.github.io/druid/
To better understand **Druid**, read the following documentation:
- [How To GUI in Defold](https://forum.defold.com/t/how-to-gui-in-defold/73256)
- [Widgets](wiki/widgets.md)
- [Druid styles](wiki/styles.md)
- [Advanced Setup](wiki/advanced-setup.md)
- [Optimize Druid Size](wiki/optimize_druid_size.md)
- [Creating Custom Components](wiki/creating_custom_components.md)
- [Changelog](wiki/changelog.md)
## Games powered by Druid
## Licenses
_Will fill later_
## License
- Original created by [AGulev](https://github.com/AGulev)
- Developed and supporting by [Insality](https://github.com/Insality)
- Assets from [Kenney](http://www.kenney.nl/)
**MIT** License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Issues and suggestions
If you have any issues, questions or suggestions please [create an issue](https://github.com/Insality/druid/issues) or contact me: [insality@gmail.com](mailto:insality@gmail.com)
If you have any issues, questions or suggestions please [create an issue](https://github.com/Insality/druid/issues)
## History
For a complete history of the development of **Druid**, please check the [changelog](wiki/changelog.md).
## Contributors
Original Druid idea by [AGulev](https://github.com/AGulev)
Special thanks to all the contributors who have helped make **Druid** better!
<a href="https://github.com/Insality/druid/graphs/contributors">
<img src="https://contributors-img.web.app/image?repo=insality/druid"/>
</a>
Read the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information.
## ❤️ Support project ❤️
Your donation helps me stay engaged in creating valuable projects for **Defold**. If you appreciate what I'm doing, please consider supporting me!
[![Github-sponsors](https://img.shields.io/badge/sponsor-30363D?style=for-the-badge&logo=GitHub-Sponsors&logoColor=#EA4AAA)](https://github.com/sponsors/insality) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/insality) [![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/insality)

View File

@ -0,0 +1,45 @@
# druid.back_handler API
> at /druid/base/back_handler.lua
Component to handle back button. It handles Android back button and Backspace key.
### Setup
Create back handler component with druid: `druid:new_back_handler(callback)`
### Notes
- Key triggers in `input.binding` should be setup for correct working
- It uses a key_back and key_backspace action ids
## Functions
- [init](#init)
## Fields
- [on_back](#on_back)
- [params](#params)
### init
---
```lua
back_handler:init([callback], [params])
```
The Back Handler constructor
- **Parameters:**
- `[callback]` *(function|nil)*: The callback to call when the back handler is triggered
- `[params]` *(any)*: Custom args to pass in the callback
## Fields
<a name="on_back"></a>
- **on_back** (_event_): fun(self: druid.back_handler, params: any?) Trigger on back handler action
<a name="params"></a>
- **params** (_any_): Custom args to pass in the callback

View File

@ -0,0 +1,70 @@
# druid.blocker API
> at /druid/base/blocker.lua
Druid component for block input. Use it to block input in special zone.
### Setup
Create blocker component with druid: `druid:new_blocker(node_name)`
### Notes
- Blocker can be used to create safe zones, where you have big buttons
- Blocker will capture all input events that hit the node, preventing them from reaching other components
- Blocker works placed as usual component in stack, so any other component can be placed on top of it and will work as usual
## Functions
- [init](#init)
- [set_enabled](#set_enabled)
- [is_enabled](#is_enabled)
## Fields
- [node](#node)
### init
---
```lua
blocker:init(node)
```
The Blocker constructor
- **Parameters:**
- `node` *(string|node)*: The node to use as a blocker
### set_enabled
---
```lua
blocker:set_enabled(state)
```
Set blocker enabled state
- **Parameters:**
- `state` *(boolean)*: The new enabled state
- **Returns:**
- `self` *(druid.blocker)*: The blocker instance
### is_enabled
---
```lua
blocker:is_enabled()
```
Get blocker enabled state
- **Returns:**
- `is_enabled` *(boolean)*: True if the blocker is enabled
## Fields
<a name="node"></a>
- **node** (_node_): The node that will block input

View File

@ -0,0 +1,271 @@
# druid.button API
> at /druid/base/button.lua
Basic Druid input component. Handle input on node and provide different callbacks on touch events.
### Setup
Create button with druid: `button = druid:new_button(node_name, callback, [params], [animation_node])`
Where node_name is name of node from GUI scene. You can use `node_name` as input trigger zone and point another node for animation via `animation_node`
### Notes
- Button callback have next params: (self, params, button_instance)
- - **self** - Druid self context
- - **params** - Additional params, specified on button creating
- - **button_instance** - button itself
- You can set _params_ on button callback on button creating: `druid:new_button("node_name", callback, params)`.
- Button have several events like on_click, on_repeated_click, on_long_click, on_hold_click, on_double_click
- Click event will not trigger if between pressed and released state cursor was outside of node zone
- Button can have key trigger to use them by key: `button:set_key_trigger`
-
## Functions
- [init](#init)
- [set_animations_disabled](#set_animations_disabled)
- [set_enabled](#set_enabled)
- [is_enabled](#is_enabled)
- [set_click_zone](#set_click_zone)
- [set_key_trigger](#set_key_trigger)
- [get_key_trigger](#get_key_trigger)
- [set_check_function](#set_check_function)
- [set_web_user_interaction](#set_web_user_interaction)
## Fields
- [on_click](#on_click)
- [on_pressed](#on_pressed)
- [on_repeated_click](#on_repeated_click)
- [on_long_click](#on_long_click)
- [on_double_click](#on_double_click)
- [on_hold_callback](#on_hold_callback)
- [on_click_outside](#on_click_outside)
- [node](#node)
- [node_id](#node_id)
- [anim_node](#anim_node)
- [params](#params)
- [hover](#hover)
- [click_zone](#click_zone)
- [start_scale](#start_scale)
- [start_pos](#start_pos)
- [disabled](#disabled)
- [key_trigger](#key_trigger)
- [style](#style)
- [druid](#druid)
- [is_repeated_started](#is_repeated_started)
- [last_pressed_time](#last_pressed_time)
- [last_released_time](#last_released_time)
- [click_in_row](#click_in_row)
- [can_action](#can_action)
### init
---
```lua
button:init(node_or_node_id, [callback], [custom_args], [anim_node])
```
The constructor for the button component
- **Parameters:**
- `node_or_node_id` *(string|node)*: Node name or GUI Node itself
- `[callback]` *(fun()|nil)*: Callback on button click
- `[custom_args]` *(any)*: Custom args for any Button event, will be passed to callbacks
- `[anim_node]` *(string|node|nil)*: Node to animate instead of trigger node, useful for animating small icons on big panels
### set_animations_disabled
---
```lua
button:set_animations_disabled()
```
Remove default button style animations
- **Returns:**
- `self` *(druid.button)*: The current button instance
### set_enabled
---
```lua
button:set_enabled([state])
```
Set button enabled state.
The style.on_set_enabled will be triggered.
Disabled button is not clickable.
- **Parameters:**
- `[state]` *(boolean|nil)*: Enabled state
- **Returns:**
- `self` *(druid.button)*: The current button instance
### is_enabled
---
```lua
button:is_enabled()
```
Get button enabled state.
By default all Buttons are enabled on creating.
- **Returns:**
- `is_enabled` *(boolean)*: True, if button is enabled now, False otherwise
### set_click_zone
---
```lua
button:set_click_zone([zone])
```
Set additional button click area.
Useful to restrict click outside of stencil node or scrollable content.
If button node placed inside stencil node, it will be automatically set to this stencil node.
- **Parameters:**
- `[zone]` *(string|node|nil)*: Gui node
- **Returns:**
- `self` *(druid.button)*: The current button instance
### set_key_trigger
---
```lua
button:set_key_trigger(key)
```
Set key name to trigger this button by keyboard.
- **Parameters:**
- `key` *(string|hash)*: The action_id of the input key. Example: "key_space"
- **Returns:**
- `self` *(druid.button)*: The current button instance
### get_key_trigger
---
```lua
button:get_key_trigger()
```
Get current key name to trigger this button.
- **Returns:**
- `key_trigger` *(hash)*: The action_id of the input key
### set_check_function
---
```lua
button:set_check_function([check_function], [failure_callback])
```
Set function for additional check for button click availability.
- **Parameters:**
- `[check_function]` *(function|nil)*: Should return true or false. If true - button can be pressed.
- `[failure_callback]` *(function|nil)*: Function will be called on button click, if check function returns false
- **Returns:**
- `self` *(druid.button)*: The current button instance
### set_web_user_interaction
---
```lua
button:set_web_user_interaction([is_web_mode])
```
Set Button mode to work inside user HTML5 interaction event.
It's required to make protected things like copy & paste text, show mobile keyboard, etc
The HTML5 button doesn't call any events except on_click event.
If the game is not HTML, html mode will be not enabled
- **Parameters:**
- `[is_web_mode]` *(boolean|nil)*: If true - button will be called inside html5 callback
- **Returns:**
- `self` *(druid.button)*: The current button instance
## Fields
<a name="on_click"></a>
- **on_click** (_event_): fun(self, custom_args, button_instance)
<a name="on_pressed"></a>
- **on_pressed** (_event_): fun(self, custom_args, button_instance)
<a name="on_repeated_click"></a>
- **on_repeated_click** (_event_): fun(self, custom_args, button_instance, click_count) Repeated click callback, while holding the button
<a name="on_long_click"></a>
- **on_long_click** (_event_): fun(self, custom_args, button_instance, hold_time) Callback on long button tap
<a name="on_double_click"></a>
- **on_double_click** (_event_): fun(self, custom_args, button_instance, click_amount) Different callback, if tap button 2+ in row
<a name="on_hold_callback"></a>
- **on_hold_callback** (_event_): fun(self, custom_args, button_instance, press_time) Hold callback, before long_click trigger
<a name="on_click_outside"></a>
- **on_click_outside** (_event_): fun(self, custom_args, button_instance)
<a name="node"></a>
- **node** (_node_): Clickable node
<a name="node_id"></a>
- **node_id** (_hash_): Node id
<a name="anim_node"></a>
- **anim_node** (_node_): Animation node. In default case equals to clickable node
<a name="params"></a>
- **params** (_any_): Custom arguments for any Button event
<a name="hover"></a>
- **hover** (_druid.hover_): Hover component for this button
<a name="click_zone"></a>
- **click_zone** (_node_): Click zone node to restrict click area
<a name="start_scale"></a>
- **start_scale** (_vector3_): Start scale of the button
<a name="start_pos"></a>
- **start_pos** (_vector3_): Start position of the button
<a name="disabled"></a>
- **disabled** (_boolean_): Is button disabled
<a name="key_trigger"></a>
- **key_trigger** (_hash_): Key trigger for this button
<a name="style"></a>
- **style** (_table_): Style for this button
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="is_repeated_started"></a>
- **is_repeated_started** (_boolean_)
<a name="last_pressed_time"></a>
- **last_pressed_time** (_integer_)
<a name="last_released_time"></a>
- **last_released_time** (_integer_)
<a name="click_in_row"></a>
- **click_in_row** (_integer_)
<a name="can_action"></a>
- **can_action** (_boolean_): Can't interact, if touch outside of button

View File

@ -0,0 +1,445 @@
# druid.component API
> at /druid/component.lua
## Functions
- [create](#create)
- [create_widget](#create_widget)
- [init](#init)
- [update](#update)
- [on_remove](#on_remove)
- [on_input](#on_input)
- [on_input_interrupt](#on_input_interrupt)
- [on_message](#on_message)
- [on_late_init](#on_late_init)
- [on_focus_lost](#on_focus_lost)
- [on_focus_gained](#on_focus_gained)
- [on_style_change](#on_style_change)
- [on_layout_change](#on_layout_change)
- [on_window_resized](#on_window_resized)
- [on_language_change](#on_language_change)
- [set_style](#set_style)
- [set_template](#set_template)
- [get_template](#get_template)
- [set_nodes](#set_nodes)
- [get_context](#get_context)
- [get_node](#get_node)
- [get_druid](#get_druid)
- [get_name](#get_name)
- [get_parent_name](#get_parent_name)
- [get_input_priority](#get_input_priority)
- [set_input_priority](#set_input_priority)
- [reset_input_priority](#reset_input_priority)
- [get_uid](#get_uid)
- [set_input_enabled](#set_input_enabled)
- [get_input_enabled](#get_input_enabled)
- [get_parent_component](#get_parent_component)
- [get_nodes](#get_nodes)
- [get_childrens](#get_childrens)
## Fields
- [druid](#druid)
### create
---
```lua
component.create([name], [input_priority])
```
Сreate a new component class, which will inherit from the base Druid component.
- **Parameters:**
- `[name]` *(string|nil)*: The name of the component
- `[input_priority]` *(number|nil)*: The input priority. The bigger number processed first. Default value: 10
- **Returns:**
- `` *(druid.component)*:
### create_widget
---
```lua
component.create_widget(self, widget_class, context)
```
Create the Druid component instance
- **Parameters:**
- `self` *(druid.instance)*: The Druid Factory used to create components
- `widget_class` *(druid.widget)*:
- `context` *(table)*:
- **Returns:**
- `` *(druid.widget)*:
### init
---
```lua
component:init()
```
Called when component is created
### update
---
```lua
component:update()
```
Called every frame
### on_remove
---
```lua
component:on_remove()
```
Called when component is removed
### on_input
---
```lua
component:on_input()
```
Called when input event is triggered
### on_input_interrupt
---
```lua
component:on_input_interrupt()
```
Called when input event is consumed before
### on_message
---
```lua
component:on_message()
```
Called when message is received
### on_late_init
---
```lua
component:on_late_init()
```
Called before update once time after GUI init
### on_focus_lost
---
```lua
component:on_focus_lost()
```
Called when app lost focus
### on_focus_gained
---
```lua
component:on_focus_gained()
```
Called when app gained focus
### on_style_change
---
```lua
component:on_style_change()
```
Called when style is changed
### on_layout_change
---
```lua
component:on_layout_change()
```
Called when GUI layout is changed
### on_window_resized
---
```lua
component:on_window_resized()
```
Called when window is resized
### on_language_change
---
```lua
component:on_language_change()
```
Called when language is changed
### set_style
---
```lua
component:set_style([druid_style])
```
Set component style. Pass nil to clear style
- **Parameters:**
- `[druid_style]` *(table|nil)*:
- **Returns:**
- `self` *(<T>)*: The component itself for chaining
### set_template
---
```lua
component:set_template([template])
```
Set component template name. Pass nil to clear template.
This template id used to access nodes inside the template on GUI scene.
Parent template will be added automatically if exist.
- **Parameters:**
- `[template]` *(string|nil)*:
- **Returns:**
- `self` *(<T>)*: The component itself for chaining
### get_template
---
```lua
component:get_template()
```
Get full template name.
- **Returns:**
- `` *(string)*:
### set_nodes
---
```lua
component:set_nodes([nodes])
```
Set current component nodes, returned from `gui.clone_tree` function.
- **Parameters:**
- `[nodes]` *(string|node|table<hash, node>|nil)*: The nodes table from gui.clone_tree or prefab node to use for clone or node id to clone
- **Returns:**
- `` *(druid.component)*:
### get_context
---
```lua
component:get_context()
```
Return current component context
- **Returns:**
- `context` *(any)*: Usually it's self of script but can be any other Druid component
### get_node
---
```lua
component:get_node(node_id)
```
Get component node by node_id. Respect to current template and nodes.
- **Parameters:**
- `node_id` *(string|node)*:
- **Returns:**
- `` *(node)*:
### get_druid
---
```lua
component:get_druid([template], [nodes])
```
Get Druid instance for inner component creation.
- **Parameters:**
- `[template]` *(string|nil)*:
- `[nodes]` *(string|node|table<hash, node>|nil)*: The nodes table from gui.clone_tree or prefab node to use for clone or node id to clone
- **Returns:**
- `` *(druid.instance)*:
### get_name
---
```lua
component:get_name()
```
Get component name
- **Returns:**
- `name` *(string)*: The component name + uid
### get_parent_name
---
```lua
component:get_parent_name()
```
Get parent component name
- **Returns:**
- `parent_name` *(string|nil)*: The parent component name if exist or nil
### get_input_priority
---
```lua
component:get_input_priority()
```
Get component input priority, the bigger number processed first. Default value: 10
- **Returns:**
- `` *(number)*:
### set_input_priority
---
```lua
component:set_input_priority(value, [is_temporary])
```
Set component input priority, the bigger number processed first. Default value: 10
- **Parameters:**
- `value` *(number)*:
- `[is_temporary]` *(boolean|nil)*: If true, the reset input priority will return to previous value
- **Returns:**
- `self` *(druid.component)*: The component itself for chaining
### reset_input_priority
---
```lua
component:reset_input_priority()
```
Reset component input priority to it's default value, that was set in `create` function or `set_input_priority`
- **Returns:**
- `self` *(druid.component)*: The component itself for chaining
### get_uid
---
```lua
component:get_uid()
```
Get component UID, unique identifier created in component creation order.
- **Returns:**
- `uid` *(number)*: The component uid
### set_input_enabled
---
```lua
component:set_input_enabled(state)
```
Set component input state. By default it's enabled.
If input is disabled, the component will not receive input events.
Recursive for all children components.
- **Parameters:**
- `state` *(boolean)*:
- **Returns:**
- `self` *(druid.component)*: The component itself for chaining
### get_input_enabled
---
```lua
component:get_input_enabled()
```
Get component input state. By default it's enabled. Can be disabled by `set_input_enabled` function.
- **Returns:**
- `` *(boolean)*:
### get_parent_component
---
```lua
component:get_parent_component()
```
Get parent component
- **Returns:**
- `parent_component` *(druid.component|nil)*: The parent component if exist or nil
### get_nodes
---
```lua
component:get_nodes()
```
Get current component nodes
- **Returns:**
- `` *(table<hash, node>|nil)*:
### get_childrens
---
```lua
component:get_childrens()
```
Return all children components, recursive
- **Returns:**
- `Array` *(table)*: of childrens if the Druid component instance
## Fields
<a name="druid"></a>
- **druid** (_druid.instance_): Druid instance to create inner components

View File

@ -0,0 +1,176 @@
# druid.drag API
> at /druid/base/drag.lua
A component that allows you to subscribe to drag events over a node
## Functions
- [init](#init)
- [set_drag_cursors](#set_drag_cursors)
- [set_click_zone](#set_click_zone)
- [set_enabled](#set_enabled)
- [is_enabled](#is_enabled)
## Fields
- [node](#node)
- [on_touch_start](#on_touch_start)
- [on_touch_end](#on_touch_end)
- [on_drag_start](#on_drag_start)
- [on_drag](#on_drag)
- [on_drag_end](#on_drag_end)
- [style](#style)
- [click_zone](#click_zone)
- [is_touch](#is_touch)
- [is_drag](#is_drag)
- [can_x](#can_x)
- [can_y](#can_y)
- [dx](#dx)
- [dy](#dy)
- [touch_id](#touch_id)
- [x](#x)
- [y](#y)
- [screen_x](#screen_x)
- [screen_y](#screen_y)
- [touch_start_pos](#touch_start_pos)
- [druid](#druid)
- [hover](#hover)
### init
---
```lua
drag:init(node_or_node_id, [on_drag_callback])
```
The constructor for Drag component
- **Parameters:**
- `node_or_node_id` *(string|node)*: The node to subscribe to drag events over
- `[on_drag_callback]` *(fun(self: any, touch: any))*: The callback to call when a drag occurs
### set_drag_cursors
---
```lua
drag:set_drag_cursors(is_enabled)
```
Set Drag component enabled state.
- **Parameters:**
- `is_enabled` *(boolean)*: True if Drag component is enabled
### set_click_zone
---
```lua
drag:set_click_zone([node])
```
Set Drag click zone
- **Parameters:**
- `[node]` *(string|node|nil)*: Node or node id
- **Returns:**
- `self` *(druid.drag)*: Current instance
### set_enabled
---
```lua
drag:set_enabled(is_enabled)
```
Set Drag component enabled state.
- **Parameters:**
- `is_enabled` *(boolean)*:
- **Returns:**
- `self` *(druid.drag)*: Current instance
### is_enabled
---
```lua
drag:is_enabled()
```
Check if Drag component is capture input
- **Returns:**
- `is_enabled` *(boolean)*: True if Drag component is enabled
## Fields
<a name="node"></a>
- **node** (_node_): The node to subscribe to drag events over
<a name="on_touch_start"></a>
- **on_touch_start** (_event_): fun(self, touch) The event triggered when a touch starts
<a name="on_touch_end"></a>
- **on_touch_end** (_event_): fun(self, touch) The event triggered when a touch ends
<a name="on_drag_start"></a>
- **on_drag_start** (_event_): fun(self, touch) The event triggered when a drag starts
<a name="on_drag"></a>
- **on_drag** (_event_): fun(self, touch) The event triggered when a drag occurs
<a name="on_drag_end"></a>
- **on_drag_end** (_event_): fun(self, touch) The event triggered when a drag ends
<a name="style"></a>
- **style** (_druid.drag.style_): The style of Drag component
<a name="click_zone"></a>
- **click_zone** (_node_): The click zone of Drag component
<a name="is_touch"></a>
- **is_touch** (_boolean_): True if a touch is active
<a name="is_drag"></a>
- **is_drag** (_boolean_): True if a drag is active
<a name="can_x"></a>
- **can_x** (_boolean_): True if Drag can move horizontally
<a name="can_y"></a>
- **can_y** (_boolean_): True if Drag can move vertically
<a name="dx"></a>
- **dx** (_number_): The horizontal drag distance
<a name="dy"></a>
- **dy** (_number_): The vertical drag distance
<a name="touch_id"></a>
- **touch_id** (_number_): The touch id
<a name="x"></a>
- **x** (_number_): The current x position
<a name="y"></a>
- **y** (_number_): The current y position
<a name="screen_x"></a>
- **screen_x** (_number_): The current screen x position
<a name="screen_y"></a>
- **screen_y** (_number_): The current screen y position
<a name="touch_start_pos"></a>
- **touch_start_pos** (_vector3_): The touch start position
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="hover"></a>
- **hover** (_druid.hover_): The component for handling hover events on a node

View File

@ -0,0 +1,144 @@
# druid.hover API
> at /druid/base/hover.lua
The component for handling hover events on a node
## Functions
- [init](#init)
- [set_hover](#set_hover)
- [is_hovered](#is_hovered)
- [set_mouse_hover](#set_mouse_hover)
- [is_mouse_hovered](#is_mouse_hovered)
- [set_click_zone](#set_click_zone)
- [set_enabled](#set_enabled)
- [is_enabled](#is_enabled)
## Fields
- [node](#node)
- [on_hover](#on_hover)
- [on_mouse_hover](#on_mouse_hover)
- [style](#style)
- [click_zone](#click_zone)
### init
---
```lua
hover:init(node, on_hover_callback, on_mouse_hover)
```
The constructor for the hover component
- **Parameters:**
- `node` *(node)*: Gui node
- `on_hover_callback` *(function)*: Hover callback
- `on_mouse_hover` *(function)*: On mouse hover callback
### set_hover
---
```lua
hover:set_hover([state])
```
Set hover state
- **Parameters:**
- `[state]` *(boolean|nil)*: The hover state
### is_hovered
---
```lua
hover:is_hovered()
```
Return current hover state. True if touch action was on the node at current time
- **Returns:**
- `is_hovered` *(boolean)*: The current hovered state
### set_mouse_hover
---
```lua
hover:set_mouse_hover([state])
```
Set mouse hover state
- **Parameters:**
- `[state]` *(boolean|nil)*: The mouse hover state
### is_mouse_hovered
---
```lua
hover:is_mouse_hovered()
```
Return current hover state. True if nil action_id (usually desktop mouse) was on the node at current time
- **Returns:**
- `The` *(boolean)*: current hovered state
### set_click_zone
---
```lua
hover:set_click_zone([zone])
```
Strict hover click area. Useful for no click events outside stencil node
- **Parameters:**
- `[zone]` *(string|node|nil)*: Gui node
### set_enabled
---
```lua
hover:set_enabled([state])
```
Set enable state of hover component.
If hover is not enabled, it will not generate
any hover events
- **Parameters:**
- `[state]` *(boolean|nil)*: The hover enabled state
### is_enabled
---
```lua
hover:is_enabled()
```
Return current hover enabled state
- **Returns:**
- `The` *(boolean)*: hover enabled state
## Fields
<a name="node"></a>
- **node** (_node_): Gui node
<a name="on_hover"></a>
- **on_hover** (_event_): fun(self: druid.hover, is_hover: boolean) Hover event
<a name="on_mouse_hover"></a>
- **on_mouse_hover** (_event_): fun(self: druid.hover, is_hover: boolean) Mouse hover event
<a name="style"></a>
- **style** (_druid.hover.style_): Style of the hover component
<a name="click_zone"></a>
- **click_zone** (_node_): Click zone of the hover component

View File

@ -0,0 +1,395 @@
# druid.scroll API
> at /druid/base/scroll.lua
Basic Druid scroll component. Handles all scrolling behavior in Druid GUI.
### Setup
Create scroll component with druid: `druid:new_scroll(view_node, content_node)`
### Notes
- View_node is the static part that captures user input and recognizes scrolling touches
- Content_node is the dynamic part that will change position according to the scroll system
- Initial scroll size will be equal to content_node size
- The initial view box will be equal to view_node size
- Scroll by default style has inertia and extra size for stretching effect
- You can setup "points of interest" to make scroll always center on closest point
- Scroll events:
- - on_scroll(self, position): On scroll move callback
- - on_scroll_to(self, position, is_instant): On scroll_to function callback
- - on_point_scroll(self, item_index, position): On scroll_to_index function callback
- Multitouch is required for scroll. Scroll correctly handles touch_id swap while dragging
## Functions
- [init](#init)
- [scroll_to](#scroll_to)
- [scroll_to_index](#scroll_to_index)
- [scroll_to_percent](#scroll_to_percent)
- [get_percent](#get_percent)
- [set_size](#set_size)
- [set_view_size](#set_view_size)
- [update_view_size](#update_view_size)
- [set_inert](#set_inert)
- [is_inert](#is_inert)
- [set_extra_stretch_size](#set_extra_stretch_size)
- [get_scroll_size](#get_scroll_size)
- [set_points](#set_points)
- [set_horizontal_scroll](#set_horizontal_scroll)
- [set_vertical_scroll](#set_vertical_scroll)
- [is_node_in_view](#is_node_in_view)
- [bind_grid](#bind_grid)
- [set_click_zone](#set_click_zone)
## Fields
- [node](#node)
- [click_zone](#click_zone)
- [on_scroll](#on_scroll)
- [on_scroll_to](#on_scroll_to)
- [on_point_scroll](#on_point_scroll)
- [view_node](#view_node)
- [view_border](#view_border)
- [content_node](#content_node)
- [view_size](#view_size)
- [position](#position)
- [target_position](#target_position)
- [available_pos](#available_pos)
- [available_size](#available_size)
- [drag](#drag)
- [selected](#selected)
- [is_animate](#is_animate)
- [style](#style)
- [druid](#druid)
- [hover](#hover)
- [points](#points)
- [available_pos_extra](#available_pos_extra)
- [available_size_extra](#available_size_extra)
### init
---
```lua
scroll:init(view_node, content_node)
```
The Scroll constructor
- **Parameters:**
- `view_node` *(string|node)*: GUI view scroll node - the static part that captures user input
- `content_node` *(string|node)*: GUI content scroll node - the dynamic part that will change position
### scroll_to
---
```lua
scroll:scroll_to(point, [is_instant])
```
Start scroll to target point.
- **Parameters:**
- `point` *(vector3)*: Target point
- `[is_instant]` *(boolean|nil)*: Instant scroll flag
### scroll_to_index
---
```lua
scroll:scroll_to_index(index, [skip_cb])
```
Scroll to item in scroll by point index.
- **Parameters:**
- `index` *(number)*: Point index
- `[skip_cb]` *(boolean|nil)*: If true, skip the point callback
### scroll_to_percent
---
```lua
scroll:scroll_to_percent(percent, [is_instant])
```
Start scroll to target scroll percent
- **Parameters:**
- `percent` *(vector3)*: target percent
- `[is_instant]` *(boolean|nil)*: instant scroll flag
### get_percent
---
```lua
scroll:get_percent()
```
Return current scroll progress status.
Values will be in [0..1] interval
- **Returns:**
- `New` *(vector3)*: vector with scroll progress values
### set_size
---
```lua
scroll:set_size(size, [offset])
```
Set scroll content size.
It will change content gui node size
- **Parameters:**
- `size` *(vector3)*: The new size for content node
- `[offset]` *(vector3|nil)*: Offset value to set, where content is starts
- **Returns:**
- `self` *(druid.scroll)*: Current scroll instance
### set_view_size
---
```lua
scroll:set_view_size(size)
```
Set new scroll view size in case the node size was changed.
- **Parameters:**
- `size` *(vector3)*: The new size for view node
- **Returns:**
- `self` *(druid.scroll)*: Current scroll instance
### update_view_size
---
```lua
scroll:update_view_size()
```
Refresh scroll view size, used when view node size is changed
- **Returns:**
- `self` *(druid.scroll)*: Current scroll instance
### set_inert
---
```lua
scroll:set_inert(state)
```
Enable or disable scroll inert
If disabled, scroll through points (if exist)
If no points, just simple drag without inertion
- **Parameters:**
- `state` *(boolean)*: Inert scroll state
- **Returns:**
- `self` *(druid.scroll)*: Current scroll instance
### is_inert
---
```lua
scroll:is_inert()
```
Return if scroll have inertion
- **Returns:**
- `is_inert` *(boolean)*: If scroll have inertion
### set_extra_stretch_size
---
```lua
scroll:set_extra_stretch_size([stretch_size])
```
Set extra size for scroll stretching
Set 0 to disable stretching effect
- **Parameters:**
- `[stretch_size]` *(number|nil)*: Size in pixels of additional scroll area
- **Returns:**
- `self` *(druid.scroll)*: Current scroll instance
### get_scroll_size
---
```lua
scroll:get_scroll_size()
```
Return vector of scroll size with width and height.
- **Returns:**
- `Available` *(vector3)*: scroll size
### set_points
---
```lua
scroll:set_points(points)
```
Set points of interest.
Scroll will always centered on closer points
- **Parameters:**
- `points` *(table)*: Array of vector3 points
- **Returns:**
- `self` *(druid.scroll)*: Current scroll instance
### set_horizontal_scroll
---
```lua
scroll:set_horizontal_scroll(state)
```
Lock or unlock horizontal scroll
- **Parameters:**
- `state` *(boolean)*: True, if horizontal scroll is enabled
- **Returns:**
- `self` *(druid.scroll)*: Current scroll instance
### set_vertical_scroll
---
```lua
scroll:set_vertical_scroll(state)
```
Lock or unlock vertical scroll
- **Parameters:**
- `state` *(boolean)*: True, if vertical scroll is enabled
- **Returns:**
- `self` *(druid.scroll)*: Current scroll instance
### is_node_in_view
---
```lua
scroll:is_node_in_view(node)
```
Check node if it visible now on scroll.
Extra border is not affected. Return true for elements in extra scroll zone
- **Parameters:**
- `node` *(node)*: The node to check
- **Returns:**
- `True` *(boolean)*: if node in visible scroll area
### bind_grid
---
```lua
scroll:bind_grid([grid])
```
Bind the grid component (Static or Dynamic) to recalculate
scroll size on grid changes
- **Parameters:**
- `[grid]` *(druid.grid|nil)*: Druid grid component
- **Returns:**
- `self` *(druid.scroll)*: Current scroll instance
### set_click_zone
---
```lua
scroll:set_click_zone(node)
```
Strict drag scroll area. Useful for
restrict events outside stencil node
- **Parameters:**
- `node` *(string|node)*: Gui node
## Fields
<a name="node"></a>
- **node** (_node_): The root node
<a name="click_zone"></a>
- **click_zone** (_node_): Optional click zone to restrict scroll area
<a name="on_scroll"></a>
- **on_scroll** (_event_): fun(self: druid.scroll, position: vector3) Triggered on scroll move
<a name="on_scroll_to"></a>
- **on_scroll_to** (_event_): fun(self: druid.scroll, target: vector3, is_instant: boolean) Triggered on scroll_to
<a name="on_point_scroll"></a>
- **on_point_scroll** (_event_): fun(self: druid.scroll, index: number, point: vector3) Triggered on scroll_to_index
<a name="view_node"></a>
- **view_node** (_node_): The scroll view node (static part)
<a name="view_border"></a>
- **view_border** (_vector4_): The scroll view borders
<a name="content_node"></a>
- **content_node** (_node_): The scroll content node (moving part)
<a name="view_size"></a>
- **view_size** (_vector3_): Size of the view node
<a name="position"></a>
- **position** (_vector3_): Current scroll position
<a name="target_position"></a>
- **target_position** (_vector3_): Target scroll position for animations
<a name="available_pos"></a>
- **available_pos** (_vector4_): Available content position (min_x, max_y, max_x, min_y)
<a name="available_size"></a>
- **available_size** (_vector3_): Size of available positions (width, height, 0)
<a name="drag"></a>
- **drag** (_druid.drag_): The drag component instance
<a name="selected"></a>
- **selected** (_number_): Current selected point of interest index
<a name="is_animate"></a>
- **is_animate** (_boolean_): True if scroll is animating
<a name="style"></a>
- **style** (_druid.scroll.style_): Component style parameters
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="hover"></a>
- **hover** (_druid.hover_): The component for handling hover events on a node
<a name="points"></a>
- **points** (_table_)
<a name="available_pos_extra"></a>
- **available_pos_extra** (_vector4_)
<a name="available_size_extra"></a>
- **available_size_extra** (_vector3_)

View File

@ -0,0 +1,387 @@
# druid.grid API
> at /druid/base/static_grid.lua
The component for manage the nodes position in the grid with various options
## Functions
- [init](#init)
- [get_pos](#get_pos)
- [get_index](#get_index)
- [get_index_by_node](#get_index_by_node)
- [set_anchor](#set_anchor)
- [refresh](#refresh)
- [set_pivot](#set_pivot)
- [add](#add)
- [set_items](#set_items)
- [remove](#remove)
- [get_size](#get_size)
- [get_size_for](#get_size_for)
- [get_borders](#get_borders)
- [get_all_pos](#get_all_pos)
- [set_position_function](#set_position_function)
- [clear](#clear)
- [get_offset](#get_offset)
- [set_in_row](#set_in_row)
- [set_item_size](#set_item_size)
- [sort_nodes](#sort_nodes)
## Fields
- [on_add_item](#on_add_item)
- [on_remove_item](#on_remove_item)
- [on_change_items](#on_change_items)
- [on_clear](#on_clear)
- [on_update_positions](#on_update_positions)
- [parent](#parent)
- [nodes](#nodes)
- [first_index](#first_index)
- [last_index](#last_index)
- [anchor](#anchor)
- [pivot](#pivot)
- [node_size](#node_size)
- [border](#border)
- [in_row](#in_row)
- [style](#style)
- [node_pivot](#node_pivot)
### init
---
```lua
grid:init(parent, element, [in_row])
```
The constructor for the grid component
- **Parameters:**
- `parent` *(string|node)*: The GUI Node container, where grid's items will be placed
- `element` *(node)*: Element prefab. Need to get it size
- `[in_row]` *(number|nil)*: How many nodes in row can be placed. By default 1
### get_pos
---
```lua
grid:get_pos(index)
```
Return pos for grid node index
- **Parameters:**
- `index` *(number)*: The grid element index
- **Returns:**
- `position` *(vector3)*: Node position
### get_index
---
```lua
grid:get_index(pos)
```
Return grid index by position
- **Parameters:**
- `pos` *(vector3)*: The node position in the grid
- **Returns:**
- `index` *(number)*: The node index
### get_index_by_node
---
```lua
grid:get_index_by_node(node)
```
Return grid index by node
- **Parameters:**
- `node` *(node)*: The gui node in the grid
- **Returns:**
- `index` *(number|nil)*: The node index
### set_anchor
---
```lua
grid:set_anchor(anchor)
```
Set grid anchor. Default anchor is equal to anchor of grid parent node
- **Parameters:**
- `anchor` *(vector3)*: Anchor
### refresh
---
```lua
grid:refresh()
```
Instantly update the grid content
- **Returns:**
- `self` *(druid.grid)*: Current grid instance
### set_pivot
---
```lua
grid:set_pivot(pivot)
```
Set grid pivot
- **Parameters:**
- `pivot` *(constant)*: The new pivot
- **Returns:**
- `self` *(druid.grid)*: Current grid instance
### add
---
```lua
grid:add(item, [index], [shift_policy], [is_instant])
```
Add new item to the grid
- **Parameters:**
- `item` *(node)*: GUI node
- `[index]` *(number|nil)*: The item position. By default add as last item
- `[shift_policy]` *(number|nil)*: How shift nodes, if required. Default: const.SHIFT.RIGHT
- `[is_instant]` *(boolean|nil)*: If true, update node positions instantly
- **Returns:**
- `self` *(druid.grid)*: Current grid instance
### set_items
---
```lua
grid:set_items(nodes, [is_instant])
```
Set new items to the grid. All previous items will be removed
- **Parameters:**
- `nodes` *(node[])*: The new grid nodes
- `[is_instant]` *(boolean|nil)*: If true, update node positions instantly
- **Returns:**
- `self` *(druid.grid)*: Current grid instance
### remove
---
```lua
grid:remove(index, [shift_policy], [is_instant])
```
Remove the item from the grid. Note that gui node will be not deleted
- **Parameters:**
- `index` *(number)*: The grid node index to remove
- `[shift_policy]` *(number|nil)*: How shift nodes, if required. Default: const.SHIFT.RIGHT
- `[is_instant]` *(boolean|nil)*: If true, update node positions instantly
- **Returns:**
- `node` *(node)*: The deleted gui node from grid
### get_size
---
```lua
grid:get_size()
```
Return grid content size
- **Returns:**
- `size` *(vector3)*: The grid content size
### get_size_for
---
```lua
grid:get_size_for(count)
```
Return grid content size for given count of nodes
- **Parameters:**
- `count` *(number)*: The count of nodes
- **Returns:**
- `size` *(vector3)*: The grid content size
### get_borders
---
```lua
grid:get_borders()
```
Return grid content borders
- **Returns:**
- `borders` *(vector4)*: The grid content borders
### get_all_pos
---
```lua
grid:get_all_pos()
```
Return array of all node positions
- **Returns:**
- `positions` *(vector3[])*: All grid node positions
### set_position_function
---
```lua
grid:set_position_function(callback)
```
Change set position function for grid nodes. It will call on
update poses on grid elements. Default: gui.set_position
- **Parameters:**
- `callback` *(function)*: Function on node set position
- **Returns:**
- `self` *(druid.grid)*: Current grid instance
### clear
---
```lua
grid:clear()
```
Clear grid nodes array. GUI nodes will be not deleted!
If you want to delete GUI nodes, use static_grid.nodes array before grid:clear
- **Returns:**
- `self` *(druid.grid)*: Current grid instance
### get_offset
---
```lua
grid:get_offset()
```
Return StaticGrid offset, where StaticGrid content starts.
- **Returns:**
- `offset` *(vector3)*: The StaticGrid offset
### set_in_row
---
```lua
grid:set_in_row(in_row)
```
Set new in_row elements for grid
- **Parameters:**
- `in_row` *(number)*: The new in_row value
- **Returns:**
- `self` *(druid.grid)*: Current grid instance
### set_item_size
---
```lua
grid:set_item_size([width], [height])
```
Set new node size for grid
- **Parameters:**
- `[width]` *(number|nil)*: The new node width
- `[height]` *(number|nil)*: The new node height
- **Returns:**
- `self` *(druid.grid)*: Current grid instance
### sort_nodes
---
```lua
grid:sort_nodes(comparator)
```
Sort grid nodes by custom comparator function
- **Parameters:**
- `comparator` *(function)*: The comparator function. (a, b) -> boolean
- **Returns:**
- `self` *(druid.grid)*: Current grid instance
## Fields
<a name="on_add_item"></a>
- **on_add_item** (_event_): fun(self: druid.grid, item: node, index: number) Trigger on add item event
<a name="on_remove_item"></a>
- **on_remove_item** (_event_): fun(self: druid.grid, index: number) Trigger on remove item event
<a name="on_change_items"></a>
- **on_change_items** (_event_): fun(self: druid.grid, index: number) Trigger on change items event
<a name="on_clear"></a>
- **on_clear** (_event_): fun(self: druid.grid) Trigger on clear event
<a name="on_update_positions"></a>
- **on_update_positions** (_event_): fun(self: druid.grid) Trigger on update positions event
<a name="parent"></a>
- **parent** (_node_): Parent node
<a name="nodes"></a>
- **nodes** (_node[]_): Nodes array
<a name="first_index"></a>
- **first_index** (_number_): First index
<a name="last_index"></a>
- **last_index** (_number_): Last index
<a name="anchor"></a>
- **anchor** (_vector3_): Anchor
<a name="pivot"></a>
- **pivot** (_vector3_): Pivot
<a name="node_size"></a>
- **node_size** (_vector3_): Node size
<a name="border"></a>
- **border** (_vector4_): Border
<a name="in_row"></a>
- **in_row** (_number_): In row
<a name="style"></a>
- **style** (_druid.grid.style_): Style
<a name="node_pivot"></a>
- **node_pivot** (_unknown_)

View File

@ -0,0 +1,349 @@
# druid.text API
> at /druid/base/text.lua
Basic Druid text component. Text components by default have the text size adjusting.
### Setup
Create text node with druid: `text = druid:new_text(node_name, [initial_value], [text_adjust_type])`
### Notes
- Text component by default have auto adjust text sizing. Text never will be bigger, than text node size, which you can setup in GUI scene.
- Text pivot can be changed with `text:set_pivot`, and text will save their position inside their text size box
- There are several text adjust types:
- - **"downscale"** - Change text's scale to fit in the text node size (default)
- - **"trim"** - Trim the text with postfix (default - "...") to fit in the text node size
- - **"no_adjust"** - No any adjust, like default Defold text node
- - **"downscale_limited"** - Change text's scale like downscale, but there is limit for text's scale
- - **"scroll"** - Change text's pivot to imitate scrolling in the text box. Use with stencil node for better effect.
- - **"scale_then_scroll"** - Combine two modes: first limited downscale, then scroll
- - **"trim_left"** - Trim the text with postfix (default - "...") to fit in the text node size
- - **"scale_then_trim"** - Combine two modes: first limited downscale, then trim
- - **"scale_then_trim_left"** - Combine two modes: first limited downscale, then trim left
## Functions
- [init](#init)
- [get_text_size](#get_text_size)
- [get_text_index_by_width](#get_text_index_by_width)
- [set_to](#set_to)
- [set_text](#set_text)
- [get_text](#get_text)
- [set_size](#set_size)
- [set_color](#set_color)
- [set_alpha](#set_alpha)
- [set_scale](#set_scale)
- [set_pivot](#set_pivot)
- [is_multiline](#is_multiline)
- [set_text_adjust](#set_text_adjust)
- [set_minimal_scale](#set_minimal_scale)
- [get_text_adjust](#get_text_adjust)
## Fields
- [node](#node)
- [on_set_text](#on_set_text)
- [on_update_text_scale](#on_update_text_scale)
- [on_set_pivot](#on_set_pivot)
- [style](#style)
- [start_pivot](#start_pivot)
- [start_scale](#start_scale)
- [scale](#scale)
- [pos](#pos)
- [node_id](#node_id)
- [start_size](#start_size)
- [text_area](#text_area)
- [adjust_type](#adjust_type)
- [color](#color)
- [last_value](#last_value)
- [last_scale](#last_scale)
### init
---
```lua
text:init(node, [value], adjust_type)
```
The Text constructor
```lua
adjust_type:
| "downscale"
| "trim"
| "no_adjust"
| "downscale_limited"
| "scroll"
| "scale_then_scroll"
| "trim_left"
| "scale_then_trim"
| "scale_then_trim_left"
```
- **Parameters:**
- `node` *(string|node)*: Node name or GUI Text Node itself
- `[value]` *(string|nil)*: Initial text. Default value is node text from GUI scene. Default: nil
- `adjust_type` *("downscale"|"downscale_limited"|"no_adjust"|"scale_then_scroll"|"scale_then_trim"...(+5))*: Adjust type for text. By default is "downscale". Options: "downscale", "trim", "no_adjust", "downscale_limited", "scroll", "scale_then_scroll", "trim_left", "scale_then_trim", "scale_then_trim_left"
### get_text_size
---
```lua
text:get_text_size([text])
```
Calculate text width with font with respect to trailing space
- **Parameters:**
- `[text]` *(string|nil)*: The text to calculate the size of, if nil - use current text
- **Returns:**
- `width` *(number)*: The text width
- `height` *(number)*: The text height
### get_text_index_by_width
---
```lua
text:get_text_index_by_width(width)
```
Get chars count by width
- **Parameters:**
- `width` *(number)*: The width to get the chars count of
- **Returns:**
- `index` *(number)*: The chars count
### set_to
---
```lua
text:set_to(set_to)
```
Set text to text field
- **Parameters:**
- `set_to` *(string)*: Text for node
- **Returns:**
- `self` *(druid.text)*: Current text instance
### set_text
---
```lua
text:set_text([new_text])
```
- **Parameters:**
- `[new_text]` *(any)*:
- **Returns:**
- `` *(druid.text)*:
### get_text
---
```lua
text:get_text()
```
- **Returns:**
- `` *(unknown)*:
### set_size
---
```lua
text:set_size(size)
```
Set text area size
- **Parameters:**
- `size` *(vector3)*: The new text area size
- **Returns:**
- `self` *(druid.text)*: Current text instance
### set_color
---
```lua
text:set_color(color)
```
Set color
- **Parameters:**
- `color` *(vector4)*: Color for node
- **Returns:**
- `self` *(druid.text)*: Current text instance
### set_alpha
---
```lua
text:set_alpha(alpha)
```
Set alpha
- **Parameters:**
- `alpha` *(number)*: Alpha for node
- **Returns:**
- `self` *(druid.text)*: Current text instance
### set_scale
---
```lua
text:set_scale(scale)
```
Set scale
- **Parameters:**
- `scale` *(vector3)*: Scale for node
- **Returns:**
- `self` *(druid.text)*: Current text instance
### set_pivot
---
```lua
text:set_pivot(pivot)
```
Set text pivot. Text will re-anchor inside text area
- **Parameters:**
- `pivot` *(userdata)*: The gui.PIVOT_* constant
- **Returns:**
- `self` *(druid.text)*: Current text instance
### is_multiline
---
```lua
text:is_multiline()
```
Return true, if text with line break
- **Returns:**
- `Is` *(boolean)*: text node with line break
### set_text_adjust
---
```lua
text:set_text_adjust(adjust_type, [minimal_scale])
```
Set text adjust, refresh the current text visuals, if needed
```lua
adjust_type:
| "downscale"
| "trim"
| "no_adjust"
| "downscale_limited"
| "scroll"
| "scale_then_scroll"
| "trim_left"
| "scale_then_trim"
| "scale_then_trim_left"
```
- **Parameters:**
- `adjust_type` *("downscale"|"downscale_limited"|"no_adjust"|"scale_then_scroll"|"scale_then_trim"...(+5))*: The adjust type to set, values: "downscale", "trim", "no_adjust", "downscale_limited", "scroll", "scale_then_scroll", "trim_left", "scale_then_trim", "scale_then_trim_left"
- `[minimal_scale]` *(number|nil)*: To remove minimal scale, use `text:set_minimal_scale(nil)`, if pass nil - not change minimal scale
- **Returns:**
- `self` *(druid.text)*: Current text instance
### set_minimal_scale
---
```lua
text:set_minimal_scale(minimal_scale)
```
Set minimal scale for "downscale_limited" or "scale_then_scroll" adjust types
- **Parameters:**
- `minimal_scale` *(number)*: If pass nil - not use minimal scale
- **Returns:**
- `self` *(druid.text)*: Current text instance
### get_text_adjust
---
```lua
text:get_text_adjust()
```
Return current text adjust type
- **Returns:**
- `adjust_type` *(string)*: The current text adjust type
## Fields
<a name="node"></a>
- **node** (_node_): The text node
<a name="on_set_text"></a>
- **on_set_text** (_event_): fun(self: druid.text, text: string) The event triggered when the text is set
<a name="on_update_text_scale"></a>
- **on_update_text_scale** (_event_): fun(self: druid.text, scale: vector3, metrics: table) The event triggered when the text scale is updated
<a name="on_set_pivot"></a>
- **on_set_pivot** (_event_): fun(self: druid.text, pivot: userdata) The event triggered when the text pivot is set
<a name="style"></a>
- **style** (_druid.text.style_): The style of the text
<a name="start_pivot"></a>
- **start_pivot** (_userdata_): The start pivot of the text
<a name="start_scale"></a>
- **start_scale** (_vector3_): The start scale of the text
<a name="scale"></a>
- **scale** (_vector3_): The current scale of the text
<a name="pos"></a>
- **pos** (_unknown_)
<a name="node_id"></a>
- **node_id** (_unknown_)
<a name="start_size"></a>
- **start_size** (_unknown_)
<a name="text_area"></a>
- **text_area** (_unknown_)
<a name="adjust_type"></a>
- **adjust_type** (_string|"downscale"|"downscale_limited"|"no_adjust"|"scale_then_scroll"...(+6)_)
<a name="color"></a>
- **color** (_unknown_)
<a name="last_value"></a>
- **last_value** (_unknown_)
<a name="last_scale"></a>
- **last_scale** (_vector3_)

View File

@ -0,0 +1,168 @@
# druid.rich_input API
> at /druid/custom/rich_input/rich_input.lua
The component that handles a rich text input field, it's a wrapper around the druid.input component
## Functions
- [init](#init)
- [set_placeholder](#set_placeholder)
- [select](#select)
- [set_text](#set_text)
- [set_font](#set_font)
- [get_text](#get_text)
- [set_allowed_characters](#set_allowed_characters)
## Fields
- [root](#root)
- [input](#input)
- [cursor](#cursor)
- [cursor_text](#cursor_text)
- [cursor_position](#cursor_position)
- [druid](#druid)
- [is_lshift](#is_lshift)
- [is_lctrl](#is_lctrl)
- [is_button_input_enabled](#is_button_input_enabled)
- [drag](#drag)
- [placeholder](#placeholder)
- [text_position](#text_position)
### init
---
```lua
rich_input:init(template, nodes)
```
- **Parameters:**
- `template` *(string)*: The template string name
- `nodes` *(table)*: Nodes table from gui.clone_tree
### set_placeholder
---
```lua
rich_input:set_placeholder(placeholder_text)
```
Set placeholder text
- **Parameters:**
- `placeholder_text` *(string)*: The placeholder text
- **Returns:**
- `self` *(druid.rich_input)*: Current instance
### select
---
```lua
rich_input:select()
```
Select input field
- **Returns:**
- `self` *(druid.rich_input)*: Current instance
### set_text
---
```lua
rich_input:set_text(text)
```
Set input field text
- **Parameters:**
- `text` *(string)*: The input text
- **Returns:**
- `self` *(druid.rich_input)*: Current instance
### set_font
---
```lua
rich_input:set_font(font)
```
Set input field font
- **Parameters:**
- `font` *(hash)*: The font hash
- **Returns:**
- `self` *(druid.rich_input)*: Current instance
### get_text
---
```lua
rich_input:get_text()
```
Set input field text
- **Returns:**
- `` *(string)*:
### set_allowed_characters
---
```lua
rich_input:set_allowed_characters(characters)
```
Set allowed charaters for input field.
See: https://defold.com/ref/stable/string/
ex: [%a%d] for alpha and numeric
- **Parameters:**
- `characters` *(string)*: Regular expression for validate user input
- **Returns:**
- `self` *(druid.rich_input)*: Current instance
## Fields
<a name="root"></a>
- **root** (_node_): The root node of the rich input
<a name="input"></a>
- **input** (_druid.input_): The input component
<a name="cursor"></a>
- **cursor** (_node_): The cursor node
<a name="cursor_text"></a>
- **cursor_text** (_node_): The cursor text node
<a name="cursor_position"></a>
- **cursor_position** (_vector3_): The position of the cursor
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="is_lshift"></a>
- **is_lshift** (_boolean_)
<a name="is_lctrl"></a>
- **is_lctrl** (_boolean_)
<a name="is_button_input_enabled"></a>
- **is_button_input_enabled** (_unknown_)
<a name="drag"></a>
- **drag** (_druid.drag_): A component that allows you to subscribe to drag events over a node
<a name="placeholder"></a>
- **placeholder** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="text_position"></a>
- **text_position** (_unknown_)

View File

@ -0,0 +1,153 @@
# druid.rich_text API
> at /druid/custom/rich_text/rich_text.lua
The component that handles a rich text display, allows to custom color, size, font, etc. of the parts of the text
## Functions
- [init](#init)
- [set_text](#set_text)
- [get_text](#get_text)
- [clear](#clear)
- [tagged](#tagged)
- [get_words](#get_words)
- [get_line_metric](#get_line_metric)
## Fields
- [root](#root)
- [text_prefab](#text_prefab)
- [style](#style)
### init
---
```lua
rich_text:init(text_node, [value])
```
- **Parameters:**
- `text_node` *(string|node)*: The text node to make Rich Text
- `[value]` *(string|nil)*: The initial text value. Default will be gui.get_text(text_node)
### set_text
---
```lua
rich_text:set_text([text])
```
Set text for Rich Text
- **Parameters:**
- `[text]` *(string|nil)*: The text to set
- **Returns:**
- `words` *(druid.rich_text.word[])*:
- `line_metrics` *(druid.rich_text.lines_metrics)*:
- **Example Usage:**
```lua
-- Color
rich_text:set_text("color=redFoobar/color")
rich_text:set_text("color=1.0,0,0,1.0Foobar/color")
rich_text:set_text("color=#ff0000Foobar/color")
rich_text:set_text("color=#ff0000ffFoobar/color")
-- Shadow
rich_text:set_text("shadow=redFoobar/shadow")
rich_text:set_text("shadow=1.0,0,0,1.0Foobar/shadow")
rich_text:set_text("shadow=#ff0000Foobar/shadow")
rich_text:set_text("shadow=#ff0000ffFoobar/shadow")
-- Outline
rich_text:set_text("outline=redFoobar/outline")
rich_text:set_text("outline=1.0,0,0,1.0Foobar/outline")
rich_text:set_text("outline=#ff0000Foobar/outline")
rich_text:set_text("outline=#ff0000ffFoobar/outline")
-- Font
rich_text:set_text("font=MyCoolFontFoobar/font")
-- Size
rich_text:set_text("size=2Twice as large/size")
-- Line break
rich_text:set_text("br/Insert a line break")
-- No break
rich_text:set_text("nobrPrevent the text from breaking")
-- Image
rich_text:set_text("img=texture:imageDisplay image")
rich_text:set_text("img=texture:image,sizeDisplay image with size")
rich_text:set_text("img=texture:image,width,heightDisplay image with width and height")
```
### get_text
---
```lua
rich_text:get_text()
```
Get the current text of the rich text
- **Returns:**
- `text` *(string)*: The current text of the rich text
### clear
---
```lua
rich_text:clear()
```
Clear all created words.
### tagged
---
```lua
rich_text:tagged(tag)
```
Get all words, which has a passed tag.
- **Parameters:**
- `tag` *(string)*: The tag to get the words for
- **Returns:**
- `words` *(druid.rich_text.word[])*: The words with the passed tag
### get_words
---
```lua
rich_text:get_words()
```
Get all current created words, each word is a table that contains the information about the word
- **Returns:**
- `` *(druid.rich_text.word[])*:
### get_line_metric
---
```lua
rich_text:get_line_metric()
```
Get the current line metrics
- **Returns:**
- `lines_metrics` *(druid.rich_text.lines_metrics)*: The line metrics of the rich text
## Fields
<a name="root"></a>
- **root** (_node_): The root node of the rich text
<a name="text_prefab"></a>
- **text_prefab** (_node_): The text prefab node
<a name="style"></a>
- **style** (_table_)

View File

@ -0,0 +1,394 @@
# druid.container API
> at /druid/extended/container.lua
Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
### Setup
Create container component with druid: `container = druid:new_container(node, mode, callback)`
### Notes
- Container can be used to create adaptable layouts that respond to window size changes
- Container supports different layout modes: FIT, STRETCH, STRETCH_X, STRETCH_Y
- Container can be nested inside other containers
- Container supports fixed margins and percentage-based sizing
- Container can be positioned using pivot points
- Container supports minimum size constraints
- Container can be fitted into window or custom size
## Functions
- [init](#init)
- [refresh_origins](#refresh_origins)
- [set_pivot](#set_pivot)
- [set_size](#set_size)
- [get_position](#get_position)
- [set_position](#set_position)
- [get_size](#get_size)
- [get_scale](#get_scale)
- [fit_into_size](#fit_into_size)
- [fit_into_window](#fit_into_window)
- [add_container](#add_container)
- [remove_container_by_node](#remove_container_by_node)
- [set_parent_container](#set_parent_container)
- [refresh](#refresh)
- [refresh_scale](#refresh_scale)
- [update_child_containers](#update_child_containers)
- [create_draggable_corners](#create_draggable_corners)
- [clear_draggable_corners](#clear_draggable_corners)
- [fit_into_node](#fit_into_node)
- [set_min_size](#set_min_size)
- [set_max_size](#set_max_size)
## Fields
- [node](#node)
- [druid](#druid)
- [node_offset](#node_offset)
- [origin_size](#origin_size)
- [size](#size)
- [origin_position](#origin_position)
- [position](#position)
- [pivot_offset](#pivot_offset)
- [center_offset](#center_offset)
- [mode](#mode)
- [fit_size](#fit_size)
- [min_size_x](#min_size_x)
- [min_size_y](#min_size_y)
- [max_size_x](#max_size_x)
- [max_size_y](#max_size_y)
- [on_size_changed](#on_size_changed)
- [node_fill_x](#node_fill_x)
- [node_fill_y](#node_fill_y)
- [x_koef](#x_koef)
- [y_koef](#y_koef)
- [x_anchor](#x_anchor)
- [y_anchor](#y_anchor)
- [style](#style)
### init
---
```lua
container:init(node, mode, [callback])
```
The Container constructor
- **Parameters:**
- `node` *(node)*: Gui node
- `mode` *(string)*: Layout mode
- `[callback]` *(fun(self: druid.container, size: vector3)|nil)*: Callback on size changed
### refresh_origins
---
```lua
container:refresh_origins()
```
Refresh the origins of the container, origins is the size and position of the container when it was created
### set_pivot
---
```lua
container:set_pivot(pivot)
```
Set the pivot of the container
- **Parameters:**
- `pivot` *(constant)*: The pivot to set
### set_size
---
```lua
container:set_size([width], [height], [anchor_pivot])
```
Set new size of layout node
- **Parameters:**
- `[width]` *(number|nil)*: The width to set
- `[height]` *(number|nil)*: The height to set
- `[anchor_pivot]` *(constant|nil)*: If set will keep the corner position relative to the new size
- **Returns:**
- `Container` *(druid.container)*:
### get_position
---
```lua
container:get_position()
```
Get the position of the container
- **Returns:**
- `position` *(vector3)*: The position of the container
### set_position
---
```lua
container:set_position(pos_x, pos_y)
```
Set the position of the container
- **Parameters:**
- `pos_x` *(number)*: The x position to set
- `pos_y` *(number)*: The y position to set
### get_size
---
```lua
container:get_size()
```
Get the current size of the layout node
- **Returns:**
- `size` *(vector3)*: The current size of the layout node
### get_scale
---
```lua
container:get_scale()
```
Get the current scale of the layout node
- **Returns:**
- `scale` *(vector3)*: The current scale of the layout node
### fit_into_size
---
```lua
container:fit_into_size(target_size)
```
Set size for layout node to fit inside it
- **Parameters:**
- `target_size` *(vector3)*: The target size to fit into
- **Returns:**
- `self` *(druid.container)*: Current container instance
### fit_into_window
---
```lua
container:fit_into_window()
```
Set current size for layout node to fit inside it
- **Returns:**
- `self` *(druid.container)*: Current container instance
### add_container
---
```lua
container:add_container(node_or_container, [mode], [on_resize_callback])
```
- **Parameters:**
- `node_or_container` *(string|table|druid.container|node)*: The node or container to add
- `[mode]` *(string|nil)*: stretch, fit, stretch_x, stretch_y. Default: Pick from node, "fit" or "stretch"
- `[on_resize_callback]` *(fun(self: userdata, size: vector3)|nil)*:
- **Returns:**
- `Container` *(druid.container)*: New created layout instance
### remove_container_by_node
---
```lua
container:remove_container_by_node([node])
```
- **Parameters:**
- `[node]` *(any)*:
- **Returns:**
- `` *(druid.container|nil)*:
### set_parent_container
---
```lua
container:set_parent_container([parent_container])
```
- **Parameters:**
- `[parent_container]` *(druid.container|nil)*: Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
### refresh
---
```lua
container:refresh()
```
### refresh_scale
---
```lua
container:refresh_scale()
```
### update_child_containers
---
```lua
container:update_child_containers()
```
### create_draggable_corners
---
```lua
container:create_draggable_corners()
```
- **Returns:**
- `self` *(druid.container)*: Current container instance
### clear_draggable_corners
---
```lua
container:clear_draggable_corners()
```
- **Returns:**
- `self` *(druid.container)*: Current container instance
### fit_into_node
---
```lua
container:fit_into_node(node)
```
Set node for layout node to fit inside it. Pass nil to reset
- **Parameters:**
- `node` *(string|node)*: The node_id or gui.get_node(node_id)
- **Returns:**
- `self` *(druid.container)*: Current container instance
### set_min_size
---
```lua
container:set_min_size([min_size_x], [min_size_y])
```
Set the minimum size of the container
- **Parameters:**
- `[min_size_x]` *(number|nil)*: The minimum size x
- `[min_size_y]` *(number|nil)*: The minimum size y
- **Returns:**
- `self` *(druid.container)*: Current container instance
### set_max_size
---
```lua
container:set_max_size([max_size_x], [max_size_y])
```
Set the maximum size of the container
- **Parameters:**
- `[max_size_x]` *(number|nil)*: The maximum size x
- `[max_size_y]` *(number|nil)*: The maximum size y
- **Returns:**
- `self` *(druid.container)*: Current container instance
## Fields
<a name="node"></a>
- **node** (_node_): The gui node
<a name="druid"></a>
- **druid** (_druid.instance_): The druid instance
<a name="node_offset"></a>
- **node_offset** (_vector4_): The node offset
<a name="origin_size"></a>
- **origin_size** (_vector3_): The origin size
<a name="size"></a>
- **size** (_vector3_): The current size
<a name="origin_position"></a>
- **origin_position** (_vector3_): The origin position
<a name="position"></a>
- **position** (_vector3_): The current position
<a name="pivot_offset"></a>
- **pivot_offset** (_vector3_): The pivot offset
<a name="center_offset"></a>
- **center_offset** (_vector3_): The center offset
<a name="mode"></a>
- **mode** (_string_): The layout mode
<a name="fit_size"></a>
- **fit_size** (_vector3_): The fit size
<a name="min_size_x"></a>
- **min_size_x** (_number_): The minimum size x
<a name="min_size_y"></a>
- **min_size_y** (_number_): The minimum size y
<a name="max_size_x"></a>
- **max_size_x** (_number_): The maximum size x
<a name="max_size_y"></a>
- **max_size_y** (_number_): The maximum size y
<a name="on_size_changed"></a>
- **on_size_changed** (_event_): fun(self: druid.container, size: vector3) The event triggered when the size changes
<a name="node_fill_x"></a>
- **node_fill_x** (_nil_)
<a name="node_fill_y"></a>
- **node_fill_y** (_nil_)
<a name="x_koef"></a>
- **x_koef** (_number_)
<a name="y_koef"></a>
- **y_koef** (_number_)
<a name="x_anchor"></a>
- **x_anchor** (_unknown_)
<a name="y_anchor"></a>
- **y_anchor** (_unknown_)
<a name="style"></a>
- **style** (_table_)

View File

@ -0,0 +1,239 @@
# druid.data_list API
> at /druid/extended/data_list.lua
Druid component to manage a list of data with a scrollable view, used to manage huge list data and render only visible elements.
### Setup
Create data list component with druid: `data_list = druid:new_data_list(scroll, grid, create_function)`
### Notes
- Data List uses a scroll component for scrolling and a grid component for layout
- Data List only renders visible elements for better performance
- Data List supports caching of elements for better performance
- Data List supports adding, removing and updating elements
- Data List supports scrolling to specific elements
- Data List supports custom element creation and cleanup
## Functions
- [init](#init)
- [set_use_cache](#set_use_cache)
- [set_data](#set_data)
- [get_data](#get_data)
- [add](#add)
- [remove](#remove)
- [remove_by_data](#remove_by_data)
- [clear](#clear)
- [get_index](#get_index)
- [get_created_nodes](#get_created_nodes)
- [get_created_components](#get_created_components)
- [scroll_to_index](#scroll_to_index)
## Fields
- [scroll](#scroll)
- [grid](#grid)
- [on_scroll_progress_change](#on_scroll_progress_change)
- [on_element_add](#on_element_add)
- [on_element_remove](#on_element_remove)
- [top_index](#top_index)
- [last_index](#last_index)
- [scroll_progress](#scroll_progress)
### init
---
```lua
data_list:init(scroll, grid, create_function)
```
The DataList constructor
- **Parameters:**
- `scroll` *(druid.scroll)*: The Scroll instance for Data List component
- `grid` *(druid.grid)*: The StaticGrid instance for Data List component
- `create_function` *(function)*: The create function callback(self, data, index, data_list). Function should return (node, [component])
### set_use_cache
---
```lua
data_list:set_use_cache(is_use_cache)
```
Set use cache version of DataList. Requires make setup of components in on_element_add callback and clean in on_element_remove
- **Parameters:**
- `is_use_cache` *(boolean)*: Use cache version of DataList
- **Returns:**
- `self` *(druid.data_list)*: Current DataList instance
### set_data
---
```lua
data_list:set_data(data)
```
Set new data set for DataList component
- **Parameters:**
- `data` *(table)*: The new data array
- **Returns:**
- `self` *(druid.data_list)*: Current DataList instance
### get_data
---
```lua
data_list:get_data()
```
Return current data from DataList component
- **Returns:**
- `data` *(table)*: The current data array
### add
---
```lua
data_list:add(data, [index], [shift_policy])
```
Add element to DataList
- **Parameters:**
- `data` *(table)*: The data to add
- `[index]` *(number|nil)*: The index to add the data at
- `[shift_policy]` *(number|nil)*: The constant from const.SHIFT.*
- **Returns:**
- `self` *(druid.data_list)*: Current DataList instance
### remove
---
```lua
data_list:remove([index], [shift_policy])
```
Remove element from DataList
- **Parameters:**
- `[index]` *(number|nil)*: The index to remove the data at
- `[shift_policy]` *(number|nil)*: The constant from const.SHIFT.*
- **Returns:**
- `self` *(druid.data_list)*: Current DataList instance
### remove_by_data
---
```lua
data_list:remove_by_data(data, [shift_policy])
```
Remove element from DataList by data value
- **Parameters:**
- `data` *(table)*: The data to remove
- `[shift_policy]` *(number|nil)*: The constant from const.SHIFT.*
- **Returns:**
- `self` *(druid.data_list)*: Current DataList instance
### clear
---
```lua
data_list:clear()
```
Clear the DataList and refresh visuals
- **Returns:**
- `self` *(druid.data_list)*: Current DataList instance
### get_index
---
```lua
data_list:get_index(data)
```
Return index for data value
- **Parameters:**
- `data` *(table)*:
- **Returns:**
- `` *(unknown|nil)*:
### get_created_nodes
---
```lua
data_list:get_created_nodes()
```
Return all currently created nodes in DataList
- **Returns:**
- `List` *(node[])*: of created nodes
### get_created_components
---
```lua
data_list:get_created_components()
```
Return all currently created components in DataList
- **Returns:**
- `components` *(druid.component[])*: List of created components
### scroll_to_index
---
```lua
data_list:scroll_to_index(index)
```
Instant scroll to element with passed index
- **Parameters:**
- `index` *(number)*: The index to scroll to
## Fields
<a name="scroll"></a>
- **scroll** (_druid.scroll_): The scroll instance for Data List component
<a name="grid"></a>
- **grid** (_druid.grid_): The StaticGrid or DynamicGrid instance for Data List component
<a name="on_scroll_progress_change"></a>
- **on_scroll_progress_change** (_event_): fun(self: druid.data_list, progress: number) The event triggered when the scroll progress changes
<a name="on_element_add"></a>
- **on_element_add** (_event_): fun(self: druid.data_list, index: number, node: node, instance: druid.component, data: table) The event triggered when a new element is added
<a name="on_element_remove"></a>
- **on_element_remove** (_event_): fun(self: druid.data_list, index: number, node: node, instance: druid.component, data: table) The event triggered when an element is removed
<a name="top_index"></a>
- **top_index** (_number_): The top index of the visible elements
<a name="last_index"></a>
- **last_index** (_number_): The last index of the visible elements
<a name="scroll_progress"></a>
- **scroll_progress** (_number_): The scroll progress

View File

@ -0,0 +1,102 @@
# druid.hotkey API
> at /druid/extended/hotkey.lua
Druid component to manage hotkeys and trigger callbacks when hotkeys are pressed.
### Setup
Create hotkey component with druid: `hotkey = druid:new_hotkey(keys, callback, callback_argument)`
### Notes
- Hotkey can be triggered by pressing a single key or a combination of keys
- Hotkey supports modificator keys (e.g. Ctrl, Shift, Alt)
- Hotkey can be triggered on key press, release or repeat
- Hotkey can be added or removed at runtime
- Hotkey can be enabled or disabled
- Hotkey can be set to repeat on key hold
## Functions
- [init](#init)
- [add_hotkey](#add_hotkey)
- [is_processing](#is_processing)
- [set_repeat](#set_repeat)
## Fields
- [on_hotkey_pressed](#on_hotkey_pressed)
- [on_hotkey_released](#on_hotkey_released)
- [style](#style)
- [druid](#druid)
### init
---
```lua
hotkey:init(keys, callback, [callback_argument])
```
The Hotkey constructor
- **Parameters:**
- `keys` *(string|string[])*: The keys to be pressed for trigger callback. Should contains one key and any modificator keys
- `callback` *(function)*: The callback function
- `[callback_argument]` *(any)*: The argument to pass into the callback function
### add_hotkey
---
```lua
hotkey:add_hotkey(keys, [callback_argument])
```
Add hotkey for component callback
- **Parameters:**
- `keys` *(string|hash|hash[]|string[])*: that have to be pressed before key pressed to activate
- `[callback_argument]` *(any)*: The argument to pass into the callback function
- **Returns:**
- `self` *(druid.hotkey)*: Current instance
### is_processing
---
```lua
hotkey:is_processing()
```
- **Returns:**
- `` *(boolean)*:
### set_repeat
---
```lua
hotkey:set_repeat(is_enabled_repeated)
```
If true, the callback will be triggered on action.repeated
- **Parameters:**
- `is_enabled_repeated` *(boolean)*: The flag value
- **Returns:**
- `self` *(druid.hotkey)*: Current instance
## Fields
<a name="on_hotkey_pressed"></a>
- **on_hotkey_pressed** (_event_): fun(self, context, callback_argument) The event triggered when a hotkey is pressed
<a name="on_hotkey_released"></a>
- **on_hotkey_released** (_event_): fun(self, context, callback_argument) The event triggered when a hotkey is released
<a name="style"></a>
- **style** (_druid.hotkey.style_): The style of the hotkey component
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components

View File

@ -0,0 +1,307 @@
# druid.input API
> at /druid/extended/input.lua
Basic Druid text input component. Handles user text input via component with button and text.
### Setup
Create input component with druid: `input = druid:new_input(button_node_name, text_node_name, keyboard_type)`
### Notes
- Input component handles user text input. Input contains button and text components
- Button needed for selecting/unselecting input field
- Click outside of button to unselect input field
- On focus lost (game minimized) input field will be unselected
- You can setup max length of the text
- You can setup allowed characters. On add not allowed characters `on_input_wrong` will be called
## Functions
- [init](#init)
- [get_text_selected](#get_text_selected)
- [get_text_selected_replaced](#get_text_selected_replaced)
- [set_text](#set_text)
- [select](#select)
- [unselect](#unselect)
- [get_text](#get_text)
- [set_max_length](#set_max_length)
- [set_allowed_characters](#set_allowed_characters)
- [reset_changes](#reset_changes)
- [select_cursor](#select_cursor)
- [move_selection](#move_selection)
## Fields
- [on_input_select](#on_input_select)
- [on_input_unselect](#on_input_unselect)
- [on_input_text](#on_input_text)
- [on_input_empty](#on_input_empty)
- [on_input_full](#on_input_full)
- [on_input_wrong](#on_input_wrong)
- [on_select_cursor_change](#on_select_cursor_change)
- [style](#style)
- [druid](#druid)
- [text](#text)
- [is_selected](#is_selected)
- [value](#value)
- [previous_value](#previous_value)
- [current_value](#current_value)
- [marked_value](#marked_value)
- [is_empty](#is_empty)
- [text_width](#text_width)
- [market_text_width](#market_text_width)
- [total_width](#total_width)
- [cursor_index](#cursor_index)
- [start_index](#start_index)
- [end_index](#end_index)
- [max_length](#max_length)
- [allowed_characters](#allowed_characters)
- [keyboard_type](#keyboard_type)
- [button](#button)
- [marked_text_width](#marked_text_width)
### init
---
```lua
input:init(click_node, text_node, [keyboard_type])
```
- **Parameters:**
- `click_node` *(node)*: Node to enabled input component
- `text_node` *(druid.text|node)*: Text node what will be changed on user input. You can pass text component instead of text node name Text
- `[keyboard_type]` *(constant|nil)*: Gui keyboard type for input field
### get_text_selected
---
```lua
input:get_text_selected()
```
- **Returns:**
- `` *(string|unknown)*:
### get_text_selected_replaced
---
```lua
input:get_text_selected_replaced(text)
```
Replace selected text with new text
- **Parameters:**
- `text` *(string)*: The text to replace selected text
- **Returns:**
- `new_text` *(string)*: New input text
### set_text
---
```lua
input:set_text([input_text])
```
Set text for input field
- **Parameters:**
- `[input_text]` *(string?)*: The string to apply for input field, if nil - will be set to empty string
### select
---
```lua
input:select()
```
Select input field. It will show the keyboard and trigger on_select events
### unselect
---
```lua
input:unselect()
```
Remove selection from input. It will hide the keyboard and trigger on_unselect events
### get_text
---
```lua
input:get_text()
```
Return current input field text
- **Returns:**
- `text` *(string)*: The current input field text
### set_max_length
---
```lua
input:set_max_length(max_length)
```
Set maximum length for input field.
Pass nil to make input field unliminted (by default)
- **Parameters:**
- `max_length` *(number)*: Maximum length for input text field
- **Returns:**
- `self` *(druid.input)*: Current input instance
### set_allowed_characters
---
```lua
input:set_allowed_characters(characters)
```
Set allowed charaters for input field.
See: https://defold.com/ref/stable/string/
ex: [%a%d] for alpha and numeric
ex: [abcdef] to allow only these characters
ex: [^%s] to allow only non-space characters
- **Parameters:**
- `characters` *(string)*: Regular expression for validate user input
- **Returns:**
- `self` *(druid.input)*: Current input instance
### reset_changes
---
```lua
input:reset_changes()
```
Reset current input selection and return previous value
- **Returns:**
- `self` *(druid.input)*: Current input instance
### select_cursor
---
```lua
input:select_cursor([cursor_index], [start_index], [end_index])
```
Set cursor position in input field
- **Parameters:**
- `[cursor_index]` *(number|nil)*: Cursor index for cursor position, if nil - will be set to the end of the text
- `[start_index]` *(number|nil)*: Start index for cursor position, if nil - will be set to the end of the text
- `[end_index]` *(number|nil)*: End index for cursor position, if nil - will be set to the start_index
- **Returns:**
- `self` *(druid.input)*: Current input instance
### move_selection
---
```lua
input:move_selection(delta, is_add_to_selection, is_move_to_end)
```
Change cursor position by delta
- **Parameters:**
- `delta` *(number)*: side for cursor position, -1 for left, 1 for right
- `is_add_to_selection` *(boolean)*: (Shift key)
- `is_move_to_end` *(boolean)*: (Ctrl key)
- **Returns:**
- `self` *(druid.input)*: Current input instance
## Fields
<a name="on_input_select"></a>
- **on_input_select** (_event_): fun(self: druid.input, input: druid.input) The event triggered when the input field is selected
<a name="on_input_unselect"></a>
- **on_input_unselect** (_event_): fun(self: druid.input, text: string, input: druid.input) The event triggered when the input field is unselected
<a name="on_input_text"></a>
- **on_input_text** (_event_): fun(self: druid.input) The event triggered when the input field is changed
<a name="on_input_empty"></a>
- **on_input_empty** (_event_): fun(self: druid.input) The event triggered when the input field is empty
<a name="on_input_full"></a>
- **on_input_full** (_event_): fun(self: druid.input) The event triggered when the input field is full
<a name="on_input_wrong"></a>
- **on_input_wrong** (_event_): fun(self: druid.input) The event triggered when the input field is wrong
<a name="on_select_cursor_change"></a>
- **on_select_cursor_change** (_event_): fun(self: druid.input, cursor_index: number, start_index: number, end_index: number) The event triggered when the cursor index is changed
<a name="style"></a>
- **style** (_druid.input.style_): The style of the input component
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="text"></a>
- **text** (_druid.text|node_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="is_selected"></a>
- **is_selected** (_boolean_)
<a name="value"></a>
- **value** (_unknown_)
<a name="previous_value"></a>
- **previous_value** (_unknown_)
<a name="current_value"></a>
- **current_value** (_unknown_)
<a name="marked_value"></a>
- **marked_value** (_string_)
<a name="is_empty"></a>
- **is_empty** (_boolean_)
<a name="text_width"></a>
- **text_width** (_integer_)
<a name="market_text_width"></a>
- **market_text_width** (_integer_)
<a name="total_width"></a>
- **total_width** (_integer_)
<a name="cursor_index"></a>
- **cursor_index** (_integer_)
<a name="start_index"></a>
- **start_index** (_number_)
<a name="end_index"></a>
- **end_index** (_number_)
<a name="max_length"></a>
- **max_length** (_nil_)
<a name="allowed_characters"></a>
- **allowed_characters** (_nil_)
<a name="keyboard_type"></a>
- **keyboard_type** (_constant_)
<a name="button"></a>
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="marked_text_width"></a>
- **marked_text_width** (_number_)

View File

@ -0,0 +1,122 @@
# druid.lang_text API
> at /druid/extended/lang_text.lua
The component used for displaying localized text, can automatically update text when locale is changed.
It wraps the Text component to handle localization using druid's get_text_function to set text by its id.
### Setup
Create lang text component with druid: `text = druid:new_lang_text(node_name, locale_id)`
### Notes
- Component automatically updates text when locale is changed
- Uses druid's get_text_function to get localized text by id
- Supports string formatting with additional parameters
## Functions
- [init](#init)
- [set_to](#set_to)
- [set_text](#set_text)
- [translate](#translate)
- [format](#format)
## Fields
- [text](#text)
- [node](#node)
- [on_change](#on_change)
- [druid](#druid)
### init
---
```lua
lang_text:init(node, [locale_id], [adjust_type])
```
- **Parameters:**
- `node` *(string|node)*: The node_id or gui.get_node(node_id)
- `[locale_id]` *(string|nil)*: Default locale id or text from node as default. If not provided, will use text from the node
- `[adjust_type]` *(string|nil)*: Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference
- **Returns:**
- `` *(druid.lang_text)*:
### set_to
---
```lua
lang_text:set_to(text)
```
Setup raw text to lang_text component. This will clear any locale settings.
- **Parameters:**
- `text` *(string)*: Text for text node
- **Returns:**
- `self` *(druid.lang_text)*: Current instance
### set_text
---
```lua
lang_text:set_text(text)
```
Setup raw text to lang_text component. This will clear any locale settings.
- **Parameters:**
- `text` *(string)*: Text for text node
- **Returns:**
- `self` *(druid.lang_text)*: Current instance
### translate
---
```lua
lang_text:translate(locale_id, ...)
```
Translate the text by locale_id. The text will be automatically updated when locale changes.
- **Parameters:**
- `locale_id` *(string)*: Locale id to get text from
- `...` *(...)*: vararg
- **Returns:**
- `self` *(druid.lang_text)*: Current instance
### format
---
```lua
lang_text:format(...)
```
Format string with new text params on localized text. Keeps the current locale but updates the format parameters.
- **Parameters:**
- `...` *(...)*: vararg
- **Returns:**
- `self` *(druid.lang_text)*: Current instance
## Fields
<a name="text"></a>
- **text** (_druid.text_): The text component
<a name="node"></a>
- **node** (_node_): The node of the text component
<a name="on_change"></a>
- **on_change** (_event_): fun(self: druid.lang_text) The event triggered when the text is changed
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components

View File

@ -0,0 +1,344 @@
# druid.layout API
> at /druid/extended/layout.lua
Druid component to manage the layout of nodes, placing them inside the node size with respect to the size and pivot of each node.
### Setup
Create layout component with druid: `layout = druid:new_layout(node, layout_type)`
### Notes
- Layout can be horizontal, vertical or horizontal with wrapping
- Layout can resize parent node to fit content
- Layout can justify content
- Layout supports margins and padding
- Layout automatically updates when nodes are added or removed
- Layout can be manually updated by calling set_dirty()
## Functions
- [init](#init)
- [update](#update)
- [get_entities](#get_entities)
- [set_node_index](#set_node_index)
- [set_margin](#set_margin)
- [set_padding](#set_padding)
- [set_dirty](#set_dirty)
- [set_justify](#set_justify)
- [set_type](#set_type)
- [set_hug_content](#set_hug_content)
- [add](#add)
- [remove](#remove)
- [get_size](#get_size)
- [get_content_size](#get_content_size)
- [refresh_layout](#refresh_layout)
- [clear_layout](#clear_layout)
- [get_node_size](#get_node_size)
- [calculate_rows_data](#calculate_rows_data)
- [set_node_position](#set_node_position)
## Fields
- [node](#node)
- [rows_data](#rows_data)
- [is_dirty](#is_dirty)
- [entities](#entities)
- [margin](#margin)
- [padding](#padding)
- [type](#type)
- [is_resize_width](#is_resize_width)
- [is_resize_height](#is_resize_height)
- [is_justify](#is_justify)
- [on_size_changed](#on_size_changed)
- [size](#size)
### init
---
```lua
layout:init(node_or_node_id, layout_type)
```
```lua
layout_type:
| "horizontal"
| "vertical"
| "horizontal_wrap"
```
- **Parameters:**
- `node_or_node_id` *(string|node)*: The node to manage the layout of
- `layout_type` *("horizontal"|"horizontal_wrap"|"vertical")*: The type of layout (horizontal, vertical, horizontal_wrap)
### update
---
```lua
layout:update()
```
### get_entities
---
```lua
layout:get_entities()
```
- **Returns:**
- `entities` *(node[])*: The entities to manage the layout of
### set_node_index
---
```lua
layout:set_node_index(node, index)
```
- **Parameters:**
- `node` *(node)*: The node to set the index of
- `index` *(number)*: The index to set the node to
- **Returns:**
- `self` *(druid.layout)*: for chaining
### set_margin
---
```lua
layout:set_margin([margin_x], [margin_y])
```
Set the margin of the layout
- **Parameters:**
- `[margin_x]` *(number|nil)*: The margin x
- `[margin_y]` *(number|nil)*: The margin y
- **Returns:**
- `self` *(druid.layout)*: Current layout instance
### set_padding
---
```lua
layout:set_padding([padding_x], [padding_y], [padding_z], [padding_w])
```
- **Parameters:**
- `[padding_x]` *(number|nil)*: The padding x
- `[padding_y]` *(number|nil)*: The padding y
- `[padding_z]` *(number|nil)*: The padding z
- `[padding_w]` *(number|nil)*: The padding w
- **Returns:**
- `self` *(druid.layout)*: Current layout instance
### set_dirty
---
```lua
layout:set_dirty()
```
- **Returns:**
- `self` *(druid.layout)*: Current layout instance
### set_justify
---
```lua
layout:set_justify(is_justify)
```
- **Parameters:**
- `is_justify` *(boolean)*:
- **Returns:**
- `self` *(druid.layout)*: Current layout instance
### set_type
---
```lua
layout:set_type(layout_type)
```
```lua
layout_type:
| "horizontal"
| "vertical"
| "horizontal_wrap"
```
- **Parameters:**
- `layout_type` *("horizontal"|"horizontal_wrap"|"vertical")*:
- **Returns:**
- `self` *(druid.layout)*: Current layout instance
### set_hug_content
---
```lua
layout:set_hug_content(is_hug_width, is_hug_height)
```
- **Parameters:**
- `is_hug_width` *(boolean)*:
- `is_hug_height` *(boolean)*:
- **Returns:**
- `self` *(druid.layout)*: Current layout instance
### add
---
```lua
layout:add(node_or_node_id)
```
Add node to layout
- **Parameters:**
- `node_or_node_id` *(string|node)*: node_or_node_id
- **Returns:**
- `self` *(druid.layout)*: Current layout instance
### remove
---
```lua
layout:remove(node_or_node_id)
```
Remove node from layout
- **Parameters:**
- `node_or_node_id` *(string|node)*: node_or_node_id
- **Returns:**
- `self` *(druid.layout)*: for chaining
### get_size
---
```lua
layout:get_size()
```
- **Returns:**
- `` *(vector3)*:
### get_content_size
---
```lua
layout:get_content_size()
```
- **Returns:**
- `` *(number)*:
- `` *(number)*:
### refresh_layout
---
```lua
layout:refresh_layout()
```
- **Returns:**
- `self` *(druid.layout)*: Current layout instance
### clear_layout
---
```lua
layout:clear_layout()
```
- **Returns:**
- `self` *(druid.layout)*: Current layout instance
### get_node_size
---
```lua
layout:get_node_size(node)
```
- **Parameters:**
- `node` *(node)*:
- **Returns:**
- `width` *(number)*: The width of the node
- `height` *(number)*: The height of the node
### calculate_rows_data
---
```lua
layout:calculate_rows_data()
```
Calculate rows data for layout. Contains total width, height and rows info (width, height, count of elements in row)
- **Returns:**
- `` *(druid.layout.rows_data)*:
### set_node_position
---
```lua
layout:set_node_position(node, x, y)
```
- **Parameters:**
- `node` *(node)*:
- `x` *(number)*:
- `y` *(number)*:
- **Returns:**
- `` *(node)*:
## Fields
<a name="node"></a>
- **node** (_node_): The node to manage the layout of
<a name="rows_data"></a>
- **rows_data** (_druid.layout.rows_data_): Last calculated rows data
<a name="is_dirty"></a>
- **is_dirty** (_boolean_): True if layout needs to be updated
<a name="entities"></a>
- **entities** (_node[]_): The entities to manage the layout of
<a name="margin"></a>
- **margin** (_{ x: number, y: number }_): The margin of the layout
<a name="padding"></a>
- **padding** (_vector4_): The padding of the layout
<a name="type"></a>
- **type** (_string_): The type of the layout
<a name="is_resize_width"></a>
- **is_resize_width** (_boolean_): True if the layout should resize the width of the node
<a name="is_resize_height"></a>
- **is_resize_height** (_boolean_): True if the layout should resize the height of the node
<a name="is_justify"></a>
- **is_justify** (_boolean_): True if the layout should justify the nodes
<a name="on_size_changed"></a>
- **on_size_changed** (_event.on_size_changed_): fun(self: druid.layout, size: vector3) The event triggered when the size of the layout is changed
<a name="size"></a>
- **size** (_unknown_)

View File

@ -0,0 +1,215 @@
# druid.progress API
> at /druid/extended/progress.lua
Basic Druid progress bar component. Changes the size or scale of a node to represent progress.
### Setup
Create progress bar component with druid: `progress = druid:new_progress(node_name, key, init_value)`
### Notes
- Node should have maximum node size in GUI scene, it represents the progress bar's maximum size
- Key is value from druid const: "x" or "y"
- Progress works correctly with 9slice nodes, it tries to set size by _set_size_ first until minimum size is reached, then it continues sizing via _set_scale_
- Progress bar can fill only by vertical or horizontal size. For diagonal progress bar, just rotate the node in GUI scene
- If you have glitchy or dark texture bugs with progress bar, try to disable mipmaps in your texture profiles
## Functions
- [init](#init)
- [update](#update)
- [fill](#fill)
- [empty](#empty)
- [set_to](#set_to)
- [get](#get)
- [set_steps](#set_steps)
- [to](#to)
- [set_max_size](#set_max_size)
## Fields
- [node](#node)
- [on_change](#on_change)
- [style](#style)
- [key](#key)
- [prop](#prop)
- [scale](#scale)
- [size](#size)
- [max_size](#max_size)
- [slice](#slice)
- [last_value](#last_value)
- [slice_size](#slice_size)
- [target](#target)
- [steps](#steps)
- [step_callback](#step_callback)
- [target_callback](#target_callback)
### init
---
```lua
progress:init(node, key, [init_value])
```
- **Parameters:**
- `node` *(string|node)*: Node name or GUI Node itself.
- `key` *(string)*: Progress bar direction: "x" or "y"
- `[init_value]` *(number|nil)*: Initial value of progress bar (0 to 1). Default: 1
### update
---
```lua
progress:update(dt)
```
- **Parameters:**
- `dt` *(number)*: Delta time
### fill
---
```lua
progress:fill()
```
Fill the progress bar
- **Returns:**
- `self` *(druid.progress)*: Current progress instance
### empty
---
```lua
progress:empty()
```
Empty the progress bar
- **Returns:**
- `self` *(druid.progress)*: Current progress instance
### set_to
---
```lua
progress:set_to(to)
```
Instant fill progress bar to value
- **Parameters:**
- `to` *(number)*: Progress bar value, from 0 to 1
- **Returns:**
- `self` *(druid.progress)*: Current progress instance
### get
---
```lua
progress:get()
```
Return the current value of the progress bar
- **Returns:**
- `value` *(number)*: The current value of the progress bar
### set_steps
---
```lua
progress:set_steps(steps, callback)
```
Set points on progress bar to fire the callback
- **Parameters:**
- `steps` *(number[])*: Array of progress bar values
- `callback` *(function)*: Callback on intersect step value
- **Returns:**
- `self` *(druid.progress)*: Current progress instance
### to
---
```lua
progress:to(to, [callback])
```
Start animation of a progress bar
- **Parameters:**
- `to` *(number)*: value between 0..1
- `[callback]` *(function|nil)*: Callback on animation ends
- **Returns:**
- `self` *(druid.progress)*: Current progress instance
### set_max_size
---
```lua
progress:set_max_size(max_size)
```
Set progress bar max node size
- **Parameters:**
- `max_size` *(vector3)*: The new node maximum (full) size
- **Returns:**
- `self` *(druid.progress)*: Current progress instance
## Fields
<a name="node"></a>
- **node** (_node_): The progress bar node
<a name="on_change"></a>
- **on_change** (_event_): fun(self: druid.progress, value: number) Event triggered when progress value changes
<a name="style"></a>
- **style** (_druid.progress.style_): Component style parameters
<a name="key"></a>
- **key** (_string_): Progress bar direction: "x" or "y"
<a name="prop"></a>
- **prop** (_hash_): Property for scaling the progress bar
<a name="scale"></a>
- **scale** (_unknown_)
<a name="size"></a>
- **size** (_unknown_)
<a name="max_size"></a>
- **max_size** (_unknown_)
<a name="slice"></a>
- **slice** (_unknown_)
<a name="last_value"></a>
- **last_value** (_number_)
<a name="slice_size"></a>
- **slice_size** (_unknown_)
<a name="target"></a>
- **target** (_nil_)
<a name="steps"></a>
- **steps** (_number[]_)
<a name="step_callback"></a>
- **step_callback** (_function_)
<a name="target_callback"></a>
- **target_callback** (_function|nil_)

View File

@ -0,0 +1,135 @@
# druid.slider API
> at /druid/extended/slider.lua
Basic Druid slider component. Creates a draggable node over a line with progress reporting.
### Setup
Create slider component with druid: `slider = druid:new_slider(node_name, end_pos, callback)`
### Notes
- Pin node should be placed in initial position at zero progress
- It will be available to move Pin node between start pos and end pos
- You can setup points of interests on slider via `slider:set_steps`. If steps exist, slider values will be only from these steps (notched slider)
- Start pos and end pos should be on vertical or horizontal line (their x or y value should be equal)
- To catch input across all slider, you can setup input node via `slider:set_input_node`
## Functions
- [init](#init)
- [set](#set)
- [set_steps](#set_steps)
- [set_input_node](#set_input_node)
- [set_enabled](#set_enabled)
- [is_enabled](#is_enabled)
## Fields
- [node](#node)
- [on_change_value](#on_change_value)
- [style](#style)
### init
---
```lua
slider:init(node, end_pos, [callback])
```
The Slider constructor
- **Parameters:**
- `node` *(node)*: GUI node to drag as a slider
- `end_pos` *(vector3)*: The end position of slider, should be on the same axis as the node
- `[callback]` *(function|nil)*: On slider change callback
### set
---
```lua
slider:set(value, [is_silent])
```
Set value for slider
- **Parameters:**
- `value` *(number)*: Value from 0 to 1
- `[is_silent]` *(boolean|nil)*: Don't trigger event if true
- **Returns:**
- `self` *(druid.slider)*: Current slider instance
### set_steps
---
```lua
slider:set_steps(steps)
```
Set slider steps. Pin node will
apply closest step position
- **Parameters:**
- `steps` *(number[])*: Array of steps
- **Returns:**
- `self` *(druid.slider)*: Current slider instance
### set_input_node
---
```lua
slider:set_input_node([input_node])
```
Set input zone for slider.
User can touch any place of node, pin instantly will
move at this position and node drag will start.
This function require the Defold version 1.3.0+
- **Parameters:**
- `[input_node]` *(string|node|nil)*:
- **Returns:**
- `self` *(druid.slider)*: Current slider instance
### set_enabled
---
```lua
slider:set_enabled(is_enabled)
```
Set Slider input enabled or disabled
- **Parameters:**
- `is_enabled` *(boolean)*: True if slider is enabled
- **Returns:**
- `self` *(druid.slider)*: Current slider instance
### is_enabled
---
```lua
slider:is_enabled()
```
Check if Slider component is enabled
- **Returns:**
- `is_enabled` *(boolean)*: True if slider is enabled
## Fields
<a name="node"></a>
- **node** (_node_): The node to manage the slider
<a name="on_change_value"></a>
- **on_change_value** (_event_): fun(self: druid.slider, value: number) The event triggered when the slider value changes
<a name="style"></a>
- **style** (_table_): The style of the slider

View File

@ -0,0 +1,57 @@
# druid.swipe API
> at /druid/extended/swipe.lua
The component to manage swipe events over a node
## Functions
- [init](#init)
- [set_click_zone](#set_click_zone)
## Fields
- [node](#node)
- [on_swipe](#on_swipe)
- [style](#style)
- [click_zone](#click_zone)
### init
---
```lua
swipe:init(node_or_node_id, on_swipe_callback)
```
- **Parameters:**
- `node_or_node_id` *(string|node)*:
- `on_swipe_callback` *(function)*:
### set_click_zone
---
```lua
swipe:set_click_zone([zone])
```
Set the click zone for the swipe, useful for restricting events outside stencil node
- **Parameters:**
- `[zone]` *(string|node|nil)*: Gui node
## Fields
<a name="node"></a>
- **node** (_node_): The node to manage the swipe
<a name="on_swipe"></a>
- **on_swipe** (_event_): fun(context, side, dist, dt) The event triggered when a swipe is detected
<a name="style"></a>
- **style** (_druid.swipe.style_): The style of the swipe
<a name="click_zone"></a>
- **click_zone** (_node_): The click zone of the swipe

View File

@ -0,0 +1,130 @@
# druid.timer API
> at /druid/extended/timer.lua
Druid component to handle timer work on gui text node. Displays time in a formatted way.
### Setup
Create timer component with druid: `timer = druid:new_timer(text_node, from_seconds, to_seconds, callback)`
### Notes
- Timer fires callback when timer value equals to _to_seconds_
- Timer will set text node with current timer value
- Timer uses update function to handle time
## Functions
- [init](#init)
- [set_to](#set_to)
- [set_state](#set_state)
- [set_interval](#set_interval)
## Fields
- [on_tick](#on_tick)
- [on_set_enabled](#on_set_enabled)
- [on_timer_end](#on_timer_end)
- [node](#node)
- [from](#from)
- [target](#target)
- [value](#value)
- [is_on](#is_on)
- [temp](#temp)
- [last_value](#last_value)
### init
---
```lua
timer:init(node, [seconds_from], [seconds_to], [callback])
```
- **Parameters:**
- `node` *(node)*: Gui text node
- `[seconds_from]` *(number|nil)*: Start timer value in seconds
- `[seconds_to]` *(number|nil)*: End timer value in seconds
- `[callback]` *(function|nil)*: Function that triggers when timer value equals to seconds_to
- **Returns:**
- `` *(druid.timer)*:
### set_to
---
```lua
timer:set_to(set_to)
```
Set the timer to a specific value
- **Parameters:**
- `set_to` *(number)*: Value in seconds
- **Returns:**
- `self` *(druid.timer)*: Current timer instance
### set_state
---
```lua
timer:set_state([is_on])
```
Set the timer to a specific value
- **Parameters:**
- `[is_on]` *(boolean|nil)*: Timer enable state
- **Returns:**
- `self` *(druid.timer)*: Current timer instance
### set_interval
---
```lua
timer:set_interval(from, to)
```
Set the timer interval
- **Parameters:**
- `from` *(number)*: Start time in seconds
- `to` *(number)*: Target time in seconds
- **Returns:**
- `self` *(druid.timer)*: Current timer instance
## Fields
<a name="on_tick"></a>
- **on_tick** (_event_): fun(context, value) The event triggered when the timer ticks
<a name="on_set_enabled"></a>
- **on_set_enabled** (_event_): fun(context, is_on) The event triggered when the timer is enabled
<a name="on_timer_end"></a>
- **on_timer_end** (_event_): fun(context) The event triggered when the timer ends
<a name="node"></a>
- **node** (_node_): The node to display the timer
<a name="from"></a>
- **from** (_number_): The start time of the timer
<a name="target"></a>
- **target** (_number_): The target time of the timer
<a name="value"></a>
- **value** (_number_): The current value of the timer
<a name="is_on"></a>
- **is_on** (_boolean_): True if the timer is on
<a name="temp"></a>
- **temp** (_unknown_)
<a name="last_value"></a>
- **last_value** (_number_)

View File

@ -0,0 +1,93 @@
# druid.widget.fps_panel API
> at /druid/widget/fps_panel/fps_panel.lua
## Functions
- [init](#init)
- [on_remove](#on_remove)
- [update](#update)
- [push_fps_value](#push_fps_value)
## Fields
- [root](#root)
- [delta_time](#delta_time)
- [collect_time](#collect_time)
- [collect_time_counter](#collect_time_counter)
- [graph_samples](#graph_samples)
- [fps_samples](#fps_samples)
- [mini_graph](#mini_graph)
- [text_min_fps](#text_min_fps)
- [text_fps](#text_fps)
- [timer_id](#timer_id)
- [previous_time](#previous_time)
### init
---
```lua
fps_panel:init()
```
### on_remove
---
```lua
fps_panel:on_remove()
```
### update
---
```lua
fps_panel:update([dt])
```
- **Parameters:**
- `[dt]` *(any)*:
### push_fps_value
---
```lua
fps_panel:push_fps_value()
```
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="delta_time"></a>
- **delta_time** (_number_): in seconds
<a name="collect_time"></a>
- **collect_time** (_integer_): in seconds
<a name="collect_time_counter"></a>
- **collect_time_counter** (_integer_)
<a name="graph_samples"></a>
- **graph_samples** (_number_)
<a name="fps_samples"></a>
- **fps_samples** (_table_): Store frame time in seconds last collect_time seconds
<a name="mini_graph"></a>
- **mini_graph** (_druid.widget.mini_graph_): Widget to display a several lines with different height in a row
<a name="text_min_fps"></a>
- **text_min_fps** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="text_fps"></a>
- **text_fps** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="timer_id"></a>
- **timer_id** (_unknown_)
<a name="previous_time"></a>
- **previous_time** (_unknown_)

View File

@ -0,0 +1,101 @@
# druid.widget.memory_panel API
> at /druid/widget/memory_panel/memory_panel.lua
## Functions
- [init](#init)
- [on_remove](#on_remove)
- [set_low_memory_limit](#set_low_memory_limit)
- [push_next_value](#push_next_value)
- [update_text_memory](#update_text_memory)
## Fields
- [root](#root)
- [delta_time](#delta_time)
- [samples_count](#samples_count)
- [memory_limit](#memory_limit)
- [mini_graph](#mini_graph)
- [max_value](#max_value)
- [text_per_second](#text_per_second)
- [text_memory](#text_memory)
- [memory](#memory)
- [memory_samples](#memory_samples)
- [timer_id](#timer_id)
### init
---
```lua
memory_panel:init()
```
### on_remove
---
```lua
memory_panel:on_remove()
```
### set_low_memory_limit
---
```lua
memory_panel:set_low_memory_limit([limit])
```
- **Parameters:**
- `[limit]` *(any)*:
### push_next_value
---
```lua
memory_panel:push_next_value()
```
### update_text_memory
---
```lua
memory_panel:update_text_memory()
```
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="delta_time"></a>
- **delta_time** (_number_)
<a name="samples_count"></a>
- **samples_count** (_integer_)
<a name="memory_limit"></a>
- **memory_limit** (_integer_)
<a name="mini_graph"></a>
- **mini_graph** (_druid.widget.mini_graph_): Widget to display a several lines with different height in a row
<a name="max_value"></a>
- **max_value** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="text_per_second"></a>
- **text_per_second** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="text_memory"></a>
- **text_memory** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="memory"></a>
- **memory** (_unknown_)
<a name="memory_samples"></a>
- **memory_samples** (_table_)
<a name="timer_id"></a>
- **timer_id** (_unknown_)

View File

@ -0,0 +1,233 @@
# druid.widget.mini_graph API
> at /druid/widget/mini_graph/mini_graph.lua
Widget to display a several lines with different height in a row
Init, set amount of samples and max value of value means that the line will be at max height
Use `push_line_value` to add a new value to the line
Or `set_line_value` to set a value to the line by index
Setup colors inside template file (at minimum and maximum)
## Functions
- [init](#init)
- [on_remove](#on_remove)
- [clear](#clear)
- [set_samples](#set_samples)
- [get_samples](#get_samples)
- [set_line_value](#set_line_value)
- [get_line_value](#get_line_value)
- [push_line_value](#push_line_value)
- [set_max_value](#set_max_value)
- [set_line_height](#set_line_height)
- [get_lowest_value](#get_lowest_value)
- [get_highest_value](#get_highest_value)
- [on_drag_widget](#on_drag_widget)
- [toggle_hide](#toggle_hide)
## Fields
- [root](#root)
- [text_header](#text_header)
- [icon_drag](#icon_drag)
- [content](#content)
- [layout](#layout)
- [prefab_line](#prefab_line)
- [color_zero](#color_zero)
- [color_one](#color_one)
- [is_hidden](#is_hidden)
- [max_value](#max_value)
- [lines](#lines)
- [values](#values)
- [container](#container)
- [default_size](#default_size)
- [samples](#samples)
### init
---
```lua
mini_graph:init()
```
### on_remove
---
```lua
mini_graph:on_remove()
```
### clear
---
```lua
mini_graph:clear()
```
### set_samples
---
```lua
mini_graph:set_samples([samples])
```
- **Parameters:**
- `[samples]` *(any)*:
### get_samples
---
```lua
mini_graph:get_samples()
```
- **Returns:**
- `` *(unknown)*:
### set_line_value
---
```lua
mini_graph:set_line_value(index, value)
```
Set normalized to control the color of the line
- **Parameters:**
- `index` *(number)*:
- `value` *(number)*: The normalized value from 0 to 1
- **Example Usage:**
```lua
for index = 1, mini_graph:get_samples() do
mini_graph:set_line_value(index, math.random())
end
```
### get_line_value
---
```lua
mini_graph:get_line_value([index])
```
- **Parameters:**
- `[index]` *(any)*:
- **Returns:**
- `` *(number)*:
### push_line_value
---
```lua
mini_graph:push_line_value([value])
```
- **Parameters:**
- `[value]` *(any)*:
### set_max_value
---
```lua
mini_graph:set_max_value([max_value])
```
- **Parameters:**
- `[max_value]` *(any)*:
### set_line_height
---
```lua
mini_graph:set_line_height([index])
```
- **Parameters:**
- `[index]` *(any)*:
### get_lowest_value
---
```lua
mini_graph:get_lowest_value()
```
### get_highest_value
---
```lua
mini_graph:get_highest_value()
```
### on_drag_widget
---
```lua
mini_graph:on_drag_widget([dx], [dy])
```
- **Parameters:**
- `[dx]` *(any)*:
- `[dy]` *(any)*:
### toggle_hide
---
```lua
mini_graph:toggle_hide()
```
- **Returns:**
- `` *(druid.widget.mini_graph)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="text_header"></a>
- **text_header** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="icon_drag"></a>
- **icon_drag** (_node_)
<a name="content"></a>
- **content** (_node_)
<a name="layout"></a>
- **layout** (_druid.layout_): Druid component to manage the layout of nodes, placing them inside the node size with respect to the size and pivot of each node.
<a name="prefab_line"></a>
- **prefab_line** (_node_)
<a name="color_zero"></a>
- **color_zero** (_unknown_)
<a name="color_one"></a>
- **color_one** (_unknown_)
<a name="is_hidden"></a>
- **is_hidden** (_boolean_)
<a name="max_value"></a>
- **max_value** (_integer_): in this value line will be at max height
<a name="lines"></a>
- **lines** (_table_)
<a name="values"></a>
- **values** (_table_)
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="default_size"></a>
- **default_size** (_vector3_)
<a name="samples"></a>
- **samples** (_any_)

View File

@ -0,0 +1,97 @@
# druid.widget.property_button API
> at /druid/widget/properties_panel/properties/property_button.lua
## Functions
- [init](#init)
- [on_click](#on_click)
- [set_text_property](#set_text_property)
- [set_text_button](#set_text_button)
- [set_color](#set_color)
## Fields
- [root](#root)
- [container](#container)
- [text_name](#text_name)
- [button](#button)
- [text_button](#text_button)
- [druid](#druid)
- [selected](#selected)
### init
---
```lua
property_button:init()
```
### on_click
---
```lua
property_button:on_click()
```
### set_text_property
---
```lua
property_button:set_text_property(text)
```
- **Parameters:**
- `text` *(string)*:
- **Returns:**
- `` *(druid.widget.property_button)*:
### set_text_button
---
```lua
property_button:set_text_button(text)
```
- **Parameters:**
- `text` *(string)*:
- **Returns:**
- `` *(druid.widget.property_button)*:
### set_color
---
```lua
property_button:set_color([color_value])
```
- **Parameters:**
- `[color_value]` *(any)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="button"></a>
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="text_button"></a>
- **text_button** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="selected"></a>
- **selected** (_node_)

View File

@ -0,0 +1,111 @@
# druid.widget.property_checkbox API
> at /druid/widget/properties_panel/properties/property_checkbox.lua
## Functions
- [init](#init)
- [set_value](#set_value)
- [get_value](#get_value)
- [on_click](#on_click)
- [set_text_property](#set_text_property)
- [on_change](#on_change)
## Fields
- [root](#root)
- [druid](#druid)
- [text_name](#text_name)
- [button](#button)
- [selected](#selected)
- [icon](#icon)
- [container](#container)
- [on_change_value](#on_change_value)
### init
---
```lua
property_checkbox:init()
```
### set_value
---
```lua
property_checkbox:set_value(value, [is_instant])
```
- **Parameters:**
- `value` *(boolean)*:
- `[is_instant]` *(any)*:
### get_value
---
```lua
property_checkbox:get_value()
```
- **Returns:**
- `` *(boolean)*:
### on_click
---
```lua
property_checkbox:on_click()
```
### set_text_property
---
```lua
property_checkbox:set_text_property(text)
```
Set the text property of the checkbox
- **Parameters:**
- `text` *(string)*:
### on_change
---
```lua
property_checkbox:on_change(callback)
```
Set the callback function for when the checkbox value changes
- **Parameters:**
- `callback` *(function)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="button"></a>
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="selected"></a>
- **selected** (_node_)
<a name="icon"></a>
- **icon** (_node_)
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="on_change_value"></a>
- **on_change_value** (_unknown_)

View File

@ -0,0 +1,93 @@
# druid.widget.property_input API
> at /druid/widget/properties_panel/properties/property_input.lua
## Functions
- [init](#init)
- [set_text_property](#set_text_property)
- [set_text_value](#set_text_value)
- [on_change](#on_change)
## Fields
- [root](#root)
- [container](#container)
- [text_name](#text_name)
- [button](#button)
- [druid](#druid)
- [selected](#selected)
- [rich_input](#rich_input)
- [on_change_value](#on_change_value)
### init
---
```lua
property_input:init()
```
### set_text_property
---
```lua
property_input:set_text_property(text)
```
- **Parameters:**
- `text` *(string)*:
- **Returns:**
- `` *(druid.widget.property_input)*:
### set_text_value
---
```lua
property_input:set_text_value(text)
```
- **Parameters:**
- `text` *(string|number)*:
- **Returns:**
- `` *(druid.widget.property_input)*:
### on_change
---
```lua
property_input:on_change(callback, [callback_context])
```
- **Parameters:**
- `callback` *(fun(self: druid.widget.property_input, text: string))*:
- `[callback_context]` *(any)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="button"></a>
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="selected"></a>
- **selected** (_node_)
<a name="rich_input"></a>
- **rich_input** (_druid.rich_input_): The component that handles a rich text input field, it's a wrapper around the druid.input component
<a name="on_change_value"></a>
- **on_change_value** (_event.event_): fun(text) Event triggered when the value of the input changes.

View File

@ -0,0 +1,171 @@
# druid.widget.property_left_right_selector API
> at /druid/widget/properties_panel/properties/property_left_right_selector.lua
## Functions
- [init](#init)
- [set_text](#set_text)
- [on_button_left](#on_button_left)
- [on_button_right](#on_button_right)
- [add_step](#add_step)
- [set_number_type](#set_number_type)
- [set_array_type](#set_array_type)
- [set_value](#set_value)
- [get_value](#get_value)
## Fields
- [root](#root)
- [druid](#druid)
- [text_name](#text_name)
- [button](#button)
- [selected](#selected)
- [value](#value)
- [on_change_value](#on_change_value)
- [text_value](#text_value)
- [button_left](#button_left)
- [button_right](#button_right)
- [container](#container)
- [number_type](#number_type)
- [array_type](#array_type)
### init
---
```lua
property_left_right_selector:init()
```
### set_text
---
```lua
property_left_right_selector:set_text([text])
```
- **Parameters:**
- `[text]` *(any)*:
- **Returns:**
- `` *(druid.widget.property_left_right_selector)*:
### on_button_left
---
```lua
property_left_right_selector:on_button_left()
```
### on_button_right
---
```lua
property_left_right_selector:on_button_right()
```
### add_step
---
```lua
property_left_right_selector:add_step(koef)
```
- **Parameters:**
- `koef` *(number)*: -1 0 1, on 0 will not move
### set_number_type
---
```lua
property_left_right_selector:set_number_type([min], [max], [is_loop], [steps])
```
- **Parameters:**
- `[min]` *(any)*:
- `[max]` *(any)*:
- `[is_loop]` *(any)*:
- `[steps]` *(any)*:
- **Returns:**
- `` *(druid.widget.property_left_right_selector)*:
### set_array_type
---
```lua
property_left_right_selector:set_array_type([array], [is_loop], [steps])
```
- **Parameters:**
- `[array]` *(any)*:
- `[is_loop]` *(any)*:
- `[steps]` *(any)*:
- **Returns:**
- `` *(druid.widget.property_left_right_selector)*:
### set_value
---
```lua
property_left_right_selector:set_value(value, [is_instant])
```
- **Parameters:**
- `value` *(string|number)*:
- `[is_instant]` *(any)*:
### get_value
---
```lua
property_left_right_selector:get_value()
```
- **Returns:**
- `` *(string|number)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="button"></a>
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="selected"></a>
- **selected** (_node_)
<a name="value"></a>
- **value** (_string_)
<a name="on_change_value"></a>
- **on_change_value** (_event_): fun(value: string|number)
<a name="text_value"></a>
- **text_value** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="button_left"></a>
- **button_left** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="button_right"></a>
- **button_right** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="number_type"></a>
- **number_type** (_table_)
<a name="array_type"></a>
- **array_type** (_table_)

View File

@ -0,0 +1,150 @@
# druid.widget.property_slider API
> at /druid/widget/properties_panel/properties/property_slider.lua
## Functions
- [init](#init)
- [set_text_function](#set_text_function)
- [set_text_property](#set_text_property)
- [on_change](#on_change)
- [set_value](#set_value)
- [get_value](#get_value)
- [update_value](#update_value)
- [set_number_type](#set_number_type)
## Fields
- [root](#root)
- [container](#container)
- [druid](#druid)
- [text_name](#text_name)
- [text_value](#text_value)
- [slider](#slider)
- [on_change_value](#on_change_value)
- [selected](#selected)
- [min](#min)
- [max](#max)
- [step](#step)
### init
---
```lua
property_slider:init()
```
### set_text_function
---
```lua
property_slider:set_text_function(callback)
```
- **Parameters:**
- `callback` *(fun(value: number):string)*:
### set_text_property
---
```lua
property_slider:set_text_property(text)
```
Sets the text property of the slider
- **Parameters:**
- `text` *(string)*:
### on_change
---
```lua
property_slider:on_change(callback)
```
Sets the callback function for when the slider value changes
- **Parameters:**
- `callback` *(fun(value: number))*:
### set_value
---
```lua
property_slider:set_value(value, [is_instant])
```
- **Parameters:**
- `value` *(number)*:
- `[is_instant]` *(any)*:
### get_value
---
```lua
property_slider:get_value()
```
- **Returns:**
- `` *(number)*:
### update_value
---
```lua
property_slider:update_value([value])
```
- **Parameters:**
- `[value]` *(any)*:
### set_number_type
---
```lua
property_slider:set_number_type([min], [max], [step])
```
- **Parameters:**
- `[min]` *(any)*:
- `[max]` *(any)*:
- `[step]` *(any)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="text_value"></a>
- **text_value** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="slider"></a>
- **slider** (_druid.slider_): Basic Druid slider component. Creates a draggable node over a line with progress reporting.
<a name="on_change_value"></a>
- **on_change_value** (_event_): fun(value:number)
<a name="selected"></a>
- **selected** (_node_)
<a name="min"></a>
- **min** (_integer_)
<a name="max"></a>
- **max** (_integer_)
<a name="step"></a>
- **step** (_number_)

View File

@ -0,0 +1,66 @@
# druid.widget.property_text API
> at /druid/widget/properties_panel/properties/property_text.lua
## Functions
- [init](#init)
- [set_text_property](#set_text_property)
- [set_text_value](#set_text_value)
## Fields
- [root](#root)
- [container](#container)
- [text_name](#text_name)
- [text_right](#text_right)
### init
---
```lua
property_text:init()
```
### set_text_property
---
```lua
property_text:set_text_property(text)
```
- **Parameters:**
- `text` *(string)*:
- **Returns:**
- `` *(druid.widget.property_text)*:
### set_text_value
---
```lua
property_text:set_text_value([text])
```
- **Parameters:**
- `[text]` *(string|nil)*:
- **Returns:**
- `` *(druid.widget.property_text)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="text_right"></a>
- **text_right** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.

View File

@ -0,0 +1,104 @@
# druid.widget.property_vector3 API
> at /druid/widget/properties_panel/properties/property_vector3.lua
## Functions
- [init](#init)
- [set_text_property](#set_text_property)
- [set_value](#set_value)
## Fields
- [root](#root)
- [container](#container)
- [text_name](#text_name)
- [button](#button)
- [druid](#druid)
- [selected_x](#selected_x)
- [selected_y](#selected_y)
- [selected_z](#selected_z)
- [rich_input_x](#rich_input_x)
- [rich_input_y](#rich_input_y)
- [rich_input_z](#rich_input_z)
- [value](#value)
- [on_change](#on_change)
### init
---
```lua
property_vector3:init()
```
### set_text_property
---
```lua
property_vector3:set_text_property(text)
```
- **Parameters:**
- `text` *(string)*:
- **Returns:**
- `` *(druid.widget.property_vector3)*:
### set_value
---
```lua
property_vector3:set_value(x, y, z)
```
- **Parameters:**
- `x` *(number)*:
- `y` *(number)*:
- `z` *(number)*:
- **Returns:**
- `` *(druid.widget.property_vector3)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="button"></a>
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="selected_x"></a>
- **selected_x** (_node_)
<a name="selected_y"></a>
- **selected_y** (_node_)
<a name="selected_z"></a>
- **selected_z** (_node_)
<a name="rich_input_x"></a>
- **rich_input_x** (_druid.rich_input_): The component that handles a rich text input field, it's a wrapper around the druid.input component
<a name="rich_input_y"></a>
- **rich_input_y** (_druid.rich_input_): The component that handles a rich text input field, it's a wrapper around the druid.input component
<a name="rich_input_z"></a>
- **rich_input_z** (_druid.rich_input_): The component that handles a rich text input field, it's a wrapper around the druid.input component
<a name="value"></a>
- **value** (_unknown_)
<a name="on_change"></a>
- **on_change** (_unknown_)

View File

@ -0,0 +1,389 @@
# druid.widget.properties_panel API
> at /druid/widget/properties_panel/properties_panel.lua
# Properties API:
- [property_button](properties_panel/property_button_api.md)
- [property_checkbox](properties_panel/property_checkbox_api.md)
- [property_slider](properties_panel/property_slider_api.md)
- [property_input](properties_panel/property_input_api.md)
- [property_text](properties_panel/property_text_api.md)
- [property_left_right_selector](properties_panel/property_left_right_selector_api.md)
- [property_vector3](properties_panel/property_vector3_api.md)
## Functions
- [properties_constructors](#properties_constructors)
- [init](#init)
- [on_remove](#on_remove)
- [on_drag_widget](#on_drag_widget)
- [clear_created_properties](#clear_created_properties)
- [clear](#clear)
- [on_size_changed](#on_size_changed)
- [update](#update)
- [add_checkbox](#add_checkbox)
- [add_slider](#add_slider)
- [add_button](#add_button)
- [add_input](#add_input)
- [add_text](#add_text)
- [add_left_right_selector](#add_left_right_selector)
- [add_vector3](#add_vector3)
- [add_inner_widget](#add_inner_widget)
- [add_widget](#add_widget)
- [remove](#remove)
- [set_hidden](#set_hidden)
- [is_hidden](#is_hidden)
- [set_properties_per_page](#set_properties_per_page)
- [set_page](#set_page)
## Fields
- [root](#root)
- [scroll](#scroll)
- [layout](#layout)
- [container](#container)
- [container_content](#container_content)
- [container_scroll_view](#container_scroll_view)
- [contaienr_scroll_content](#contaienr_scroll_content)
- [button_hidden](#button_hidden)
- [text_header](#text_header)
- [paginator](#paginator)
- [properties](#properties)
- [content](#content)
- [default_size](#default_size)
- [current_page](#current_page)
- [properties_per_page](#properties_per_page)
- [property_checkbox_prefab](#property_checkbox_prefab)
- [property_slider_prefab](#property_slider_prefab)
- [property_button_prefab](#property_button_prefab)
- [property_input_prefab](#property_input_prefab)
- [property_text_prefab](#property_text_prefab)
- [property_left_right_selector_prefab](#property_left_right_selector_prefab)
- [property_vector3_prefab](#property_vector3_prefab)
- [is_dirty](#is_dirty)
### properties_constructors
---
```lua
properties_panel:properties_constructors()
```
List of properties functions to create a new widget. Used to not spawn non-visible widgets but keep the reference
### init
---
```lua
properties_panel:init()
```
### on_remove
---
```lua
properties_panel:on_remove()
```
### on_drag_widget
---
```lua
properties_panel:on_drag_widget([dx], [dy])
```
- **Parameters:**
- `[dx]` *(any)*:
- `[dy]` *(any)*:
### clear_created_properties
---
```lua
properties_panel:clear_created_properties()
```
### clear
---
```lua
properties_panel:clear()
```
### on_size_changed
---
```lua
properties_panel:on_size_changed([new_size])
```
- **Parameters:**
- `[new_size]` *(any)*:
### update
---
```lua
properties_panel:update([dt])
```
- **Parameters:**
- `[dt]` *(any)*:
### add_checkbox
---
```lua
properties_panel:add_checkbox([on_create])
```
Inspect Property Checkbox API [here](properties_panel/property_checkbox_api.md)
- **Parameters:**
- `[on_create]` *(fun(checkbox: druid.widget.property_checkbox)|nil)*:
- **Returns:**
- `` *(druid.widget.properties_panel)*:
### add_slider
---
```lua
properties_panel:add_slider([on_create])
```
Inspect Property Slider API [here](properties_panel/property_slider_api.md)
- **Parameters:**
- `[on_create]` *(fun(slider: druid.widget.property_slider)|nil)*:
- **Returns:**
- `` *(druid.widget.properties_panel)*:
### add_button
---
```lua
properties_panel:add_button([on_create])
```
Inspect Property Button API [here](properties_panel/property_button_api.md)
- **Parameters:**
- `[on_create]` *(fun(button: druid.widget.property_button)|nil)*:
- **Returns:**
- `` *(druid.widget.properties_panel)*:
### add_input
---
```lua
properties_panel:add_input([on_create])
```
Inspect Property Input API [here](properties_panel/property_input_api.md)
- **Parameters:**
- `[on_create]` *(fun(input: druid.widget.property_input)|nil)*:
- **Returns:**
- `` *(druid.widget.properties_panel)*:
### add_text
---
```lua
properties_panel:add_text([on_create])
```
Inspect Property Text API [here](properties_panel/property_text_api.md)
- **Parameters:**
- `[on_create]` *(fun(text: druid.widget.property_text)|nil)*:
- **Returns:**
- `` *(druid.widget.properties_panel)*:
### add_left_right_selector
---
```lua
properties_panel:add_left_right_selector([on_create])
```
Inspect Property Left Right Selector API [here](properties_panel/property_left_right_selector_api.md)
- **Parameters:**
- `[on_create]` *(fun(selector: druid.widget.property_left_right_selector)|nil)*:
- **Returns:**
- `` *(druid.widget.properties_panel)*:
### add_vector3
---
```lua
properties_panel:add_vector3([on_create])
```
Inspect Property Vector3 API [here](properties_panel/property_vector3_api.md)
- **Parameters:**
- `[on_create]` *(fun(vector3: druid.widget.property_vector3)|nil)*:
- **Returns:**
- `` *(druid.widget.properties_panel)*:
### add_inner_widget
---
```lua
properties_panel:add_inner_widget(widget_class, [template], [nodes], [on_create])
```
- **Parameters:**
- `widget_class` *(<T:druid.widget>)*:
- `[template]` *(string|nil)*:
- `[nodes]` *(node|table<hash, node>|nil)*:
- `[on_create]` *(fun(widget: <T:druid.widget>)|nil)*:
- **Returns:**
- `` *(druid.widget.properties_panel)*:
### add_widget
---
```lua
properties_panel:add_widget(create_widget_callback)
```
- **Parameters:**
- `create_widget_callback` *(fun():druid.widget)*:
- **Returns:**
- `` *(druid.widget.properties_panel)*:
### remove
---
```lua
properties_panel:remove([widget])
```
- **Parameters:**
- `[widget]` *(any)*:
### set_hidden
---
```lua
properties_panel:set_hidden([is_hidden])
```
- **Parameters:**
- `[is_hidden]` *(any)*:
### is_hidden
---
```lua
properties_panel:is_hidden()
```
- **Returns:**
- `` *(unknown)*:
### set_properties_per_page
---
```lua
properties_panel:set_properties_per_page(properties_per_page)
```
- **Parameters:**
- `properties_per_page` *(number)*:
### set_page
---
```lua
properties_panel:set_page([page])
```
- **Parameters:**
- `[page]` *(any)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="scroll"></a>
- **scroll** (_druid.scroll_): Basic Druid scroll component. Handles all scrolling behavior in Druid GUI.
<a name="layout"></a>
- **layout** (_druid.layout_): Druid component to manage the layout of nodes, placing them inside the node size with respect to the size and pivot of each node.
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="container_content"></a>
- **container_content** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="container_scroll_view"></a>
- **container_scroll_view** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="contaienr_scroll_content"></a>
- **contaienr_scroll_content** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="button_hidden"></a>
- **button_hidden** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="text_header"></a>
- **text_header** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="paginator"></a>
- **paginator** (_druid.widget.property_left_right_selector_)
<a name="properties"></a>
- **properties** (_druid.widget[]_): List of created properties
<a name="content"></a>
- **content** (_node_)
<a name="default_size"></a>
- **default_size** (_vector3_)
<a name="current_page"></a>
- **current_page** (_integer_)
<a name="properties_per_page"></a>
- **properties_per_page** (_integer_)
<a name="property_checkbox_prefab"></a>
- **property_checkbox_prefab** (_node_)
<a name="property_slider_prefab"></a>
- **property_slider_prefab** (_node_)
<a name="property_button_prefab"></a>
- **property_button_prefab** (_node_)
<a name="property_input_prefab"></a>
- **property_input_prefab** (_node_)
<a name="property_text_prefab"></a>
- **property_text_prefab** (_node_)
<a name="property_left_right_selector_prefab"></a>
- **property_left_right_selector_prefab** (_node_)
<a name="property_vector3_prefab"></a>
- **property_vector3_prefab** (_node_)
<a name="is_dirty"></a>
- **is_dirty** (_boolean_)

172
api/druid_api.md Normal file
View File

@ -0,0 +1,172 @@
# druid API
> at /druid/druid.lua
Entry point for Druid UI Framework.
Create a new Druid instance and adjust the Druid settings here.
## Functions
- [new](#new)
- [register](#register)
- [set_default_style](#set_default_style)
- [set_text_function](#set_text_function)
- [set_sound_function](#set_sound_function)
- [init_window_listener](#init_window_listener)
- [on_window_callback](#on_window_callback)
- [on_language_change](#on_language_change)
- [get_widget](#get_widget)
- [register_druid_as_widget](#register_druid_as_widget)
- [unregister_druid_as_widget](#unregister_druid_as_widget)
### new
---
```lua
druid.new(context, [style])
```
Create a new Druid instance for creating GUI components.
- **Parameters:**
- `context` *(table)*: The Druid context. Usually, this is the self of the gui_script. It is passed into all Druid callbacks.
- `[style]` *(table|nil)*: The Druid style table to override style parameters for this Druid instance.
- **Returns:**
- `druid_instance` *(druid.instance)*: The new Druid instance
### register
---
```lua
druid.register(name, module)
```
Register a new external Druid component.
Register component just makes the druid:new_{name} function.
For example, if you register a component called "my_component", you can create it using druid:new_my_component(...).
This can be useful if you have your own "basic" components that you don't want to require in every file.
The default way to create component is `druid_instance:new(component_class, ...)`.
- **Parameters:**
- `name` *(string)*: Module name
- `module` *(table)*: Lua table with component
### set_default_style
---
```lua
druid.set_default_style(style)
```
Set the default style for all Druid instances.
- **Parameters:**
- `style` *(table)*: Default style
### set_text_function
---
```lua
druid.set_text_function(callback)
```
Set the text function for the LangText component.
- **Parameters:**
- `callback` *(fun(text_id: string):string)*: Get localized text function
### set_sound_function
---
```lua
druid.set_sound_function(callback)
```
Set the sound function to able components to play sounds.
- **Parameters:**
- `callback` *(fun(sound_id: string))*: Sound play callback
### init_window_listener
---
```lua
druid.init_window_listener()
```
Subscribe Druid to the window listener. It will override your previous
window listener, so if you have one, you should call M.on_window_callback manually.
### on_window_callback
---
```lua
druid.on_window_callback(window_event)
```
Set the window callback to enable Druid window events.
- **Parameters:**
- `window_event` *(constant)*: Event param from window listener
### on_language_change
---
```lua
druid.on_language_change()
```
Call this function when the game language changes.
It will notify all Druid instances to update the lang text components.
### get_widget
---
```lua
druid.get_widget(widget_class, gui_url)
```
Create a widget from the binded Druid GUI instance.
The widget will be created and all widget functions can be called from Game Object contexts.
This allow use only `druid_widget.gui_script` for GUI files and call this widget functions from Game Object script file.
Widget class here is a your lua file for the GUI scene (a widgets in Druid)
- **Parameters:**
- `widget_class` *(<T:druid.widget>)*: The class of the widget to return
- `gui_url` *(url)*: GUI url
- **Returns:**
- `widget` *(<T:druid.widget>?)*: The new created widget,
- **Example Usage:**
```lua
msg.url(nil, nil, "gui_widget") -- current game object
msg.url(nil, object_url, "gui_widget") -- other game object
```
### register_druid_as_widget
---
```lua
druid.register_druid_as_widget(druid)
```
Bind a Druid GUI instance to the current game object.
This instance now can produce widgets from `druid.get_widget()` function.
Only one widget can be set per game object.
- **Parameters:**
- `druid` *(druid.instance)*: The druid instance to register
### unregister_druid_as_widget
---
```lua
druid.unregister_druid_as_widget()
```
Should be called on final, where druid instance is destroyed.

540
api/druid_helper_api.md Normal file
View File

@ -0,0 +1,540 @@
# druid.helper API
> at /druid/helper.lua
The helper module contains various functions that are used in the Druid library.
You can use these functions in your projects as well.
## Functions
- [centrate_text_with_icon](#centrate_text_with_icon)
- [centrate_icon_with_text](#centrate_icon_with_text)
- [centrate_nodes](#centrate_nodes)
- [get_node](#get_node)
- [get_screen_aspect_koef](#get_screen_aspect_koef)
- [get_gui_scale](#get_gui_scale)
- [step](#step)
- [clamp](#clamp)
- [distance](#distance)
- [sign](#sign)
- [round](#round)
- [lerp](#lerp)
- [contains](#contains)
- [deepcopy](#deepcopy)
- [add_array](#add_array)
- [pick_node](#pick_node)
- [get_scaled_size](#get_scaled_size)
- [get_scene_scale](#get_scene_scale)
- [get_closest_stencil_node](#get_closest_stencil_node)
- [get_pivot_offset](#get_pivot_offset)
- [is_desktop](#is_desktop)
- [is_mobile](#is_mobile)
- [is_web](#is_web)
- [is_web_mobile](#is_web_mobile)
- [is_multitouch_supported](#is_multitouch_supported)
- [table_to_string](#table_to_string)
- [get_border](#get_border)
- [get_text_metrics_from_node](#get_text_metrics_from_node)
- [insert_with_shift](#insert_with_shift)
- [remove_with_shift](#remove_with_shift)
- [get_full_position](#get_full_position)
- [get_animation_data_from_node](#get_animation_data_from_node)
### centrate_text_with_icon
---
```lua
helper.centrate_text_with_icon([text_node], [icon_node], margin)
```
Center two nodes.
Nodes will be center around 0 x position
text_node will be first (at left side)
- **Parameters:**
- `[text_node]` *(node|nil)*: Gui text node
- `[icon_node]` *(node|nil)*: Gui box node
- `margin` *(number)*: Offset between nodes
- **Returns:**
- `` *(unknown)*:
### centrate_icon_with_text
---
```lua
helper.centrate_icon_with_text([icon_node], [text_node], [margin])
```
Center two nodes.
Nodes will be center around 0 x position
icon_node will be first (at left side)
- **Parameters:**
- `[icon_node]` *(node|nil)*: Gui box node
- `[text_node]` *(node|nil)*: Gui text node
- `[margin]` *(number|nil)*: Offset between nodes
- **Returns:**
- `` *(unknown)*:
### centrate_nodes
---
```lua
helper.centrate_nodes([margin], ...)
```
Centerate nodes by x position with margin.
This functions calculate total width of nodes and set position for each node.
The centrate will be around 0 x position.
- **Parameters:**
- `[margin]` *(number|nil)*: Offset between nodes
- `...` *(...)*: vararg
- **Returns:**
- `` *(unknown)*:
### get_node
---
```lua
helper.get_node(node_id, [template], [nodes])
```
- **Parameters:**
- `node_id` *(string|node)*:
- `[template]` *(string|nil)*: Full Path to the template
- `[nodes]` *(table<hash, node>|nil)*: Nodes what created with gui.clone_tree
- **Returns:**
- `` *(node)*:
### get_screen_aspect_koef
---
```lua
helper.get_screen_aspect_koef()
```
Get current screen stretch multiplier for each side
- **Returns:**
- `stretch_x` *(number)*:
- `stretch_y` *(number)*:
### get_gui_scale
---
```lua
helper.get_gui_scale()
```
Get current GUI scale for each side
- **Returns:**
- `scale_x` *(number)*:
### step
---
```lua
helper.step(current, target, step)
```
Move value from current to target value with step amount
- **Parameters:**
- `current` *(number)*: Current value
- `target` *(number)*: Target value
- `step` *(number)*: Step amount
- **Returns:**
- `New` *(number)*: value
### clamp
---
```lua
helper.clamp(value, [v1], [v2])
```
Clamp value between min and max. Works with nil values and swap min and max if needed.
- **Parameters:**
- `value` *(number)*: Value
- `[v1]` *(number|nil)*: Min value. If nil, value will be clamped to positive infinity
- `[v2]` *(number|nil)*: Max value If nil, value will be clamped to negative infinity
- **Returns:**
- `value` *(number)*: Clamped value
### distance
---
```lua
helper.distance(x1, y1, x2, y2)
```
Calculate distance between two points
- **Parameters:**
- `x1` *(number)*: First point x
- `y1` *(number)*: First point y
- `x2` *(number)*: Second point x
- `y2` *(number)*: Second point y
- **Returns:**
- `distance` *(number)*:
### sign
---
```lua
helper.sign(val)
```
Return sign of value
- **Parameters:**
- `val` *(number)*: Value
- **Returns:**
- `sign` *(number)*: Sign of value, -1, 0 or 1
### round
---
```lua
helper.round(num, [num_decimal_places])
```
Round number to specified decimal places
- **Parameters:**
- `num` *(number)*: Number
- `[num_decimal_places]` *(number|nil)*: Decimal places
- **Returns:**
- `value` *(number)*: Rounded number
### lerp
---
```lua
helper.lerp(a, b, t)
```
Lerp between two values
- **Parameters:**
- `a` *(number)*: First value
- `b` *(number)*: Second value
- `t` *(number)*: Lerp amount
- **Returns:**
- `value` *(number)*: Lerped value
### contains
---
```lua
helper.contains([array], [value])
```
Check if value contains in array
- **Parameters:**
- `[array]` *(any[])*: Array to check
- `[value]` *(any)*: Value
- **Returns:**
- `index` *(number|nil)*: Index of value in array or nil if value not found
### deepcopy
---
```lua
helper.deepcopy(orig_table)
```
Make a copy table with all nested tables
- **Parameters:**
- `orig_table` *(table)*: Original table
- **Returns:**
- `Copy` *(table)*: of original table
### add_array
---
```lua
helper.add_array([target], [source])
```
Add all elements from source array to the target array
- **Parameters:**
- `[target]` *(any[])*: Array to put elements from source
- `[source]` *(any[]|nil)*: The source array to get elements from
- **Returns:**
- `The` *(any[])*: target array
### pick_node
---
```lua
helper.pick_node(node, x, y, [node_click_area])
```
Make a check with gui.pick_node, but with additional node_click_area check.
- **Parameters:**
- `node` *(node)*:
- `x` *(number)*:
- `y` *(number)*:
- `[node_click_area]` *(node|nil)*: Additional node to check for click area. If nil, only node will be checked
- **Returns:**
- `` *(unknown)*:
### get_scaled_size
---
```lua
helper.get_scaled_size(node)
```
Get size of node with scale multiplier
- **Parameters:**
- `node` *(node)*: GUI node
- **Returns:**
- `scaled_size` *(vector3)*:
### get_scene_scale
---
```lua
helper.get_scene_scale(node, [include_passed_node_scale])
```
Get cumulative parent's node scale
- **Parameters:**
- `node` *(node)*: Gui node
- `[include_passed_node_scale]` *(boolean|nil)*: True if add current node scale to result
- **Returns:**
- `The` *(vector3)*: scene node scale
### get_closest_stencil_node
---
```lua
helper.get_closest_stencil_node(node)
```
Return closest non inverted clipping parent node for given node
- **Parameters:**
- `node` *(node)*: GUI node
- **Returns:**
- `stencil_node` *(node|nil)*: The closest stencil node or nil
### get_pivot_offset
---
```lua
helper.get_pivot_offset(pivot_or_node)
```
Get pivot offset for given pivot or node
Offset shown in [-0.5 .. 0.5] range, where -0.5 is left or bottom, 0.5 is right or top.
- **Parameters:**
- `pivot_or_node` *(number|node)*: GUI pivot or node
- **Returns:**
- `offset` *(vector3)*: The pivot offset
### is_desktop
---
```lua
helper.is_desktop()
```
Check if device is desktop
- **Returns:**
- `` *(boolean)*:
### is_mobile
---
```lua
helper.is_mobile()
```
Check if device is native mobile (Android or iOS)
- **Returns:**
- `Is` *(boolean)*: mobile
### is_web
---
```lua
helper.is_web()
```
Check if device is HTML5
- **Returns:**
- `` *(boolean)*:
### is_web_mobile
---
```lua
helper.is_web_mobile()
```
Check if device is HTML5 mobile
- **Returns:**
- `` *(boolean)*:
### is_multitouch_supported
---
```lua
helper.is_multitouch_supported()
```
Check if device is mobile and can support multitouch
- **Returns:**
- `is_multitouch` *(boolean)*: Is multitouch supported
### table_to_string
---
```lua
helper.table_to_string(t)
```
Simple table to one-line string converter
- **Parameters:**
- `t` *(table)*:
- **Returns:**
- `` *(string)*:
### get_border
---
```lua
helper.get_border(node, [offset])
```
Distance from node position to his borders
- **Parameters:**
- `node` *(node)*: GUI node
- `[offset]` *(vector3|nil)*: Offset from node position. Pass current node position to get non relative border values
- **Returns:**
- `border` *(vector4)*: Vector4 with border values (left, top, right, down)
### get_text_metrics_from_node
---
```lua
helper.get_text_metrics_from_node(text_node)
```
Get text metric from GUI node.
- **Parameters:**
- `text_node` *(node)*:
- **Returns:**
- `` *(GUITextMetrics)*:
### insert_with_shift
---
```lua
helper.insert_with_shift(array, [item], [index], [shift_policy])
```
Add value to array with shift policy
Shift policy can be: left, right, no_shift
- **Parameters:**
- `array` *(table)*: Array
- `[item]` *(any)*: Item to insert
- `[index]` *(number|nil)*: Index to insert. If nil, item will be inserted at the end of array
- `[shift_policy]` *(number|nil)*: The druid_const.SHIFT.* constant
- **Returns:**
- `Inserted` *(any)*: item
### remove_with_shift
---
```lua
helper.remove_with_shift([array], [index], [shift_policy])
```
Remove value from array with shift policy
Shift policy can be: left, right, no_shift
- **Parameters:**
- `[array]` *(any[])*: Array
- `[index]` *(number|nil)*: Index to remove. If nil, item will be removed from the end of array
- `[shift_policy]` *(number|nil)*: The druid_const.SHIFT.* constant
- **Returns:**
- `Removed` *(any)*: item
### get_full_position
---
```lua
helper.get_full_position(node, [root])
```
Get full position of node in the GUI tree
- **Parameters:**
- `node` *(node)*: GUI node
- `[root]` *(node|nil)*: GUI root node to stop search
- **Returns:**
- `` *(unknown)*:
### get_animation_data_from_node
---
```lua
helper.get_animation_data_from_node(node, atlas_path)
```
- **Parameters:**
- `node` *(node)*:
- `atlas_path` *(string)*: Path to the atlas
- **Returns:**
- `` *(druid.system.animation_data)*:

540
api/druid_instance_api.md Normal file
View File

@ -0,0 +1,540 @@
# druid.instance API
> at /druid/system/druid_instance.lua
The Druid Factory used to create components
## Functions
- [create_druid_instance](#create_druid_instance)
- [new](#new)
- [final](#final)
- [remove](#remove)
- [update](#update)
- [on_input](#on_input)
- [on_message](#on_message)
- [on_window_event](#on_window_event)
- [set_whitelist](#set_whitelist)
- [set_blacklist](#set_blacklist)
- [new_widget](#new_widget)
- [new_button](#new_button)
- [new_blocker](#new_blocker)
- [new_back_handler](#new_back_handler)
- [new_hover](#new_hover)
- [new_text](#new_text)
- [new_grid](#new_grid)
- [new_scroll](#new_scroll)
- [new_drag](#new_drag)
- [new_swipe](#new_swipe)
- [new_lang_text](#new_lang_text)
- [new_slider](#new_slider)
- [new_input](#new_input)
- [new_data_list](#new_data_list)
- [new_timer](#new_timer)
- [new_progress](#new_progress)
- [new_layout](#new_layout)
- [new_container](#new_container)
- [new_hotkey](#new_hotkey)
- [new_rich_text](#new_rich_text)
- [new_rich_input](#new_rich_input)
### create_druid_instance
---
```lua
instance.create_druid_instance(context, [style])
```
Druid class constructor which used to create a Druid's components
- **Parameters:**
- `context` *(table)*: Druid context. Usually it is self of gui script
- `[style]` *(table?)*: Druid style table
- **Returns:**
- `instance` *(druid.instance)*: The new Druid instance
### new
---
```lua
instance:new(component, ...)
```
Create new Druid component instance
- **Parameters:**
- `component` *(<T:druid.component>)*: The component class to create
- `...` *(...)*: vararg
- **Returns:**
- `instance` *(<T:druid.component>)*: The new ready to use component
### final
---
```lua
instance:final()
```
Call this in gui_script final function.
### remove
---
```lua
instance:remove(component)
```
Remove created component from Druid instance.
Component `on_remove` function will be invoked, if exist.
- **Parameters:**
- `component` *(<T:druid.component>)*: Component instance
- **Returns:**
- `is_removed` *(boolean)*: True if component was removed
### update
---
```lua
instance:update(dt)
```
Call this in gui_script update function.
- **Parameters:**
- `dt` *(number)*: Delta time
### on_input
---
```lua
instance:on_input(action_id, action)
```
Call this in gui_script on_input function.
- **Parameters:**
- `action_id` *(hash)*: Action_id from on_input
- `action` *(table)*: Action from on_input
- **Returns:**
- `is_input_consumed` *(boolean)*: The boolean value is input was consumed
### on_message
---
```lua
instance:on_message(message_id, message, sender)
```
Call this in gui_script on_message function.
- **Parameters:**
- `message_id` *(hash)*: Message_id from on_message
- `message` *(table)*: Message from on_message
- `sender` *(url)*: Sender from on_message
### on_window_event
---
```lua
instance:on_window_event(window_event)
```
Called when the window event occurs
- **Parameters:**
- `window_event` *(number)*: The window event
### set_whitelist
---
```lua
instance:set_whitelist(whitelist_components)
```
Set whitelist components for input processing.
If whitelist is not empty and component not contains in this list,
component will be not processed on input step
- **Parameters:**
- `whitelist_components` *(table|druid.component[])*: The array of component to whitelist
- **Returns:**
- `self` *(druid.instance)*: The Druid instance
### set_blacklist
---
```lua
instance:set_blacklist(blacklist_components)
```
Set blacklist components for input processing.
If blacklist is not empty and component contains in this list,
component will be not processed on input step DruidInstance
- **Parameters:**
- `blacklist_components` *(table|druid.component[])*: The array of component to blacklist
- **Returns:**
- `self` *(druid.instance)*: The Druid instance
### new_widget
---
```lua
instance:new_widget(widget, [template], [nodes], ...)
```
Create new Druid widget instance
- **Parameters:**
- `widget` *(<T:druid.component>)*: The widget class to create
- `[template]` *(string|nil)*: The template name used by widget
- `[nodes]` *(string|node|table<hash, node>|nil)*: The nodes table from gui.clone_tree or prefab node to use for clone or node id to clone
- `...` *(...)*: vararg
- **Returns:**
- `widget` *(<T:druid.component>)*: The new ready to use widget
### new_button
---
```lua
instance:new_button(node, [callback], [params], [anim_node])
```
Create Button component
- **Parameters:**
- `node` *(string|node)*: The node_id or gui.get_node(node_id)
- `[callback]` *(function|event|nil)*: Button callback
- `[params]` *(any)*: Button callback params
- `[anim_node]` *(string|node|nil)*: Button anim node (node, if not provided)
- **Returns:**
- `button` *(druid.button)*: The new button component
### new_blocker
---
```lua
instance:new_blocker(node)
```
Create Blocker component
- **Parameters:**
- `node` *(string|node)*: The node_id or gui.get_node(node_id)
- **Returns:**
- `blocker` *(druid.blocker)*: The new blocker component
### new_back_handler
---
```lua
instance:new_back_handler([callback], [params])
```
Create BackHandler component
- **Parameters:**
- `[callback]` *(function|event|nil)*: The callback(self, custom_args) to call on back event
- `[params]` *(any)*: Callback argument
- **Returns:**
- `back_handler` *(druid.back_handler)*: The new back handler component
### new_hover
---
```lua
instance:new_hover(node, [on_hover_callback], [on_mouse_hover_callback])
```
Create Hover component
- **Parameters:**
- `node` *(string|node)*: The node_id or gui.get_node(node_id)
- `[on_hover_callback]` *(function|nil)*: Hover callback
- `[on_mouse_hover_callback]` *(function|nil)*: Mouse hover callback
- **Returns:**
- `hover` *(druid.hover)*: The new hover component
### new_text
---
```lua
instance:new_text(node, [value], [adjust_type])
```
Create Text component
- **Parameters:**
- `node` *(string|druid.text|node)*: The node_id or gui.get_node(node_id)
- `[value]` *(string|nil)*: Initial text. Default value is node text from GUI scene.
- `[adjust_type]` *(string|nil)*: Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference
- **Returns:**
- `text` *(druid.text)*: The new text component
### new_grid
---
```lua
instance:new_grid(parent_node, item, [in_row])
```
Create Grid component
- **Parameters:**
- `parent_node` *(string|node)*: The node_id or gui.get_node(node_id). Parent of all Grid items.
- `item` *(string|node)*: Item prefab. Required to get grid's item size. Can be adjusted separately.
- `[in_row]` *(number|nil)*: How many nodes in row can be placed
- **Returns:**
- `grid` *(druid.grid)*: The new grid component
### new_scroll
---
```lua
instance:new_scroll(view_node, content_node)
```
Create Scroll component
- **Parameters:**
- `view_node` *(string|node)*: The node_id or gui.get_node(node_id). Will used as user input node.
- `content_node` *(string|node)*: The node_id or gui.get_node(node_id). Will used as scrollable node inside view_node.
- **Returns:**
- `scroll` *(druid.scroll)*: The new scroll component
### new_drag
---
```lua
instance:new_drag(node, [on_drag_callback])
```
Create Drag component
- **Parameters:**
- `node` *(string|node)*: The node_id or gui.get_node(node_id). Will used as user input node.
- `[on_drag_callback]` *(function|nil)*: Callback for on_drag_event(self, dx, dy)
- **Returns:**
- `drag` *(druid.drag)*: The new drag component
### new_swipe
---
```lua
instance:new_swipe(node, [on_swipe_callback])
```
Create Swipe component
- **Parameters:**
- `node` *(string|node)*: The node_id or gui.get_node(node_id). Will used as user input node.
- `[on_swipe_callback]` *(function|nil)*: Swipe callback for on_swipe_end event
- **Returns:**
- `swipe` *(druid.swipe)*: The new swipe component
### new_lang_text
---
```lua
instance:new_lang_text(node, [locale_id], [adjust_type])
```
Create LangText component
- **Parameters:**
- `node` *(string|node)*: The_node id or gui.get_node(node_id)
- `[locale_id]` *(string|nil)*: Default locale id or text from node as default
- `[adjust_type]` *(string|nil)*: Adjust type for text node. Default: "downscale"
- **Returns:**
- `lang_text` *(druid.lang_text)*: The new lang text component
### new_slider
---
```lua
instance:new_slider(pin_node, end_pos, [callback])
```
Create Slider component
- **Parameters:**
- `pin_node` *(string|node)*: The_node id or gui.get_node(node_id).
- `end_pos` *(vector3)*: The end position of slider
- `[callback]` *(function|nil)*: On slider change callback
- **Returns:**
- `slider` *(druid.slider)*: The new slider component
### new_input
---
```lua
instance:new_input(click_node, text_node, [keyboard_type])
```
Create Input component
- **Parameters:**
- `click_node` *(string|node)*: Button node to enabled input component
- `text_node` *(string|druid.text|node)*: Text node what will be changed on user input
- `[keyboard_type]` *(number|nil)*: Gui keyboard type for input field
- **Returns:**
- `input` *(druid.input)*: The new input component
### new_data_list
---
```lua
instance:new_data_list(druid_scroll, druid_grid, create_function)
```
Create DataList component
- **Parameters:**
- `druid_scroll` *(druid.scroll)*: The Scroll instance for Data List component
- `druid_grid` *(druid.grid)*: The Grid instance for Data List component
- `create_function` *(function)*: The create function callback(self, data, index, data_list). Function should return (node, [component])
- **Returns:**
- `data_list` *(druid.data_list)*: The new data list component
### new_timer
---
```lua
instance:new_timer(node, [seconds_from], [seconds_to], [callback])
```
Create Timer component
- **Parameters:**
- `node` *(string|node)*: Gui text node
- `[seconds_from]` *(number|nil)*: Start timer value in seconds
- `[seconds_to]` *(number|nil)*: End timer value in seconds
- `[callback]` *(function|nil)*: Function on timer end
- **Returns:**
- `timer` *(druid.timer)*: The new timer component
### new_progress
---
```lua
instance:new_progress(node, key, [init_value])
```
Create Progress component
- **Parameters:**
- `node` *(string|node)*: Progress bar fill node or node name
- `key` *(string)*: Progress bar direction: "x" or "y"
- `[init_value]` *(number|nil)*: Initial value of progress bar. Default: 1
- **Returns:**
- `progress` *(druid.progress)*: The new progress component
### new_layout
---
```lua
instance:new_layout(node, [mode])
```
Create Layout component
- **Parameters:**
- `node` *(string|node)*: The_node id or gui.get_node(node_id).
- `[mode]` *(string|nil)*: vertical|horizontal|horizontal_wrap. Default: horizontal
- **Returns:**
- `layout` *(druid.layout)*: The new layout component
### new_container
---
```lua
instance:new_container(node, [mode], [callback])
```
Create Container component
- **Parameters:**
- `node` *(string|node)*: The_node id or gui.get_node(node_id).
- `[mode]` *(string|nil)*: Layout mode
- `[callback]` *(fun(self: druid.container, size: vector3)|nil)*: Callback on size changed
- **Returns:**
- `container` *(druid.container)*: The new container component
### new_hotkey
---
```lua
instance:new_hotkey(keys_array, [callback], [callback_argument])
```
Create Hotkey component
- **Parameters:**
- `keys_array` *(string|string[])*: Keys for trigger action. Should contains one action key and any amount of modificator keys
- `[callback]` *(function|event|nil)*: The callback function
- `[callback_argument]` *(any)*: The argument to pass into the callback function
- **Returns:**
- `hotkey` *(druid.hotkey)*: The new hotkey component
### new_rich_text
---
```lua
instance:new_rich_text(text_node, [value])
```
Create RichText component.
- **Parameters:**
- `text_node` *(string|node)*: The text node to make Rich Text
- `[value]` *(string|nil)*: The initial text value. Default will be gui.get_text(text_node)
- **Returns:**
- `rich_text` *(druid.rich_text)*: The new rich text component
### new_rich_input
---
```lua
instance:new_rich_input(template, [nodes])
```
Create RichInput component.
As a template please check rich_input.gui layout.
- **Parameters:**
- `template` *(string)*: The template string name
- `[nodes]` *(table|nil)*: Nodes table from gui.clone_tree
- **Returns:**
- `rich_input` *(druid.rich_input)*: The new rich input component

643
api/quick_api_reference.md Normal file
View File

@ -0,0 +1,643 @@
# Quick API Reference
# Table of Contents
1. [Druid](#druid)
2. [Druid Instance](#druid-instance)
3. [Components](#components)
1. [Base Component](#base-component)
2. [Blocker](#blocker)
3. [Button](#button)
4. [Container](#container)
5. [Data List](#data-list)
6. [Drag](#drag)
7. [Grid](#grid)
8. [Hotkey](#hotkey)
9. [Hover](#hover)
10. [Input](#input)
11. [Lang Text](#lang-text)
12. [Layout](#layout)
13. [Progress](#progress)
14. [Rich Input](#rich-input)
15. [Rich Text](#rich-text)
16. [Scroll](#scroll)
17. [Slider](#slider)
18. [Swipe](#swipe)
19. [Text](#text)
20. [Timer](#timer)
4. [Helper](#helper)
5. [Widgets](#widgets)
# API Reference
## [Druid](druid_api.md)
Inspect [API Here](druid_api.md)
```lua
local druid = require("druid.druid")
druid.init_window_listener()
druid.on_language_change()
druid.on_window_callback(window_event)
druid.set_default_style(style)
druid.set_sound_function(callback)
druid.set_text_function(callback)
self.druid = druid.new(context, [style])
```
## [Druid Instance](druid_instance_api.md)
Inspect [API Here](druid_instance_api.md)
```lua
-- Lifecycle
self.druid:final()
self.druid:update(dt)
self.druid:on_input(action_id, action)
self.druid:on_message(message_id, message, sender)
-- Custom components
self.druid:new(component, ...)
self.druid:new_widget(widget, [template], [nodes], ...)
-- Built-in components
self.druid:new_button(node, [callback], [params], [anim_node])
self.druid:new_text(node, [value], [no_adjust])
self.druid:new_grid(parent_node, item, [in_row])
self.druid:new_scroll(view_node, content_node)
self.druid:new_data_list(druid_scroll, druid_grid, create_function)
self.druid:new_progress(node, key, [init_value])
self.druid:new_lang_text(node, [locale_id], [adjust_type])
self.druid:new_rich_text(text_node, [value])
self.druid:new_back_handler([callback], [params])
self.druid:new_blocker(node)
self.druid:new_hover(node, [on_hover_callback], [on_mouse_hover_callback])
self.druid:new_drag(node, [on_drag_callback])
self.druid:new_swipe(node, [on_swipe_callback])
self.druid:new_input(click_node, text_node, [keyboard_type])
self.druid:new_rich_input(template, [nodes])
self.druid:new_layout(node, [mode])
self.druid:new_container(node, [mode], [callback])
self.druid:new_hotkey(keys_array, [callback], [callback_argument])
self.druid:new_slider(pin_node, end_pos, [callback])
self.druid:new_timer(node, [seconds_from], [seconds_to], [callback])
-- Operational
self.druid:remove(component)
self.druid:set_blacklist(blacklist_components)
self.druid:set_whitelist(whitelist_components)
```
## Components
### [Base Component](components/base/component_api.md)
Inspect [API Here](components/base/component_api.md)
Basic methods for all components and widgets.
```lua
component:get_childrens()
component:get_context()
component:get_druid([template], [nodes])
component:get_input_priority()
component:get_node(node_id)
component:get_nodes()
component:get_parent_component()
component:get_template()
component:reset_input_priority()
component:set_input_enabled(state)
component:set_input_priority(value, [is_temporary])
component:set_nodes(nodes)
component:set_style([druid_style])
component:set_template([template])
-- All widgets goes with created Druid instance
-- All other component's functions also exists
widget.druid
```
### [Blocker](components/base/blocker_api.md)
Inspect [API Here](components/base/blocker_api.md)
```lua
local blocker = self.druid:new_blocker(node)
blocker:is_enabled()
blocker:set_enabled(state)
```
### [Button](components/base/button_api.md)
Inspect [API Here](components/base/button_api.md)
```lua
local button = require("druid.base.button")
button:init(node_or_node_id, [callback], [custom_args], [anim_node])
button:set_animations_disabled()
button:set_enabled([state])
button:is_enabled()
button:set_click_zone([zone])
button:set_key_trigger(key)
button:get_key_trigger()
button:set_check_function([check_function], [failure_callback])
button:set_web_user_interaction([is_web_mode])
button.on_click
button.on_pressed
button.on_repeated_click
button.on_long_click
button.on_double_click
button.on_hold_callback
button.on_click_outside
```
### [Container](components/extended/container_api.md)
Inspect [API Here](components/extended/container_api.md)
```lua
local container = self.druid:new_container(node, [mode], [callback])
container:add_container(node_or_container, [mode], [on_resize_callback])
container:clear_draggable_corners()
container:create_draggable_corners()
container:fit_into_node(node)
container:fit_into_size(target_size)
container:fit_into_window()
container:get_position()
container:get_scale()
container:get_size()
container:on_window_resized()
container:refresh()
container:refresh_origins()
container:refresh_scale()
container:remove_container_by_node([node])
container:set_min_size([min_size_x], [min_size_y])
container:set_max_size([max_size_x], [max_size_y])
container:set_parent_container([parent_container])
container:set_pivot(pivot)
container:set_position(pos_x, pos_y)
container:set_size([width], [height], [anchor_pivot])
container:update_child_containers()
container.on_size_changeed
```
### [Data List](components/extended/data_list_api.md)
Inspect [API Here](components/extended/data_list_api.md)
```lua
local data_list = self.druid:new_data_list(druid_scroll, druid_grid, create_function)
data_list:add(data, [index], [shift_policy])
data_list:clear()
data_list:get_created_components()
data_list:get_created_nodes()
data_list:get_data()
data_list:get_index(data)
data_list:remove([index], [shift_policy])
data_list:remove_by_data(data, [shift_policy])
data_list:scroll_to_index(index)
data_list:set_data(data)
data_list:set_use_cache(is_use_cache)
data_list.on_scroll_progress_change
data_list.on_element_add
data_list.on_element_remove
```
### [Drag](components/base/drag_api.md)
Inspect [API Here](components/base/drag_api.md)
```lua
local drag = self.druid:new_drag(node, [on_drag_callback])
drag:is_enabled()
drag:on_window_resized()
drag:set_click_zone([node])
drag:set_drag_cursors(is_enabled)
drag:set_enabled(is_enabled)
drag.on_touch_start
drag.on_touch_end
drag.on_drag_start
drag.on_drag
drag.on_drag_end
```
### [Grid](components/base/static_grid_api.md)
Inspect [API Here](components/base/static_grid_api.md)
```lua
local grid = self.druid:new_grid(parent_node, item, [in_row])
grid:add(item, [index], [shift_policy], [is_instant])
grid:clear()
grid:get_all_pos()
grid:get_borders()
grid:get_index(pos)
grid:get_index_by_node(node)
grid:get_offset()
grid:get_pos(index)
grid:get_size()
grid:get_size_for([count])
grid:refresh()
grid:remove(index, [shift_policy], [is_instant])
grid:set_anchor(anchor)
grid:set_in_row(in_row)
grid:set_item_size([width], [height])
grid:set_items(nodes, [is_instant])
grid:set_pivot([pivot])
grid:set_position_function(callback)
grid:sort_nodes(comparator)
grid.on_add_item
grid.on_remove_item
grid.on_change_items
grid.on_clear
grid.on_update_positions
```
### [Hotkey](components/extended/hotkey_api.md)
Inspect [API Here](components/extended/hotkey_api.md)
```lua
local hotkey = self.druid:new_hotkey(keys_array, [callback], [callback_argument])
hotkey:add_hotkey(keys, [callback_argument])
hotkey:is_processing()
hotkey:on_focus_gained()
hotkey:set_repeat(is_enabled_repeated)
hotkey.on_hotkey_pressed
hotkey.on_hotkey_released
```
### [Hover](components/base/hover_api.md)
Inspect [API Here](components/base/hover_api.md)
```lua
local hover = self.druid:new_hover(node, [on_hover_callback], [on_mouse_hover_callback])
hover:is_enabled()
hover:is_hovered()
hover:is_mouse_hovered()
hover:set_click_zone([zone])
hover:set_enabled([state])
hover:set_hover([state])
hover:set_mouse_hover([state])
hover.on_hover
hover.on_mouse_hover
```
### [Input](components/extended/input_api.md)
Inspect [API Here](components/extended/input_api.md)
```lua
local input = self.druid:new_input(click_node, text_node, [keyboard_type])
input:get_text()
input:get_text_selected()
input:get_text_selected_replaced(text)
input:move_selection(delta, is_add_to_selection, is_move_to_end)
input:on_focus_lost()
input:reset_changes()
input:select()
input:select_cursor([cursor_index], [start_index], [end_index])
input:set_allowed_characters(characters)
input:set_max_length(max_length)
input:set_text(input_text)
input:unselect()
input.on_input_select
input.on_input_unselect
input.on_input_text
input.on_input_empty
input.on_input_full
input.on_input_wrong
input.on_select_cursor_change
```
### [Lang Text](components/extended/lang_text_api.md)
Inspect [API Here](components/extended/lang_text_api.md)
```lua
local lang_text = self.druid:new_lang_text(node, [locale_id], [adjust_type])
lang_text:format([a], [b], [c], [d], [e], [f], [g])
lang_text:on_language_change()
lang_text:set_text(text)
lang_text:set_to(text)
lang_text:translate(locale_id, [a], [b], [c], [d], [e], [f], [g])
lang_text.on_change
```
### [Layout](components/extended/layout_api.md)
Inspect [API Here](components/extended/layout_api.md)
```lua
local layout = self.druid:new_layout(node, [mode])
layout:add(node_or_node_id)
layout:calculate_rows_data()
layout:clear_layout()
layout:get_content_size()
layout:get_entities()
layout:get_node_size(node)
layout:get_size()
layout:refresh_layout()
layout:remove(node_or_node_id)
layout:set_dirty()
layout:set_hug_content(is_hug_width, is_hug_height)
layout:set_justify(is_justify)
layout:set_margin([margin_x], [margin_y])
layout:set_node_index([node], [index])
layout:set_node_position(node, x, y)
layout:set_padding([padding_x], [padding_y], [padding_z], [padding_w])
layout:set_type(type)
layout:update()
layout.on_size_changed
```
### [Progress](components/extended/progress_api.md)
Inspect [API Here](components/extended/progress_api.md)
```lua
local progress = self.druid:new_progress(node, key, [init_value])
progress:empty()
progress:fill()
progress:get()
progress:set_max_size(max_size)
progress:set_steps(steps, callback)
progress:set_to(to)
progress:to(to, [callback])
progress:update([dt])
progress.on_change
```
### [Rich Input](components/custom/rich_input_api.md)
Inspect [API Here](components/custom/rich_input_api.md)
```lua
local rich_input = self.druid:new_rich_input(template, [nodes])
rich_input:get_text()
rich_input:select()
rich_input:set_allowed_characters(characters)
rich_input:set_font(font)
rich_input:set_placeholder(placeholder_text)
rich_input:set_text(text)
```
### [Rich Text](components/custom/rich_text_api.md)
Inspect [API Here](components/custom/rich_text_api.md)
```lua
local rich_text = self.druid:new_rich_text(text_node, [value])
rich_text:characters(word)
rich_text:clear()
rich_text:get_line_metric()
rich_text:get_text()
rich_text:get_words()
rich_text:set_text([text])
rich_text:tagged(tag)
```
### [Scroll](components/base/scroll_api.md)
Inspect [API Here](components/base/scroll_api.md)
```lua
local scroll = self.druid:new_scroll(view_node, content_node)
scroll:bind_grid([grid])
scroll:get_percent()
scroll:get_scroll_size()
scroll:is_inert()
scroll:is_node_in_view(node)
scroll:scroll_to(point, [is_instant])
scroll:scroll_to_index(index, [skip_cb])
scroll:scroll_to_percent(percent, [is_instant])
scroll:set_click_zone(node)
scroll:set_extra_stretch_size([stretch_size])
scroll:set_horizontal_scroll(state)
scroll:set_inert(state)
scroll:set_points(points)
scroll:set_size(size, [offset])
scroll:set_vertical_scroll(state)
scroll:set_view_size(size)
scroll:update([dt])
scroll:update_view_size()
scroll.on_scroll
scroll.on_scroll_to
scroll.on_point_scroll
```
### [Slider](components/extended/slider_api.md)
Inspect [API Here](components/extended/slider_api.md)
```lua
local slider = self.druid:new_slider(pin_node, end_pos, [callback])
slider:is_enabled()
slider:set(value, [is_silent])
slider:set_enabled(is_enabled)
slider:set_input_node([input_node])
slider:set_steps(steps)
slider.on_change_value
```
### [Swipe](components/extended/swipe_api.md)
Inspect [API Here](components/extended/swipe_api.md)
```lua
local swipe = self.druid:new_swipe(node, [on_swipe_callback])
swipe:set_click_zone([zone])
swipe.on_swipe
```
### [Text](components/base/text_api.md)
Inspect [API Here](components/base/text_api.md)
```lua
local text = self.druid:new_text(node, [value], [no_adjust])
text:get_text()
text:get_text_adjust()
text:get_text_index_by_width(width)
text:get_text_size([text])
text:is_multiline()
text:set_alpha(alpha)
text:set_color(color)
text:set_minimal_scale(minimal_scale)
text:set_pivot(pivot)
text:set_scale(scale)
text:set_size(size)
text:set_text([new_text])
text:set_text_adjust([adjust_type], [minimal_scale])
text:set_to(set_to)
text.on_set_text
text.on_update_text_scale
text.on_set_pivot
```
### [Timer](components/extended/timer_api.md)
Inspect [API Here](components/extended/timer_api.md)
```lua
local timer = self.druid:new_timer(node, [seconds_from], [seconds_to], [callback])
timer:set_interval(from, to)
timer:set_state([is_on])
timer:set_to(set_to)
timer:update([dt])
timer.on_tick
timer.on_set_enabled
timer.on_timer_end
```
## [Helper](druid_helper_api.md)
Inspect [API Here](druid_helper_api.md)
```lua
local helper = require("druid.helper")
helper.add_array([target], [source])
helper.centrate_icon_with_text([icon_node], [text_node], [margin])
helper.centrate_nodes([margin], ...)
helper.centrate_text_with_icon([text_node], [icon_node], margin)
helper.clamp(value, [v1], [v2])
helper.contains([array], [value])
helper.deepcopy(orig_table)
helper.distance(x1, y1, x2, y2)
helper.get_animation_data_from_node(node, atlas_path)
helper.get_border(node, [offset])
helper.get_closest_stencil_node(node)
helper.get_full_position(node, [root])
helper.get_gui_scale()
helper.get_node(node_id, [template], [nodes])
helper.get_pivot_offset(pivot_or_node)
helper.get_scaled_size(node)
helper.get_scene_scale(node, [include_passed_node_scale])
helper.get_screen_aspect_koef()
helper.get_text_metrics_from_node(text_node)
helper.insert_with_shift(array, [item], [index], [shift_policy])
helper.is_mobile()
helper.is_multitouch_supported()
helper.is_web()
helper.is_web_mobile()
helper.lerp(a, b, t)
helper.pick_node(node, x, y, [node_click_area])
helper.remove_with_shift([array], [index], [shift_policy])
helper.round(num, [num_decimal_places])
helper.sign(val)
helper.step(current, target, step)
helper.table_to_string(t)
```
## [Widgets](widgets_api.md)
Inspect [API Here](widgets_api.md)
### [FPS Panel](/api/components/widgets/fps_panel_api.md)
Inspect [API Here](/api/components/widgets/fps_panel_api.md)
```lua
local fps_panel = require("druid.widget.fps_panel.fps_panel")
fps_panel:init()
fps_panel:push_fps_value()
```
### [Memory Panel](/api/components/widgets/memory_panel_api.md)
Inspect [API Here](/api/components/widgets/memory_panel_api.md)
```lua
local memory_panel = require("druid.widget.memory_panel.memory_panel")
memory_panel:init()
memory_panel:set_low_memory_limit([limit])
memory_panel:push_next_value()
memory_panel:update_text_memory()
```
### [Mini Graph](/api/components/widgets/mini_graph_api.md)
Inspect [API Here](/api/components/widgets/mini_graph_api.md)
```lua
local mini_graph = require("druid.widget.mini_graph.mini_graph")
mini_graph:clear()
mini_graph:set_samples([samples])
mini_graph:get_samples()
mini_graph:set_line_value(index, value)
mini_graph:get_line_value([index])
mini_graph:push_line_value([value])
mini_graph:set_max_value([max_value])
mini_graph:set_line_height([index])
mini_graph:get_lowest_value()
mini_graph:get_highest_value()
mini_graph:toggle_hide()
```
### [Properties Panel](/api/components/widgets/properties_panel_api.md)
Inspect [API Here](/api/components/widgets/properties_panel_api.md)
```lua
local properties_panel = require("druid.widget.properties_panel.properties_panel")
properties_panel:properties_constructors()
properties_panel:init()
properties_panel:clear_created_properties()
properties_panel:clear()
properties_panel:add_checkbox([on_create])
properties_panel:add_slider([on_create])
properties_panel:add_button([on_create])
properties_panel:add_input([on_create])
properties_panel:add_text([on_create])
properties_panel:add_left_right_selector([on_create])
properties_panel:add_vector3([on_create])
properties_panel:add_inner_widget(widget_class, [template], [nodes], [on_create])
properties_panel:add_widget(create_widget_callback)
properties_panel:remove([widget])
properties_panel:set_hidden([is_hidden])
properties_panel:is_hidden()
properties_panel:set_properties_per_page(properties_per_page)
properties_panel:set_page([page])
```

View File

@ -1,17 +0,0 @@
project='Druid'
title='Defold Druid UI Library'
description='Documentation for Druid Library'
file={"./druid",
exclude = {
"./druid/styles/",
"./druid/system/middleclass.lua"
}
}
package='druid'
sort=false
dir='./docs'
style='!fixed'
format='discount'
topics={"./docs_md", "README.md"}
use_markdown_titles=true
no_space_before_args=true

BIN
docs/Druid.wasm Normal file

Binary file not shown.

36
docs/Druid_asmjs.js Normal file

File diff suppressed because one or more lines are too long

1
docs/Druid_wasm.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"content":[{"name":"game.projectc","size":4552,"pieces":[{"name":"game0.projectc","offset":0}]},{"name":"game.arci","size":15008,"pieces":[{"name":"game0.arci","offset":0}]},{"name":"game.arcd","size":3789178,"pieces":[{"name":"game0.arcd","offset":0},{"name":"game1.arcd","offset":2097152}]},{"name":"game.dmanifest","size":17041,"pieces":[{"name":"game0.dmanifest","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game0.public.der","offset":0}]}],"total_size":3825941}

BIN
docs/archive/game0.arcd Normal file

Binary file not shown.

BIN
docs/archive/game0.arci Normal file

Binary file not shown.

Binary file not shown.

243
docs/archive/game0.projectc Normal file
View File

@ -0,0 +1,243 @@
[project]
title = Druid
version = 1.1.0
write_log = 0
minimum_log_level = 1
compress_archive = 1
publisher = Insality
developer = Maksim Tuprikov
custom_resources = /example/locales
commit_sha = 423a5239036790befe5fd0afd5b7a653314ad8be
title_as_file_name = Druid
[display]
width = 1920
height = 1080
high_dpi = 1
samples = 0
fullscreen = 0
update_frequency = 60
swap_interval = 1
vsync = 1
display_profiles = /builtins/render/default.display_profilesc
dynamic_orientation = 1
display_device_info = 0
[render]
clear_color_red = 0
clear_color_green = 0
clear_color_blue = 0
clear_color_alpha = 1
[physics]
type = 2D
max_collision_object_count = 128
use_fixed_timestep = 0
gravity_y = -10
debug = 0
debug_alpha = 0.9
world_count = 4
gravity_x = 0
gravity_z = 0
scale = 1
allow_dynamic_transforms = 1
debug_scale = 30
max_collisions = 64
max_contacts = 128
contact_impulse_limit = 0
ray_cast_limit_2d = 64
ray_cast_limit_3d = 128
trigger_overlap_capacity = 16
velocity_threshold = 1
max_fixed_timesteps = 2
[bootstrap]
main_collection = /example/druid.collectionc
render = /builtins/render/default.renderc
[graphics]
default_texture_min_filter = linear
default_texture_mag_filter = linear
max_draw_calls = 128
max_characters = 8192
max_font_batches = 128
max_debug_vertices = 10000
texture_profiles = /builtins/graphics/default.texture_profiles
verify_graphics_calls = 0
opengl_version_hint = 33
opengl_core_profile_hint = true
memory_size = 512
[shader]
output_spirv = 0
[sound]
gain = 1
max_sound_data = 128
max_sound_buffers = 32
max_sound_sources = 16
max_sound_instances = 256
max_component_count = 32
use_thread = 1
[resource]
http_cache = 0
max_resources = 1024
[input]
repeat_delay = 0.5
repeat_interval = 0.2
gamepads = /builtins/input/default.gamepadsc
game_binding = /builtins/input/all.input_bindingc
use_accelerometer = 0
[sprite]
max_count = 16
subpixels = 1
[model]
max_count = 0
split_meshes = 0
[mesh]
max_count = 0
[gui]
max_count = 64
max_particlefx_count = 64
max_particle_count = 1024
max_animation_count = 1024
[collection]
max_instances = 128
max_input_stack_entries = 16
[collection_proxy]
max_count = 8
[collectionfactory]
max_count = 64
[factory]
max_count = 16
[ios]
launch_screen = /builtins/manifests/ios/LaunchScreen.storyboardc
pre_renderered_icons = 0
bundle_identifier = example.unnamed
bundle_name =
infoplist = /builtins/manifests/ios/Info.plist
privacymanifest = /builtins/manifests/ios/PrivacyInfo.xcprivacy
default_language = en
localizations = en
[android]
version_code = 970
minimum_sdk_version = 19
target_sdk_version = 35
package = com.insality.druid
gcm_sender_id =
manifest = /builtins/manifests/android/AndroidManifest.xml
iap_provider = GooglePlay
input_method = HiddenInputField
immersive_mode = 0
display_cutout = 1
debuggable = 0
proguard =
extract_native_libs = 1
[osx]
app_icon =
infoplist = /builtins/manifests/osx/Info.plist
privacymanifest = /builtins/manifests/osx/PrivacyInfo.xcprivacy
bundle_identifier = example.unnamed
bundle_name =
bundle_version = 1
default_language = en
localizations = en
[windows]
app_icon =
[html5]
custom_heap_size = 0
heap_size = 64
htmlfile = /builtins/manifests/web/engine_template.html
cssfile = /builtins/manifests/web/dark_theme.css
splash_image = /media/druid_logo.png
archive_location_prefix = archive
archive_location_suffix =
engine_arguments = --verify-graphics-calls=false
wasm_streaming = 0
show_fullscreen_button = 0
show_made_with_defold = 0
show_console_banner = 0
scale_mode = stretch
transparent_graphics_context = 0
[particle_fx]
max_count = 0
max_emitter_count = 0
max_particle_count = 0
[network]
http_timeout = 0
ssl_certificates =
http_thread_count = 4
http_cache_enabled = 1
[library]
include_dirs = druid
[script]
shared_state = 1
[label]
max_count = 0
subpixels = 1
[profiler]
track_cpu = 0
sleep_between_server_updates = 0
[liveupdate]
settings = /liveupdate.settings
enabled = 1
mount_on_start = 1
[tilemap]
max_count = 0
max_tile_count = 0
[engine]
run_while_iconified = 0
fixed_update_frequency = 60
max_time_step = 0.5
[druid]
no_auto_input = 0
input_text = text
input_touch = touch
input_marked_text = marked_text
input_key_esc = key_esc
input_key_back = key_back
input_key_enter = key_enter
input_key_backspace = key_backspace
input_multitouch = touch_multi
input_scroll_up = mouse_wheel_up
input_scroll_down = mouse_wheel_down
[native_extension]
app_manifest =
[saver]
autosave_timer = 2
[lang]
path = /example/locales
langs = en,ru,es,de,fr,ja,pt,it,kr,zh
default = es
[event]
use_xpcall = 1

Binary file not shown.

BIN
docs/archive/game1.arcd Normal file

Binary file not shown.

1172
docs/dmloader.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
{"content":[{"name":"game.projectc","size":2838,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":5008,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":279217,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":10936,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,170 +0,0 @@
[project]
title = druid
version = 0.4.0
write_log = 0
compress_archive = 1
[display]
width = 600
height = 900
high_dpi = 0
samples = 0
fullscreen = 0
update_frequency = 0
vsync = 1
display_profiles = /builtins/render/default.display_profilesc
dynamic_orientation = 0
[render]
clear_color_red = 0
clear_color_green = 0
clear_color_blue = 0
clear_color_alpha = 0
[physics]
type = 2D
gravity_y = -10
debug = 0
debug_alpha = 0.9
world_count = 4
gravity_x = 0
gravity_z = 0
scale = 1
debug_scale = 30
max_collisions = 64
max_contacts = 128
contact_impulse_limit = 0
ray_cast_limit_2d = 64
ray_cast_limit_3d = 128
trigger_overlap_capacity = 16
[bootstrap]
main_collection = /example/kenney.collectionc
render = /builtins/render/default.renderc
[graphics]
default_texture_min_filter = linear
default_texture_mag_filter = linear
max_draw_calls = 1024
max_characters = 8192
max_debug_vertices = 10000
texture_profiles = /example/custom.texture_profiles
[sound]
gain = 1
max_sound_data = 128
max_sound_buffers = 32
max_sound_sources = 16
max_sound_instances = 256
[resource]
http_cache = 0
max_resources = 1024
[input]
repeat_delay = 0.5
repeat_interval = 0.2
gamepads = /builtins/input/default.gamepadsc
game_binding = /input/game.input_bindingc
use_accelerometer = 0
[sprite]
max_count = 128
subpixels = 1
[spine]
max_count = 128
[model]
max_count = 128
[gui]
max_count = 64
max_particlefx_count = 64
max_particle_count = 1024
[collection]
max_instances = 1024
[collection_proxy]
max_count = 8
[collectionfactory]
max_count = 128
[factory]
max_count = 128
[ios]
pre_renderered_icons = 0
bundle_identifier = example.unnamed
infoplist = /builtins/manifests/ios/Info.plist
[android]
version_code = 1
minimum_sdk_version = 16
target_sdk_version = 28
package = com.insality.druid
manifest = /builtins/manifests/android/AndroidManifest.xml
iap_provider = GooglePlay
input_method = HiddenInputField
immersive_mode = 0
debuggable = 0
[osx]
infoplist = /builtins/manifests/osx/Info.plist
bundle_identifier = example.unnamed
[windows]
[html5]
custom_heap_size = 0
heap_size = 64
htmlfile = /builtins/manifests/web/engine_template.html
cssfile = /builtins/manifests/web/light_theme.css
archive_location_prefix = archive
show_fullscreen_button = 0
show_made_with_defold = 0
scale_mode = fit
engine_arguments = --verify-graphics-calls=false
splash_image = /media/druid_logo.png
[particle_fx]
max_count = 64
max_particle_count = 1024
[iap]
auto_finish_transactions = 1
[network]
http_timeout = 0
[library]
include_dirs = druid
[script]
shared_state = 1
[label]
max_count = 64
subpixels = 1
[profiler]
track_cpu = 0
[liveupdate]
settings = /liveupdate.settings
[tilemap]
max_count = 16
max_tile_count = 2048
[engine]
run_while_iconified = 0
[druid]
no_auto_input = 0
[native_extension]
app_manifest = /example/game.appmanifest

Binary file not shown.

Binary file not shown.

View File

@ -1,702 +0,0 @@
/* ********************************************************************* */
/* Load and combine data that is split into archives */
/* ********************************************************************* */
var Combine = {
_targets: [],
_targetIndex: 0,
// target: build target
// name: intended filepath of built object
// size: expected size of built object.
// data: combined data
// downloaded: total amount of data downloaded
// pieces: array of name, offset and data objects
// numExpectedFiles: total number of files expected in description
// lastRequestedPiece: index of last data file requested (strictly ascending)
// totalLoadedPieces: counts the number of data files received
//MAX_CONCURRENT_XHR: 6, // remove comment if throttling of XHR is desired.
isCompleted: false, // status of process
_onCombineCompleted: [], // signature: name, data.
_onAllTargetsBuilt:[], // signature: void
_onDownloadProgress: [], // signature: downloaded, total
_currentDownloadBytes: 0,
_totalDownloadBytes: 0,
_retry_time: 0, // pause before retry file loading after error
_max_retry_count: 0, // how many attempts we do when trying to download a file.
_can_not_download_file_callback: undefined, //Function that is called if you can't download file after 'retry_count' attempts.
_archiveLocationFilter: function(path) { return "split" + path; },
can_not_download_file: function(file) {
if (typeof Combine._can_not_download_file_callback === 'function') {
Combine._can_not_download_file_callback(file);
}
},
addProgressListener: function(callback) {
if (typeof callback !== 'function') {
throw "Invalid callback registration";
}
this._onDownloadProgress.push(callback);
},
addCombineCompletedListener: function(callback) {
if (typeof callback !== 'function') {
throw "Invalid callback registration";
}
this._onCombineCompleted.push(callback);
},
addAllTargetsBuiltListener: function(callback) {
if (typeof callback !== 'function') {
throw "Invalid callback registration";
}
this._onAllTargetsBuilt.push(callback);
},
// descriptUrl: location of text file describing files to be preloaded
process: function(descriptUrl, attempt_count) {
if (!attempt_count) {
attempt_count = 0;
}
var xhr = new XMLHttpRequest();
xhr.open('GET', descriptUrl);
xhr.responseType = 'text';
xhr.onload = function(evt) {
Combine.onReceiveDescription(xhr);
};
xhr.onerror = function(evt) {
attempt_count += 1;
if (attempt_count < Combine._max_retry_count) {
console.warn("Can't download file '" + descriptUrl + "' . Next try in " + Combine._retry_time + " sec.");
setTimeout(function() {
Combine.process(descriptUrl, attempt_count);
}, Combine._retry_time * 1000);
} else {
Combine.can_not_download_file(descriptUrl);
}
};
xhr.send(null);
},
cleanUp: function() {
this._targets = [];
this._targetIndex = 0;
this.isCompleted = false;
this._onCombineCompleted = [];
this._onAllTargetsBuilt = [];
this._onDownloadProgress = [];
this._currentDownloadBytes = 0;
this._totalDownloadBytes = 0;
},
onReceiveDescription: function(xhr) {
var json = JSON.parse(xhr.responseText);
this._targets = json.content;
this._totalDownloadBytes = 0;
this._currentDownloadBytes = 0;
var targets = this._targets;
for(var i=0; i<targets.length; ++i) {
this._totalDownloadBytes += targets[i].size;
}
this.requestContent();
},
requestContent: function() {
var target = this._targets[this._targetIndex];
if (1 < target.pieces.length) {
target.data = new Uint8Array(target.size);
}
var limit = target.pieces.length;
if (typeof this.MAX_CONCURRENT_XHR !== 'undefined') {
limit = Math.min(limit, this.MAX_CONCURRENT_XHR);
}
for (var i=0; i<limit; ++i) {
this.requestPiece(target, i);
}
},
requestPiece: function(target, index, attempt_count) {
if (!attempt_count) {
attempt_count = 0;
}
if (index < target.lastRequestedPiece) {
throw "Request out of order";
}
var item = target.pieces[index];
target.lastRequestedPiece = index;
var total = 0;
var downloaded = 0;
var xhr = new XMLHttpRequest();
var url = this._archiveLocationFilter('/' + item.name);
xhr.open('GET', url, true);
xhr.responseType = 'arraybuffer';
// called periodically with information about the transaction
xhr.onprogress = function(evt) {
if (evt.total && evt.lengthComputable) {
total = evt.total;
}
if (evt.loaded && evt.lengthComputable) {
var delta = evt.loaded - downloaded;
downloaded = evt.loaded;
Combine._currentDownloadBytes += delta;
Combine.updateProgress(target);
}
};
// called when the transaction completes successfully
xhr.onload = function(evt) {
item.data = new Uint8Array(xhr.response);
item.dataLength = item.data.length;
total = item.dataLength;
downloaded = item.dataLength;
Combine.copyData(target, item);
Combine.onPieceLoaded(target, item);
Combine.updateProgress(target);
item.data = undefined;
};
// called when the transaction fails
xhr.onerror = function(evt) {
downloaded = 0;
Combine.updateProgress(target);
attempt_count += 1;
if (attempt_count < Combine._max_retry_count) {
console.warn("Can't download file '" + item.name + "' . Next try in " + Combine._retry_time + " sec.");
setTimeout(function() {
Combine.requestPiece(target, index, attempt_count);
}, Combine._retry_time * 1000);
} else {
Combine.can_not_download_file(item.name);
}
};
xhr.send(null);
},
updateProgress: function(target) {
for(i = 0; i<this._onDownloadProgress.length; ++i) {
this._onDownloadProgress[i](this._currentDownloadBytes, this._totalDownloadBytes);
}
},
copyData: function(target, item) {
if (1 == target.pieces.length) {
target.data = item.data;
} else {
var start = item.offset;
var end = start + item.data.length;
if (0 > start) {
throw "Buffer underflow";
}
if (end > target.data.length) {
throw "Buffer overflow";
}
target.data.set(item.data, item.offset);
}
},
onPieceLoaded: function(target, item) {
if (typeof target.totalLoadedPieces === 'undefined') {
target.totalLoadedPieces = 0;
}
++target.totalLoadedPieces;
if (target.totalLoadedPieces == target.pieces.length) {
this.finalizeTarget(target);
++this._targetIndex;
for (var i=0; i<this._onCombineCompleted.length; ++i) {
this._onCombineCompleted[i](target.name, target.data);
}
if (this._targetIndex < this._targets.length) {
this.requestContent();
} else {
this.isCompleted = true;
for (i=0; i<this._onAllTargetsBuilt.length; ++i) {
this._onAllTargetsBuilt[i]();
}
}
} else {
var next = target.lastRequestedPiece + 1;
if (next < target.pieces.length) {
this.requestPiece(target, next);
}
}
},
finalizeTarget: function(target) {
var actualSize = 0;
for (var i=0;i<target.pieces.length; ++i) {
actualSize += target.pieces[i].dataLength;
}
if (actualSize != target.size) {
throw "Unexpected data size";
}
if (1 < target.pieces.length) {
var output = target.data;
var pieces = target.pieces;
for (i=0; i<pieces.length; ++i) {
var item = pieces[i];
// Bounds check
var start = item.offset;
var end = start + item.dataLength;
if (0 < i) {
var previous = pieces[i - 1];
if (previous.offset + previous.dataLength > start) {
throw "Segment underflow";
}
}
if (pieces.length - 2 > i) {
var next = pieces[i + 1];
if (end > next.offset) {
throw "Segment overflow";
}
}
}
}
}
};
/* ********************************************************************* */
/* Default splash and progress visualisation */
/* ********************************************************************* */
var Progress = {
progress_id: "defold-progress",
bar_id: "defold-progress-bar",
addProgress : function (canvas) {
/* Insert default progress bar below canvas */
canvas.insertAdjacentHTML('afterend', '<div id="' + Progress.progress_id + '" class="canvas-app-progress"><div id="' + Progress.bar_id + '" class="canvas-app-progress-bar" style="width: 0%;"></div></div>');
Progress.bar = document.getElementById(Progress.bar_id);
Progress.progress = document.getElementById(Progress.progress_id);
},
updateProgress: function (percentage, text) {
Progress.bar.style.width = percentage + "%";
},
removeProgress: function () {
if (Progress.progress.parentElement !== null) {
Progress.progress.parentElement.removeChild(Progress.progress);
// Remove any background/splash image that was set in runApp().
// Workaround for Safari bug DEF-3061.
Module.canvas.style.background = "";
}
}
};
/* ********************************************************************* */
/* Default input override */
/* ********************************************************************* */
var CanvasInput = {
arrowKeysHandler : function(e) {
switch(e.keyCode) {
case 37: case 38: case 39: case 40: // Arrow keys
case 32: e.preventDefault(); e.stopPropagation(); // Space
default: break; // do not block other keys
}
},
onFocusIn : function(e) {
window.addEventListener("keydown", CanvasInput.arrowKeysHandler, false);
},
onFocusOut: function(e) {
window.removeEventListener("keydown", CanvasInput.arrowKeysHandler, false);
},
addToCanvas : function(canvas) {
canvas.addEventListener("focus", CanvasInput.onFocusIn, false);
canvas.addEventListener("blur", CanvasInput.onFocusOut, false);
canvas.focus();
CanvasInput.onFocusIn();
}
};
/* ********************************************************************* */
/* Module is Emscripten namespace */
/* ********************************************************************* */
var Module = {
noInitialRun: true,
_filesToPreload: [],
_archiveLoaded: false,
_preLoadDone: false,
_waitingForArchive: false,
// Persistent storage
persistentStorage: true,
_syncInProgress: false,
_syncNeeded: false,
_syncInitial: false,
_syncMaxTries: 3,
_syncTries: 0,
print: function(text) { console.log(text); },
printErr: function(text) { console.error(text); },
setStatus: function(text) { console.log(text); },
isWASMSupported: (function() {
try {
if (typeof WebAssembly === "object"
&& typeof WebAssembly.instantiate === "function") {
const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
if (module instanceof WebAssembly.Module)
return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;
}
} catch (e) {
}
return false;
})(),
prepareErrorObject: function (err, url, line, column, errObj) {
line = typeof line == "undefined" ? 0 : line;
column = typeof column == "undefined" ? 0 : column;
url = typeof url == "undefined" ? "" : url;
var errorLine = url + ":" + line + ":" + column;
var error = errObj || (typeof window.event != "undefined" ? window.event.error : "" ) || err || "Undefined Error";
var message = "";
var stack = "";
var backtrace = "";
if (typeof error == "object" && typeof error.stack != "undefined" && typeof error.message != "undefined") {
stack = String(error.stack);
message = String(error.message);
} else {
stack = String(error).split("\n");
message = stack.shift();
stack = stack.join("\n");
}
stack = stack || errorLine;
var callLine = /at (\S+:\d*$)/.exec(message);
if (callLine) {
message = message.replace(/(at \S+:\d*$)/, "");
stack = callLine[1] + "\n" + stack;
}
message = message.replace(/(abort\(.+\)) at .+/, "$1");
stack = stack.replace(/\?{1}\S+(:\d+:\d+)/g, "$1");
stack = stack.replace(/ *at (\S+)$/gm, "@$1");
stack = stack.replace(/ *at (\S+)(?: \[as \S+\])? +\((.+)\)/g, "$1@$2");
stack = stack.replace(/^((?:Object|Array)\.)/gm, "");
stack = stack.split("\n");
return { stack:stack, message:message };
},
hasWebGLSupport: function() {
var webgl_support = false;
try {
var canvas = document.createElement("canvas");
var gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
if (gl && gl instanceof WebGLRenderingContext) {
webgl_support = true;
}
} catch (error) {
console.log("An error occurred while detecting WebGL support: " + error);
webgl_support = false;
}
return webgl_support;
},
handleVisibilityChange: function () {
GLFW.onFocusChanged(document[Module.hiddenProperty] ? 0 : 1);
},
getHiddenProperty: function () {
if ('hidden' in document) return 'hidden';
var prefixes = ['webkit','moz','ms','o'];
for (var i = 0; i < prefixes.length; i++) {
if ((prefixes[i] + 'Hidden') in document)
return prefixes[i] + 'Hidden';
}
return null;
},
setupVisibilityChangeListener: function() {
Module.hiddenProperty = Module.getHiddenProperty();
if( Module.hiddenProperty ) {
var eventName = Module.hiddenProperty.replace(/[H|h]idden/,'') + 'visibilitychange';
document.addEventListener(eventName, Module.handleVisibilityChange, false);
} else {
console.log("No document.hidden property found. The focus events won't be enabled.")
}
},
/**
* Module.runApp - Starts the application given a canvas element id
*
* 'extra_params' is an optional object that can have the following fields:
*
* 'archive_location_filter':
* Filter function that will run for each archive path.
*
* 'unsupported_webgl_callback':
* Function that is called if WebGL is not supported.
*
* 'engine_arguments':
* List of arguments (strings) that will be passed to the engine.
*
* 'persistent_storage':
* Boolean toggling the usage of persistent storage.
*
* 'custom_heap_size':
* Number of bytes specifying the memory heap size.
*
* 'disable_context_menu':
* Disables the right-click context menu on the canvas element if true.
*
* 'retry_time':
* Pause before retry file loading after error.
*
* 'retry_count':
* How many attempts we do when trying to download a file.
*
* 'can_not_download_file_callback':
* Function that is called if you can't download file after 'retry_count' attempts.
**/
runApp: function(app_canvas_id, extra_params) {
app_canvas_id = (typeof app_canvas_id === 'undefined') ? 'canvas' : app_canvas_id;
var params = {
archive_location_filter: function(path) { return 'split' + path; },
unsupported_webgl_callback: undefined,
engine_arguments: [],
persistent_storage: true,
custom_heap_size: undefined,
disable_context_menu: true,
retry_time: 1,
retry_count: 10,
can_not_download_file_callback: undefined,
};
for (var k in extra_params) {
if (extra_params.hasOwnProperty(k)) {
params[k] = extra_params[k];
}
}
Module.canvas = document.getElementById(app_canvas_id);
Module.arguments = params["engine_arguments"];
Module.persistentStorage = params["persistent_storage"];
Module["TOTAL_MEMORY"] = params["custom_heap_size"];
if (Module.hasWebGLSupport()) {
// Override game keys
CanvasInput.addToCanvas(Module.canvas);
Module.setupVisibilityChangeListener();
// Add progress visuals
Progress.addProgress(Module.canvas);
// Add context menu hide-handler if requested
if (params["disable_context_menu"])
{
Module.canvas.oncontextmenu = function(e) {
e.preventDefault();
};
}
Combine._retry_time = params["retry_time"];
Combine._max_retry_count = params["retry_count"];
if (typeof params["can_not_download_file_callback"] === "function") {
Combine._can_not_download_file_callback = params["can_not_download_file_callback"];
}
// Load and assemble archive
Combine.addCombineCompletedListener(Module.onArchiveFileLoaded);
Combine.addAllTargetsBuiltListener(Module.onArchiveLoaded);
Combine.addProgressListener(Module.onArchiveLoadProgress);
Combine._archiveLocationFilter = params["archive_location_filter"];
Combine.process(Combine._archiveLocationFilter('/archive_files.json'));
} else {
Progress.addProgress(Module.canvas);
Progress.updateProgress(100, "Unable to start game, WebGL not supported");
Module.setStatus = function(text) {
if (text) Module.printErr('[missing WebGL] ' + text);
};
if (typeof params["unsupported_webgl_callback"] === "function") {
params["unsupported_webgl_callback"]();
}
}
},
onArchiveLoadProgress: function(downloaded, total) {
Progress.updateProgress(downloaded / total * 100);
},
onArchiveFileLoaded: function(name, data) {
Module._filesToPreload.push({path: name, data: data});
},
onArchiveLoaded: function() {
Combine.cleanUp();
Module._archiveLoaded = true;
Progress.updateProgress(100, "Starting...");
if (Module._waitingForArchive) {
Module._preloadAndCallMain();
}
},
toggleFullscreen: function() {
if (GLFW.isFullscreen) {
GLFW.cancelFullScreen();
} else {
GLFW.requestFullScreen();
}
},
preSync: function(done) {
// Initial persistent sync before main is called
FS.syncfs(true, function(err) {
if(err) {
Module._syncTries += 1;
console.error("FS syncfs error: " + err);
if (Module._syncMaxTries > Module._syncTries) {
Module.preSync(done);
} else {
Module._syncInitial = true;
done();
}
} else {
Module._syncInitial = true;
if (done !== undefined) {
done();
}
}
});
},
preloadAll: function() {
if (Module._preLoadDone) {
return;
}
Module._preLoadDone = true;
for (var i = 0; i < Module._filesToPreload.length; ++i) {
var item = Module._filesToPreload[i];
FS.createPreloadedFile("", item.path, item.data, true, true);
}
},
// Tries to do a MEM->IDB sync
// It will flag that another one is needed if there is already one sync running.
persistentSync: function() {
// Need to wait for the initial sync to finish since it
// will call close on all its file streams which will trigger
// new persistentSync for each.
if (Module._syncInitial) {
if (Module._syncInProgress) {
Module._syncNeeded = true;
} else {
Module._startSyncFS();
}
}
},
preInit: [function() {
/* Mount filesystem on preinit */
var dir = DMSYS.GetUserPersistentDataRoot();
FS.mkdir(dir);
// If IndexedDB is supported we mount the persistent data root as IDBFS,
// then try to do a IDB->MEM sync before we start the engine to get
// previously saved data before boot.
window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
if (Module.persistentStorage && window.indexedDB) {
FS.mount(IDBFS, {}, dir);
// Patch FS.close so it will try to sync MEM->IDB
var _close = FS.close; FS.close = function(stream) { var r = _close(stream); Module.persistentSync(); return r; }
// Sync IDB->MEM before calling main()
Module.preSync(function() {
Module._preloadAndCallMain();
});
} else {
Module._preloadAndCallMain();
}
}],
preRun: [function() {
/* If archive is loaded, preload all its files */
if(Module._archiveLoaded) {
Module.preloadAll();
}
}],
postRun: [function() {
if(Module._archiveLoaded) {
Progress.removeProgress();
}
}],
_preloadAndCallMain: function() {
// If the archive isn't loaded,
// we will have to wait with calling main.
if (!Module._archiveLoaded) {
Module._waitingForArchive = true;
} else {
// Need to set heap size before calling main
TOTAL_MEMORY = Module["TOTAL_MEMORY"] || TOTAL_MEMORY;
Module.preloadAll();
Progress.removeProgress();
if (Module.callMain === undefined) {
Module.noInitialRun = false;
} else {
Module.callMain(Module.arguments);
}
}
},
// Wrap IDBFS syncfs call with logic to avoid multiple syncs
// running at the same time.
_startSyncFS: function() {
Module._syncInProgress = true;
if (Module._syncMaxTries > Module._syncTries) {
FS.syncfs(false, function(err) {
Module._syncInProgress = false;
if (err) {
console.error("Module._startSyncFS error: " + err);
Module._syncTries += 1;
}
if (Module._syncNeeded) {
Module._syncNeeded = false;
Module._startSyncFS();
}
});
}
},
};
window.onerror = function(err, url, line, column, errObj) {
var errorObject = Module.prepareErrorObject(err, url, line, column, errObj);
Module.ccall('JSWriteDump', 'null', ['string'], [JSON.stringify(errorObject.stack)]);
Module.setStatus('Exception thrown, see JavaScript console');
Module.setStatus = function(text) {
if (text) Module.printErr('[post-exception status] ' + text);
};
};

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

File diff suppressed because one or more lines are too long

View File

@ -1,211 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, minimal-ui, shrink-to-fit=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>druid 0.4.0</title>
<style type='text/css'>
/* Disable user selection to avoid strange bug in Chrome on Windows:
* Selecting a text outside the canvas, then clicking+draging would
* drag the selected text but block mouse down/up events to the engine.
*/
body {
position: fixed; /* Prevent overscroll */
margin:0;
padding:0;
}
.canvas-app-container {
width: 100%;
height: 100%;
position: absolute;
align-items: center;
justify-content: center;
overflow: hidden;
}
.canvas-app-container:-webkit-full-screen {
/* Auto width and height in Safari/Chrome fullscreen. */
width: auto;
height: auto;
}
#canvas {
outline: none;
border: 0;
width: 100%;
vertical-align: bottom;
}
canvas:focus, canvas:active {
outline: none;
border: 0;
ie-dummy: expression(this.hideFocus=true);
-moz-outline-style: none;
}
div {
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.canvas-app-progress {
position: absolute;
background-color: #d1dbeb;
height: 6px;
margin-top: -6px;
width: 100%;
}
.canvas-app-progress-bar {
font-size: 12px;
height: 6px;
color: rgb(255, 255, 255);
background-color: #1a72eb;
text-align: center;
line-height: 20px;
}
.link, .button {
font-family: sans-serif;
font-size: 14px;
font-weight: normal;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: 0px;
padding-top: 12px;
}
.buttons-background {
background-color: #ffffff;
width: 100%;
height: 42px;
}
body {
background-color: #ffffff;
}
.canvas-app-container {
background: rgba(250,252,255,1);
background: -moz-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(250,252,255,1)), color-stop(50%, rgba(250,252,255,1)), color-stop(50%, rgba(245,249,255,1)), color-stop(100%, rgba(245,249,255,1)));
background: -webkit-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
background: -o-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
background: -ms-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
background: linear-gradient(135deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fafcff', endColorstr='#f5f9ff', GradientType=1 );
}
.canvas-app-canvas {
background-repeat:no-repeat;
background-position: center center;
background-image: url("druid_logo.png");
}
</style>
</head>
<body>
<div id="app-container" class="canvas-app-container">
<canvas id="canvas" class="canvas-app-canvas" tabindex="1" width="600" height="900"></canvas>
<div class="buttons-background">
</div>
</div>
<!-- -->
<script id='engine-loader' type='text/javascript' src="dmloader.js"></script>
<!-- -->
<script id='engine-setup' type='text/javascript'>
var extra_params = {
archive_location_filter: function( path ) {
return ("archive" + path + "");
},
engine_arguments: ["--verify-graphics-calls=false",],
custom_heap_size: 67108864,
disable_context_menu: true
}
Module['onRuntimeInitialized'] = function() {
Module.runApp("canvas", extra_params);
};
Module["locateFile"] = function(path, scriptDirectory)
{
// dmengine*.wasm is hardcoded in the built JS loader for WASM,
// we need to replace it here with the correct project name.
if (path == "dmengine.wasm" || path == "dmengine_release.wasm" || path == "dmengine_headless.wasm") {
path = "druid.wasm";
}
return scriptDirectory + path;
};
var is_iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
var buttonHeight = 0;
// Resize on init, screen resize and orientation change
function resize_game_canvas() {
// Hack for iOS when exit from Fullscreen mode
if (is_iOS) {
window.scrollTo(0, 0);
}
var app_container = document.getElementById('app-container');
var game_canvas = document.getElementById('canvas');
var innerWidth = window.innerWidth;
var innerHeight = window.innerHeight - buttonHeight;
var width = 600;
var height = 900;
var targetRatio = width / height;
var actualRatio = innerWidth / innerHeight;
//Fit
if (actualRatio > targetRatio) {
width = innerHeight * targetRatio;
height = innerHeight;
app_container.style.marginLeft = ((innerWidth - width) / 2) + "px";
app_container.style.marginTop = "0px";
}
else {
width = innerWidth;
height = innerWidth / targetRatio;
app_container.style.marginLeft = "0px";
app_container.style.marginTop = ((innerHeight - height) / 2) + "px";
}
app_container.style.width = width + "px";
app_container.style.height = height + buttonHeight + "px";
game_canvas.width = width;
game_canvas.height = height;
}
resize_game_canvas();
window.addEventListener('resize', resize_game_canvas, false);
window.addEventListener('orientationchange', resize_game_canvas, false);
function load_engine() {
var engineJS = document.createElement('script');
engineJS.type = 'text/javascript';
if (Module['isWASMSupported']) {
engineJS.src = 'druid_wasm.js';
} else {
engineJS.src = 'druid_asmjs.js';
}
document.head.appendChild(engineJS);
}
</script>
<script id='engine-start' type='text/javascript'>
load_engine();
</script>
</body>
</html>

BIN
docs/druid_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 KiB

View File

@ -1,207 +1,161 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="ldoc_fixed.css" type="text/css" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, minimal-ui, shrink-to-fit=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Druid 1.1.0</title>
<style type='text/css'>
/* Disable user selection to avoid strange bug in Chrome on Windows:
* Selecting a text outside the canvas, then clicking+draging would
* drag the selected text but block mouse down/up events to the engine.
*/
body {
position: fixed; /* Prevent overscroll */
margin:0;
padding:0;
}
.canvas-app-container {
width: 100%;
height: 100%;
position: absolute;
align-items: center;
justify-content: center;
overflow: hidden;
}
.canvas-app-container:-webkit-full-screen {
/* Auto width and height in Safari/Chrome fullscreen. */
width: auto;
height: auto;
}
#canvas {
outline: none;
border: 0;
width: 100%;
vertical-align: bottom;
}
#canvas-container {
position: relative;
}
canvas:focus, canvas:active {
outline: none;
border: 0;
ie-dummy: expression(this.hideFocus=true);
-moz-outline-style: none;
}
body, div {
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.canvas-app-progress {
position: absolute;
background-color: #394046;
height: 6px;
margin-top: -6px;
width: 100%;
}
.canvas-app-progress-bar {
font-size: 12px;
height: 6px;
color: rgb(255, 255, 255);
background-color: #1a72eb;
text-align: center;
line-height: 20px;
transition: transform 1s ease;
transform-origin: left;
transform: scaleX(1.0);
}
.link, .button {
font-family: sans-serif;
font-size: 14px;
font-weight: normal;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: 0px;
padding-top: 12px;
}
.buttons-background {
background-color: #1e2226;
width: 100%;
height: 42px;
}
body {
background-color: #1e2226;
}
.canvas-app-container {
background: rgba(36,41,46,1);
background: -moz-linear-gradient(-45deg, rgba(36,41,46,1) 0%, rgba(36,41,46,1) 49%, rgba(38,43,49,1) 50%, rgba(38,43,49,1) 100%);
background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(36,41,46,1)), color-stop(49%, rgba(36,41,46,1)), color-stop(50%, rgba(38,43,49,1)), color-stop(100%, rgba(38,43,49,1)));
background: -webkit-linear-gradient(-45deg, rgba(36,41,46,1) 0%, rgba(36,41,46,1) 49%, rgba(38,43,49,1) 50%, rgba(38,43,49,1) 100%);
background: -o-linear-gradient(-45deg, rgba(36,41,46,1) 0%, rgba(36,41,46,1) 49%, rgba(38,43,49,1) 50%, rgba(38,43,49,1) 100%);
background: -ms-linear-gradient(-45deg, rgba(36,41,46,1) 0%, rgba(36,41,46,1) 49%, rgba(38,43,49,1) 50%, rgba(38,43,49,1) 100%);
background: linear-gradient(135deg, rgba(36,41,46,1) 0%, rgba(36,41,46,1) 49%, rgba(38,43,49,1) 50%, rgba(38,43,49,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#24292e', endColorstr='#262b31', GradientType=1 );
}
.canvas-app-canvas {
background-repeat:no-repeat;
background-position: center center;
background-image: url("druid_logo.png");
}
</style>
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="modules/druid.button.html">druid.button</a></li>
<li><a href="modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="modules/druid.drag.html">druid.drag</a></li>
<li><a href="modules/druid.grid.html">druid.grid</a></li>
<li><a href="modules/druid.hover.html">druid.hover</a></li>
<li><a href="modules/druid.input.html">druid.input</a></li>
<li><a href="modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="modules/druid.progress.html">druid.progress</a></li>
<li><a href="modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="modules/druid.slider.html">druid.slider</a></li>
<li><a href="modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="modules/druid.text.html">druid.text</a></li>
<li><a href="modules/druid.timer.html">druid.timer</a></li>
<li><a href="modules/component.html">component</a></li>
<li><a href="modules/druid.html">druid</a></li>
<li><a href="modules/druid_event.html">druid_event</a></li>
<li><a href="modules/druid.helper.html">druid.helper</a></li>
<li><a href="modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="topics/01-components.md.html">01-components</a></li>
<li><a href="topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="topics/03-styles.md.html">Styles</a></li>
<li><a href="topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="topics/05-examples.md.html">Examples</a></li>
<li><a href="topics/changelog.md.html">changelog</a></li>
<li><a href="topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h2>Documentation for Druid Library</h2>
<h2>Modules</h2>
<table class="module_list">
<tr>
<td class="name" nowrap><a href="modules/druid.back_handler.html">druid.back_handler</a></td>
<td class="summary">Component to handle back key (android, backspace)</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.blocker.html">druid.blocker</a></td>
<td class="summary">Component to block input on specify zone by node</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.button.html">druid.button</a></td>
<td class="summary">Component to handle basic GUI button</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.checkbox.html">druid.checkbox</a></td>
<td class="summary">Druid checkbox component</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.checkbox_group.html">druid.checkbox_group</a></td>
<td class="summary">Checkbox group module</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.drag.html">druid.drag</a></td>
<td class="summary">Component to handle drag action on node.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.grid.html">druid.grid</a></td>
<td class="summary">Component to handle placing components by row and columns.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.hover.html">druid.hover</a></td>
<td class="summary">Component to handle hover node interaction</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.input.html">druid.input</a></td>
<td class="summary">Druid input text component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.lang_text.html">druid.lang_text</a></td>
<td class="summary">Component to handle all GUI texts
Good working with localization system</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.progress.html">druid.progress</a></td>
<td class="summary">Basic progress bar component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.radio_group.html">druid.radio_group</a></td>
<td class="summary">Radio group module</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.scroll.html">druid.scroll</a></td>
<td class="summary">Component to handle scroll content.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.slider.html">druid.slider</a></td>
<td class="summary">Druid slider component</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.swipe.html">druid.swipe</a></td>
<td class="summary">Component to handle swipe gestures on node.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.text.html">druid.text</a></td>
<td class="summary">Component to handle all GUI texts.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.timer.html">druid.timer</a></td>
<td class="summary">Component to handle GUI timers.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/component.html">component</a></td>
<td class="summary">Basic class for all Druid components.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.html">druid</a></td>
<td class="summary">Druid UI Library.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid_event.html">druid_event</a></td>
<td class="summary">Lua event small library</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.helper.html">druid.helper</a></td>
<td class="summary">Text node or icon node can be nil</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid_instance.html">druid_instance</a></td>
<td class="summary">Druid main class.</td>
</tr>
</table>
<h2>Topics</h2>
<table class="module_list">
<tr>
<td class="name" nowrap><a href="topics/01-components.md.html">01-components.md</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="topics/02-creating_custom_components.md.html">02-creating_custom_components.md</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="topics/03-styles.md.html">03-styles.md</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="topics/04-druid_assets.md.html">04-druid_assets.md</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="topics/05-examples.md.html">05-examples.md</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="topics/changelog.md.html">changelog.md</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="topics/README.md.html">README.md</a></td>
<td class="summary"></td>
</tr>
</table>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
<div id="app-container" class="canvas-app-container">
<div id="running-from-file-warning" style="display: none; margin: 3em;">
<h1>Running from local file ⚠️</h1>
<p>It seems like you have opened this file by double-clicking on it. In order to test your build in a browser <b>you need to load this file from a web server</b>. You can either upload this file and the rest of the files from a Defold HTML5 bundle to a web hosting service OR host them using a local web server on your home network.</p>
<p><a href="https://defold.com/manuals/html5/#testing-html5-build" target="_blank">Learn more about running a local web server in the Defold HTML5 manual</a>.</p>
</div>
<div id="webgl-not-supported" style="display: none; margin: 3em;">
<h1>WebGL not supported ⚠️</h1>
<p>WebGL is not supported by your browser - visit <a href="https://get.webgl.org/">https://get.webgl.org/</a> to learn more.</p>
</div>
<div id="canvas-container" class="canvas-app-canvas-container">
<canvas id="canvas" class="canvas-app-canvas" tabindex="1" width="1920" height="1080"></canvas>
</div>
<div class="buttons-background">
</div>
</div>
<!-- -->
<script id='engine-loader' type='text/javascript' src="dmloader.js"></script>
<script id='engine-setup' type='text/javascript'>
// From here you can configure game startup parameters via the CUSTOM_PARAMETERS object,
// override ProgressView to create your own loader. See dmloader.js for more details.
</script>
<script id='engine-start' type='text/javascript'>
var runningFromFileWarning = document.getElementById("running-from-file-warning");
if (window.location.href.startsWith("file://")) {
runningFromFileWarning.style.display = "block";
}
else {
EngineLoader.load("canvas", "Druid");
runningFromFileWarning.parentNode.removeChild(runningFromFileWarning);
}
</script>
</body>
</html>

View File

@ -1,311 +0,0 @@
/* BEGIN RESET
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.8.2r1
*/
html {
color: #000;
background: #FFF;
}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td {
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset,img {
border: 0;
}
address,caption,cite,code,dfn,em,strong,th,var,optgroup {
font-style: inherit;
font-weight: inherit;
}
del,ins {
text-decoration: none;
}
li {
margin-left: 20px;
}
caption,th {
text-align: left;
}
h1,h2,h3,h4,h5,h6 {
font-size: 100%;
font-weight: bold;
}
q:before,q:after {
content: '';
}
abbr,acronym {
border: 0;
font-variant: normal;
}
sup {
vertical-align: baseline;
}
sub {
vertical-align: baseline;
}
legend {
color: #000;
}
input,button,textarea,select,optgroup,option {
font-family: inherit;
font-size: inherit;
font-style: inherit;
font-weight: inherit;
}
input,button,textarea,select {*font-size:100%;
}
/* END RESET */
body {
margin-left: 1em;
margin-right: 1em;
font-family: arial, helvetica, geneva, sans-serif;
background-color: #ffffff; margin: 0px;
}
code, tt { font-family: monospace; font-size: 1.1em; }
span.parameter { font-family:monospace; }
span.parameter:after { content:":"; }
span.types:before { content:"("; }
span.types:after { content:")"; }
.type { font-weight: bold; font-style:italic }
body, p, td, th { font-size: .95em; line-height: 1.2em;}
p, ul { margin: 10px 0 0 0px;}
strong { font-weight: bold;}
em { font-style: italic;}
h1 {
font-size: 1.5em;
margin: 0 0 20px 0;
}
h2, h3, h4 { margin: 15px 0 10px 0; }
h2 { font-size: 1.25em; }
h3 { font-size: 1.15em; }
h4 { font-size: 1.06em; }
a:link { font-weight: bold; color: #004080; text-decoration: none; }
a:visited { font-weight: bold; color: #006699; text-decoration: none; }
a:link:hover { text-decoration: underline; }
hr {
color:#cccccc;
background: #00007f;
height: 1px;
}
blockquote { margin-left: 3em; }
ul { list-style-type: disc; }
p.name {
font-family: "Andale Mono", monospace;
padding-top: 1em;
}
pre {
background-color: rgb(245, 245, 245);
border: 1px solid #C0C0C0; /* silver */
padding: 10px;
margin: 10px 0 10px 0;
overflow: auto;
font-family: "Andale Mono", monospace;
}
pre.example {
font-size: .85em;
}
table.index { border: 1px #00007f; }
table.index td { text-align: left; vertical-align: top; }
#container {
margin-left: 1em;
margin-right: 1em;
background-color: #ffffff;
}
#product {
text-align: center;
border-bottom: 1px solid #cccccc;
background-color: #ffffff;
}
#product big {
font-size: 2em;
}
#main {
background-color:#FFFFFF; // #f0f0f0;
border-left: 1px solid #cccccc;
}
#navigation {
position: fixed;
top: 0;
left: 0;
float: left;
width: 14em;
vertical-align: top;
background-color:#FFFFFF; // #f0f0f0;
border-right: 2px solid #cccccc;
overflow: visible;
overflow-y: scroll;
height: 100%;
padding-left: 1em;
}
#navigation h2 {
background-color:#FFFFFF;//:#e7e7e7;
font-size:1.1em;
color:#000000;
text-align: left;
padding:0.2em;
border-bottom:1px solid #dddddd;
}
#navigation ul
{
font-size:1em;
list-style-type: none;
margin: 1px 1px 10px 1px;
}
#navigation li {
text-indent: -1em;
display: block;
margin: 3px 0px 0px 22px;
}
#navigation li li a {
margin: 0px 3px 0px -1em;
}
#content {
margin-left: 14em;
padding: 1em;
padding-left: 2em;
width: 700px;
border-left: 2px solid #cccccc;
// border-right: 2px solid #cccccc;
background-color: #ffffff;
}
#about {
clear: both;
padding-left: 1em;
margin-left: 14em; // avoid the damn sidebar!
border-top: 2px solid #cccccc;
border-left: 2px solid #cccccc;
background-color: #ffffff;
}
@media print {
body {
font: 12pt "Times New Roman", "TimeNR", Times, serif;
}
a { font-weight: bold; color: #004080; text-decoration: underline; }
#main {
background-color: #ffffff;
border-left: 0px;
}
#container {
margin-left: 2%;
margin-right: 2%;
background-color: #ffffff;
}
#content {
padding: 1em;
background-color: #ffffff;
}
#navigation {
display: none;
}
pre.example {
font-family: "Andale Mono", monospace;
font-size: 10pt;
page-break-inside: avoid;
}
}
table.module_list {
border-width: 1px;
border-style: solid;
border-color: #cccccc;
border-collapse: collapse;
}
table.module_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #cccccc;
}
table.module_list td.name { background-color: #f0f0f0; ; min-width: 200px; }
table.module_list td.summary { width: 100%; }
table.function_list {
border-width: 1px;
border-style: solid;
border-color: #cccccc;
border-collapse: collapse;
}
table.function_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #cccccc;
}
table.function_list td.name { background-color: #f6f6ff; ; min-width: 200px; }
table.function_list td.summary { width: 100%; }
dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;}
dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;}
dl.table h3, dl.function h3 {font-size: .95em;}
ul.nowrap {
overflow:auto;
whitespace:nowrap;
}
/* stop sublists from having initial vertical space */
ul ul { margin-top: 0px; }
ol ul { margin-top: 0px; }
ol ol { margin-top: 0px; }
ul ol { margin-top: 0px; }
/* make the target distinct; helps when we're navigating to a function */
a:target + * {
background-color: #FF9;
}
/* styles for prettification of source */
pre .comment { color: #558817; }
pre .constant { color: #a8660d; }
pre .escape { color: #844631; }
pre .keyword { color: #aa5050; font-weight: bold; }
pre .library { color: #0e7c6b; }
pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
pre .string { color: #8080ff; }
pre .number { color: #f8660d; }
pre .operator { color: #2239a8; font-weight: bold; }
pre .preprocessor, pre .prepro { color: #a33243; }
pre .global { color: #800080; }
pre .user-keyword { color: #800080; }
pre .prompt { color: #558817; }
pre .url { color: #272fc2; text-decoration: underline; }

View File

@ -1,517 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><strong>component</strong></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>component</code></h1>
<p>Basic class for all Druid components.</p>
<p> To create you component, use <a href="../modules/component.html#Component.create">component.create</a></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#set_style">set_style(style)</a></td>
<td class="summary">Set current component style table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_template">get_template()</a></td>
<td class="summary">Get current component template name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_template">set_template(template)</a></td>
<td class="summary">Set current component template name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_nodes">get_nodes()</a></td>
<td class="summary">Get current component nodes</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_nodes">set_nodes(nodes)</a></td>
<td class="summary">Set current component nodes</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_context">get_context()</a></td>
<td class="summary">Get current component context</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_context">set_context(context)</a></td>
<td class="summary">Set current component context</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_interests">get_interests()</a></td>
<td class="summary">Get current component interests</td>
</tr>
<tr>
<td class="name" nowrap><a href="#increase_input_priority">increase_input_priority()</a></td>
<td class="summary">Increase input priority in current input stack</td>
</tr>
<tr>
<td class="name" nowrap><a href="#reset_input_priority">reset_input_priority()</a></td>
<td class="summary">Reset input priority in current input stack</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_node">get_node(node_or_name)</a></td>
<td class="summary">Get node for component by name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_druid">get_druid()</a></td>
<td class="summary">Return druid with context of calling component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_child_of">is_child_of()</a></td>
<td class="summary">Return true, if current component is child of another component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_name">get_name()</a></td>
<td class="summary">Return component name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#setup_component">setup_component(table, table, table)</a></td>
<td class="summary">Setup component context and his style table</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Component.create">Component.create(name[, interest={}])</a></td>
<td class="summary">Create new component.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "set_style"></a>
<strong>set_style(style)</strong>
</dt>
<dd>
Set current component style table.
Invoke <code>on_style_change</code> on component, if exist. Component should handle
their style changing and store all style params
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">style</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Druid style module
</li>
</ul>
</dd>
<dt>
<a name = "get_template"></a>
<strong>get_template()</strong>
</dt>
<dd>
Get current component template name
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Component template name
</ol>
</dd>
<dt>
<a name = "set_template"></a>
<strong>set_template(template)</strong>
</dt>
<dd>
Set current component template name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">template</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Component template name
</li>
</ul>
</dd>
<dt>
<a name = "get_nodes"></a>
<strong>get_nodes()</strong>
</dt>
<dd>
Get current component nodes
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component nodes table
</ol>
</dd>
<dt>
<a name = "set_nodes"></a>
<strong>set_nodes(nodes)</strong>
</dt>
<dd>
Set current component nodes
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">nodes</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component nodes table
</li>
</ul>
</dd>
<dt>
<a name = "get_context"></a>
<strong>get_context()</strong>
</dt>
<dd>
Get current component context
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component context
</ol>
</dd>
<dt>
<a name = "set_context"></a>
<strong>set_context(context)</strong>
</dt>
<dd>
Set current component context
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">context</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Druid context. Usually it is self of script
</li>
</ul>
</dd>
<dt>
<a name = "get_interests"></a>
<strong>get_interests()</strong>
</dt>
<dd>
Get current component interests
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
List of component interests
</ol>
</dd>
<dt>
<a name = "increase_input_priority"></a>
<strong>increase_input_priority()</strong>
</dt>
<dd>
Increase input priority in current input stack
</dd>
<dt>
<a name = "reset_input_priority"></a>
<strong>reset_input_priority()</strong>
</dt>
<dd>
Reset input priority in current input stack
</dd>
<dt>
<a name = "get_node"></a>
<strong>get_node(node_or_name)</strong>
</dt>
<dd>
Get node for component by name.
If component has nodes, node<em>or</em>name should be string
It auto pick node by template name or from nodes by clone<em>tree
if they was setup via component:set</em>nodes, component:set_template
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node_or_name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a> or <span class="type">node</span></span>
Node name or node itself
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">node</span></span>
Gui node
</ol>
</dd>
<dt>
<a name = "get_druid"></a>
<strong>get_druid()</strong>
</dt>
<dd>
Return druid with context of calling component.
Use it to create component inside of other components.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Druid</span></span>
Druid instance with component context
</ol>
</dd>
<dt>
<a name = "is_child_of"></a>
<strong>is_child_of()</strong>
</dt>
<dd>
Return true, if current component is child of another component
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
True, if current component is child of another
</ol>
</dd>
<dt>
<a name = "get_name"></a>
<strong>get_name()</strong>
</dt>
<dd>
Return component name
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
The component name
</ol>
</dd>
<dt>
<a name = "setup_component"></a>
<strong>setup_component(table, table, table)</strong>
</dt>
<dd>
Setup component context and his style table
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">table</span>
<span class="types"><span class="type">style</span></span>
Druid style module
</li>
<li><span class="parameter">table</span>
<span class="types"><span class="type">style</span></span>
Druid style module
</li>
<li><span class="parameter">table</span>
<span class="types"><span class="type">style</span></span>
Druid style module
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
Component itself
</ol>
</dd>
<dt>
<a name = "Component.create"></a>
<strong>Component.create(name[, interest={}])</strong>
</dt>
<dd>
Create new component. It will inheritance from basic
druid component.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Component name
</li>
<li><span class="parameter">interest</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
List of component's interest
(<em>default</em> {})
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,225 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><strong>druid.back_handler</strong></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.back_handler</code></h1>
<p>Component to handle back key (android, backspace)</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(callback[, Callback])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_input">on_input(action_id, action)</a></td>
<td class="summary">Input handler for component</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(callback[, Callback])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">callback</span></span>
On back button
</li>
<li><span class="parameter">Callback</span>
<span class="types"><span class="type">params</span></span>
argument
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "on_input"></a>
<strong>on_input(action_id, action)</strong>
</dt>
<dd>
Input handler for component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">action_id</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
on_input action id
</li>
<li><span class="parameter">action</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
on_input action
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_back</span>
<span class="types"><span class="type">druid_event</span></span>
On back handler callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">params</span>
<span class="types"><span class="type">any</span></span>
Params to click callbacks
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,244 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><strong>druid.blocker</strong></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.blocker</code></h1>
<p>Component to block input on specify zone by node</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node)</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_enabled">set_enabled(state)</a></td>
<td class="summary">Set enabled blocker component state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_enabled">is_enabled()</a></td>
<td class="summary">Return blocked enabled state</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node)</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
</dd>
<dt>
<a name = "set_enabled"></a>
<strong>set_enabled(state)</strong>
</dt>
<dd>
Set enabled blocker component state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
Enabled state
</li>
</ul>
</dd>
<dt>
<a name = "is_enabled"></a>
<strong>is_enabled()</strong>
</dt>
<dd>
Return blocked enabled state
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
True, if blocker is enabled
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_click</span>
<span class="types"><span class="type">druid_event</span></span>
On release button callback
</li>
<li><span class="parameter">on_enable_change</span>
<span class="types"><span class="type">druid_event</span></span>
On enable/disable callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Trigger node
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,455 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><strong>druid.button</strong></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.button</code></h1>
<p>Component to handle basic GUI button</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, callback[, params[, anim_node]])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_enabled">set_enabled(state)</a></td>
<td class="summary">Set enabled button component state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_enabled">is_enabled()</a></td>
<td class="summary">Return button enabled state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(zone)</a></td>
<td class="summary">Strict button click area.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_key_trigger">set_key_trigger(key)</a></td>
<td class="summary">Set key-code to trigger this button</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_key_trigger">get_key_trigger()</a></td>
<td class="summary">Get key-code to trigger this button</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="summary">Component style params.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, callback[, params[, anim_node]])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Button callback
</li>
<li><span class="parameter">params</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Button callback params
(<em>optional</em>)
</li>
<li><span class="parameter">anim_node</span>
<span class="types"><span class="type">node</span></span>
Button anim node (node, if not provided)
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "set_enabled"></a>
<strong>set_enabled(state)</strong>
</dt>
<dd>
Set enabled button component state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
Enabled state
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.button</span></span>
Current button instance
</ol>
</dd>
<dt>
<a name = "is_enabled"></a>
<strong>is_enabled()</strong>
</dt>
<dd>
Return button enabled state
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
True, if button is enabled
</ol>
</dd>
<dt>
<a name = "set_click_zone"></a>
<strong>set_click_zone(zone)</strong>
</dt>
<dd>
Strict button click area. Useful for
no click events outside stencil node
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">zone</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.button</span></span>
Current button instance
</ol>
</dd>
<dt>
<a name = "set_key_trigger"></a>
<strong>set_key_trigger(key)</strong>
</dt>
<dd>
Set key-code to trigger this button
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">key</span>
<span class="types"><span class="type">hash</span></span>
The action_id of the key
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.button</span></span>
Current button instance
</ol>
</dd>
<dt>
<a name = "get_key_trigger"></a>
<strong>get_key_trigger()</strong>
</dt>
<dd>
Get key-code to trigger this button
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">hash</span></span>
The action_id of the key
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_click</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button_instance) On release button callback
</li>
<li><span class="parameter">on_repeated_click</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button<em>instance, click</em>amount) On repeated action button callback
</li>
<li><span class="parameter">on_long_click</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button_instance, time) On long tap button callback
</li>
<li><span class="parameter">on_double_click</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button<em>instance, click</em>amount) On double tap button callback
</li>
<li><span class="parameter">on_hold_callback</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button<em>instance, time) On button hold before long</em>click callback
</li>
<li><span class="parameter">on_click_outside</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button_instance) On click outside of button
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Trigger node
</li>
<li><span class="parameter">anim_node</span>
<span class="types"><span class="type">node</span></span>
Animation node
(<em>default</em> node)
</li>
<li><span class="parameter">start_scale</span>
<span class="types"><span class="type">vector3</span></span>
Initial scale of anim_node
</li>
<li><span class="parameter">start_pos</span>
<span class="types"><span class="type">vector3</span></span>
Initial pos of anim_node
</li>
<li><span class="parameter">pos</span>
<span class="types"><span class="type">vector3</span></span>
Initial pos of anim_node
</li>
<li><span class="parameter">params</span>
<span class="types"><span class="type">any</span></span>
Params to click callbacks
</li>
<li><span class="parameter">hover</span>
<span class="types"><span class="type">druid.hover</span></span>
Druid hover logic component
</li>
<li><span class="parameter">click_zone</span>
<span class="types"><span class="type">node</span></span>
Restriction zone
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
</dt>
<dd>
Component style params.
You can override this component styles params in druid styles table
or create your own style
<h3>Fields:</h3>
<ul>
<li><span class="parameter">LONGTAP_TIME</span>
<span class="types"><span class="type">number</span></span>
Minimum time to trigger on<em>hold</em>callback
(<em>default</em> 0.4)
</li>
<li><span class="parameter">AUTOHOLD_TRIGGER</span>
<span class="types"><span class="type">number</span></span>
Maximum hold time to trigger button release while holding
(<em>default</em> 0.8)
</li>
<li><span class="parameter">DOUBLETAP_TIME</span>
<span class="types"><span class="type">number</span></span>
Time between double taps
(<em>default</em> 0.4)
</li>
<li><span class="parameter">on_click</span>
<span class="types"><span class="type">function</span></span>
(self, node)
</li>
<li><span class="parameter">on_click_disabled</span>
<span class="types"><span class="type">function</span></span>
(self, node)
</li>
<li><span class="parameter">on_hover</span>
<span class="types"><span class="type">function</span></span>
(self, node, hover_state)
</li>
<li><span class="parameter">on_mouse_hover</span>
<span class="types"><span class="type">function</span></span>
(self, node, hover_state)
</li>
<li><span class="parameter">on_set_enabled</span>
<span class="types"><span class="type">function</span></span>
(self, node, enabled_state)
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,289 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><strong>druid.checkbox</strong></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.checkbox</code></h1>
<p>Druid checkbox component</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, callback[, click=node])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_state">set_state(state, is_silent)</a></td>
<td class="summary">Set checkbox state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_state">get_state()</a></td>
<td class="summary">Return checkbox state</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="summary">Component style params.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, callback[, click=node])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Checkbox callback
</li>
<li><span class="parameter">click</span>
<span class="types"><span class="type">node</span></span>
node Trigger node, by default equals to node
(<em>default</em> node)
</li>
</ul>
</dd>
<dt>
<a name = "set_state"></a>
<strong>set_state(state, is_silent)</strong>
</dt>
<dd>
Set checkbox state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
Checkbox state
</li>
<li><span class="parameter">is_silent</span>
<span class="types"><span class="type">bool</span></span>
Don't trigger on<em>change</em>state if true
</li>
</ul>
</dd>
<dt>
<a name = "get_state"></a>
<strong>get_state()</strong>
</dt>
<dd>
Return checkbox state
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
Checkbox state
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_change_state</span>
<span class="types"><span class="type">druid_event</span></span>
On change state callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Visual node
</li>
<li><span class="parameter">click_node</span>
<span class="types"><span class="type">node</span></span>
Button trigger node
(<em>default</em> node)
</li>
<li><span class="parameter">button</span>
<span class="types"><span class="type">druid.button</span></span>
Button component from click_node
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
</dt>
<dd>
Component style params.
You can override this component styles params in druid styles table
or create your own style
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_change_state</span>
<span class="types"><span class="type">function</span></span>
(self, node, state)
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,249 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><strong>druid.checkbox_group</strong></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.checkbox_group</code></h1>
<p>Checkbox group module</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, callback[, click=node])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_state">set_state(indexes)</a></td>
<td class="summary">Set checkbox group state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_state">get_state()</a></td>
<td class="summary">Return checkbox group state</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, callback[, click=node])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node[]</span></span>
Array of gui node
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Checkbox callback
</li>
<li><span class="parameter">click</span>
<span class="types"><span class="type">node[]</span></span>
node Array of trigger nodes, by default equals to nodes
(<em>default</em> node)
</li>
</ul>
</dd>
<dt>
<a name = "set_state"></a>
<strong>set_state(indexes)</strong>
</dt>
<dd>
Set checkbox group state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">indexes</span>
<span class="types"><span class="type">bool[]</span></span>
Array of checkbox state
</li>
</ul>
</dd>
<dt>
<a name = "get_state"></a>
<strong>get_state()</strong>
</dt>
<dd>
Return checkbox group state
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool[]</span></span>
Array if checkboxes state
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_checkbox_click</span>
<span class="types"><span class="type">druid_event</span></span>
On any checkbox click
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">checkboxes</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Array of checkbox components
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,289 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><strong>druid.drag</strong></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.drag</code></h1>
<p>Component to handle drag action on node.</p>
<p> Drag have correct handling for multitouch and swap
touched while dragging. Drag will be processed even
the cursor is outside of node, if drag is already started</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, on_drag_callback)</a></td>
<td class="summary">Drag component constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(zone)</a></td>
<td class="summary">Strict drag click area.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Components fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="summary">Component style params.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, on_drag_callback)</strong>
</dt>
<dd>
Drag component constructor
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
GUI node to detect dragging
</li>
<li><span class="parameter">on_drag_callback</span>
<span class="types"><span class="type">function</span></span>
Callback for on<em>drag</em>event(self, dx, dy)
</li>
</ul>
</dd>
<dt>
<a name = "set_click_zone"></a>
<strong>set_click_zone(zone)</strong>
</dt>
<dd>
Strict drag click area. Useful for
restrict events outside stencil node
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">zone</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_touch_start</span>
<span class="types"><span class="type">druid_event</span></span>
(self) Event on touch start
</li>
<li><span class="parameter">on_touch_end</span>
<span class="types"><span class="type">druid_event</span></span>
(self) Event on touch end
</li>
<li><span class="parameter">on_drag_start</span>
<span class="types"><span class="type">druid_event</span></span>
(self) Event on drag start
</li>
<li><span class="parameter">on_drag</span>
<span class="types"><span class="type">druid_event</span></span>
(self, dx, dy) Event on drag progress
</li>
<li><span class="parameter">on_drag_end</span>
<span class="types"><span class="type">druid_event</span></span>
(self) Event on drag end
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Components fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">is_touch</span>
<span class="types"><span class="type">bool</span></span>
Is component now touching
</li>
<li><span class="parameter">is_drag</span>
<span class="types"><span class="type">bool</span></span>
Is component now dragging
</li>
<li><span class="parameter">can_x</span>
<span class="types"><span class="type">bool</span></span>
Is drag component process vertical dragging. Default - true
</li>
<li><span class="parameter">can_y</span>
<span class="types"><span class="type">bool</span></span>
Is drag component process horizontal. Default - true
</li>
<li><span class="parameter">x</span>
<span class="types"><span class="type">number</span></span>
Current touch x position
</li>
<li><span class="parameter">y</span>
<span class="types"><span class="type">number</span></span>
Current touch y position
</li>
<li><span class="parameter">touch_start_pos</span>
<span class="types"><span class="type">vector3</span></span>
Touch start position
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
</dt>
<dd>
Component style params.
You can override this component styles params in druid styles table
or create your own style
<h3>Fields:</h3>
<ul>
<li><span class="parameter">DRAG_DEADZONE</span>
<span class="types"><span class="type">number</span></span>
Distance in pixels to start dragging
(<em>default</em> 10)
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,381 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><strong>druid.grid</strong></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.grid</code></h1>
<p>Component to handle placing components by row and columns.</p>
<p> Grid can anchor your elements, get content size and other</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(parent, element[, in_row=1])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_offset">set_offset(offset)</a></td>
<td class="summary">Set grid items offset, the distance between items</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_anchor">set_anchor(acnhor)</a></td>
<td class="summary">Set grid anchor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add">add(item[, index])</a></td>
<td class="summary">Add new item to the grid</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_size">get_size()</a></td>
<td class="summary">Return grid content size</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_all_pos">get_all_pos()</a></td>
<td class="summary">Return array of all node positions</td>
</tr>
<tr>
<td class="name" nowrap><a href="#clear">clear()</a></td>
<td class="summary">Clear grid nodes array.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(parent, element[, in_row=1])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">parent</span>
<span class="types"><span class="type">node</span></span>
The gui node parent, where items will be placed
</li>
<li><span class="parameter">element</span>
<span class="types"><span class="type">node</span></span>
Element prefab. Need to get it size
</li>
<li><span class="parameter">in_row</span>
<span class="types"><span class="type">number</span></span>
How many nodes in row can be placed
(<em>default</em> 1)
</li>
</ul>
</dd>
<dt>
<a name = "set_offset"></a>
<strong>set_offset(offset)</strong>
</dt>
<dd>
Set grid items offset, the distance between items
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">offset</span>
<span class="types"><span class="type">vector3</span></span>
Offset
</li>
</ul>
</dd>
<dt>
<a name = "set_anchor"></a>
<strong>set_anchor(acnhor)</strong>
</dt>
<dd>
Set grid anchor
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">acnhor</span>
<span class="types"><span class="type">vector3</span></span>
Anchor
</li>
</ul>
</dd>
<dt>
<a name = "add"></a>
<strong>add(item[, index])</strong>
</dt>
<dd>
Add new item to the grid
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">item</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
The item position. By default add as last item
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "get_size"></a>
<strong>get_size()</strong>
</dt>
<dd>
Return grid content size
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">vector3</span></span>
The grid content size
</ol>
</dd>
<dt>
<a name = "get_all_pos"></a>
<strong>get_all_pos()</strong>
</dt>
<dd>
Return array of all node positions
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">vector3[]</span></span>
All grid node positions
</ol>
</dd>
<dt>
<a name = "clear"></a>
<strong>clear()</strong>
</dt>
<dd>
Clear grid nodes array. GUI nodes will be not deleted!
If you want to delete GUI nodes, use grid.nodes array before grid:clear
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_add_item</span>
<span class="types"><span class="type">druid_event</span></span>
On item add callback
</li>
<li><span class="parameter">on_remove_item</span>
<span class="types"><span class="type">druid_event</span></span>
On item remove callback
</li>
<li><span class="parameter">on_clear</span>
<span class="types"><span class="type">druid_event</span></span>
On grid clear callback
</li>
<li><span class="parameter">on_update_positions</span>
<span class="types"><span class="type">druid_event</span></span>
On update item positions callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">parent</span>
<span class="types"><span class="type">node</span></span>
Parent gui node
</li>
<li><span class="parameter">nodes</span>
<span class="types"><span class="type">node[]</span></span>
List of all grid nodes
</li>
<li><span class="parameter">offset</span>
<span class="types"><span class="type">vector3</span></span>
Item distance between each other items
</li>
<li><span class="parameter">anchor</span>
<span class="types"><span class="type">vector3</span></span>
Item anchor
</li>
<li><span class="parameter">node_size</span>
<span class="types"><span class="type">vector3</span></span>
Item size
</li>
<li><span class="parameter">border</span>
<span class="types"><span class="type">vector4</span></span>
The size of item content
</li>
<li><span class="parameter">border_offer</span>
<span class="types"><span class="type">vector3</span></span>
The border offset for correct anchor calculations
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,305 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><strong>druid.helper</strong></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.helper</code></h1>
<p>Text node or icon node can be nil</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#centrate_text_with_icon">centrate_text_with_icon([text_node][, icon_node], margin)</a></td>
<td class="summary">Center two nodes.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#centrate_icon_with_text">centrate_icon_with_text([icon_node[, text_node[, margin=0]]])</a></td>
<td class="summary">Center two nodes.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_enabled">is_enabled(node)</a></td>
<td class="summary">Check if node is enabled in gui hierarchy.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_pivot_offset">get_pivot_offset(pivot)</a></td>
<td class="summary">Get node offset for given gui pivot</td>
</tr>
<tr>
<td class="name" nowrap><a href="#helper..is_mobile">helper..is_mobile()</a></td>
<td class="summary">Check if device is mobile (Android or iOS)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_web">is_web()</a></td>
<td class="summary">Check if device is HTML5</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_border">get_border()</a></td>
<td class="summary">Distance from node to size border</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "centrate_text_with_icon"></a>
<strong>centrate_text_with_icon([text_node][, icon_node], margin)</strong>
</dt>
<dd>
Center two nodes.
Nodes will be center around 0 x position
text_node will be first (at left side)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">text_node</span>
<span class="types"><span class="type">text</span></span>
Gui text node
(<em>optional</em>)
</li>
<li><span class="parameter">icon_node</span>
<span class="types"><span class="type">box</span></span>
Gui box node
(<em>optional</em>)
</li>
<li><span class="parameter">margin</span>
<span class="types"><span class="type">number</span></span>
Offset between nodes
</li>
</ul>
</dd>
<dt>
<a name = "centrate_icon_with_text"></a>
<strong>centrate_icon_with_text([icon_node[, text_node[, margin=0]]])</strong>
</dt>
<dd>
Center two nodes.
Nodes will be center around 0 x position
icon_node will be first (at left side)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">icon_node</span>
<span class="types"><span class="type">box</span></span>
Gui box node
(<em>optional</em>)
</li>
<li><span class="parameter">text_node</span>
<span class="types"><span class="type">text</span></span>
Gui text node
(<em>optional</em>)
</li>
<li><span class="parameter">margin</span>
<span class="types"><span class="type">number</span></span>
Offset between nodes
(<em>default</em> 0)
</li>
</ul>
</dd>
<dt>
<a name = "is_enabled"></a>
<strong>is_enabled(node)</strong>
</dt>
<dd>
Check if node is enabled in gui hierarchy.
Return false, if node or any his parent is disabled
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
Is enabled in hierarchy
</ol>
</dd>
<dt>
<a name = "get_pivot_offset"></a>
<strong>get_pivot_offset(pivot)</strong>
</dt>
<dd>
Get node offset for given gui pivot
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">pivot</span>
<span class="types"><span class="type">gui.pivot</span></span>
The node pivot
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">vector3</span></span>
Vector offset with [-1..1] values
</ol>
</dd>
<dt>
<a name = "helper..is_mobile"></a>
<strong>helper..is_mobile()</strong>
</dt>
<dd>
Check if device is mobile (Android or iOS)
</dd>
<dt>
<a name = "is_web"></a>
<strong>is_web()</strong>
</dt>
<dd>
Check if device is HTML5
</dd>
<dt>
<a name = "get_border"></a>
<strong>get_border()</strong>
</dt>
<dd>
Distance from node to size border
<h3>Returns:</h3>
<ol>
vector4 (left, top, right, down)
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,301 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><strong>druid.hover</strong></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.hover</code></h1>
<p>Component to handle hover node interaction</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, on_hover_callback)</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_hover">set_hover(state)</a></td>
<td class="summary">Set hover state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_mouse_hover">set_mouse_hover(state)</a></td>
<td class="summary">Set mouse hover state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(zone)</a></td>
<td class="summary">Strict hover click area.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_enabled">set_enabled(state)</a></td>
<td class="summary">Set enable state of hover component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_enabled">is_enabled()</a></td>
<td class="summary">Return current hover enabled state</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, on_hover_callback)</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
<li><span class="parameter">on_hover_callback</span>
<span class="types"><span class="type">function</span></span>
Hover callback
</li>
</ul>
</dd>
<dt>
<a name = "set_hover"></a>
<strong>set_hover(state)</strong>
</dt>
<dd>
Set hover state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
The hover state
</li>
</ul>
</dd>
<dt>
<a name = "set_mouse_hover"></a>
<strong>set_mouse_hover(state)</strong>
</dt>
<dd>
Set mouse hover state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
The mouse hover state
</li>
</ul>
</dd>
<dt>
<a name = "set_click_zone"></a>
<strong>set_click_zone(zone)</strong>
</dt>
<dd>
Strict hover click area. Useful for
no click events outside stencil node
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">zone</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
</dd>
<dt>
<a name = "set_enabled"></a>
<strong>set_enabled(state)</strong>
</dt>
<dd>
Set enable state of hover component.
If hover is not enabled, it will not generate
any hover events
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
The hover enabled state
</li>
</ul>
</dd>
<dt>
<a name = "is_enabled"></a>
<strong>is_enabled()</strong>
</dt>
<dd>
Return current hover enabled state
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
The hover enabled state
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_hover</span>
<span class="types"><span class="type">druid_event</span></span>
On hover callback (Touch pressed)
</li>
<li><span class="parameter">on_mouse_hover</span>
<span class="types"><span class="type">druid_event</span></span>
On mouse hover callback (Touch over without action_id)
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,336 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><strong>druid</strong></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid</code></h1>
<p>Druid UI Library.</p>
<p>
<p> Powerful Defold component based UI library. Use standart
components or make your own game-specific components to
make amazing GUI in your games.</p>
<p> Contains the several basic components and examples
to how to do your custom complex components to
separate UI game logic to small files</p>
<pre>
<span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">function</span> init(self)
self.druid = druid.new(self)
<span class="keyword">end</span>
</pre>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#register">register(name, module)</a></td>
<td class="summary">Register external druid component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new">new(context[, style])</a></td>
<td class="summary">Create Druid instance.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_default_style">set_default_style(style)</a></td>
<td class="summary">Set new default style.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_text_function">set_text_function(callback)</a></td>
<td class="summary">Set text function
Druid locale component will call this function
to get translated text.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_sound_function">set_sound_function(callback)</a></td>
<td class="summary">Set sound function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_window_callback">on_window_callback(event)</a></td>
<td class="summary">Callback on global window event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_layout_change">on_layout_change()</a></td>
<td class="summary">Callback on global layout change event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_language_change">on_language_change()</a></td>
<td class="summary">Callback on global language change event.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "register"></a>
<strong>register(name, module)</strong>
</dt>
<dd>
Register external druid component.
After register you can create the component with
druid<em>instance:new</em>{name}. For example <code>druid:new_button(...)</code>
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
module name
</li>
<li><span class="parameter">module</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
lua table with component
</li>
</ul>
</dd>
<dt>
<a name = "new"></a>
<strong>new(context[, style])</strong>
</dt>
<dd>
Create Druid instance.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">context</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Druid context. Usually it is self of script
</li>
<li><span class="parameter">style</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Druid style module
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid_instance</span></span>
Druid instance
</ol>
</dd>
<dt>
<a name = "set_default_style"></a>
<strong>set_default_style(style)</strong>
</dt>
<dd>
Set new default style.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">style</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Druid style module
</li>
</ul>
</dd>
<dt>
<a name = "set_text_function"></a>
<strong>set_text_function(callback)</strong>
</dt>
<dd>
Set text function
Druid locale component will call this function
to get translated text. After set<em>text</em>funtion
all existing locale component will be updated
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Get localized text function
</li>
</ul>
</dd>
<dt>
<a name = "set_sound_function"></a>
<strong>set_sound_function(callback)</strong>
</dt>
<dd>
Set sound function.
Component will call this function to
play sound by sound_id
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Sound play callback
</li>
</ul>
</dd>
<dt>
<a name = "on_window_callback"></a>
<strong>on_window_callback(event)</strong>
</dt>
<dd>
Callback on global window event.
Used to trigger on<em>focus</em>lost and on<em>focus</em>gain
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Event param from window listener
</li>
</ul>
</dd>
<dt>
<a name = "on_layout_change"></a>
<strong>on_layout_change()</strong>
</dt>
<dd>
Callback on global layout change event.
</dd>
<dt>
<a name = "on_language_change"></a>
<strong>on_language_change()</strong>
</dt>
<dd>
Callback on global language change event.
Use to update all lang texts
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,395 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><strong>druid.input</strong></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.input</code></h1>
<p>Druid input text component.</p>
<p> Carry on user text input</p>
<h3>Info:</h3>
<ul>
<li><strong>Author</strong>: Part of code from Britzl gooey input component</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#set_text">set_text(input_text)</a></td>
<td class="summary">Set text for input field</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_text">get_text()</a></td>
<td class="summary">Return current input field text</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_max_length">set_max_length(max_length)</a></td>
<td class="summary">Set maximum length for input field.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_allowerd_characters">set_allowerd_characters(characters)</a></td>
<td class="summary">Set allowed charaters for input field.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#reset_changes">reset_changes()</a></td>
<td class="summary">Reset current input selection and return previous value</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="summary">Component style params.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "set_text"></a>
<strong>set_text(input_text)</strong>
</dt>
<dd>
Set text for input field
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">input_text</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
The string to apply for input field
</li>
</ul>
</dd>
<dt>
<a name = "get_text"></a>
<strong>get_text()</strong>
</dt>
<dd>
Return current input field text
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
The current input field text
</ol>
</dd>
<dt>
<a name = "set_max_length"></a>
<strong>set_max_length(max_length)</strong>
</dt>
<dd>
Set maximum length for input field.
Pass nil to make input field unliminted (by default)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">max_length</span>
<span class="types"><span class="type">number</span></span>
Maximum length for input text field
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.input</span></span>
Current input instance
</ol>
</dd>
<dt>
<a name = "set_allowerd_characters"></a>
<strong>set_allowerd_characters(characters)</strong>
</dt>
<dd>
Set allowed charaters for input field.
See: https://defold.com/ref/stable/string/
ex: [%a%d] for alpha and numeric
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">characters</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Regulax exp. for validate user input
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.input</span></span>
Current input instance
</ol>
</dd>
<dt>
<a name = "reset_changes"></a>
<strong>reset_changes()</strong>
</dt>
<dd>
Reset current input selection and return previous value
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_input_select</span>
<span class="types"><span class="type">druid_event</span></span>
(self, button_node) On input field select callback
</li>
<li><span class="parameter">on_input_unselect</span>
<span class="types"><span class="type">druid_event</span></span>
(self, button_node) On input field unselect callback
</li>
<li><span class="parameter">on_input_text</span>
<span class="types"><span class="type">druid_event</span></span>
(self, input_text) On input field text change callback
</li>
<li><span class="parameter">on_input_empty</span>
<span class="types"><span class="type">druid_event</span></span>
(self, input_text) On input field text change to empty string callback
</li>
<li><span class="parameter">on_input_full</span>
<span class="types"><span class="type">druid_event</span></span>
(self, input_text) On input field text change to max length string callback
</li>
<li><span class="parameter">on_input_wrong</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button_instance) On trying user input with not allowed character callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">text</span>
<span class="types"><span class="type">druid.text</span></span>
Text component
</li>
<li><span class="parameter">button</span>
<span class="types"><span class="type">druid.button</span></span>
Button component
</li>
<li><span class="parameter">is_selected</span>
<span class="types"><span class="type">bool</span></span>
Is current input selected now
</li>
<li><span class="parameter">is_empty</span>
<span class="types"><span class="type">bool</span></span>
Is current input is empty now
</li>
<li><span class="parameter">max_length</span>
<span class="types"><span class="type">number</span></span>
Max length for input text
(<em>optional</em>)
</li>
<li><span class="parameter">allowerd_characters</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Pattern matching for user input
(<em>optional</em>)
</li>
<li><span class="parameter">keyboard_type</span>
<span class="types"><span class="type">number</span></span>
Gui keyboard type for input field
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
</dt>
<dd>
Component style params.
You can override this component styles params in druid styles table
or create your own style
<h3>Fields:</h3>
<ul>
<li><span class="parameter">IS_LONGTAP_ERASE</span>
<span class="types"><span class="type">bool</span></span>
Is long tap will erase current input data
(<em>default</em> false)
</li>
<li><span class="parameter">MASK_DEFAULT_CHAR</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Default character mask for password input
(<em>default</em> *)
</li>
<li><span class="parameter">on_select</span>
<span class="types"><span class="type">function</span></span>
(self, button_node) Callback on input field selecting
</li>
<li><span class="parameter">on_unselect</span>
<span class="types"><span class="type">function</span></span>
(self, button_node) Callback on input field unselecting
</li>
<li><span class="parameter">on_input_wrong</span>
<span class="types"><span class="type">function</span></span>
(self, button_node) Callback on wrong user input
</li>
<li><span class="parameter">button_style</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Custom button style for input node
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,250 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><strong>druid.lang_text</strong></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.lang_text</code></h1>
<p>Component to handle all GUI texts
Good working with localization system</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, locale_id, no_adjust)</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_to">set_to(text)</a></td>
<td class="summary">Setup raw text to lang_text component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#translate">translate(locale_id)</a></td>
<td class="summary">Translate the text by locale_id</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, locale_id, no_adjust)</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
The text node
</li>
<li><span class="parameter">locale_id</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Default locale id
</li>
<li><span class="parameter">no_adjust</span>
<span class="types"><span class="type">bool</span></span>
If true, will not correct text size
</li>
</ul>
</dd>
<dt>
<a name = "set_to"></a>
<strong>set_to(text)</strong>
</dt>
<dd>
Setup raw text to lang_text component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">text</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Text for text node
</li>
</ul>
</dd>
<dt>
<a name = "translate"></a>
<strong>translate(locale_id)</strong>
</dt>
<dd>
Translate the text by locale_id
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">locale_id</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Locale id
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_change</span>
<span class="types"><span class="type">druid_event</span></span>
On change text callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">text</span>
<span class="types"><span class="type">druid.text</span></span>
The text component
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,393 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><strong>druid.progress</strong></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.progress</code></h1>
<p>Basic progress bar component.</p>
<p> For correct progress bar init it should be in max size from gui</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, key[, init_value=1])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#fill">fill()</a></td>
<td class="summary">Fill a progress bar and stop progress animation</td>
</tr>
<tr>
<td class="name" nowrap><a href="#empty">empty()</a></td>
<td class="summary">Empty a progress bar</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_to">set_to(to)</a></td>
<td class="summary">Instant fill progress bar to value</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get">get()</a></td>
<td class="summary">Return current progress bar value</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_steps">set_steps(steps, callback)</a></td>
<td class="summary">Set points on progress bar to fire the callback</td>
</tr>
<tr>
<td class="name" nowrap><a href="#to">to(to[, callback])</a></td>
<td class="summary">Start animation of a progress bar</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="summary">Component style params.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, key[, init_value=1])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a> or <span class="type">node</span></span>
Progress bar fill node or node name
</li>
<li><span class="parameter">key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Progress bar direction: const.SIDE.X or const.SIDE.Y
</li>
<li><span class="parameter">init_value</span>
<span class="types"><span class="type">number</span></span>
Initial value of progress bar
(<em>default</em> 1)
</li>
</ul>
</dd>
<dt>
<a name = "fill"></a>
<strong>fill()</strong>
</dt>
<dd>
Fill a progress bar and stop progress animation
</dd>
<dt>
<a name = "empty"></a>
<strong>empty()</strong>
</dt>
<dd>
Empty a progress bar
</dd>
<dt>
<a name = "set_to"></a>
<strong>set_to(to)</strong>
</dt>
<dd>
Instant fill progress bar to value
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">to</span>
<span class="types"><span class="type">number</span></span>
Progress bar value, from 0 to 1
</li>
</ul>
</dd>
<dt>
<a name = "get"></a>
<strong>get()</strong>
</dt>
<dd>
Return current progress bar value
</dd>
<dt>
<a name = "set_steps"></a>
<strong>set_steps(steps, callback)</strong>
</dt>
<dd>
Set points on progress bar to fire the callback
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">steps</span>
<span class="types"><span class="type">number[]</span></span>
Array of progress bar values
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Callback on intersect step value
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">progress:set_steps({<span class="number">0</span>, <span class="number">0.3</span>, <span class="number">0.6</span>, <span class="number">1</span>}, <span class="keyword">function</span>(self, step) <span class="keyword">end</span>)</pre>
</ul>
</dd>
<dt>
<a name = "to"></a>
<strong>to(to[, callback])</strong>
</dt>
<dd>
Start animation of a progress bar
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">to</span>
<span class="types"><span class="type">number</span></span>
value between 0..1
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Callback on animation ends
(<em>optional</em>)
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_change</span>
<span class="types"><span class="type">druid_event</span></span>
On progress bar change callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Progress bar fill node
</li>
<li><span class="parameter">key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
The progress bar direction
</li>
<li><span class="parameter">scale</span>
<span class="types"><span class="type">vector3</span></span>
Current progress bar scale
</li>
<li><span class="parameter">size</span>
<span class="types"><span class="type">vector3</span></span>
Current progress bar size
</li>
<li><span class="parameter">max_size</span>
<span class="types"><span class="type">number</span></span>
Maximum size of progress bar
</li>
<li><span class="parameter">slice</span>
<span class="types"><span class="type">vector4</span></span>
Progress bar slice9 settings
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
</dt>
<dd>
Component style params.
You can override this component styles params in druid styles table
or create your own style
<h3>Fields:</h3>
<ul>
<li><span class="parameter">SPEED</span>
<span class="types"><span class="type">number</span></span>
Progress bas fill rate. More -> faster
(<em>default</em> 5)
</li>
<li><span class="parameter">MIN_DELTA</span>
<span class="types"><span class="type">number</span></span>
Minimum step to fill progress bar
(<em>default</em> 0.005)
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,249 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><strong>druid.radio_group</strong></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.radio_group</code></h1>
<p>Radio group module</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, callback[, click=node])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_state">set_state(index)</a></td>
<td class="summary">Set radio group state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_state">get_state()</a></td>
<td class="summary">Return radio group state</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, callback[, click=node])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node[]</span></span>
Array of gui node
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Radio callback
</li>
<li><span class="parameter">click</span>
<span class="types"><span class="type">node[]</span></span>
node Array of trigger nodes, by default equals to nodes
(<em>default</em> node)
</li>
</ul>
</dd>
<dt>
<a name = "set_state"></a>
<strong>set_state(index)</strong>
</dt>
<dd>
Set radio group state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
Index in radio group
</li>
</ul>
</dd>
<dt>
<a name = "get_state"></a>
<strong>get_state()</strong>
</dt>
<dd>
Return radio group state
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
Index in radio group
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_radio_click</span>
<span class="types"><span class="type">druid_event</span></span>
On any checkbox click
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">checkboxes</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Array of checkbox components
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,617 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><strong>druid.scroll</strong></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.scroll</code></h1>
<p>Component to handle scroll content.</p>
<p> Scroll consist from two nodes: scroll parent and scroll input
Scroll input the user input zone, it's static
Scroll parent the scroll moving part, it will change position.
Setup initial scroll size by changing scroll parent size. If scroll parent
size will be less than scroll_input size, no scroll is available. For scroll
parent size should be more than input size</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(view_node, content_node)</a></td>
<td class="summary">Scroll constructor.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#scroll_to">scroll_to(vector3[, is_instant])</a></td>
<td class="summary">Start scroll to target point.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#scroll_to_index">scroll_to_index(index[, skip_cb])</a></td>
<td class="summary">Scroll to item in scroll by point index.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#scroll_to_percent">scroll_to_percent(vector3[, is_instant])</a></td>
<td class="summary">Start scroll to target scroll percent</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_percent">get_percent()</a></td>
<td class="summary">Return current scroll progress status.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_size">set_size(size)</a></td>
<td class="summary">Set scroll content size.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_inert">set_inert(state)</a></td>
<td class="summary">Enable or disable scroll inert.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_inert">is_inert()</a></td>
<td class="summary">Return if scroll have inertion.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_extra_stretch_size">set_extra_stretch_size([stretch_size=0])</a></td>
<td class="summary">Set extra size for scroll stretching.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_scroll_size">get_scroll_size()</a></td>
<td class="summary">Return vector of scroll size with width and height.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_points">set_points(points)</a></td>
<td class="summary">Set points of interest.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="summary">Component style params.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(view_node, content_node)</strong>
</dt>
<dd>
Scroll constructor.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">view_node</span>
<span class="types"><span class="type">node</span></span>
GUI view scroll node
</li>
<li><span class="parameter">content_node</span>
<span class="types"><span class="type">node</span></span>
GUI content scroll node
</li>
</ul>
</dd>
<dt>
<a name = "scroll_to"></a>
<strong>scroll_to(vector3[, is_instant])</strong>
</dt>
<dd>
Start scroll to target point.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">vector3</span>
<span class="types"><span class="type">point</span></span>
Target point
</li>
<li><span class="parameter">is_instant</span>
<span class="types"><span class="type">bool</span></span>
Instant scroll flag
(<em>optional</em>)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<li><pre class="example">scroll:scroll_to(vmath.vector3(<span class="number">0</span>, <span class="number">50</span>, <span class="number">0</span>))</pre></li>
<li><pre class="example">scroll:scroll_to(vmath.vector3(<span class="number">0</span>), <span class="keyword">true</span>)</pre></li>
</ul>
</dd>
<dt>
<a name = "scroll_to_index"></a>
<strong>scroll_to_index(index[, skip_cb])</strong>
</dt>
<dd>
Scroll to item in scroll by point index.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
Point index
</li>
<li><span class="parameter">skip_cb</span>
<span class="types"><span class="type">bool</span></span>
If true, skip the point callback
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "scroll_to_percent"></a>
<strong>scroll_to_percent(vector3[, is_instant])</strong>
</dt>
<dd>
Start scroll to target scroll percent
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">vector3</span>
<span class="types"><span class="type">point</span></span>
target percent
</li>
<li><span class="parameter">is_instant</span>
<span class="types"><span class="type">bool</span></span>
instant scroll flag
(<em>optional</em>)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">scroll:scroll_to_percent(vmath.vector3(<span class="number">0.5</span>, <span class="number">0</span>, <span class="number">0</span>))</pre>
</ul>
</dd>
<dt>
<a name = "get_percent"></a>
<strong>get_percent()</strong>
</dt>
<dd>
Return current scroll progress status.
Values will be in [0..1] interval
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">vector3</span></span>
New vector with scroll progress values
</ol>
</dd>
<dt>
<a name = "set_size"></a>
<strong>set_size(size)</strong>
</dt>
<dd>
Set scroll content size.
It will change content gui node size
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">size</span>
<span class="types"><span class="type">vector3</span></span>
The new size for content node
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.scroll</span></span>
Current scroll instance
</ol>
</dd>
<dt>
<a name = "set_inert"></a>
<strong>set_inert(state)</strong>
</dt>
<dd>
Enable or disable scroll inert.
If disabled, scroll through points (if exist)
If no points, just simple drag without inertion
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
Inert scroll state
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.scroll</span></span>
Current scroll instance
</ol>
</dd>
<dt>
<a name = "is_inert"></a>
<strong>is_inert()</strong>
</dt>
<dd>
Return if scroll have inertion.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
If scroll have inertion
</ol>
</dd>
<dt>
<a name = "set_extra_stretch_size"></a>
<strong>set_extra_stretch_size([stretch_size=0])</strong>
</dt>
<dd>
Set extra size for scroll stretching.
Set 0 to disable stretching effect
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">stretch_size</span>
<span class="types"><span class="type">number</span></span>
Size in pixels of additional scroll area
(<em>default</em> 0)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.scroll</span></span>
Current scroll instance
</ol>
</dd>
<dt>
<a name = "get_scroll_size"></a>
<strong>get_scroll_size()</strong>
</dt>
<dd>
Return vector of scroll size with width and height.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">vector3</span></span>
Available scroll size
</ol>
</dd>
<dt>
<a name = "set_points"></a>
<strong>set_points(points)</strong>
</dt>
<dd>
Set points of interest.
Scroll will always centered on closer points
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">points</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Array of vector3 points
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.scroll</span></span>
Current scroll instance
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_scroll</span>
<span class="types"><span class="type">druid_event</span></span>
On scroll move callback
</li>
<li><span class="parameter">on_scroll_to</span>
<span class="types"><span class="type">druid_event</span></span>
On scroll_to function callback
</li>
<li><span class="parameter">on_point_scroll</span>
<span class="types"><span class="type">druid_event</span></span>
On scroll<em>to</em>index function callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">view_node</span>
<span class="types"><span class="type">node</span></span>
Scroll view node
</li>
<li><span class="parameter">content_node</span>
<span class="types"><span class="type">node</span></span>
Scroll content node
</li>
<li><span class="parameter">is_inert</span>
<span class="types"><span class="type">bool</span></span>
Flag, if scroll now moving by inertion
</li>
<li><span class="parameter">inertion</span>
<span class="types"><span class="type">vector3</span></span>
Current inert speed
</li>
<li><span class="parameter">position</span>
<span class="types"><span class="type">vector3</span></span>
Current scroll posisition
</li>
<li><span class="parameter">target_position</span>
<span class="types"><span class="type">vector3</span></span>
Current scroll target position
</li>
<li><span class="parameter">available_pos</span>
<span class="types"><span class="type">vector4</span></span>
Available position for content node: (min<em>x, max</em>y, max<em>x, min</em>y)
</li>
<li><span class="parameter">available_size</span>
<span class="types"><span class="type">vector3</span></span>
Size of available positions: (width, height, 0)
</li>
<li><span class="parameter">drag</span>
<span class="types"><span class="type">druid.drag</span></span>
Drag component
</li>
<li><span class="parameter">Current</span>
<span class="types"><span class="type">selected</span></span>
index of points of interests
(<em>optional</em>)
</li>
<li><span class="parameter">is_animate</span>
<span class="types"><span class="type">bool</span></span>
Flag, if scroll now animating by gui.animate
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
</dt>
<dd>
Component style params.
You can override this component styles params in druid styles table
or create your own style
<h3>Fields:</h3>
<ul>
<li><span class="parameter">FRICT</span>
<span class="types"><span class="type">number</span></span>
Multiplier for free inertion
(<em>default</em> 0)
</li>
<li><span class="parameter">FRICT_HOLD</span>
<span class="types"><span class="type">number</span></span>
Multiplier for inertion, while touching
(<em>default</em> 0)
</li>
<li><span class="parameter">INERT_THRESHOLD</span>
<span class="types"><span class="type">number</span></span>
Scroll speed to stop inertion
(<em>default</em> 3)
</li>
<li><span class="parameter">INERT_SPEED</span>
<span class="types"><span class="type">number</span></span>
Multiplier for inertion speed
(<em>default</em> 30)
</li>
<li><span class="parameter">POINTS_DEADZONE</span>
<span class="types"><span class="type">number</span></span>
Speed to check points of interests in no_inertion mode
(<em>default</em> 20)
</li>
<li><span class="parameter">BACK_SPEED</span>
<span class="types"><span class="type">number</span></span>
Scroll back returning lerp speed
(<em>default</em> 0.35)
</li>
<li><span class="parameter">ANIM_SPEED</span>
<span class="types"><span class="type">number</span></span>
Scroll gui.animation speed for scroll_to function
(<em>default</em> 0.2)
</li>
<li><span class="parameter">EXTRA_STRETCH_SIZE</span>
<span class="types"><span class="type">number</span></span>
extra size in pixels outside of scroll (stretch effect)
(<em>default</em> 0)
</li>
<li><span class="parameter">SMALL_CONTENT_SCROLL</span>
<span class="types"><span class="type">bool</span></span>
If true, content node with size less than view node size can be scrolled
(<em>default</em> false)
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,288 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><strong>druid.slider</strong></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.slider</code></h1>
<p>Druid slider component</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, end_pos[, callback])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set">set(value[, is_silent])</a></td>
<td class="summary">Set value for slider</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_steps">set_steps(steps)</a></td>
<td class="summary">Set slider steps.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, end_pos[, callback])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui pin node
</li>
<li><span class="parameter">end_pos</span>
<span class="types"><span class="type">vector3</span></span>
The end position of slider
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
On slider change callback
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "set"></a>
<strong>set(value[, is_silent])</strong>
</dt>
<dd>
Set value for slider
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">value</span>
<span class="types"><span class="type">number</span></span>
Value from 0 to 1
</li>
<li><span class="parameter">is_silent</span>
<span class="types"><span class="type">bool</span></span>
Don't trigger event if true
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "set_steps"></a>
<strong>set_steps(steps)</strong>
</dt>
<dd>
Set slider steps. Pin node will
apply closest step position
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">steps</span>
<span class="types"><span class="type">number[]</span></span>
Array of steps
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">slider:set_steps({<span class="number">0</span>, <span class="number">0.2</span>, <span class="number">0.6</span>, <span class="number">1</span>})</pre>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_change_value</span>
<span class="types"><span class="type">druid_event</span></span>
On change value callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Slider pin node
</li>
<li><span class="parameter">start_pos</span>
<span class="types"><span class="type">vector3</span></span>
Start pin node position
</li>
<li><span class="parameter">pos</span>
<span class="types"><span class="type">vector3</span></span>
Current pin node position
</li>
<li><span class="parameter">target_pos</span>
<span class="types"><span class="type">vector3</span></span>
Targer pin node position
</li>
<li><span class="parameter">end_pos</span>
<span class="types"><span class="type">vector3</span></span>
End pin node position
</li>
<li><span class="parameter">dist</span>
<span class="types"><span class="type">number</span></span>
Length between start and end position
</li>
<li><span class="parameter">is_drag</span>
<span class="types"><span class="type">bool</span></span>
Current drag state
</li>
<li><span class="parameter">value</span>
<span class="types"><span class="type">number</span></span>
Current slider value
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,263 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><strong>druid.swipe</strong></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.swipe</code></h1>
<p>Component to handle swipe gestures on node.</p>
<p> Swipe will be triggered, if swipe was started and
ended on one node</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, on_swipe_callback)</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(zone)</a></td>
<td class="summary">Strict swipe click area.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Components fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="summary">Component style params.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, on_swipe_callback)</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
<li><span class="parameter">on_swipe_callback</span>
<span class="types"><span class="type">function</span></span>
Swipe callback for on<em>swipe</em>end event
</li>
</ul>
</dd>
<dt>
<a name = "set_click_zone"></a>
<strong>set_click_zone(zone)</strong>
</dt>
<dd>
Strict swipe click area. Useful for
restrict events outside stencil node
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">zone</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Components fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Swipe node
</li>
<li><span class="parameter">click_zone</span>
<span class="types"><span class="type">node</span></span>
Restriction zone
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_swipe</span>
<span class="types"><span class="type">druid_event</span></span>
Trigger on swipe event
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
</dt>
<dd>
Component style params.
You can override this component styles params in druid styles table
or create your own style
<h3>Fields:</h3>
<ul>
<li><span class="parameter">SWIPE_TIME</span>
<span class="types"><span class="type">number</span></span>
Maximum time for swipe trigger
(<em>default</em> 0.4)
</li>
<li><span class="parameter">SWIPE_THRESHOLD</span>
<span class="types"><span class="type">number</span></span>
Minimum distance for swipe trigger
(<em>default</em> 50)
</li>
<li><span class="parameter">SWIPE_TRIGGER_ON_MOVE</span>
<span class="types"><span class="type">bool</span></span>
If true, trigger on swipe moving, not only release action
(<em>default</em> false)
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,414 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><strong>druid.text</strong></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.text</code></h1>
<p>Component to handle all GUI texts.</p>
<p> Druid text can adjust itself for text node size
Text will never will be outside of his text size (even multiline)</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node[, value[, no_adjust]])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_text_width">get_text_width([text])</a></td>
<td class="summary">Calculate text width with font with respect to trailing space</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_to">set_to(set_to)</a></td>
<td class="summary">Set text to text field</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_color">set_color(color)</a></td>
<td class="summary">Set color</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_alpha">set_alpha(alpha)</a></td>
<td class="summary">Set alpha</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_scale">set_scale(scale)</a></td>
<td class="summary">Set scale</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_pivot">set_pivot(pivot)</a></td>
<td class="summary">Set text pivot.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_multiline">is_multiline()</a></td>
<td class="summary">Return true, if text with line break</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node[, value[, no_adjust]])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui text node
</li>
<li><span class="parameter">value</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Initial text. Default value is node text from GUI scene.
(<em>optional</em>)
</li>
<li><span class="parameter">no_adjust</span>
<span class="types"><span class="type">bool</span></span>
If true, text will be not auto-adjust size
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "get_text_width"></a>
<strong>get_text_width([text])</strong>
</dt>
<dd>
Calculate text width with font with respect to trailing space
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">text</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "set_to"></a>
<strong>set_to(set_to)</strong>
</dt>
<dd>
Set text to text field
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">set_to</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Text for node
</li>
</ul>
</dd>
<dt>
<a name = "set_color"></a>
<strong>set_color(color)</strong>
</dt>
<dd>
Set color
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">color</span>
<span class="types"><span class="type">vector4</span></span>
Color for node
</li>
</ul>
</dd>
<dt>
<a name = "set_alpha"></a>
<strong>set_alpha(alpha)</strong>
</dt>
<dd>
Set alpha
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">alpha</span>
<span class="types"><span class="type">number</span></span>
Alpha for node
</li>
</ul>
</dd>
<dt>
<a name = "set_scale"></a>
<strong>set_scale(scale)</strong>
</dt>
<dd>
Set scale
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">scale</span>
<span class="types"><span class="type">vector3</span></span>
Scale for node
</li>
</ul>
</dd>
<dt>
<a name = "set_pivot"></a>
<strong>set_pivot(pivot)</strong>
</dt>
<dd>
Set text pivot. Text will re-anchor inside
his text area
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">pivot</span>
<span class="types"><span class="type">gui.pivot</span></span>
Gui pivot constant
</li>
</ul>
</dd>
<dt>
<a name = "is_multiline"></a>
<strong>is_multiline()</strong>
</dt>
<dd>
Return true, if text with line break
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
Is text node with line break
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_set_text</span>
<span class="types"><span class="type">druid_event</span></span>
On set text callback
</li>
<li><span class="parameter">on_update_text_scale</span>
<span class="types"><span class="type">druid_event</span></span>
On adjust text size callback
</li>
<li><span class="parameter">on_set_pivot</span>
<span class="types"><span class="type">druid_event</span></span>
On change pivot callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Text node
</li>
<li><span class="parameter">pos</span>
<span class="types"><span class="type">vector3</span></span>
Current text position
</li>
<li><span class="parameter">start_scale</span>
<span class="types"><span class="type">vector3</span></span>
Initial text node scale
</li>
<li><span class="parameter">scale</span>
<span class="types"><span class="type">vector3</span></span>
Current text node scale
</li>
<li><span class="parameter">start_size</span>
<span class="types"><span class="type">vector3</span></span>
Initial text node size
</li>
<li><span class="parameter">text_area</span>
<span class="types"><span class="type">vector3</span></span>
Current text node available are
</li>
<li><span class="parameter">is_no_adjust</span>
<span class="types"><span class="type">bool</span></span>
Current text size adjust settings
</li>
<li><span class="parameter">color</span>
<span class="types"><span class="type">vector3</span></span>
Current text color
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,303 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><strong>druid.timer</strong></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.timer</code></h1>
<p>Component to handle GUI timers.</p>
<p> Timer updating by game delta time. If game is not focused -
timer will be not updated.</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, seconds_from[, seconds_to=0[, callback]])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_to">set_to(set_to)</a></td>
<td class="summary">Set text to text field</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_state">set_state(is_on)</a></td>
<td class="summary">Called when update</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_interval">set_interval(from, to)</a></td>
<td class="summary">Set time interval</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, seconds_from[, seconds_to=0[, callback]])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui text node
</li>
<li><span class="parameter">seconds_from</span>
<span class="types"><span class="type">number</span></span>
Start timer value in seconds
</li>
<li><span class="parameter">seconds_to</span>
<span class="types"><span class="type">number</span></span>
End timer value in seconds
(<em>default</em> 0)
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Function on timer end
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "set_to"></a>
<strong>set_to(set_to)</strong>
</dt>
<dd>
Set text to text field
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">set_to</span>
<span class="types"><span class="type">number</span></span>
Value in seconds
</li>
</ul>
</dd>
<dt>
<a name = "set_state"></a>
<strong>set_state(is_on)</strong>
</dt>
<dd>
Called when update
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">is_on</span>
<span class="types"><span class="type">bool</span></span>
Timer enable state
</li>
</ul>
</dd>
<dt>
<a name = "set_interval"></a>
<strong>set_interval(from, to)</strong>
</dt>
<dd>
Set time interval
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">from</span>
<span class="types"><span class="type">number</span></span>
Start time in seconds
</li>
<li><span class="parameter">to</span>
<span class="types"><span class="type">number</span></span>
Target time in seconds
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_tick</span>
<span class="types"><span class="type">druid_event</span></span>
On timer tick callback. Fire every second
</li>
<li><span class="parameter">on_set_enabled</span>
<span class="types"><span class="type">druid_event</span></span>
On timer change enabled state callback
</li>
<li><span class="parameter">on_timer_end</span>
<span class="types"><span class="type">druid_event</span></span>
On timer end callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Trigger node
</li>
<li><span class="parameter">from</span>
<span class="types"><span class="type">number</span></span>
Initial timer value
</li>
<li><span class="parameter">target</span>
<span class="types"><span class="type">number</span></span>
Target timer value
</li>
<li><span class="parameter">value</span>
<span class="types"><span class="type">number</span></span>
Current timer value
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,249 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><strong>druid_event</strong></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid_event</code></h1>
<p>Lua event small library</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Event">Event(initial_callback)</a></td>
<td class="summary">Event constructur</td>
</tr>
<tr>
<td class="name" nowrap><a href="#event:subscribe">event:subscribe(callback)</a></td>
<td class="summary">Subscribe callback on event</td>
</tr>
<tr>
<td class="name" nowrap><a href="#event:unsubscribe">event:unsubscribe(callback)</a></td>
<td class="summary">Unsubscribe callback on event</td>
</tr>
<tr>
<td class="name" nowrap><a href="#event:is_exist">event:is_exist()</a></td>
<td class="summary">Return true, if event have at lease one handler</td>
</tr>
<tr>
<td class="name" nowrap><a href="#event:clear">event:clear()</a></td>
<td class="summary">Clear the all event handlers</td>
</tr>
<tr>
<td class="name" nowrap><a href="#event:trigger">event:trigger(...)</a></td>
<td class="summary">Trigger the event and call all subscribed callbacks</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "Event"></a>
<strong>Event(initial_callback)</strong>
</dt>
<dd>
Event constructur
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">initial_callback</span>
<span class="types"><span class="type">function</span></span>
Subscribe the callback on new event, if callback exist
</li>
</ul>
</dd>
<dt>
<a name = "event:subscribe"></a>
<strong>event:subscribe(callback)</strong>
</dt>
<dd>
Subscribe callback on event
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Callback itself
</li>
</ul>
</dd>
<dt>
<a name = "event:unsubscribe"></a>
<strong>event:unsubscribe(callback)</strong>
</dt>
<dd>
Unsubscribe callback on event
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Callback itself
</li>
</ul>
</dd>
<dt>
<a name = "event:is_exist"></a>
<strong>event:is_exist()</strong>
</dt>
<dd>
Return true, if event have at lease one handler
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
True if event have handlers
</ol>
</dd>
<dt>
<a name = "event:clear"></a>
<strong>event:clear()</strong>
</dt>
<dd>
Clear the all event handlers
</dd>
<dt>
<a name = "event:trigger"></a>
<strong>event:trigger(...)</strong>
</dt>
<dd>
Trigger the event and call all subscribed callbacks
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
All event params
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,920 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><strong>druid_instance</strong></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid_instance</code></h1>
<p>Druid main class.</p>
<p> Create instance of this
to start creating components</p>
<h3>See also:</h3>
<ul>
<li><a href="../modules/druid.button.html#">druid.button</a></li>
<li><a href="../modules/druid.blocker.html#">druid.blocker</a></li>
<li><a href="../modules/druid.back_handler.html#">druid.back_handler</a></li>
<li><a href="../modules/druid.input.html#">druid.input</a></li>
<li><a href="../modules/druid.text.html#">druid.text</a></li>
<li><a href="../modules/druid.lang_text.html#">druid.lang_text</a></li>
<li><a href="../modules/druid.timer.html#">druid.timer</a></li>
<li><a href="../modules/druid.progress.html#">druid.progress</a></li>
<li><a href="../modules/druid.grid.html#">druid.grid</a></li>
<li><a href="../modules/druid.scroll.html#">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html#">druid.slider</a></li>
<li><a href="../modules/druid.checkbox.html#">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html#">druid.checkbox_group</a></li>
<li><a href="../modules/druid.radio_group.html#">druid.radio_group</a></li>
<li><a href="../modules/druid.swipe.html#">druid.swipe</a></li>
<li><a href="../modules/druid.drag.html#">druid.drag</a></li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#druid:initialize">druid:initialize(table, table)</a></td>
<td class="summary">Druid class constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:create">druid:create(component, ...)</a></td>
<td class="summary">Create new druid component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:final">druid:final()</a></td>
<td class="summary">Call on final function on gui_script.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:remove">druid:remove(component)</a></td>
<td class="summary">Remove component from druid instance.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:update">druid:update(dt)</a></td>
<td class="summary">Druid update function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:on_input">druid:on_input(action_id, action)</a></td>
<td class="summary">Druid on_input function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:on_message">druid:on_message(message_id, message, sender)</a></td>
<td class="summary">Druid on_message function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:on_focus_lost">druid:on_focus_lost()</a></td>
<td class="summary">Druid on focus lost interest function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:on_focus_gained">druid:on_focus_gained()</a></td>
<td class="summary">Druid on focus gained interest function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:on_layout_change">druid:on_layout_change()</a></td>
<td class="summary">Druid on layout change function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid.on_language_change">druid.on_language_change()</a></td>
<td class="summary">Druid on language change.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_button">druid:new_button(...)</a></td>
<td class="summary">Create button basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_blocker">druid:new_blocker(...)</a></td>
<td class="summary">Create blocker basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_back_handler">druid:new_back_handler(...)</a></td>
<td class="summary">Create back_handler basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_hover">druid:new_hover(...)</a></td>
<td class="summary">Create hover basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_text">druid:new_text(...)</a></td>
<td class="summary">Create text basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_lang_text">druid:new_lang_text(...)</a></td>
<td class="summary">Create lang_text basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_timer">druid:new_timer(...)</a></td>
<td class="summary">Create timer basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_progress">druid:new_progress(...)</a></td>
<td class="summary">Create progress basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_grid">druid:new_grid(...)</a></td>
<td class="summary">Create grid basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_scroll">druid:new_scroll(...)</a></td>
<td class="summary">Create scroll basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_slider">druid:new_slider(...)</a></td>
<td class="summary">Create slider basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_checkbox">druid:new_checkbox(...)</a></td>
<td class="summary">Create checkbox basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_input">druid:new_input(...)</a></td>
<td class="summary">Create input basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_checkbox_group">druid:new_checkbox_group(...)</a></td>
<td class="summary">Create checkbox_group basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_radio_group">druid:new_radio_group(...)</a></td>
<td class="summary">Create radio_group basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_swipe">druid:new_swipe(...)</a></td>
<td class="summary">Create swipe basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_drag">druid:new_drag(...)</a></td>
<td class="summary">Create drag basic component</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "druid:initialize"></a>
<strong>druid:initialize(table, table)</strong>
</dt>
<dd>
Druid class constructor
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">table</span>
<span class="types"><span class="type">style</span></span>
Druid style module
</li>
<li><span class="parameter">table</span>
<span class="types"><span class="type">style</span></span>
Druid style module
</li>
</ul>
</dd>
<dt>
<a name = "druid:create"></a>
<strong>druid:create(component, ...)</strong>
</dt>
<dd>
Create new druid component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">component</span>
<span class="types"><span class="type">Component</span></span>
Component module
</li>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
Other component params to pass it to component:init function
</li>
</ul>
</dd>
<dt>
<a name = "druid:final"></a>
<strong>druid:final()</strong>
</dt>
<dd>
Call on final function on gui<em>script. It will call on</em>remove
on all druid components
</dd>
<dt>
<a name = "druid:remove"></a>
<strong>druid:remove(component)</strong>
</dt>
<dd>
Remove component from druid instance.
Component <code>on_remove</code> function will be invoked, if exist.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">component</span>
<span class="types"><span class="type">Component</span></span>
Component instance
</li>
</ul>
</dd>
<dt>
<a name = "druid:update"></a>
<strong>druid:update(dt)</strong>
</dt>
<dd>
Druid update function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">dt</span>
<span class="types"><span class="type">number</span></span>
Delta time
</li>
</ul>
</dd>
<dt>
<a name = "druid:on_input"></a>
<strong>druid:on_input(action_id, action)</strong>
</dt>
<dd>
Druid on_input function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">action_id</span>
<span class="types"><span class="type">hash</span></span>
Action<em>id from on</em>input
</li>
<li><span class="parameter">action</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Action from on_input
</li>
</ul>
</dd>
<dt>
<a name = "druid:on_message"></a>
<strong>druid:on_message(message_id, message, sender)</strong>
</dt>
<dd>
Druid on_message function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">message_id</span>
<span class="types"><span class="type">hash</span></span>
Message<em>id from on</em>message
</li>
<li><span class="parameter">message</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Message from on_message
</li>
<li><span class="parameter">sender</span>
<span class="types"><span class="type">hash</span></span>
Sender from on_message
</li>
</ul>
</dd>
<dt>
<a name = "druid:on_focus_lost"></a>
<strong>druid:on_focus_lost()</strong>
</dt>
<dd>
Druid on focus lost interest function.
This one called by on<em>window</em>callback by global window listener
</dd>
<dt>
<a name = "druid:on_focus_gained"></a>
<strong>druid:on_focus_gained()</strong>
</dt>
<dd>
Druid on focus gained interest function.
This one called by on<em>window</em>callback by global window listener
</dd>
<dt>
<a name = "druid:on_layout_change"></a>
<strong>druid:on_layout_change()</strong>
</dt>
<dd>
Druid on layout change function.
Called on update gui layout
</dd>
<dt>
<a name = "druid.on_language_change"></a>
<strong>druid.on_language_change()</strong>
</dt>
<dd>
Druid on language change.
This one called by global gruid.on<em>language</em>change, but can be
call manualy to update all translations
</dd>
<dt>
<a name = "druid:new_button"></a>
<strong>druid:new_button(...)</strong>
</dt>
<dd>
Create button basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
button init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
button component
</ol>
</dd>
<dt>
<a name = "druid:new_blocker"></a>
<strong>druid:new_blocker(...)</strong>
</dt>
<dd>
Create blocker basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
blocker init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
blocker component
</ol>
</dd>
<dt>
<a name = "druid:new_back_handler"></a>
<strong>druid:new_back_handler(...)</strong>
</dt>
<dd>
Create back_handler basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
back_handler init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
back_handler component
</ol>
</dd>
<dt>
<a name = "druid:new_hover"></a>
<strong>druid:new_hover(...)</strong>
</dt>
<dd>
Create hover basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
hover init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
hover component
</ol>
</dd>
<dt>
<a name = "druid:new_text"></a>
<strong>druid:new_text(...)</strong>
</dt>
<dd>
Create text basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
text init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
text component
</ol>
</dd>
<dt>
<a name = "druid:new_lang_text"></a>
<strong>druid:new_lang_text(...)</strong>
</dt>
<dd>
Create lang_text basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
lang_text init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
lang_text component
</ol>
</dd>
<dt>
<a name = "druid:new_timer"></a>
<strong>druid:new_timer(...)</strong>
</dt>
<dd>
Create timer basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
timer init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
timer component
</ol>
</dd>
<dt>
<a name = "druid:new_progress"></a>
<strong>druid:new_progress(...)</strong>
</dt>
<dd>
Create progress basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
progress init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
progress component
</ol>
</dd>
<dt>
<a name = "druid:new_grid"></a>
<strong>druid:new_grid(...)</strong>
</dt>
<dd>
Create grid basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
grid init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
grid component
</ol>
</dd>
<dt>
<a name = "druid:new_scroll"></a>
<strong>druid:new_scroll(...)</strong>
</dt>
<dd>
Create scroll basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
scroll init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
scroll component
</ol>
</dd>
<dt>
<a name = "druid:new_slider"></a>
<strong>druid:new_slider(...)</strong>
</dt>
<dd>
Create slider basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
slider init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
slider component
</ol>
</dd>
<dt>
<a name = "druid:new_checkbox"></a>
<strong>druid:new_checkbox(...)</strong>
</dt>
<dd>
Create checkbox basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
checkbox init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
checkbox component
</ol>
</dd>
<dt>
<a name = "druid:new_input"></a>
<strong>druid:new_input(...)</strong>
</dt>
<dd>
Create input basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
input init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
input component
</ol>
</dd>
<dt>
<a name = "druid:new_checkbox_group"></a>
<strong>druid:new_checkbox_group(...)</strong>
</dt>
<dd>
Create checkbox_group basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
checkbox_group init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
checkbox_group component
</ol>
</dd>
<dt>
<a name = "druid:new_radio_group"></a>
<strong>druid:new_radio_group(...)</strong>
</dt>
<dd>
Create radio_group basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
radio_group init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
radio_group component
</ol>
</dd>
<dt>
<a name = "druid:new_swipe"></a>
<strong>druid:new_swipe(...)</strong>
</dt>
<dd>
Create swipe basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
swipe init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
swipe component
</ol>
</dd>
<dt>
<a name = "druid:new_drag"></a>
<strong>druid:new_drag(...)</strong>
</dt>
<dd>
Create drag basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
drag init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Componetn</span></span>
drag component
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,472 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Button">Button </a></li>
<li><a href="#Text">Text </a></li>
<li><a href="#Blocker">Blocker </a></li>
<li><a href="#Back_Handler">Back Handler </a></li>
<li><a href="#Lang_text">Lang text </a></li>
<li><a href="#Scroll">Scroll </a></li>
<li><a href="#Progress">Progress </a></li>
<li><a href="#Slider">Slider </a></li>
<li><a href="#Input">Input </a></li>
<li><a href="#Checkbox">Checkbox </a></li>
<li><a href="#Checkbox_group">Checkbox group </a></li>
<li><a href="#Radio_group">Radio group </a></li>
<li><a href="#Timer">Timer </a></li>
<li><a href="#Grid">Grid </a></li>
<li><a href="#Hover">Hover </a></li>
<li><a href="#Swipe">Swipe </a></li>
<li><a href="#Drag">Drag </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><strong>01-components</strong></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Druid components</h1>
<p><a name="Button"></a></p>
<h2>Button</h2>
<p><a href="https://insality.github.io/druid/modules/druid.button.html">Button API here</a></p>
<h3>Overview</h3>
<p>Basic Druid input component. Handle input on node and provide different callbacks on touch events.</p>
<h3>Setup</h3>
<p>Create button with druid: <code>button = druid:new_button(node_name, callback, [params], [animation_node])</code>
Where node name is name of node from GUI scene. You can use <code>node_name</code> as input trigger zone and point another node for animation via <code>animation_node</code></p>
<h3>Notes</h3>
<p>- Button callback have next params: (self, params, button_instance)</p>
<pre>
- **self** - Druid self context
- **params** - Additional params, specified on button creating
- **button_instance** - button itself
</pre>
<p>- You can set <em>params</em> on button callback on button creating: <code>druid:new_button(&quot;node_name&quot;, callback, params)</code>. This <em>params</em> will pass in callback as second argument
- Button have next events:</p>
<pre>
- **on_click** - basic button callback
- **on_repeated_click** - repeated click callback, <span class="keyword">while</span> holding the button, don<span class="string">'t trigger if callback is empty
- **on_long_click** - callback on long button tap, don'</span>t trigger <span class="keyword">if</span> callback is empty
- **on_hold_click** - hold callback, before long_click trigger, don<span class="string">'t trigger if callback is empty
- **on_double_click** - different callback, if tap button 2+ in row, don'</span>t trigger <span class="keyword">if</span> callback is empty
</pre>
<p>- Click event will not trigger, if between pressed and released state cursor was outside of node zone
- If button have double click event and it is triggered, usual callback will be not invoked
- If you have stencil on buttons and you don't want trigger them outside of stencil node, you can use <a href="../modules/druid.button.html#set_click_zone">button:set_click_zone</a> to restrict button click zone
- Button can have key trigger to use then by key: <a href="../modules/druid.button.html#set_key_trigger">button:set_key_trigger</a>
- Animation node can be used for example to animate small icon on big panel. Node name of trigger zone will be <code>big panel</code> and animation node will be <code>small icon</code></p>
<p><a name="Text"></a></p>
<h2>Text</h2>
<p><a href="https://insality.github.io/druid/modules/druid.text.html">Text API here</a></p>
<h3>Overview</h3>
<p>Basic Druid text component. Text components by default have the text size adjusting.</p>
<h3>Setup</h3>
<p>Create text node with druid: <code>text = druid:new_text(node_name, [initial_value], [is_disable_size_adjust])</code></p>
<h3>Notes</h3>
<p>- Text component by default have auto adjust text sizing. Text never will be bigger, than text node size, which you can setup in GUI scene. It can be disabled on component creating by settings argument <code>is_no_adjust</code> to <em>true</em></p>
<p><img src="../media/text_autosize.png" alt=""/></p>
<ul>
<li>Text pivot can be changed with <a href="../modules/druid.text.html#set_pivot">text:set_pivot</a>, and text will save their position inside their text size box:</li>
</ul>
<p><img src="../media/text_anchor.gif" alt=""/></p>
<p><a name="Blocker"></a></p>
<h2>Blocker</h2>
<p><a href="https://insality.github.io/druid/modules/druid.blocker.html">Blocker API here</a></p>
<h3>Overview</h3>
<p>Druid component for block input. Use it to block input in special zone.</p>
<h3>Setup</h3>
<p>Create blocker component with druid: <code>druid:new_blocker(node_name)</code></p>
<h3>Notes</h3>
<p>Explanation:
<img src="../media/blocker_scheme.png" alt=""/></p>
<p>Blue zone is <strong>button</strong> with close_window callback</p>
<p>Yellow zone is blocker with window content</p>
<p>So you can do the safe zones, when you have the big buttons</p>
<p><a name="Back_Handler"></a></p>
<h2>Back Handler</h2>
<p><a href="https://insality.github.io/druid/modules/druid.back_handler.html">Back handler API here</a></p>
<h3>Overview</h3>
<p>Component to handle back button. It handle Android back button and Backspace key. Key triggers in <code>input.binding</code> should be setup for correct working.</p>
<h3>Setup</h3>
<p>Setup callback with <code>druid:new_back_handler(callback)</code></p>
<h3>Notes</h3>
<p><a name="Lang_text"></a></p>
<h2>Lang text</h2>
<p><a href="https://insality.github.io/druid/modules/druid.lang_text.html">Lang text API here</a></p>
<h3>Overview</h3>
<p>Wrap on Text component to handle localization. It uses druid get<em>text</em>function to set text by it's id</p>
<h3>Setup</h3>
<p>Create lang text component with druid <code>text = druid:new_lang_text(node_name, locale_id)</code></p>
<h3>Notes</h3>
<p><a name="Scroll"></a></p>
<h2>Scroll</h2>
<p><a href="https://insality.github.io/druid/modules/druid.scroll.html">Scroll API here</a></p>
<h3>Overview</h3>
<p>Basic Druid scroll component. Handle all scrolling stuff in druid GUI</p>
<h3>Setup</h3>
<p>Create scroll component with druid: <code>scroll = druid:new_scroll(view_node, content_node)</code>.</p>
<p><em>View</em>node_ - is static part. It capturing user input and recognize scrolling touches</p>
<p><em>Content</em>node_ - is dynamic part. This node will change position by scroll system</p>
<p>Initial scroll size will be equal to <em>content</em>node_ node size. The initial view box will be equal to <em>view</em>node_ node size</p>
<p>Usually, Place <em>view</em>node_ and as children add <em>content</em>node_:
<img src="../media/scroll_scheme.png" alt=""/>
<img src="../media/scroll_outline.png" alt=""/></p>
<p>*Here content<em>node below view</em>node, in game content_node be able to scroll left until end*</p>
<h3>Notes</h3>
<p>- Scroll by default style have inertion and extra size for strecthing effect. It can be adjust via scroll <a href="https://insality.github.io/druid/modules/druid.scroll.html#Style">style settings</a>
- You can setup "points of interest". Scroll always will be centered on closes point of interest. It is able to create slider without inertion and points of interest on each scroll element.
- Scroll have next events:</p>
<pre>
- *on_scroll* (self, position) On scroll move callback
- *on_scroll_to* (self, position, is_instant) On scroll_to <span class="keyword">function</span> callback
- *on_point_scroll* (self, item_index, position) On scroll_to_index <span class="keyword">function</span> callback
</pre>
<p>- You can adjust scroll content size by <code>scroll:set_size(node_size)</code>. It will setup new size to <em>content node</em>
- You can enabled or disable inertion mode via <code>scroll:set_intert(state)</code>
- You can adjust extra stretch size via <a href="../modules/druid.scroll.html#set_extra_stretch_size">scroll:set_extra_stretch_size</a>
- Multitouch is required for scroll. Scroll is correctly handling touch_id swap while dragging scroll</p>
<p><a name="Progress"></a></p>
<h2>Progress</h2>
<p><a href="https://insality.github.io/druid/modules/druid.progress.html">Progress API here</a></p>
<h3>Overview</h3>
<p>Basic Druid progress bar component</p>
<h3>Setup</h3>
<p>Create progress bar component with druid: <code>progress = druid:new_progress(node_name, key, init_value)</code></p>
<p>Node name should have maximum node size, so in GUI scene, node_name should be fully filled.
Key is value from druid const: const.SIDE.X (or just "x") or const.SIDE.Y (or just "y")</p>
<h3>Notes</h3>
<p>- Progress correct working with 9slice nodes, it trying to set size by <em>set</em>size_ first, if it is not possible, it set up sizing via <em>set</em>scale_
- Progress bar can fill only by vertical or horizontal size. If you want make diagonal progress bar, just rotate node in GUI scene
- If you have glitchy or dark texture bug with progress bar, try to disable mipmaps in your texture profiles</p>
<p><a name="Slider"></a></p>
<h2>Slider</h2>
<p><a href="https://insality.github.io/druid/modules/druid.slider.html">Slider API here</a></p>
<h3>Overview</h3>
<p>Basic Druid slider component</p>
<h3>Setup</h3>
<p>Create slider component with druid: <code>slider = druid:new_slider(node_name, end_pos, callback)</code></p>
<p>Pin node (node_name in params) should be placed in zero position (initial). It will be available to mode Pin node between start pos and end pos. </p>
<h3>Notes</h3>
<p>- You can setup points of interests on slider via <a href="../modules/druid.slider.html#set_steps">slider:set_steps</a>. If steps are exist, slider values will be only from this steps (notched slider)
- For now, start pos and end pos should be on vertical or horizontal line (their x or y value should be equal)</p>
<p><a name="Input"></a></p>
<h2>Input</h2>
<p><a href="https://insality.github.io/druid/modules/druid.input.html">Input API here</a></p>
<h3>Overview</h3>
<p>Basic Druid text input component (unimplemented)</p>
<h3>Setup</h3>
<p>Create input component with druid: <code>input = druid:new_input(button_node_name, text_node_name, keyboard_type)</code></p>
<h3>Notes</h3>
<p>- Input component handle user text input. Input contains from button and text components. Button needed for selecting/unselecting input field
- Long click on input field for clear and select input field (clearing can be disable via styles)
- Click outside of button to unselect input field
- On focus lost (game minimized) input field will be unselected
- You can setup max length of the text
- You can setup allowed characters. On add not allowed characters <code>on_input_wrong</code> will be called. By default it cause simple shake animation
- The keyboard for input will not show on mobile HTML5. So input field in mobile HTML5 is not working now
- To make work different keyboard type, make sure value in game.project Android:InputMethod set to HidderInputField (https://defold.com/manuals/project-settings/#input-method)</p>
<p><a name="Checkbox"></a></p>
<h2>Checkbox</h2>
<p><a href="https://insality.github.io/druid/modules/druid.checkbox.html">Checkbox API here</a></p>
<h3>Overview</h3>
<p>Basic Druid checkbox component.</p>
<h3>Setup</h3>
<p>Create checkbox component with druid: <code>checkbox = druid:new_checkbox(node, callback)</code></p>
<h3>Notes</h3>
<p>- Checkbox uses button to handle click
- You can setup another node to handle input with click_node arg in component init: <code>druid:new_checkbox(node, callback, [click_node])</code></p>
<p><a name="Checkbox_group"></a></p>
<h2>Checkbox group</h2>
<p><a href="https://insality.github.io/druid/modules/druid.checkbox_group.html">Checkbox group API here</a></p>
<h3>Overview</h3>
<p>Several checkboxes in one group</p>
<h3>Setup</h3>
<p>Create checkbox_group component with druid: <code>group = druid:new_checkbox_group(nodes[], callback)</code></p>
<h3>Notes</h3>
<p>- Callback arguments: <code>function(self, checkbox_index)</code>. Index is equals in <em>nodes[]</em> array in component constructor
- You can get/set checkbox_group state with <code>group:set_state()</code> and <code>group:get_state()</code></p>
<p><a name="Radio_group"></a></p>
<h2>Radio group</h2>
<p><a href="https://insality.github.io/druid/modules/druid.radio_group.html">Radio group API here</a></p>
<h3>Overview</h3>
<p>Several checkboxes in one group with single choice</p>
<h3>Setup</h3>
<p>Create radio_group component with druid: <code>group = druid:new_radio_group(nodes[], callback)</code></p>
<h3>Notes</h3>
<p>- Callback arguments: <code>function(self, checkbox_index)</code>. Index is equals in <em>nodes[]</em> array in component constructor
- You can get/set radio_group state with <code>group:set_state()</code> and <code>group:get_state()</code>
- Only different from checkbox_group: on click another checkboxes in this group will be unchecked</p>
<p><a name="Timer"></a></p>
<h2>Timer</h2>
<p><a href="https://insality.github.io/druid/modules/druid.timer.html">Timer API here</a></p>
<h3>Overview</h3>
<p>Handle timer work on gui text node</p>
<h3>Setup</h3>
<p>Create timer component with druid: <code>timer = druid:new_timer(text_node, from_seconds, to_seconds, callback)</code></p>
<h3>Notes</h3>
<p>- Timer fires callback, when timer value equals to <em>to</em>seconds_
- Timer will setup text node with current timer value
- Timer uses update function to handle time</p>
<p><a name="Grid"></a></p>
<h2>Grid</h2>
<p><a href="https://insality.github.io/druid/modules/druid.grid.html">Grid API here</a></p>
<h3>Overview</h3>
<p>Component for manage node positions. Very simple implementation for nodes with equal size</p>
<h3>Setup</h3>
<p>Create component with druid: <code>grid = druid:new_grid(parent_node, prefab_node, max_in_row_elements)</code></p>
<h3>Notes</h3>
<p>- Grid on <em>adding elements</em> will setup parent to <em>parent</em>node_
- You can get array of position of every element for setup points of interest in scroll component
- You can get size of all elements for setup size in scroll component
- You can adjust anchor and border between elements
- <em>Prefab node</em> in component init used to get grid item size</p>
<p><a name="Hover"></a></p>
<h2>Hover</h2>
<p><a href="https://insality.github.io/druid/modules/druid.hover.html">Hover API here</a></p>
<h3>Overview</h3>
<p>System Druid component, handle hover node state.</p>
<h3>Setup</h3>
<p>Create hover component with druid: <code>hover = druid:new_hover(node, callback)</code></p>
<h3>Notes</h3>
<p>- By default, hover handles <em>hover event</em> with pressed touch action_id. So it's mean, what mouse or touch have to be pressed
- On desktop platforms there is <em>on</em>mouse<em>hover</em> event. It's event on mouse hover without any action id
- By default, assume what node is on not hovered state (both <em>hover</em> and <em>mouse</em>hover_)</p>
<p><a name="Swipe"></a></p>
<h2>Swipe</h2>
<p><a href="https://insality.github.io/druid/modules/druid.swipe.html">Swipe API here</a></p>
<h3>Overview</h3>
<p>System Druid component, handle swipe actions on node</p>
<h3>Setup</h3>
<p>Create swipe component with druid: <code>hover = druid:new_swipe(node, swipe_callback)</code></p>
<h3>Notes</h3>
<p>- Swipe callback have next params: (self, swipe_side, distance, time)</p>
<pre>
- **self** - Druid self context
- **swipe_side**: *<span class="global">string</span>* - values from [<span class="string">"up"</span>, <span class="string">"down"</span>, <span class="string">"left"</span>, <span class="string">"right"</span>]
- **distance**: *number* - <span class="keyword">in</span> pixels, distance of swipe
- **time**: *number* - <span class="keyword">in</span> seconds, time of swiping
</pre>
<p>- Swipe trigger only, if all input actions was on swipe node. If action will be outside of node, swipe status will be reseted
- In swipe style table you can adjust minimal distance and maximum time to trigg- Hover state trigger only with touch on mobile devices or button mouse holding. Just mouse over swipe
- In swipe style table you can toggle type of swipe triggering. if SWIPE<em>TRIGGER</em>ON_MOVE setup to true - swipe will trigger as swipe can be triggered. If setup to false - swipe will trigger only on released action
- If you have stencil on swipe node and you don't want trigger it outside of stencil node, you can use <a href="../modules/druid.swipe.html#set_click_zone">swipe:set_click_zone</a> to restrict swipe zonethout buttons is now not allowed.</p>
<p><a name="Drag"></a></p>
<h2>Drag</h2>
<p><a href="https://insality.github.io/druid/modules/druid.drag.html">Drag API here</a></p>
<h3>Overview</h3>
<p>System Druid component, handle drag actions on node</p>
<h3>Setup</h3>
<p>Create drag component with druid: <code>hover = druid:new_drag(node, drag_callback)</code></p>
<h3>Notes</h3>
<p>- Drag callback have next params: (self, swipe_side, distance, time)</p>
<pre>
- **self**: Druid self context
- **dx**: *number* - delta x position
- **dy**: *number* - delta y position
</pre>
<p>- In styles, you can point the drag start deadzone. Default value is 10 pixels
- Drag correctly process multitouch. You can switch touch_id, while dragging on node with correct <em>dx</em> and <em>dy</em> values (made for correct scrolling)
- You can restrict horizontal or vertical dragging by setting <code>drag.can_x</code> or <code>drag.can_y</code> to <em>false</em> value
- You can get info about current drag state:</p>
<pre>
- _is_touch_ - Is currently node touching
- _is_drag_ - Is currently node is dragging
- _x_ <span class="keyword">and</span> _y_ - Current touch position
- _touch_start_pos_ - Touch stat positions
</pre>
<p>- Drag have next events:</p>
<pre>
- _on_touch_start_ (self) - Event on touch start
- _on_touch_end_ (self) - Event on touch <span class="keyword">end</span>
- _on_drag_start_ (self) - Event on drag start
- _on_drag_ (self, dx, dy) - Event on drag process
- _on_drag_end_ (self) - Event on drag <span class="keyword">end</span>
</pre>
<p>- Drag node zone can be restricted via <code>drag:set_click_zone(node)</code></p>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,252 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Overview">Overview </a></li>
<li><a href="#Custom_components">Custom components </a></li>
<li><a href="#Best_practice_on_custom_components">Best practice on custom components </a></li>
<li><a href="#Power_of_using_templates">Power of using templates </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><strong>Creating custom components</strong></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Creating custom components</h1>
<p><a name="Overview"></a></p>
<h2>Overview</h2>
<p>Druid allows you to create your custom components from druid basic components or other custom components.</p>
<p>Every component is the children of Basic Druid component. Read the [basic component API here].(https://insality.github.io/druid/modules/component.html), Methods of basic components you can call via self:{method_name}</p>
<p><a name="Custom_components"></a></p>
<h2>Custom components</h2>
<p>Basic custom component template looks like this:</p>
<pre>
<span class="keyword">local</span> const = <span class="global">require</span>(<span class="string">"druid.const"</span>)
<span class="keyword">local</span> component = <span class="global">require</span>(<span class="string">"druid.component"</span>)
<span class="keyword">local</span> M = component.create(<span class="string">"my_component"</span>)
<span class="comment">-- Component constructor
</span><span class="keyword">function</span> M.init(self, ...)
<span class="keyword">end</span>
<span class="comment">-- Call only if exist interest: const.ON_UPDATE
</span><span class="keyword">function</span> M.update(self, dt)
<span class="keyword">end</span>
<span class="comment">-- Call only if exist interest: const.ON_INPUT or const.ON_INPUT_HIGH
</span><span class="keyword">function</span> M.on_input(self, action_id, action)
<span class="keyword">end</span>
<span class="comment">-- Call on component creation and on component:set_style() function
</span><span class="keyword">function</span> M.on_style_change(self, style)
<span class="keyword">end</span>
<span class="comment">-- Call only if exist interest: const.ON_MESSAGE
</span><span class="keyword">function</span> M.on_message(self, message_id, message, sender)
<span class="keyword">end</span>
<span class="comment">-- Call only if component with ON_ANGUAGECHANinterest
</span><span class="keyword">function</span> M.on_anguagechanself)
<span class="keyword">end</span>
<span class="comment">-- Call only if component with ON_LAYOUT_CHANGE interest
</span><span class="keyword">function</span> M.on_layout_change(self)
<span class="keyword">end</span>
<span class="comment">-- Call, if input was capturing before this component
</span><span class="comment">-- Example: scroll is start scrolling, so you need unhover button
</span><span class="keyword">function</span> M.on_input_interrupt(self)
<span class="keyword">end</span>
<span class="comment">-- Call, if game lost focus. Need ON_FOCUS_LOST intereset
</span><span class="keyword">function</span> M.on_focus_lost(self)
<span class="keyword">end</span>
<span class="comment">-- Call, if game gained focus. Need ON_FOCUS_GAINED intereset
</span><span class="keyword">function</span> M.on_focus_gained(self)
<span class="keyword">end</span>
<span class="comment">-- Call on component remove or on druid:final
</span><span class="keyword">function</span> M.on_remove(self)
<span class="keyword">end</span>
<span class="keyword">return</span> M
</pre>
<p>Add your custom component to druid via <a href="../modules/druid.html#register">druid.register</a></p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_component = <span class="global">require</span>(<span class="string">"my.amazing.component"</span>)
<span class="keyword">function</span> init(self)
druid.register(<span class="string">"my_component"</span>, my_component)
<span class="keyword">end</span>
</pre>
<p>Registering make new function with "new<em>{component</em>name}". In our example it will be: <code>druid:new_my_component()</code>.</p>
<p>Or you can create component without registering with <code>druid:create(my_component_module)</code></p>
<p>As component registered, you can create your component with next code:</p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_component = <span class="global">require</span>(<span class="string">"my.amazing.component"</span>)
<span class="keyword">function</span> init(self)
self.druid = druid.new(self)
<span class="keyword">local</span> my_component = self.druid:new_my_component(...)
<span class="comment">-- or --
</span> <span class="keyword">local</span> my_component = self.druid:create(my_component, ...)
<span class="keyword">end</span>
</pre>
<h3>Interest</h3>
<p>Interest - is a way to indicate what events your component will respond to.
There is next interests in druid:
- <strong>ON_MESSAGE</strong> - component will receive messages from on_message</p>
<ul>
<li><p><strong>ON_UPDATE</strong> - component will be updated from update</p></li>
<li><p><strong>ON<em>INPUT</em>HIGH</strong> - component will receive input from on<em>input, before other components with ON</em>INPUT</p></li>
<li><p><strong>ON_INPUT</strong> - component will receive input from on<em>input, after other components with ON</em>INPUT_HIGH</p></li>
<li><p><strong>ON<em>LANGUAGE</em>CHANGE</strong> - will call <em>on</em>language<em>change</em> function on language change trigger</p></li>
<li><p><strong>ON<em>LAYOUT</em>CHANGE</strong> will call <em>on</em>layout<em>change</em> function on layout change trigger</p></li>
<li><p><strong>ON<em>FOCUS</em>LOST</strong> will call <em>on</em>focust<em>lost</em> function in on focus lost event. You need to pass window_callback to global <a href="../modules/druid.html#on_window_callback">druid:on_window_callback</a></p></li>
<li><p><strong>ON<em>FOCUS</em>GAINED</strong> will call <em>on</em>focust<em>gained</em> function in on focus gained event. You need to pass window_callback to global <a href="../modules/druid.html#on_window_callback">druid:on_window_callback</a></p></li>
</ul>
<p><a name="Best_practice_on_custom_components"></a></p>
<h2>Best practice on custom components</h2>
<p>On each component recommended describe component scheme in next way:</p>
<pre>
<span class="comment">-- Component module
</span><span class="keyword">local</span> component = <span class="global">require</span>(<span class="string">"druid.component"</span>)
<span class="keyword">local</span> M = component.create(<span class="string">"your_component"</span>)
<span class="keyword">local</span> SCHEME = {
ROOT = <span class="string">"root"</span>,
ITEM = <span class="string">"item"</span>,
TITLE = <span class="string">"title"</span>
}
<span class="keyword">function</span> M.init(self, template_name, node_table)
<span class="comment">-- If component use template, setup it:
</span> self:set_template(template_name)
<span class="comment">-- If component was cloned with gui.clone_tree, pass his nodes
</span> self:set_nodes(node_table)
<span class="comment">-- helper can get node from gui/template/table
</span> <span class="keyword">local</span> root = self:get_node(SCHEME.ROOT)
<span class="comment">-- This component can spawn another druid components:
</span> <span class="keyword">local</span> druid = self:get_druid()
<span class="comment">-- Button self on callback is self of _this_ component
</span> <span class="keyword">local</span> button = druid:new_button(...)
<span class="keyword">end</span>
</pre>
<p><a name="Power_of_using_templates"></a></p>
<h2>Power of using templates</h2>
<p>You can use one component, but creating and customizing templates for them. Templates only requires to match the component scheme.</p>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,162 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Overview">Overview </a></li>
<li><a href="#Usage">Usage </a></li>
<li><a href="#Create_your_own_styles">Create your own styles </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><strong>Styles</strong></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Styles</h1>
<p><a name="Overview"></a></p>
<h2>Overview</h2>
<p>Styles - set of functions and parameters for components to customize their behavior.</p>
<p>Styles is a table, where key is name of component, and value is style table for this component.</p>
<p>In component API documentation, you can find the style API for this component. Or just lookup for existing styles and modify them.</p>
<p><a name="Usage"></a></p>
<h2>Usage</h2>
<p>Setup default druid style for all druid instances via <a href="../modules/druid.html#set_default_style">druid.set_default_style</a>
You can pass <em>nil</em> or <em>empty</em>table_ to use default values for all components (no styles)</p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_style = <span class="global">require</span>(<span class="string">"my.amazing.style"</span>)
<span class="keyword">local</span> <span class="keyword">function</span> init(self)
druid.set_default_style(my_style)
<span class="keyword">end</span>
</pre>
<p>Setup custom style to specific druid instance:</p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_style = <span class="global">require</span>(<span class="string">"my.amazing.style"</span>)
<span class="keyword">local</span> <span class="keyword">function</span> init(self)
<span class="comment">-- This druid instance will be use my_style as default
</span> self.druid = druid.new(self, my_style)
<span class="keyword">end</span>
</pre>
<p>Change component style with <em>set</em>style_ function</p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_style = <span class="global">require</span>(<span class="string">"my.amazing.style"</span>)
<span class="keyword">local</span> <span class="keyword">function</span> init(self)
self.druid = druid.new(self)
self.button = self.druid:new_button(self, <span class="string">"node"</span>)
<span class="comment">-- Setup custom style for specific component
</span> self.button:set_style(my_style)
<span class="keyword">end</span>
</pre>
<p><a name="Create_your_own_styles"></a></p>
<h2>Create your own styles</h2>
<p>The most components have their styles. You can explore it on <a href="https://insality.github.io/druid/">Druid API</a> in table style section (<a href="https://insality.github.io/druid/modules/druid.button.html#Style">button example</a>). Or you can see, what fields component uses in code in function <code>on_style_change</code></p>
<p>To create you style, create lua module, what return &lt;<em>component</em>name_, <em>component</em>style_> table</p>
<p>Example: <a href="https://github.com/Insality/druid/blob/develop/druid/styles/default/style.lua">default druid style</a></p>
<p>Override all fields you want and set your style with one of next ways:</p>
<ul>
<li>Set your style as global via <a href="../modules/druid.html#set_default_style">druid.set_default_style</a></li>
<li>Set style for concrete druid instance via <code>druid = druid.new(self, style)</code></li>
<li>Set style for concrete instance via <code>component:set_style(style)</code></li>
</ul>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More