Annotations update [2]

This commit is contained in:
Insality
2023-10-17 22:00:43 +03:00
parent 86b92f90a7
commit 50c9b6bad5
50 changed files with 327 additions and 2238 deletions

View File

@@ -46,7 +46,7 @@ local BackHandler = component.create("back_handler")
--- The @{BackHandler} constructor
-- @tparam BackHandler self @{BackHandler}
-- @tparam function callback @The callback(self, custom_args) to call on back event
-- @tparam[opt] any custom_args Button events custom arguments
-- @tparam any|nil custom_args Button events custom arguments
-- @local
function BackHandler.init(self, callback, custom_args)
self.params = custom_args

View File

@@ -71,7 +71,7 @@ end
--
-- Don't change node enabled state itself.
-- @tparam Blocker self @{Blocker}
-- @tparam boolean state Enabled state
-- @tparam boolean|nil state Enabled state
function Blocker.set_enabled(self, state)
self._is_enabled = state
end

View File

@@ -282,10 +282,10 @@ end
--- The @{Button} constructor
-- @tparam Button self @{Button}
-- @tparam string|node node Node name or GUI Node itself
-- @tparam string|node node The node_id or gui.get_node(node_id)
-- @tparam function callback On click button callback
-- @tparam[opt] any custom_args Button events custom arguments
-- @tparam[opt] string|node anim_node Node to animate instead of trigger node.
-- @tparam any|nil custom_args Button events custom arguments
-- @tparam string|node|nil anim_node Node to animate instead of trigger node.
function Button.init(self, node, callback, custom_args, anim_node)
self.druid = self:get_druid()
self.node = self:get_node(node)
@@ -447,7 +447,7 @@ end
-- The style.on_set_enabled will be triggered.
-- Disabled button is not clickable.
-- @tparam Button self @{Button}
-- @tparam boolean state Enabled state
-- @tparam boolean|nil state Enabled state
-- @treturn Button Current button instance
-- @usage
-- button:set_enabled(false)
@@ -515,8 +515,8 @@ end
--- Set function for additional check for button click availability
-- @tparam Button self
-- @tparam[opt] function check_function Should return true or false. If true - button can be pressed.
-- @tparam[opt] function failure_callback Function will be called on button click, if check function return false
-- @tparam function|nil check_function Should return true or false. If true - button can be pressed.
-- @tparam function|nil failure_callback Function will be called on button click, if check function return false
-- @treturn Button Current button instance
function Button.set_check_function(self, check_function, failure_callback)
self._check_function = check_function
@@ -531,7 +531,7 @@ end
--
-- If the game is not HTML, html mode will be not enabled
-- @tparam Button self
-- @tparam[opt] boolean is_web_mode If true - button will be called inside html5 callback
-- @tparam boolean|nil is_web_mode If true - button will be called inside html5 callback
-- @treturn Button Current button instance
-- @usage
-- button:set_web_user_interaction(true)

View File

@@ -313,7 +313,7 @@ end
--- Set Drag input enabled or disabled
-- @tparam Drag self @{Drag}
-- @tparam boolean is_enabled
-- @tparam boolean|nil is_enabled
function Drag.set_enabled(self, is_enabled)
self._is_enabled = is_enabled
end

View File

@@ -89,7 +89,7 @@ end
--- Set hover state
-- @tparam Hover self @{Hover}
-- @tparam boolean state The hover state
-- @tparam boolean|nil state The hover state
function Hover.set_hover(self, state)
if self._is_hovered ~= state then
self._is_hovered = state
@@ -108,7 +108,7 @@ end
--- Set mouse hover state
-- @tparam Hover self @{Hover}
-- @tparam boolean state The mouse hover state
-- @tparam boolean|nil state The mouse hover state
function Hover.set_mouse_hover(self, state)
if self._is_mouse_hovered ~= state then
self._is_mouse_hovered = state
@@ -138,7 +138,7 @@ end
-- If hover is not enabled, it will not generate
-- any hover events
-- @tparam Hover self @{Hover}
-- @tparam boolean state The hover enabled state
-- @tparam boolean|nil state The hover enabled state
function Hover.set_enabled(self, state)
self._is_enabled = state

View File

