#69 Fix annotations in button component

This commit is contained in:
Insality 2020-05-24 22:56:53 +03:00
parent d3a56f717e
commit 474b97469e
3 changed files with 14 additions and 8 deletions

View File

@ -265,10 +265,13 @@ end
--- Set enabled button component state
-- @function button:set_enabled
-- @tparam bool state Enabled state
-- @treturn druid.button Current button instance
function M.set_enabled(self, state)
self.disabled = not state
self.hover:set_enabled(state)
self.style.on_set_enabled(self, self.node, state)
return self
end
@ -284,10 +287,11 @@ end
-- no click events outside stencil node
-- @function button:set_click_zone
-- @tparam node zone Gui node
-- @tparam druid.button Self instance to make chain calls
-- @treturn druid.button Current button instance
function M.set_click_zone(self, zone)
self.click_zone = self:get_node(zone)
self.hover:set_click_zone(zone)
return self
end
@ -295,9 +299,10 @@ end
--- Set key-code to trigger this button
-- @function button:set_key_trigger
-- @tparam hash key The action_id of the key
-- @tparam druid.button Self instance to make chain calls
-- @treturn druid.button Current button instance
function M.set_key_trigger(self, key)
self.key_trigger = hash(key)
return self
end

View File

@ -282,7 +282,7 @@ end
-- Pass nil to make input field unliminted (by default)
-- @function input:set_max_length
-- @tparam number max_length Maximum length for input text field
-- @treturn druid.input Self instance to make chain calls
-- @treturn druid.input Current input instance
function M.set_max_length(self, max_length)
self.max_length = max_length
return self
@ -294,7 +294,7 @@ end
-- ex: [%a%d] for alpha and numeric
-- @function input:set_allowerd_characters
-- @tparam string characters Regulax exp. for validate user input
-- @treturn druid.input Self instance to make chain calls
-- @treturn druid.input Current input instance
function M.set_allowed_characters(self, characters)
self.allowed_characters = characters
return self

View File

@ -473,7 +473,7 @@ end
-- It will change content gui node size
-- @function scroll:set_size
-- @tparam vector3 size The new size for content node
-- @treturn druid.scroll Self instance
-- @treturn druid.scroll Current scroll instance
function M.set_size(self, size)
gui.set_size(self.content_node, size)
update_size(self)
@ -487,9 +487,10 @@ end
-- If no points, just simple drag without inertion
-- @function scroll:set_inert
-- @tparam bool state Inert scroll state
-- @treturn druid.scroll Self instance
-- @treturn druid.scroll Current scroll instance
function M.set_inert(self, state)
self._is_inert = state
return self
end
@ -506,7 +507,7 @@ end
-- Set 0 to disable stretching effect
-- @function scroll:set_extra_strech_size
-- @tparam[opt=0] number stretch_size Size in pixels of additional scroll area
-- @treturn druid.scroll Self instance
-- @treturn druid.scroll Current scroll instance
function M.set_extra_strech_size(self, stretch_size)
self.style.EXTRA_STRECH_SIZE = stretch_size or 0
update_size(self)
@ -527,7 +528,7 @@ end
-- Scroll will always centered on closer points
-- @function scroll:set_points
-- @tparam table points Array of vector3 points
-- @treturn druid.scroll Self instance
-- @treturn druid.scroll Current scroll instance
function M.set_points(self, points)
self.points = points