Update docs, changelogs, example. Prepare to 0.6.0 release

This commit is contained in:
Insality
2021-04-06 00:03:55 +03:00
parent 015564f5b3
commit 9ff97b98ea
62 changed files with 2597 additions and 3418 deletions

View File

@@ -9,6 +9,7 @@
--- Params to back callback
-- @tfield any params
---
local Event = require("druid.event")
local const = require("druid.const")

View File

@@ -6,6 +6,7 @@
---Trigger node
-- @tfield node node
---
local const = require("druid.const")
local component = require("druid.component")

View File

@@ -45,6 +45,7 @@
---Restriction zone
-- @tfield[opt] node click_zone
---
local Event = require("druid.event")
local const = require("druid.const")

View File

@@ -42,6 +42,7 @@
--- Touch start position
-- @tfield vector3 touch_start_pos
---
local Event = require("druid.event")
local const = require("druid.const")

View File

@@ -9,6 +9,7 @@
--- On mouse hover callback(self, state)
-- @tfield druid_event on_mouse_hover
---
local Event = require("druid.event")
local const = require("druid.const")

View File

@@ -52,6 +52,7 @@
--- Flag, if scroll now animating by gui.animate
-- @tfield bool is_animate
---
local Event = require("druid.event")
local const = require("druid.const")
@@ -384,8 +385,8 @@ end
--- Check node if it visible now on scroll.
-- Extra border is not affected. Return true for elements in extra scroll zone
-- @tparam Scroll self
-- @tparma node node The node to check
-- @treturn boolean True, if node in visible scroll area
-- @tparam node node The node to check
-- @treturn boolean True if node in visible scroll area
function Scroll.is_node_in_view(self, node)
local node_border = helper.get_border(node, gui.get_position(node))
local view_border = helper.get_border(self.view_node, -(self.position - self._outside_offset_vector))

View File

@@ -40,6 +40,7 @@
--- The size of item content
-- @tfield vector4 border
---
local const = require("druid.const")
local Event = require("druid.event")

View File

@@ -14,6 +14,7 @@
--- Trigger on swipe event(self, swipe_side, dist, delta_time
-- @tfield druid_event on_swipe)
---
local Event = require("druid.event")
local const = require("druid.const")

View File

@@ -38,6 +38,7 @@
--- Current text color
-- @tfield vector3 color
---
local Event = require("druid.event")
local const = require("druid.const")

View File

@@ -15,6 +15,7 @@
--- Button component from click_node
-- @tfield Button button
---
local Event = require("druid.event")
local component = require("druid.component")

View File

@@ -9,6 +9,7 @@
--- Array of checkbox components
-- @tfield table checkboxes
---
local Event = require("druid.event")
local component = require("druid.component")

View File

@@ -6,10 +6,10 @@
--- The Druid scroll component
-- @tfield Scroll scroll
-- @tfield druid.scroll scroll
--- The Druid Grid component
-- @tfield StaticGrid grid
-- @tfield druid.static_grid grid
--- The current visual top data index
-- @tfield number top_index
@@ -17,9 +17,13 @@
--- The current visual last data index
-- @tfield number last_index
--- The current progress of scroll posititon (approx.)
--- The current progress of scroll posititon
-- @tfield number scroll_progress
--- Event triggered when scroll progress is changed; event(self, progress_value)
-- @tfield druid_event on_scroll_progress_change
---
local const = require("druid.const")
local helper = require("druid.helper")
@@ -31,8 +35,8 @@ local DataList = component.create("data_list")
--- Data list constructor
-- @tparam DataList self
-- @tparam druid.scroll The Scroll instance for Data List component
-- @tparam druid.grid The Grid instance for Data List component
-- @tparam druid.scroll scroll The Scroll instance for Data List component
-- @tparam druid.grid grid The Grid instance for Data List component
-- @tparam function create_function The create function callback(self, data, index, data_list). Function should return (node, [component])
function DataList.init(self, scroll, grid, create_function)
self.druid = self:get_druid()
@@ -40,7 +44,7 @@ function DataList.init(self, scroll, grid, create_function)
self.grid = grid
self.scroll:bind_grid(grid)
--- Current visual elements indexes
-- Current visual elements indexes
self.top_index = 1
self.last_index = 1
self.scroll_progress = 0

View File

@@ -36,6 +36,7 @@
--- The size of item content
-- @tfield vector4 border
---
local const = require("druid.const")
local Event = require("druid.event")
@@ -177,7 +178,6 @@ end
--- Remove the item from the grid. Note that gui node will be not deleted
-- @tparam DynamicGrid self
-- @tparam number index The grid node index to remove
-- @tparam[opt=false] bool is_shift_left If true, shift all nodes to the left, otherwise shift nodes to the right
-- @tparam[opt=SHIFT.RIGHT] number shift_policy How shift nodes, if required. See const.SHIFT
-- @treturn Node The deleted gui node from grid
function DynamicGrid.remove(self, index, shift_policy)

View File

@@ -44,6 +44,7 @@
--- Gui keyboard type for input field
-- @tfield number keyboard_type
---
local Event = require("druid.event")
local const = require("druid.const")

View File

@@ -10,6 +10,7 @@
--- The text component
-- @tfield Text text
---
local Event = require("druid.event")
local settings = require("druid.system.settings")

View File

@@ -25,6 +25,7 @@
--- Progress bar slice9 settings
-- @tfield vector4 slice
---
local Event = require("druid.event")
local const = require("druid.const")

View File

@@ -9,6 +9,7 @@
--- Array of checkbox components
-- @tfield Checkbox[] checkboxes
---
local Event = require("druid.event")
local component = require("druid.component")

View File

@@ -30,6 +30,7 @@
--- Current slider value
-- @tfield number value
---
local Event = require("druid.event")

View File

@@ -26,6 +26,7 @@
--- Current timer value
-- @tfield number value
---
local Event = require("druid.event")
local formats = require("druid.helper.formats")

View File

@@ -65,7 +65,7 @@ M["scroll"] = {
INERT_SPEED = 30, -- koef. of inert speed
EXTRA_STRETCH_SIZE = 100, -- extra size in pixels outside of scroll (stretch effect)
POINTS_DEADZONE = 20, -- Speed to check points of interests in no_inertion mode
WHEEL_SCROLL_SPEED = 20,
WHEEL_SCROLL_SPEED = 0,
WHEEL_SCROLL_INVERTED = false,
SMALL_CONTENT_SCROLL = true, -- If true, content node with size less than view node size can be scrolled
}

View File

@@ -26,6 +26,7 @@
-- @see RadioGroup
-- @see Swipe
-- @see Drag
-- @see DataList
-- @see Hover
local helper = require("druid.helper")
@@ -562,10 +563,13 @@ end
--- Create data list basic component
-- @function druid:new_data_list
-- @tparam args ... drag init args
-- @treturn Component data list component
function DruidInstance.new_data_list(self, ...)
return DruidInstance.new(self, data_list, ...)
-- @tparam druid.scroll druid_scroll The Scroll instance for Data List component
-- @tparam druid.grid druid_grid The Grid instance for Data List component
-- @tparam function create_function The create function callback(self, data, index, data_list). Function should return (node, [component])
-- @treturn DataList data_list component
function DruidInstance.new_data_list(self, druid_scroll, druid_grid, create_function)
-- return helper.extended_component("data_list")
return DruidInstance.new(self, data_list, druid_scroll, druid_grid, create_function)
end