mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Update annotations
This commit is contained in:
@@ -171,7 +171,6 @@ end
|
||||
|
||||
|
||||
--- The Scroll constructor
|
||||
---@param self Scroll Scroll
|
||||
---@param view_node string|node GUI view scroll node
|
||||
---@param content_node string|node GUI content scroll node
|
||||
function M:init(view_node, content_node)
|
||||
@@ -253,7 +252,6 @@ end
|
||||
|
||||
|
||||
--- Start scroll to target point.
|
||||
---@param self Scroll Scroll
|
||||
---@param point vector3 Target point
|
||||
---@param is_instant boolean|nil Instant scroll flag
|
||||
-- @usage scroll:scroll_to(vmath.vector3(0, 50, 0))
|
||||
@@ -287,7 +285,6 @@ end
|
||||
|
||||
|
||||
--- Scroll to item in scroll by point index.
|
||||
---@param self Scroll Scroll
|
||||
---@param index number Point index
|
||||
---@param skip_cb boolean|nil If true, skip the point callback
|
||||
function M:scroll_to_index(index, skip_cb)
|
||||
@@ -310,7 +307,6 @@ end
|
||||
|
||||
|
||||
--- Start scroll to target scroll percent
|
||||
---@param self Scroll Scroll
|
||||
---@param percent vector3 target percent
|
||||
---@param is_instant boolean|nil instant scroll flag
|
||||
-- @usage scroll:scroll_to_percent(vmath.vector3(0.5, 0, 0))
|
||||
@@ -336,7 +332,6 @@ end
|
||||
|
||||
--- Return current scroll progress status.
|
||||
-- Values will be in [0..1] interval
|
||||
---@param self Scroll Scroll
|
||||
---@return vector3 New vector with scroll progress values
|
||||
function M:get_percent()
|
||||
local x_perc = 1 - inverse_lerp(self.available_pos.x, self.available_pos.z, self.position.x)
|
||||
@@ -348,7 +343,6 @@ end
|
||||
|
||||
--- Set scroll content size.
|
||||
-- It will change content gui node size
|
||||
---@param self Scroll Scroll
|
||||
---@param size vector3 The new size for content node
|
||||
---@param offset vector3|nil Offset value to set, where content is starts
|
||||
---@return druid.scroll Current scroll instance
|
||||
@@ -364,7 +358,6 @@ end
|
||||
|
||||
|
||||
--- Set new scroll view size in case the node size was changed.
|
||||
---@param self Scroll Scroll
|
||||
---@param size vector3 The new size for view node
|
||||
---@return druid.scroll Current scroll instance
|
||||
function M:set_view_size(size)
|
||||
@@ -378,7 +371,6 @@ end
|
||||
|
||||
|
||||
--- Refresh scroll view size
|
||||
---@param self Scroll Scroll
|
||||
function M:update_view_size()
|
||||
self.view_size = helper.get_scaled_size(self.view_node)
|
||||
self.view_border = helper.get_border(self.view_node)
|
||||
@@ -391,7 +383,6 @@ end
|
||||
--- Enable or disable scroll inert.
|
||||
-- If disabled, scroll through points (if exist)
|
||||
-- If no points, just simple drag without inertion
|
||||
---@param self Scroll Scroll
|
||||
---@param state boolean|nil Inert scroll state
|
||||
---@return druid.scroll Current scroll instance
|
||||
function M:set_inert(state)
|
||||
@@ -402,7 +393,6 @@ end
|
||||
|
||||
|
||||
--- Return if scroll have inertion.
|
||||
---@param self Scroll Scroll
|
||||
---@return boolean @If scroll have inertion
|
||||
function M:is_inert()
|
||||
return self._is_inert
|
||||
@@ -411,7 +401,6 @@ end
|
||||
|
||||
--- Set extra size for scroll stretching.
|
||||
-- Set 0 to disable stretching effect
|
||||
---@param self Scroll Scroll
|
||||
---@param stretch_size number|nil Size in pixels of additional scroll area
|
||||
---@return druid.scroll Current scroll instance
|
||||
function M:set_extra_stretch_size(stretch_size)
|
||||
@@ -423,7 +412,6 @@ end
|
||||
|
||||
|
||||
--- Return vector of scroll size with width and height.
|
||||
---@param self Scroll Scroll
|
||||
---@return vector3 Available scroll size
|
||||
function M:get_scroll_size()
|
||||
return self.available_size
|
||||
@@ -432,7 +420,6 @@ end
|
||||
|
||||
--- Set points of interest.
|
||||
-- Scroll will always centered on closer points
|
||||
---@param self Scroll Scroll
|
||||
---@param points table Array of vector3 points
|
||||
---@return druid.scroll Current scroll instance
|
||||
function M:set_points(points)
|
||||
@@ -449,7 +436,6 @@ end
|
||||
|
||||
|
||||
--- Lock or unlock horizontal scroll
|
||||
---@param self Scroll Scroll
|
||||
---@param state boolean|nil True, if horizontal scroll is enabled
|
||||
---@return druid.scroll Current scroll instance
|
||||
function M:set_horizontal_scroll(state)
|
||||
@@ -460,7 +446,6 @@ end
|
||||
|
||||
|
||||
--- Lock or unlock vertical scroll
|
||||
---@param self Scroll Scroll
|
||||
---@param state boolean|nil True, if vertical scroll is enabled
|
||||
---@return druid.scroll Current scroll instance
|
||||
function M:set_vertical_scroll(state)
|
||||
@@ -472,7 +457,6 @@ end
|
||||
|
||||
--- Check node if it visible now on scroll.
|
||||
-- Extra border is not affected. Return true for elements in extra scroll zone
|
||||
---@param self Scroll Scroll
|
||||
---@param node node The node to check
|
||||
---@return boolean True if node in visible scroll area
|
||||
function M:is_node_in_view(node)
|
||||
@@ -513,8 +497,7 @@ end
|
||||
|
||||
--- Bind the grid component (Static or Dynamic) to recalculate
|
||||
-- scroll size on grid changes
|
||||
---@param self Scroll Scroll
|
||||
---@param grid StaticGrid Druid grid component
|
||||
---@param grid druid.grid Druid grid component
|
||||
---@return druid.scroll Current scroll instance
|
||||
function M:bind_grid(grid)
|
||||
if self._grid_on_change then
|
||||
@@ -542,7 +525,6 @@ end
|
||||
|
||||
--- Strict drag scroll area. Useful for
|
||||
-- restrict events outside stencil node
|
||||
---@param self Drag
|
||||
---@param node node|string Gui node
|
||||
function M:set_click_zone(node)
|
||||
self.drag:set_click_zone(node)
|
||||
|
Reference in New Issue
Block a user