
Druid 0.6.0: Release Defold Druid v0.6.0 · Insality/druid · GitHub
Hey! Are you tired from Druid updates? (It’s a joke)
Finally, got a time to release component to process huge amount of data. So introducing: DataList component. It can help solve your problem with GUI nodes limit reached
and helps with scroll optimization. Give feedback about it!
The next important stuff is EmmyLua docs. I’m implemented EmmyLua doc generator from LuaDoc and Protofiles, so now you can use EmmyLua annotations inside your IDE instead of website API looking or source code scanning.
Also the Druid examples is reworked, so each example will be in separate collection. Now it’s become a much easier to learn Druid via examples. A lot of stuff in progress now, but you already can see on it!
Input priority got reworked too. Now instead of two input stacks: usual and high, Druid use simple input priority value.
And I should note here are several breaking changes, take a look in changelogs.
Wanna something more? Add an issues!
Have a good day.
Changelog 0.6.0
- #43 Add DataList Druid extended component. Component used to manage huge amount of data to make stuff like infinity scroll.
- This versions is first basic implementation. But it should be enough for almost all basic stuff.
- Create Data List with
druid:new_data_list(scroll, grid, create_function)
.- scroll - already created Scroll component
- grid - already created StaticGrid or DynamicGrid component
- create_function - your function to create node instances. This callback have next parameters:
fun(self, data, index, data_list)
- self - Script/Druid context
- data- your element data
- index - element index
- data_list - current DataList component
- Create function should return root node and optionaly, Druid component. It’s required to manage create/remove lifecycle
- Set data with
data_list:set_data({...})
- In current version there is no
add/remove
functions
- Add EmmyLua annotations (ta-daaa). See how to use it FAQ!
- Add context argument to Druid Event. You can pass this argument to forward it first in your callbacks (for example - object context)
- Add SHIFT_POLICY for Static and Dynamic Grids. It mean how nodes will be shifted if you append data between nodes. There are
const.SHIFT.RIGHT
,const.SHIFT.LEFT
andconst.SHIFT.NO_SHIFT
.- [BREAKING] Please check your
StaticGrid:remove
andDynamicGrid:remove
functions
- [BREAKING] Please check your
- #102 [BREAKING] Removed
component:increase_input_priority
component function. Usecomponent:set_input_priority
function instead. The bigger priority value processed first. The value 10 is default for Druid components, the 100 value is maximum priority for acquire input in drag and input components- Add constants for priorities: const.PRIORITY_INPUT, const.PRIORITY_INPUT_HIGH, const.PRIORITY_INPUT_MAX.
- [BREAKING] If you use in you custom components interest:
component.ON_INPUT_HIGH
you should replace it withcomponent.ON_INPUT
and addconst.PRIORITY_INPUT_HIGH
as third param. For example:
before:
after:local Drag = component.create("drag", { component.ON_INPUT_HIGH })
local Drag = component.create("drag", { component.ON_INPUT }, const.PRIORITY_INPUT_HIGH)
- Lang text now can be initialized without default locale id
- Input component: rename field selected to is_selected (according to the docs)
- #92 Setup repo for CI and unit tests. (Yea, successful build and tests badges!)
- #86 Fix a lot of event triggers on scroll inertia moving
- #101 Fix scroll to other node instead of swipe direction with scroll’s points of interest (without inert settings)
- #103 Add
helper.centate_nodes
function. It can horizontal align several Box and Text nodes - #105 Add
Input:select
andInput:unselect
function. - #106 Add
Input.style.IS_UNSELECT_ON_RESELECT
style param. If true, it will be unselect input on click on input box, not only on outside click. - #108 Add component interests const to
component.lua
- #116 You can pass Text component in Input component instead of text node
- #117 Move each Druid example in separate collection. It’s a lot of easier now to learn via examples, check it!
- Examples in progress, so a lot of stuff are locked now, stay tuned!
- #118 Druid.scroll freezes if held in one place for a long time
- #123 Add scroll for Scroll component via mouse wheel or touchpad:
- Added Scroll style params:
WHEEL_SCROLL_SPEED
,WHEEL_SCROLL_INVERTED
- Mouse scroll working when cursor is hover on scroll view node
- Vertical scroll have more priority than horizontal
- Fix: When Hover component node became disabled, reset hover state (throw on_hover and on_mouse_hover events)
- By default mouse scroll is disabled
- This is basic implementation, it is work not perfect
- Added Scroll style params:
- #124 Add
Scroll:set_click_zone
function. This is just link toDrag:set_click_zone
function inside scroll component. - #127 The
druid:create
is deprecated. Usedruid:new
for creating custom components