@@ -234,7 +234,7 @@ end
--- Start scroll to target point.
-- @tparam Scroll self @{Scroll}
-- @tparam vector3 point Target point
-- @tparam[opt] boolean is_instant Instant scroll flag
-- @tparam boolean|nil is_instant Instant scroll flag
-- @usage scroll:scroll_to(vmath.vector3(0, 50, 0))
-- @usage scroll:scroll_to(vmath.vector3(0), true)
function Scroll.scroll_to(self, point, is_instant)
@@ -268,7 +268,7 @@ end
--- Scroll to item in scroll by point index.
-- @tparam Scroll self @{Scroll}
-- @tparam number index Point index
-- @tparam[opt] boolean skip_cb If true, skip the point callback
-- @tparam boolean|nil skip_cb If true, skip the point callback
function Scroll.scroll_to_index(self, index, skip_cb)
if not self.points then
return
@@ -291,7 +291,7 @@ end
--- Start scroll to target scroll percent
-- @tparam Scroll self @{Scroll}
-- @tparam vector3 percent target percent
-- @tparam[opt] boolean is_instant instant scroll flag
-- @tparam boolean|nil is_instant instant scroll flag
-- @usage scroll:scroll_to_percent(vmath.vector3(0.5, 0, 0))
function Scroll.scroll_to_percent(self, percent, is_instant)
local border = self.available_pos
@@ -339,7 +339,7 @@ end
-- If disabled, scroll through points (if exist)
-- If no points, just simple drag without inertion
-- @tparam Scroll self @{Scroll}
-- @tparam boolean state Inert scroll state
-- @tparam boolean|nil state Inert scroll state
-- @treturn druid.scroll Current scroll instance
function Scroll.set_inert(self, state)
self._is_inert = state
@@ -397,7 +397,7 @@ end
--- Lock or unlock horizontal scroll
-- @tparam Scroll self @{Scroll}
-- @tparam boolean state True, if horizontal scroll is enabled
-- @tparam boolean|nil state True, if horizontal scroll is enabled
-- @treturn druid.scroll Current scroll instance
function Scroll.set_horizontal_scroll(self, state)
self._is_horizontal_scroll = state
@@ -408,7 +408,7 @@ end
--- Lock or unlock vertical scroll
-- @tparam Scroll self @{Scroll}
-- @tparam boolean state True, if vertical scroll is enabled
-- @tparam boolean|nil state True, if vertical scroll is enabled
-- @treturn druid.scroll Current scroll instance
function Scroll.set_vertical_scroll(self, state)
self._is_vertical_scroll = state

View File

@@ -214,7 +214,7 @@ end
--- Add new item to the grid
-- @tparam StaticGrid self @{StaticGrid}
-- @tparam node item Gui node
-- @tparam[opt] number index The item position. By default add as last item
-- @tparam number|nil index The item position. By default add as last item
-- @tparam[opt=SHIFT.RIGHT] number shift_policy How shift nodes, if required. See const.SHIFT
-- @tparam[opt=false] boolean is_instant If true, update node positions instantly
function StaticGrid.add(self, item, index, shift_policy, is_instant)
@@ -379,7 +379,7 @@ end
--- Update grid inner state
-- @tparam StaticGrid self @{StaticGrid}
-- @tparam boolean is_instant If true, node position update instantly, otherwise with set_position_function callback
-- @tparam boolean|nil is_instant If true, node position update instantly, otherwise with set_position_function callback
-- @local
function StaticGrid._update(self, is_instant)
self:_update_indexes()
@@ -425,7 +425,7 @@ end
--- Update grid nodes position
-- @tparam StaticGrid self @{StaticGrid}
-- @tparam boolean is_instant If true, node position update instantly, otherwise with set_position_function callback
-- @tparam boolean|nil is_instant If true, node position update instantly, otherwise with set_position_function callback
-- @local
function StaticGrid._update_pos(self, is_instant)
local zero_offset = self:_get_zero_offset()

View File

@@ -225,7 +225,7 @@ end
--- The @{Text} constructor
-- @tparam Text self @{Text}
-- @tparam string|node node Node name or GUI Text Node itself
-- @tparam[opt] string value Initial text. Default value is node text from GUI scene.
-- @tparam string|nil value Initial text. Default value is node text from GUI scene.
-- @tparam[opt=downscale] string adjust_type Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference
function Text.init(self, node, value, adjust_type)
self.node = self:get_node(node)
@@ -273,7 +273,7 @@ end
--- Calculate text width with font with respect to trailing space
-- @tparam Text self @{Text}
-- @tparam[opt] string text
-- @tparam string|nil text
-- @treturn number Width
-- @treturn number Height
function Text.get_text_size(self, text)
@@ -392,8 +392,8 @@ end
--- Set text adjust, refresh the current text visuals, if needed
-- @tparam Text self @{Text}
-- @tparam[opt] number adjust_type See const.TEXT_ADJUST. If pass nil - use current adjust type
-- @tparam[opt] number minimal_scale If pass nil - not use minimal scale
-- @tparam number|nil adjust_type See const.TEXT_ADJUST. If pass nil - use current adjust type
-- @tparam number|nil minimal_scale If pass nil - not use minimal scale
-- @treturn Text Current text instance
function Text.set_text_adjust(self, adjust_type, minimal_scale)
self.adjust_type = adjust_type