Update docs and changelogs

This commit is contained in:
Insality 2020-04-18 02:31:52 +03:00
parent 56795363f8
commit 36d7bcee5a
4 changed files with 33 additions and 3 deletions

View File

@ -4,6 +4,7 @@ Druid 0.3.0:
- Add swipe basic component - Add swipe basic component
- Swipe component handle simple swipe gestures on node. It has single callback with direction on swipe. You can adjust a several parameters of swipe in druid style. - Swipe component handle simple swipe gestures on node. It has single callback with direction on swipe. You can adjust a several parameters of swipe in druid style.
- Add swipe example at main Druid example. Try swipe left/right to switch example pages.
- Add input basic component - Add input basic component
- Input component handle user text input. Input contains from button and text component. Button needed for selecting input field - Input component handle user text input. Input contains from button and text component. Button needed for selecting input field
@ -12,6 +13,7 @@ Druid 0.3.0:
- On focus lost (game minimized) input field will be unselected - On focus lost (game minimized) input field will be unselected
- You can setup max length of the text - You can setup max length of the text
- You can setup allowed characters. On add not allowed characters `on_input_wrong` will be called. By default it cause simple shake animation - You can setup allowed characters. On add not allowed characters `on_input_wrong` will be called. By default it cause simple shake animation
- The keyboard for input will not show on mobile HTML5
- Add button on_click_outside event. You can subscribe on this event in button. Was needed for Input component (click outside to deselect input field). - Add button on_click_outside event. You can subscribe on this event in button. Was needed for Input component (click outside to deselect input field).
- Add start_pos to button component - Add start_pos to button component

View File

@ -154,6 +154,9 @@ function M.on_focus_lost(self)
end end
--- Set text for input field
-- @function input:set_text
-- @tparam string input_text The string to apply for input field
function M.set_text(self, input_text) function M.set_text(self, input_text)
self.value = input_text self.value = input_text
@ -194,22 +197,34 @@ function M.set_text(self, input_text)
end end
--- Return current input field text
-- @function input:get_text
-- @treturn string The current input field text
function M.get_text(self) function M.get_text(self)
return self.value .. self.marked_value return self.value .. self.marked_value
end end
--- Set maximum length for input field.
-- Pass nil to make input field unliminted (by default)
-- @function input:set_max_length
-- @tparam number max_length Maximum length for input text field
function M.set_max_length(self, max_length) function M.set_max_length(self, max_length)
self.max_length = max_length self.max_length = max_length
end end
-- [%a%d] for alpha numeric --- Set allowed charaters for input field.
-- ex: [%a%d] for alpha and numeric
-- @function input:set_allowerd_characters
-- @tparam string characters Regulax exp. for validate user input
function M.set_allowed_characters(self, characters) function M.set_allowed_characters(self, characters)
self.allowed_characters = characters self.allowed_characters = characters
end end
--- Reset current input selection and return previous value
-- @function input:reset_changes
function M.reset_changes(self) function M.reset_changes(self)
self:set_text(self.previous_value) self:set_text(self.previous_value)
unselect(self) unselect(self)

View File

@ -100,7 +100,6 @@ end
-- Used to trigger on_focus_lost and on_focus_gain -- Used to trigger on_focus_lost and on_focus_gain
-- @function druid.on_window_callback -- @function druid.on_window_callback
-- @tparam string event Event param from window listener -- @tparam string event Event param from window listener
-- @tparam table data Data param from window listener
function M.on_window_callback(event) function M.on_window_callback(event)
local instances = get_druid_instances() local instances = get_druid_instances()
@ -130,7 +129,7 @@ end
--- Callback on global language change event. --- Callback on global language change event.
-- Used to update all lang texts -- Use to update all lang texts
-- @function druid.on_language_change -- @function druid.on_language_change
function M.on_language_change() function M.on_language_change()
local instances = get_druid_instances() local instances = get_druid_instances()

View File

@ -235,6 +235,9 @@ function Druid.on_message(self, message_id, message, sender)
end end
--- Druid on focus lost interest function.
-- This one called by on_window_callback by global window listener
-- @function druid:on_focus_lost
function Druid.on_focus_lost(self) function Druid.on_focus_lost(self)
local components = self.components[const.ON_FOCUS_LOST] local components = self.components[const.ON_FOCUS_LOST]
if components then if components then
@ -244,6 +247,10 @@ function Druid.on_focus_lost(self)
end end
end end
--- Druid on focus gained interest function.
-- This one called by on_window_callback by global window listener
-- @function druid:on_focus_gained
function Druid.on_focus_gained(self) function Druid.on_focus_gained(self)
local components = self.components[const.ON_FOCUS_GAINED] local components = self.components[const.ON_FOCUS_GAINED]
if components then if components then
@ -254,6 +261,9 @@ function Druid.on_focus_gained(self)
end end
--- Druid on layout change function.
-- Called on update gui layout
-- @function druid:on_layout_change
function Druid.on_layout_change(self) function Druid.on_layout_change(self)
local components = self.components[const.ON_LAYOUT_CHANGE] local components = self.components[const.ON_LAYOUT_CHANGE]
if components then if components then
@ -264,6 +274,10 @@ function Druid.on_layout_change(self)
end end
--- Druid on language change.
-- This one called by global gruid.on_language_change, but can be
-- call manualy to update all translations
-- @function druid.on_language_change
function Druid.on_language_change(self) function Druid.on_language_change(self)
local components = self.components[const.ON_LANGUAGE_CHANGE] local components = self.components[const.ON_LANGUAGE_CHANGE]
if components then if components then