This commit is contained in:
Insality 2025-03-06 01:13:04 +02:00
parent 1a138f7020
commit ea4ff7eafc
4 changed files with 1 additions and 84 deletions

View File

@ -1,16 +0,0 @@
# Button Quick API reference
```lua
button:get_key_trigger()
button:init(node_or_node_id, [callback], [custom_args], [anim_node])
button:is_enabled()
button:on_input([action_id], [action])
button:on_input_interrupt()
button:on_late_init()
button:on_style_change(style)
button:set_check_function([check_function], [failure_callback])
button:set_click_zone([zone])
button:set_enabled([state])
button:set_key_trigger(key)
button:set_web_user_interaction([is_web_mode])
```

View File

@ -91,13 +91,10 @@ component:get_childrens()
component:get_context() component:get_context()
component:get_druid([template], [nodes]) component:get_druid([template], [nodes])
component:get_input_priority() component:get_input_priority()
component:get_name()
component:get_node(node_id) component:get_node(node_id)
component:get_nodes() component:get_nodes()
component:get_parent_component() component:get_parent_component()
component:get_parent_name()
component:get_template() component:get_template()
component:get_uid()
component:reset_input_priority() component:reset_input_priority()
component:set_input_enabled(state) component:set_input_enabled(state)
component:set_input_priority(value, [is_temporary]) component:set_input_priority(value, [is_temporary])
@ -112,7 +109,6 @@ component:set_template([template])
local blocker = self.druid:new_blocker(node) local blocker = self.druid:new_blocker(node)
blocker:is_enabled() blocker:is_enabled()
blocker:on_input(action_id, action)
blocker:set_enabled(state) blocker:set_enabled(state)
``` ```
@ -123,10 +119,6 @@ local button = self.druid:new_button(node, [callback], [params], [anim_node])
button:get_key_trigger() button:get_key_trigger()
button:is_enabled() button:is_enabled()
button:on_input([action_id], [action])
button:on_input_interrupt()
button:on_late_init()
button:on_style_change(style)
button:set_check_function([check_function], [failure_callback]) button:set_check_function([check_function], [failure_callback])
button:set_click_zone([zone]) button:set_click_zone([zone])
button:set_enabled([state]) button:set_enabled([state])
@ -148,10 +140,6 @@ container:fit_into_window()
container:get_position() container:get_position()
container:get_scale() container:get_scale()
container:get_size() container:get_size()
container:init(node, mode, [callback])
container:on_late_init()
container:on_remove()
container:on_style_change([style])
container:on_window_resized() container:on_window_resized()
container:refresh() container:refresh()
container:refresh_origins() container:refresh_origins()
@ -176,8 +164,6 @@ data_list:get_created_components()
data_list:get_created_nodes() data_list:get_created_nodes()
data_list:get_data() data_list:get_data()
data_list:get_index(data) data_list:get_index(data)
data_list:init(scroll, grid, create_function)
data_list:on_remove()
data_list:remove([index], [shift_policy]) data_list:remove([index], [shift_policy])
data_list:remove_by_data(data, [shift_policy]) data_list:remove_by_data(data, [shift_policy])
data_list:scroll_to_index(index) data_list:scroll_to_index(index)
@ -190,12 +176,7 @@ data_list:set_use_cache(is_use_cache)
```lua ```lua
local drag = self.druid:new_drag(node, [on_drag_callback]) local drag = self.druid:new_drag(node, [on_drag_callback])
drag:init(node_or_node_id, on_drag_callback)
drag:is_enabled() drag:is_enabled()
drag:on_input(action_id, action)
drag:on_input_interrupt()
drag:on_late_init()
drag:on_style_change([style])
drag:on_window_resized() drag:on_window_resized()
drag:set_click_zone([node]) drag:set_click_zone([node])
drag:set_drag_cursors(is_enabled) drag:set_drag_cursors(is_enabled)
@ -217,9 +198,6 @@ grid:get_offset()
grid:get_pos(index) grid:get_pos(index)
grid:get_size() grid:get_size()
grid:get_size_for([count]) grid:get_size_for([count])
grid:init(parent, element, [in_row])
grid:on_layout_change()
grid:on_style_change([style])
grid:refresh() grid:refresh()
grid:remove(index, [shift_policy], [is_instant]) grid:remove(index, [shift_policy], [is_instant])
grid:set_anchor(anchor) grid:set_anchor(anchor)
@ -237,11 +215,8 @@ grid:sort_nodes(comparator)
local hotkey = self.druid:new_hotkey(keys_array, [callback], [callback_argument]) local hotkey = self.druid:new_hotkey(keys_array, [callback], [callback_argument])
hotkey:add_hotkey(keys, [callback_argument]) hotkey:add_hotkey(keys, [callback_argument])
hotkey:init(keys, callback, [callback_argument])
hotkey:is_processing() hotkey:is_processing()
hotkey:on_focus_gained() hotkey:on_focus_gained()
hotkey:on_input([action_id], [action])
hotkey:on_style_change([style])
hotkey:set_repeat(is_enabled_repeated) hotkey:set_repeat(is_enabled_repeated)
``` ```
@ -250,14 +225,9 @@ hotkey:set_repeat(is_enabled_repeated)
```lua ```lua
local hover = self.druid:new_hover(node, [on_hover_callback], [on_mouse_hover_callback]) local hover = self.druid:new_hover(node, [on_hover_callback], [on_mouse_hover_callback])
hover:init(node, on_hover_callback, on_mouse_hover)
hover:is_enabled() hover:is_enabled()
hover:is_hovered() hover:is_hovered()
hover:is_mouse_hovered() hover:is_mouse_hovered()
hover:on_input([action_id], [action])
hover:on_input_interrupt()
hover:on_late_init()
hover:on_style_change([style])
hover:set_click_zone([zone]) hover:set_click_zone([zone])
hover:set_enabled([state]) hover:set_enabled([state])
hover:set_hover([state]) hover:set_hover([state])
@ -272,12 +242,8 @@ local input = self.druid:new_input(click_node, text_node, [keyboard_type])
input:get_text() input:get_text()
input:get_text_selected() input:get_text_selected()
input:get_text_selected_replaced(text) input:get_text_selected_replaced(text)
input:init(click_node, text_node, [keyboard_type])
input:move_selection(delta, is_add_to_selection, is_move_to_end) input:move_selection(delta, is_add_to_selection, is_move_to_end)
input:on_focus_lost() input:on_focus_lost()
input:on_input([action_id], [action])
input:on_input_interrupt()
input:on_style_change([style])
input:reset_changes() input:reset_changes()
input:select() input:select()
input:select_cursor([cursor_index], [start_index], [end_index]) input:select_cursor([cursor_index], [start_index], [end_index])
@ -293,7 +259,6 @@ input:unselect()
local lang_text = self.druid:new_lang_text(node, [locale_id], [adjust_type]) local lang_text = self.druid:new_lang_text(node, [locale_id], [adjust_type])
lang_text:format([a], [b], [c], [d], [e], [f], [g]) lang_text:format([a], [b], [c], [d], [e], [f], [g])
lang_text:init(node, [locale_id], [adjust_type])
lang_text:on_language_change() lang_text:on_language_change()
lang_text:set_text(text) lang_text:set_text(text)
lang_text:set_to(text) lang_text:set_to(text)
@ -312,7 +277,6 @@ layout:get_content_size()
layout:get_entities() layout:get_entities()
layout:get_node_size(node) layout:get_node_size(node)
layout:get_size() layout:get_size()
layout:init(node_or_node_id, layout_type)
layout:refresh_layout() layout:refresh_layout()
layout:remove(node_or_node_id) layout:remove(node_or_node_id)
layout:set_dirty() layout:set_dirty()
@ -334,10 +298,6 @@ local progress = self.druid:new_progress(node, key, [init_value])
progress:empty() progress:empty()
progress:fill() progress:fill()
progress:get() progress:get()
progress:init(node, key, [init_value])
progress:on_layout_change()
progress:on_remove()
progress:on_style_change([style])
progress:set_max_size(max_size) progress:set_max_size(max_size)
progress:set_steps(steps, callback) progress:set_steps(steps, callback)
progress:set_to(to) progress:set_to(to)
@ -351,8 +311,6 @@ progress:update([dt])
local rich_input = self.druid:new_rich_input(template, [nodes]) local rich_input = self.druid:new_rich_input(template, [nodes])
rich_input:get_text() rich_input:get_text()
rich_input:init(template, nodes)
rich_input:on_input([action_id], [action])
rich_input:select() rich_input:select()
rich_input:set_allowed_characters(characters) rich_input:set_allowed_characters(characters)
rich_input:set_font(font) rich_input:set_font(font)
@ -370,10 +328,6 @@ rich_text:clear()
rich_text:get_line_metric() rich_text:get_line_metric()
rich_text:get_text() rich_text:get_text()
rich_text:get_words() rich_text:get_words()
rich_text:init(text_node, [value])
rich_text:on_layout_change()
rich_text:on_remove()
rich_text:on_style_change([style])
rich_text:set_text([text]) rich_text:set_text([text])
rich_text:tagged(tag) rich_text:tagged(tag)
``` ```
@ -386,14 +340,8 @@ local scroll = self.druid:new_scroll(view_node, content_node)
scroll:bind_grid([grid]) scroll:bind_grid([grid])
scroll:get_percent() scroll:get_percent()
scroll:get_scroll_size() scroll:get_scroll_size()
scroll:init(view_node, content_node)
scroll:is_inert() scroll:is_inert()
scroll:is_node_in_view(node) scroll:is_node_in_view(node)
scroll:on_input([action_id], [action])
scroll:on_late_init()
scroll:on_layout_change()
scroll:on_remove()
scroll:on_style_change([style])
scroll:scroll_to(point, [is_instant]) scroll:scroll_to(point, [is_instant])
scroll:scroll_to_index(index, [skip_cb]) scroll:scroll_to_index(index, [skip_cb])
scroll:scroll_to_percent(percent, [is_instant]) scroll:scroll_to_percent(percent, [is_instant])
@ -414,12 +362,7 @@ scroll:update_view_size()
```lua ```lua
local slider = self.druid:new_slider(pin_node, end_pos, [callback]) local slider = self.druid:new_slider(pin_node, end_pos, [callback])
slider:init(node, end_pos, [callback])
slider:is_enabled() slider:is_enabled()
slider:on_input([action_id], [action])
slider:on_layout_change()
slider:on_remove()
slider:on_window_resized()
slider:set(value, [is_silent]) slider:set(value, [is_silent])
slider:set_enabled(is_enabled) slider:set_enabled(is_enabled)
slider:set_input_node([input_node]) slider:set_input_node([input_node])
@ -431,11 +374,6 @@ slider:set_steps(steps)
```lua ```lua
local swipe = self.druid:new_swipe(node, [on_swipe_callback]) local swipe = self.druid:new_swipe(node, [on_swipe_callback])
swipe:init(node_or_node_id, on_swipe_callback)
swipe:on_input(action_id, action)
swipe:on_input_interrupt()
swipe:on_late_init()
swipe:on_style_change(style)
swipe:set_click_zone([zone]) swipe:set_click_zone([zone])
``` ```
@ -448,10 +386,7 @@ text:get_text()
text:get_text_adjust() text:get_text_adjust()
text:get_text_index_by_width(width) text:get_text_index_by_width(width)
text:get_text_size([text]) text:get_text_size([text])
text:init(node, [value], [adjust_type])
text:is_multiline() text:is_multiline()
text:on_layout_change()
text:on_style_change([style])
text:set_alpha(alpha) text:set_alpha(alpha)
text:set_color(color) text:set_color(color)
text:set_minimal_scale(minimal_scale) text:set_minimal_scale(minimal_scale)
@ -468,8 +403,6 @@ text:set_to(set_to)
```lua ```lua
local timer = self.druid:new_timer(node, [seconds_from], [seconds_to], [callback]) local timer = self.druid:new_timer(node, [seconds_from], [seconds_to], [callback])
timer:init(node, [seconds_from], [seconds_to], [callback])
timer:on_layout_change()
timer:set_interval(from, to) timer:set_interval(from, to)
timer:set_state([is_on]) timer:set_state([is_on])
timer:set_to(set_to) timer:set_to(set_to)

View File

@ -235,7 +235,7 @@ end
---Get parent component ---Get parent component
---@return druid.component|nil parent The parent component if exist or nil ---@return druid.component|nil parent_component The parent component if exist or nil
function M:get_parent_component() function M:get_parent_component()
return self._meta.parent return self._meta.parent
end end