mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 10:02:18 +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
|
||||
|
Reference in New Issue
Block a user