mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Annotations update
This commit is contained in:
@@ -46,7 +46,7 @@ function Checkbox.on_style_change(self, style)
|
||||
end
|
||||
|
||||
|
||||
--- Component init function
|
||||
--- The @{Checkbox} constructor
|
||||
-- @tparam Checkbox self @{Checkbox}
|
||||
-- @tparam node node Gui node
|
||||
-- @tparam function callback Checkbox callback
|
||||
@@ -71,9 +71,9 @@ end
|
||||
|
||||
--- Set checkbox state
|
||||
-- @tparam Checkbox self @{Checkbox}
|
||||
-- @tparam bool state Checkbox state
|
||||
-- @tparam bool is_silent Don't trigger on_change_state if true
|
||||
-- @tparam bool is_instant If instant checkbox change
|
||||
-- @tparam boolean state Checkbox state
|
||||
-- @tparam boolean is_silent Don't trigger on_change_state if true
|
||||
-- @tparam boolean is_instant If instant checkbox change
|
||||
function Checkbox.set_state(self, state, is_silent, is_instant)
|
||||
self.state = state
|
||||
self.style.on_change_state(self, self.node, state, is_instant)
|
||||
@@ -88,7 +88,7 @@ end
|
||||
|
||||
--- Return checkbox state
|
||||
-- @tparam Checkbox self @{Checkbox}
|
||||
-- @treturn bool Checkbox state
|
||||
-- @treturn boolean Checkbox state
|
||||
function Checkbox.get_state(self)
|
||||
return self.state
|
||||
end
|
||||
|
@@ -21,7 +21,7 @@ local component = require("druid.component")
|
||||
local CheckboxGroup = component.create("checkbox_group")
|
||||
|
||||
|
||||
--- Component init function
|
||||
--- The @{CheckboxGroup} constructor
|
||||
-- @tparam CheckboxGroup self @{CheckboxGroup}
|
||||
-- @tparam node[] nodes Array of gui node
|
||||
-- @tparam function callback Checkbox callback
|
||||
@@ -45,7 +45,7 @@ end
|
||||
|
||||
--- Set checkbox group state
|
||||
-- @tparam CheckboxGroup self @{CheckboxGroup}
|
||||
-- @tparam bool[] indexes Array of checkbox state
|
||||
-- @tparam boolean[] indexes Array of checkbox state
|
||||
-- @tparam boolean is_instant If instant state change
|
||||
function CheckboxGroup.set_state(self, indexes, is_instant)
|
||||
for i = 1, #indexes do
|
||||
@@ -58,7 +58,7 @@ end
|
||||
|
||||
--- Return checkbox group state
|
||||
-- @tparam CheckboxGroup self @{CheckboxGroup}
|
||||
-- @treturn bool[] Array if checkboxes state
|
||||
-- @treturn boolean[] Array if checkboxes state
|
||||
function CheckboxGroup.get_state(self)
|
||||
local result = {}
|
||||
|
||||
|
@@ -43,7 +43,7 @@ local Event = require("druid.event")
|
||||
local DataList = component.create("data_list")
|
||||
|
||||
|
||||
--- Data list constructor
|
||||
--- The @{DataList} constructor
|
||||
-- @tparam DataList self @{DataList}
|
||||
-- @tparam Scroll scroll The @{Scroll} instance for Data List component
|
||||
-- @tparam StaticGrid|DynamicGrid grid The @{StaticGrid} or @{DynamicGrid} instance for Data List component
|
||||
@@ -197,7 +197,7 @@ end
|
||||
|
||||
--- Return all currenly created nodes in DataList
|
||||
-- @tparam DataList self @{DataList}
|
||||
-- @treturn Node[] List of created nodes
|
||||
-- @treturn node[] List of created nodes
|
||||
function DataList.get_created_nodes(self)
|
||||
local nodes = {}
|
||||
|
||||
|
@@ -65,7 +65,7 @@ local AVAILABLE_PIVOTS = {
|
||||
}
|
||||
|
||||
|
||||
--- Component init function
|
||||
--- The @{DynamicGrid} constructor
|
||||
-- @tparam DynamicGrid self @{DynamicGrid}
|
||||
-- @tparam node parent The gui node parent, where items will be placed
|
||||
function DynamicGrid.init(self, parent)
|
||||
@@ -322,7 +322,7 @@ end
|
||||
|
||||
--- Update grid inner state
|
||||
-- @tparam DynamicGrid self @{DynamicGrid}
|
||||
-- @tparam bool is_instant If true, node position update instantly, otherwise with set_position_function callback
|
||||
-- @tparam boolean is_instant If true, node position update instantly, otherwise with set_position_function callback
|
||||
-- @local
|
||||
function DynamicGrid._update(self, is_instant)
|
||||
self:_update_indexes()
|
||||
@@ -378,7 +378,7 @@ end
|
||||
|
||||
--- Update grid nodes position
|
||||
-- @tparam DynamicGrid self @{DynamicGrid}
|
||||
-- @tparam bool is_instant If true, node position update instantly, otherwise with set_position_function callback
|
||||
-- @tparam boolean is_instant If true, node position update instantly, otherwise with set_position_function callback
|
||||
-- @local
|
||||
function DynamicGrid._update_pos(self, is_instant)
|
||||
for index, node in pairs(self.nodes) do
|
||||
|
@@ -27,11 +27,11 @@ local component = require("druid.component")
|
||||
local Hotkey = component.create("hotkey")
|
||||
|
||||
|
||||
--- Component init function
|
||||
--- The @{Hotkey} constructor
|
||||
-- @tparam Hotkey self @{Hotkey}
|
||||
-- @tparam string[]|string keys The keys to be pressed for trigger callback. Should contains one key and any modificator keys
|
||||
-- @tparam function callback The callback function
|
||||
-- @tparam[opt] value callback_argument The argument to pass into the callback function
|
||||
-- @tparam[opt] any callback_argument The argument to pass into the callback function
|
||||
function Hotkey.init(self, keys, callback, callback_argument)
|
||||
self.druid = self:get_druid()
|
||||
|
||||
@@ -63,7 +63,7 @@ end
|
||||
--- Add hotkey for component callback
|
||||
-- @tparam Hotkey self @{Hotkey}
|
||||
-- @tparam string[]|hash[]|string|hash keys that have to be pressed before key pressed to activate
|
||||
-- @tparam[opt] value callback_argument The argument to pass into the callback function
|
||||
-- @tparam[opt] any callback_argument The argument to pass into the callback function
|
||||
function Hotkey.add_hotkey(self, keys, callback_argument)
|
||||
keys = keys or {}
|
||||
if type(keys) == "string" then
|
||||
|
@@ -34,10 +34,10 @@
|
||||
-- @tfield Button button @{Button}
|
||||
|
||||
--- Is current input selected now
|
||||
-- @tfield bool is_selected
|
||||
-- @tfield boolean is_selected
|
||||
|
||||
--- Is current input is empty now
|
||||
-- @tfield bool is_empty
|
||||
-- @tfield boolean is_empty
|
||||
|
||||
--- Max length for input text
|
||||
-- @tfield[opt] number max_length
|
||||
@@ -87,10 +87,10 @@ end
|
||||
-- You can override this component styles params in druid styles table
|
||||
-- or create your own style
|
||||
-- @table style
|
||||
-- @tfield[opt=false] bool IS_LONGTAP_ERASE Is long tap will erase current input data
|
||||
-- @tfield[opt=false] boolean IS_LONGTAP_ERASE Is long tap will erase current input data
|
||||
-- @tfield[opt=*] string MASK_DEFAULT_CHAR Default character mask for password input
|
||||
-- @tfield[opt=false] bool IS_UNSELECT_ON_RESELECT If true, call unselect on select selected input
|
||||
-- @tfield[opt=false] bool NO_CONSUME_INPUT_WHILE_SELECTED If true, will not consume input while input is selected. It's allow to interact with other components while input is selected (text input still captured)
|
||||
-- @tfield[opt=false] boolean IS_UNSELECT_ON_RESELECT If true, call unselect on select selected input
|
||||
-- @tfield[opt=false] boolean NO_CONSUME_INPUT_WHILE_SELECTED If true, will not consume input while input is selected. It's allow to interact with other components while input is selected (text input still captured)
|
||||
-- @tfield function on_select (self, button_node) Callback on input field selecting
|
||||
-- @tfield function on_unselect (self, button_node) Callback on input field unselecting
|
||||
-- @tfield function on_input_wrong (self, button_node) Callback on wrong user input
|
||||
@@ -115,7 +115,7 @@ function Input.on_style_change(self, style)
|
||||
end
|
||||
|
||||
|
||||
--- Component init function
|
||||
--- The @{Input} constructor
|
||||
-- @tparam Input self @{Input}
|
||||
-- @tparam node click_node Node to enabled input component
|
||||
-- @tparam node|Text text_node Text node what will be changed on user input. You can pass text component instead of text node name @{Text}
|
||||
|
@@ -28,7 +28,7 @@ local Event = require("druid.event")
|
||||
local Layout = component.create("layout")
|
||||
|
||||
|
||||
--- Component init function
|
||||
--- The @{Layout} constructor
|
||||
-- @tparam Layout self @{Layout}
|
||||
-- @tparam node node Gui node
|
||||
-- @tparam string mode The layout mode (from const.LAYOUT_MODE)
|
||||
@@ -194,7 +194,7 @@ end
|
||||
|
||||
--- Set node for layout node to fit inside it. Pass nil to reset
|
||||
-- @tparam Layout self @{Layout}
|
||||
-- @tparam[opt] Node node
|
||||
-- @tparam[opt] node node
|
||||
-- @treturn Layout @{Layout}
|
||||
function Layout.fit_into_node(self, node)
|
||||
self._fit_node = node
|
||||
|
@@ -110,7 +110,7 @@ function Progress.on_style_change(self, style)
|
||||
end
|
||||
|
||||
|
||||
--- @{Progress} constructor
|
||||
--- The @{Progress} constructor
|
||||
-- @tparam Progress self @{Progress}
|
||||
-- @tparam string|node node Node name or GUI Node itself.
|
||||
-- @tparam string key Progress bar direction: const.SIDE.X or const.SIDE.Y
|
||||
|
@@ -30,7 +30,7 @@ local function on_checkbox_click(self, index, is_instant)
|
||||
end
|
||||
|
||||
|
||||
--- Component init function
|
||||
--- The @{RadioGroup} constructor
|
||||
-- @tparam RadioGroup self @{RadioGroup}
|
||||
-- @tparam node[] nodes Array of gui node
|
||||
-- @tparam function callback Radio callback
|
||||
|
@@ -29,7 +29,7 @@
|
||||
-- @tfield number dist
|
||||
|
||||
--- Current drag state
|
||||
-- @tfield bool is_drag
|
||||
-- @tfield boolean is_drag
|
||||
|
||||
--- Current slider value
|
||||
-- @tfield number value
|
||||
@@ -56,7 +56,7 @@ local function set_position(self, value)
|
||||
end
|
||||
|
||||
|
||||
--- Component init function
|
||||
--- The @{Slider} constructor
|
||||
-- @tparam Slider self @{Slider}
|
||||
-- @tparam node node Gui pin node
|
||||
-- @tparam vector3 end_pos The end position of slider
|
||||
@@ -174,7 +174,7 @@ end
|
||||
--- Set value for slider
|
||||
-- @tparam Slider self @{Slider}
|
||||
-- @tparam number value Value from 0 to 1
|
||||
-- @tparam[opt] bool is_silent Don't trigger event if true
|
||||
-- @tparam[opt] boolean is_silent Don't trigger event if true
|
||||
function Slider.set(self, value, is_silent)
|
||||
value = helper.clamp(value, 0, 1)
|
||||
set_position(self, value)
|
||||
@@ -202,7 +202,7 @@ end
|
||||
-- move at this position and node drag will start.
|
||||
-- This function require the Defold version 1.3.0+
|
||||
-- @tparam Slider self @{Slider}
|
||||
-- @tparam Node input_node
|
||||
-- @tparam node input_node
|
||||
-- @treturn Slider @{Slider}
|
||||
function Slider.set_input_node(self, input_node)
|
||||
self._input_node = self:get_node(input_node)
|
||||
|
@@ -76,7 +76,7 @@ end
|
||||
-- @table style
|
||||
-- @tfield[opt=0.4] number SWIPE_TIME Maximum time for swipe trigger
|
||||
-- @tfield[opt=50] number SWIPE_THRESHOLD Minimum distance for swipe trigger
|
||||
-- @tfield[opt=false] bool SWIPE_TRIGGER_ON_MOVE If true, trigger on swipe moving, not only release action
|
||||
-- @tfield[opt=false] boolean SWIPE_TRIGGER_ON_MOVE If true, trigger on swipe moving, not only release action
|
||||
function Swipe.on_style_change(self, style)
|
||||
self.style = {}
|
||||
self.style.SWIPE_TIME = style.SWIPE_TIME or 0.4
|
||||
@@ -85,7 +85,7 @@ function Swipe.on_style_change(self, style)
|
||||
end
|
||||
|
||||
|
||||
--- Component init function
|
||||
--- The @{Swipe} constructor
|
||||
-- @tparam Swipe self @{Swipe}
|
||||
-- @tparam node node Gui node
|
||||
-- @tparam function on_swipe_callback Swipe callback for on_swipe_end event
|
||||
|
@@ -44,7 +44,7 @@ local function second_string_min(sec)
|
||||
end
|
||||
|
||||
|
||||
--- Component init function
|
||||
--- The @{Timer} constructor
|
||||
-- @tparam Timer self @{Timer}
|
||||
-- @tparam node node Gui text node
|
||||
-- @tparam number seconds_from Start timer value in seconds
|
||||
@@ -110,7 +110,7 @@ end
|
||||
|
||||
--- Called when update
|
||||
-- @tparam Timer self @{Timer}
|
||||
-- @tparam bool is_on Timer enable state
|
||||
-- @tparam boolean is_on Timer enable state
|
||||
function Timer.set_state(self, is_on)
|
||||
self.is_on = is_on
|
||||
|
||||
|
Reference in New Issue
Block a user