mirror of
https://github.com/Insality/druid
synced 2025-09-27 10:02:19 +02:00
Update API pages
This commit is contained in:
@@ -11,8 +11,8 @@ local component = require("druid.component")
|
||||
---- Key triggers in `input.binding` should be setup for correct working
|
||||
---- It uses a key_back and key_backspace action ids
|
||||
---@class druid.back_handler: druid.component
|
||||
---@field on_back event Trigger on back handler action, fun(self, params)
|
||||
---@field params any|nil Custom args to pass in the callback
|
||||
---@field on_back event fun(self: druid.back_handler, params: any?) Trigger on back handler action
|
||||
---@field params any? Custom args to pass in the callback
|
||||
local M = component.create("back_handler")
|
||||
|
||||
|
||||
|
@@ -32,13 +32,13 @@ local component = require("druid.component")
|
||||
---- Button can have key trigger to use them by key: `button:set_key_trigger`
|
||||
----
|
||||
---@class druid.button: druid.component
|
||||
---@field on_click event function(self, custom_args, button_instance)
|
||||
---@field on_pressed event function(self, custom_args, button_instance)
|
||||
---@field on_repeated_click event function(self, custom_args, button_instance, click_count) Repeated click callback, while holding the button
|
||||
---@field on_long_click event function(self, custom_args, button_instance, hold_time) Callback on long button tap
|
||||
---@field on_double_click event function(self, custom_args, button_instance, click_amount) Different callback, if tap button 2+ in row
|
||||
---@field on_hold_callback event function(self, custom_args, button_instance, press_time) Hold callback, before long_click trigger
|
||||
---@field on_click_outside event function(self, custom_args, button_instance)
|
||||
---@field on_click event fun(self, custom_args, button_instance)
|
||||
---@field on_pressed event fun(self, custom_args, button_instance)
|
||||
---@field on_repeated_click event fun(self, custom_args, button_instance, click_count) Repeated click callback, while holding the button
|
||||
---@field on_long_click event fun(self, custom_args, button_instance, hold_time) Callback on long button tap
|
||||
---@field on_double_click event fun(self, custom_args, button_instance, click_amount) Different callback, if tap button 2+ in row
|
||||
---@field on_hold_callback event fun(self, custom_args, button_instance, press_time) Hold callback, before long_click trigger
|
||||
---@field on_click_outside event fun(self, custom_args, button_instance)
|
||||
---@field node node Clickable node
|
||||
---@field node_id hash Node id
|
||||
---@field anim_node node Animation node. In default case equals to clickable node
|
||||
|
@@ -38,9 +38,9 @@ local component = require("druid.component")
|
||||
---@class druid.scroll: druid.component
|
||||
---@field node node The root node
|
||||
---@field click_zone node|nil Optional click zone to restrict scroll area
|
||||
---@field on_scroll event Triggered on scroll move with fun(self, position)
|
||||
---@field on_scroll_to event Triggered on scroll_to with fun(self, target, is_instant)
|
||||
---@field on_point_scroll event Triggered on scroll_to_index with fun(self, index, point)
|
||||
---@field on_scroll event fun(self: druid.scroll, position: vector3) Triggered on scroll move
|
||||
---@field on_scroll_to event fun(self: druid.scroll, target: vector3, is_instant: boolean) Triggered on scroll_to
|
||||
---@field on_point_scroll event fun(self: druid.scroll, index: number, point: vector3) Triggered on scroll_to_index
|
||||
---@field view_node node The scroll view node (static part)
|
||||
---@field view_border vector4 The scroll view borders
|
||||
---@field content_node node The scroll content node (moving part)
|
||||
|
@@ -9,11 +9,11 @@ local component = require("druid.component")
|
||||
|
||||
---The component for manage the nodes position in the grid with various options
|
||||
---@class druid.grid: druid.component
|
||||
---@field on_add_item event Trigger on add item event, fun(self, item, index)
|
||||
---@field on_remove_item event Trigger on remove item event, fun(self, index)
|
||||
---@field on_change_items event Trigger on change items event, fun(self, index)
|
||||
---@field on_clear event Trigger on clear event, fun(self)
|
||||
---@field on_update_positions event Trigger on update positions event, fun(self)
|
||||
---@field on_add_item event fun(self: druid.grid, item: node, index: number) Trigger on add item event
|
||||
---@field on_remove_item event fun(self: druid.grid, index: number) Trigger on remove item event
|
||||
---@field on_change_items event fun(self: druid.grid, index: number) Trigger on change items event
|
||||
---@field on_clear event fun(self: druid.grid) Trigger on clear event
|
||||
---@field on_update_positions event fun(self: druid.grid) Trigger on update positions event
|
||||
---@field parent node Parent node
|
||||
---@field nodes node[] Nodes array
|
||||
---@field first_index number First index
|
||||
|
@@ -33,9 +33,9 @@ local utf8 = utf8 or utf8_lua --[[@as utf8]]
|
||||
---- - **"scale_then_trim_left"** - Combine two modes: first limited downscale, then trim left
|
||||
---@class druid.text: druid.component
|
||||
---@field node node The text node
|
||||
---@field on_set_text event fun(self, text) The event triggered when the text is set
|
||||
---@field on_update_text_scale event fun(self, scale, metrics) The event triggered when the text scale is updated
|
||||
---@field on_set_pivot event fun(self, pivot) The event triggered when the text pivot is set
|
||||
---@field on_set_text event fun(self: druid.text, text: string) The event triggered when the text is set
|
||||
---@field on_update_text_scale event fun(self: druid.text, scale: vector3, metrics: table) The event triggered when the text scale is updated
|
||||
---@field on_set_pivot event fun(self: druid.text, pivot: userdata) The event triggered when the text pivot is set
|
||||
---@field style druid.text.style The style of the text
|
||||
---@field start_pivot userdata The start pivot of the text
|
||||
---@field start_scale vector3 The start scale of the text
|
||||
|
@@ -18,9 +18,9 @@ local event = require("event.event")
|
||||
---@class druid.data_list: druid.component
|
||||
---@field scroll druid.scroll The scroll instance for Data List component
|
||||
---@field grid druid.grid The StaticGrid or DynamicGrid instance for Data List component
|
||||
---@field on_scroll_progress_change event The event triggered when the scroll progress changes
|
||||
---@field on_element_add event The event triggered when a new element is added
|
||||
---@field on_element_remove event The event triggered when an element is removed
|
||||
---@field on_scroll_progress_change event fun(self: druid.data_list, progress: number) The event triggered when the scroll progress changes
|
||||
---@field on_element_add event fun(self: druid.data_list, index: number, node: node, instance: druid.component, data: table) The event triggered when a new element is added
|
||||
---@field on_element_remove event fun(self: druid.data_list, index: number, node: node, instance: druid.component, data: table) The event triggered when an element is removed
|
||||
---@field top_index number The top index of the visible elements
|
||||
---@field last_index number The last index of the visible elements
|
||||
---@field scroll_progress number The scroll progress
|
||||
|
@@ -15,7 +15,7 @@ local settings = require("druid.system.settings")
|
||||
---@class druid.lang_text: druid.component
|
||||
---@field text druid.text The text component
|
||||
---@field node node The node of the text component
|
||||
---@field on_change event The event triggered when the text is changed
|
||||
---@field on_change event fun(self: druid.lang_text) The event triggered when the text is changed
|
||||
---@field private last_locale_args table The last locale arguments
|
||||
---@field private last_locale string The last locale
|
||||
local M = component.create("lang_text")
|
||||
|
@@ -42,7 +42,7 @@ local component = require("druid.component")
|
||||
---@field is_resize_width boolean True if the layout should resize the width of the node
|
||||
---@field is_resize_height boolean True if the layout should resize the height of the node
|
||||
---@field is_justify boolean True if the layout should justify the nodes
|
||||
---@field on_size_changed event.on_size_changed The event triggered when the size of the layout is changed
|
||||
---@field on_size_changed event.on_size_changed fun(self: druid.layout, size: vector3) The event triggered when the size of the layout is changed
|
||||
local M = component.create("layout")
|
||||
|
||||
|
||||
|
@@ -19,7 +19,7 @@ local component = require("druid.component")
|
||||
---- If you have glitchy or dark texture bugs with progress bar, try to disable mipmaps in your texture profiles
|
||||
---@class druid.progress: druid.component
|
||||
---@field node node The progress bar node
|
||||
---@field on_change event Event triggered when progress value changes
|
||||
---@field on_change event fun(self: druid.progress, value: number) Event triggered when progress value changes
|
||||
---@field style druid.progress.style Component style parameters
|
||||
---@field key string Progress bar direction: "x" or "y"
|
||||
---@field prop hash Property for scaling the progress bar
|
||||
|
@@ -16,7 +16,7 @@ local component = require("druid.component")
|
||||
---- To catch input across all slider, you can setup input node via `slider:set_input_node`
|
||||
---@class druid.slider: druid.component
|
||||
---@field node node The node to manage the slider
|
||||
---@field on_change_value event The event triggered when the slider value changes
|
||||
---@field on_change_value event fun(self: druid.slider, value: number) The event triggered when the slider value changes
|
||||
---@field style table The style of the slider
|
||||
---@field private start_pos vector3 The start position of the slider
|
||||
---@field private pos vector3 The current position of the slider
|
||||
|
Reference in New Issue
Block a user