Update docs, changelogs, example. Prepare to 0.6.0 release

This commit is contained in:
Insality 2021-04-06 00:03:55 +03:00
parent 015564f5b3
commit 9ff97b98ea
62 changed files with 2597 additions and 3418 deletions

View File

@ -43,6 +43,7 @@ function druid.set_text_function(callback) end
---@class druid.back_handler : druid.base_component ---@class druid.back_handler : druid.base_component
---@field on_back druid_event On back handler callback(self, params) ---@field on_back druid_event On back handler callback(self, params)
---@field params any Params to back callback
local druid__back_handler = {} local druid__back_handler = {}
--- Component init function --- Component init function
@ -59,6 +60,7 @@ function druid__back_handler.on_input(self, action_id, action) end
---@class druid.base_component ---@class druid.base_component
---@field ALL field Component Interests
local druid__base_component = {} local druid__base_component = {}
--- Get current component context --- Get current component context
@ -71,6 +73,11 @@ function druid__base_component.get_context(self) end
---@return Druid Druid instance with component context ---@return Druid Druid instance with component context
function druid__base_component.get_druid(self) end function druid__base_component.get_druid(self) end
--- Return component input priority
---@param self druid.base_component
---@return number The component input priority
function druid__base_component.get_input_priority(self) end
--- Return component name --- Return component name
---@param self druid.base_component ---@param self druid.base_component
---@return string The component name ---@return string The component name
@ -87,12 +94,14 @@ function druid__base_component.get_node(self, node_or_name) end
---@return druid.base_component|nil The druid component instance or nil ---@return druid.base_component|nil The druid component instance or nil
function druid__base_component.get_parent_component(self) end function druid__base_component.get_parent_component(self) end
--- Increase input priority in current input stack --- Return component uid.
---@param self druid.base_component ---@param self druid.base_component
function druid__base_component.increase_input_priority(self) end ---@return number The component uid
function druid__base_component.get_uid(self) end
--- Reset input priority in current input stack --- Reset component input priority to default value
---@param self druid.base_component ---@param self druid.base_component
---@return number The component input priority
function druid__base_component.reset_input_priority(self) end function druid__base_component.reset_input_priority(self) end
--- Set component input state. --- Set component input state.
@ -101,6 +110,12 @@ function druid__base_component.reset_input_priority(self) end
---@return druid.base_component BaseComponent itself ---@return druid.base_component BaseComponent itself
function druid__base_component.set_input_enabled(self, state) end function druid__base_component.set_input_enabled(self, state) end
--- Set component input priority
---@param self druid.base_component
---@param value number The new input priority value
---@return number The component input priority
function druid__base_component.set_input_priority(self, value) end
--- Set current component nodes --- Set current component nodes
---@param self druid.base_component ---@param self druid.base_component
---@param nodes table BaseComponent nodes table ---@param nodes table BaseComponent nodes table
@ -126,6 +141,7 @@ function druid__base_component.setup_component(self, druid_instance, context, st
---@class druid.blocker : druid.base_component ---@class druid.blocker : druid.base_component
---@field node node Trigger node
local druid__blocker = {} local druid__blocker = {}
--- Component init function --- Component init function
@ -146,6 +162,7 @@ function druid__blocker.set_enabled(self, state) end
---@class druid.button : druid.base_component ---@class druid.button : druid.base_component
---@field anim_node node Animation node ---@field anim_node node Animation node
---@field click_zone node Restriction zone
---@field hover druid.hover Druid hover logic component ---@field hover druid.hover Druid hover logic component
---@field node node Trigger node ---@field node node Trigger node
---@field on_click druid_event On release button callback(self, params, button_instance) ---@field on_click druid_event On release button callback(self, params, button_instance)
@ -211,6 +228,7 @@ local druid__button__style = {}
---@class druid.checkbox : druid.base_component ---@class druid.checkbox : druid.base_component
---@field button Button Button component from click_node
---@field click_node node Button trigger node ---@field click_node node Button trigger node
---@field node node Visual node ---@field node node Visual node
---@field on_change_state druid_event On change state callback(self, state) ---@field on_change_state druid_event On change state callback(self, state)
@ -242,6 +260,7 @@ local druid__checkbox__style = {}
---@class druid.checkbox_group : druid.base_component ---@class druid.checkbox_group : druid.base_component
---@field checkboxes table Array of checkbox components
---@field on_checkbox_click druid_event On any checkbox click callback(self, index) ---@field on_checkbox_click druid_event On any checkbox click callback(self, index)
local druid__checkbox_group = {} local druid__checkbox_group = {}
@ -263,6 +282,59 @@ function druid__checkbox_group.init(self, nodes, callback, click_nodes) end
function druid__checkbox_group.set_state(self, indexes) end function druid__checkbox_group.set_state(self, indexes) end
---@class druid.data_list : druid.base_component
---@field grid druid.static_grid The Druid Grid component
---@field last_index number The current visual last data index
---@field on_scroll_progress_change druid_event Event triggered when scroll progress is changed; event(self, progress_value)
---@field scroll druid.scroll The Druid scroll component
---@field scroll_progress number The current progress of scroll posititon
---@field top_index number The current visual top data index
local druid__data_list = {}
--- Clear the DataList and refresh visuals
---@param self druid.data_list
function druid__data_list.clear(self) end
--- Return first index from data.
---@param self druid.data_list
function druid__data_list.get_first_index(self) end
--- Return index for data value
---@param self druid.data_list
---@param data table
function druid__data_list.get_index(self, data) end
--- Return last index from data
---@param self druid.data_list
function druid__data_list.get_last_index(self) end
--- Return amount of data
---@param self druid.data_list
function druid__data_list.get_length(self) end
--- Data list constructor
---@param self druid.data_list
---@param scroll druid.scroll The Scroll instance for Data List component
---@param grid druid.grid The Grid instance for Data List component
---@param create_function function The create function callback(self, data, index, data_list). Function should return (node, [component])
function druid__data_list.init(self, scroll, grid, create_function) end
--- Druid System on_remove function
---@param self druid.data_list
function druid__data_list.on_remove(self) end
--- Instant scroll to element with passed index
---@param self druid.data_list
---@param index number
function druid__data_list.scroll_to_index(self, index) end
--- Set new data set for DataList component
---@param self druid.data_list
---@param data table The new data array
---@return druid.data_list Current DataList instance
function druid__data_list.set_data(self, data) end
---@class druid.drag : druid.base_component ---@class druid.drag : druid.base_component
---@field can_x bool Is drag component process vertical dragging. ---@field can_x bool Is drag component process vertical dragging.
---@field can_y bool Is drag component process horizontal. ---@field can_y bool Is drag component process horizontal.
@ -274,6 +346,7 @@ function druid__checkbox_group.set_state(self, indexes) end
---@field on_touch_end druid_event Event on touch end callback(self) ---@field on_touch_end druid_event Event on touch end callback(self)
---@field on_touch_start druid_event Event on touch start callback(self) ---@field on_touch_start druid_event Event on touch start callback(self)
---@field style druid.drag.style Component style params. ---@field style druid.drag.style Component style params.
---@field touch_start_pos vector3 Touch start position
---@field x number Current touch x position ---@field x number Current touch x position
---@field y number Current touch y position ---@field y number Current touch y position
local druid__drag = {} local druid__drag = {}
@ -286,8 +359,8 @@ function druid__drag.init(self, node, on_drag_callback) end
--- Strict drag click area. --- Strict drag click area.
---@param self druid.drag ---@param self druid.drag
---@param zone node Gui node ---@param node node Gui node
function druid__drag.set_click_zone(self, zone) end function druid__drag.set_click_zone(self, node) end
---@class druid.drag.style ---@class druid.drag.style
@ -296,10 +369,11 @@ local druid__drag__style = {}
---@class druid.dynamic_grid : druid.base_component ---@class druid.dynamic_grid : druid.base_component
---@field border vector4 The size of item content
---@field first_index number The first index of node in grid ---@field first_index number The first index of node in grid
---@field last_index number The last index of node in grid ---@field last_index number The last index of node in grid
---@field node_size vector3 Item size ---@field node_size vector3 Item size
---@field nodes node[] List of all grid nodes ---@field nodes node[] List of all grid elements.
---@field on_add_item druid_event On item add callback(self, node, index) ---@field on_add_item druid_event On item add callback(self, node, index)
---@field on_change_items druid_event On item add or remove callback(self, index) ---@field on_change_items druid_event On item add or remove callback(self, index)
---@field on_clear druid_event On grid clear callback(self) ---@field on_clear druid_event On grid clear callback(self)
@ -318,8 +392,8 @@ function druid__dynamic_grid._get_side_vector(self, side, is_forward) end
---@param self druid.dynamic_grid ---@param self druid.dynamic_grid
---@param node node Gui node ---@param node node Gui node
---@param index number The node position. By default add as last node ---@param index number The node position. By default add as last node
---@param is_shift_left bool If true, shift all nodes to the left, otherwise shift nodes to the right ---@param shift_policy number How shift nodes, if required. See const.SHIFT
function druid__dynamic_grid.add(self, node, index, is_shift_left) end function druid__dynamic_grid.add(self, node, index, shift_policy) end
--- Clear grid nodes array. --- Clear grid nodes array.
---@param self druid.dynamic_grid ---@param self druid.dynamic_grid
@ -331,12 +405,22 @@ function druid__dynamic_grid.clear(self) end
---@return vector3[] All grid node positions ---@return vector3[] All grid node positions
function druid__dynamic_grid.get_all_pos(self) end function druid__dynamic_grid.get_all_pos(self) end
--- Return grid content borders
---@param self druid.dynamic_grid
---@return vector3 The grid content borders
function druid__dynamic_grid.get_borders(self) end
--- Return grid index by node --- Return grid index by node
---@param self druid.dynamic_grid ---@param self druid.dynamic_grid
---@param node node The gui node in the grid ---@param node node The gui node in the grid
---@return number The node index ---@return number The node index
function druid__dynamic_grid.get_index_by_node(self, node) end function druid__dynamic_grid.get_index_by_node(self, node) end
--- Return DynamicGrid offset, where DynamicGrid content starts.
---@param self druid.dynamic_grid The DynamicGrid instance
---@return vector3 The DynamicGrid offset
function druid__dynamic_grid.get_offset(self) end
--- Return pos for grid node index --- Return pos for grid node index
---@param self druid.dynamic_grid ---@param self druid.dynamic_grid
---@param index number The grid element index ---@param index number The grid element index
@ -359,8 +443,9 @@ function druid__dynamic_grid.init(self, parent) end
--- Remove the item from the grid. --- Remove the item from the grid.
---@param self druid.dynamic_grid ---@param self druid.dynamic_grid
---@param index number The grid node index to remove ---@param index number The grid node index to remove
---@param is_shift_left bool If true, shift all nodes to the left, otherwise shift nodes to the right ---@param shift_policy number How shift nodes, if required. See const.SHIFT
function druid__dynamic_grid.remove(self, index, is_shift_left) end ---@return Node The deleted gui node from grid
function druid__dynamic_grid.remove(self, index, shift_policy) end
--- Change set position function for grid nodes. --- Change set position function for grid nodes.
---@param self druid.dynamic_grid ---@param self druid.dynamic_grid
@ -371,6 +456,7 @@ function druid__dynamic_grid.set_position_function(self, callback) end
---@class druid.hover : druid.base_component ---@class druid.hover : druid.base_component
---@field on_hover druid_event On hover callback(self, state) ---@field on_hover druid_event On hover callback(self, state)
---@field on_mouse_hover druid_event On mouse hover callback(self, state)
local druid__hover = {} local druid__hover = {}
--- Component init function --- Component init function
@ -410,6 +496,7 @@ function druid__hover.set_mouse_hover(self, state) end
---@field button druid.button Button component ---@field button druid.button Button component
---@field is_empty bool Is current input is empty now ---@field is_empty bool Is current input is empty now
---@field is_selected bool Is current input selected now ---@field is_selected bool Is current input selected now
---@field keyboard_type number Gui keyboard type for input field
---@field max_length number Max length for input text ---@field max_length number Max length for input text
---@field on_input_empty druid_event On input field text change to empty string callback(self, input_text) ---@field on_input_empty druid_event On input field text change to empty string callback(self, input_text)
---@field on_input_full druid_event On input field text change to max length string callback(self, input_text) ---@field on_input_full druid_event On input field text change to max length string callback(self, input_text)
@ -430,6 +517,10 @@ function druid__input.get_text(self) end
---@param self druid.input ---@param self druid.input
function druid__input.reset_changes(self) end function druid__input.reset_changes(self) end
--- Select input field.
---@param self druid.input
function druid__input.select(self) end
--- Set allowed charaters for input field. --- Set allowed charaters for input field.
---@param self druid.input ---@param self druid.input
---@param characters string Regulax exp. for validate user input ---@param characters string Regulax exp. for validate user input
@ -447,9 +538,14 @@ function druid__input.set_max_length(self, max_length) end
---@param input_text string The string to apply for input field ---@param input_text string The string to apply for input field
function druid__input.set_text(self, input_text) end function druid__input.set_text(self, input_text) end
--- Remove selection from input.
---@param self druid.input
function druid__input.unselect(self) end
---@class druid.input.style ---@class druid.input.style
---@field IS_LONGTAP_ERASE field Is long tap will erase current input data ---@field IS_LONGTAP_ERASE field Is long tap will erase current input data
---@field IS_UNSELECT_ON_RESELECT field If true, call unselect on select selected input
---@field MASK_DEFAULT_CHAR field Default character mask for password input ---@field MASK_DEFAULT_CHAR field Default character mask for password input
---@field button_style field Custom button style for input node ---@field button_style field Custom button style for input node
---@field on_input_wrong field (self, button_node) Callback on wrong user input ---@field on_input_wrong field (self, button_node) Callback on wrong user input
@ -460,12 +556,13 @@ local druid__input__style = {}
---@class druid.lang_text : druid.base_component ---@class druid.lang_text : druid.base_component
---@field on_change druid_event On change text callback ---@field on_change druid_event On change text callback
---@field text Text The text component
local druid__lang_text = {} local druid__lang_text = {}
--- Component init function --- Component init function
---@param self druid.lang_text ---@param self druid.lang_text
---@param node node The text node ---@param node node The text node
---@param locale_id string Default locale id ---@param locale_id string Default locale id, optional
---@param no_adjust bool If true, will not correct text size ---@param no_adjust bool If true, will not correct text size
function druid__lang_text.init(self, node, locale_id, no_adjust) end function druid__lang_text.init(self, node, locale_id, no_adjust) end
@ -487,6 +584,7 @@ function druid__lang_text.translate(self, locale_id) end
---@field on_change druid_event On progress bar change callback(self, new_value) ---@field on_change druid_event On progress bar change callback(self, new_value)
---@field scale vector3 Current progress bar scale ---@field scale vector3 Current progress bar scale
---@field size vector3 Current progress bar size ---@field size vector3 Current progress bar size
---@field slice vector4 Progress bar slice9 settings
---@field style druid.progress.style Component style params. ---@field style druid.progress.style Component style params.
local druid__progress = {} local druid__progress = {}
@ -534,6 +632,7 @@ local druid__progress__style = {}
---@class druid.radio_group : druid.base_component ---@class druid.radio_group : druid.base_component
---@field checkboxes Checkbox[] Array of checkbox components
---@field on_radio_click druid_event On any checkbox click ---@field on_radio_click druid_event On any checkbox click
local druid__radio_group = {} local druid__radio_group = {}
@ -561,6 +660,7 @@ function druid__radio_group.set_state(self, index) end
---@field content_node node Scroll content node ---@field content_node node Scroll content node
---@field drag Drag Drag Druid component ---@field drag Drag Drag Druid component
---@field inertion vector3 Current inert speed ---@field inertion vector3 Current inert speed
---@field is_animate bool Flag, if scroll now animating by gui.animate
---@field is_inert bool Flag, if scroll now moving by inertion ---@field is_inert bool Flag, if scroll now moving by inertion
---@field on_point_scroll druid_event On scroll_to_index function callback(self, index, point) ---@field on_point_scroll druid_event On scroll_to_index function callback(self, index, point)
---@field on_scroll druid_event On scroll move callback(self, position) ---@field on_scroll druid_event On scroll move callback(self, position)
@ -603,6 +703,12 @@ function druid__scroll.init(self, view_node, content_node) end
---@return bool If scroll have inertion ---@return bool If scroll have inertion
function druid__scroll.is_inert(self) end function druid__scroll.is_inert(self) end
--- Check node if it visible now on scroll.
---@param self druid.scroll
---@param node node The node to check
---@return boolean True if node in visible scroll area
function druid__scroll.is_node_in_view(self, node) end
--- Start scroll to target point. --- Start scroll to target point.
---@param self druid.scroll ---@param self druid.scroll
---@param point vector3 Target point ---@param point vector3 Target point
@ -621,6 +727,11 @@ function druid__scroll.scroll_to_index(self, index, skip_cb) end
---@param is_instant bool instant scroll flag ---@param is_instant bool instant scroll flag
function druid__scroll.scroll_to_percent(self, percent, is_instant) end function druid__scroll.scroll_to_percent(self, percent, is_instant) end
--- Strict drag scroll area.
---@param self druid.drag
---@param node node Gui node
function druid__scroll.set_click_zone(self, node) end
--- Set extra size for scroll stretching. --- Set extra size for scroll stretching.
---@param self druid.scroll ---@param self druid.scroll
---@param stretch_size number Size in pixels of additional scroll area ---@param stretch_size number Size in pixels of additional scroll area
@ -648,8 +759,9 @@ function druid__scroll.set_points(self, points) end
--- Set scroll content size. --- Set scroll content size.
---@param self druid.scroll ---@param self druid.scroll
---@param size vector3 The new size for content node ---@param size vector3 The new size for content node
---@param offset vector3 Offset value to set, where content is starts
---@return druid.scroll Current scroll instance ---@return druid.scroll Current scroll instance
function druid__scroll.set_size(self, size) end function druid__scroll.set_size(self, size, offset) end
--- Lock or unlock vertical scroll --- Lock or unlock vertical scroll
---@param self druid.scroll ---@param self druid.scroll
@ -668,6 +780,8 @@ function druid__scroll.set_vertical_scroll(self, state) end
---@field INERT_THRESHOLD field Scroll speed to stop inertion ---@field INERT_THRESHOLD field Scroll speed to stop inertion
---@field POINTS_DEADZONE field Speed to check points of interests in no_inertion mode ---@field POINTS_DEADZONE field Speed to check points of interests in no_inertion mode
---@field SMALL_CONTENT_SCROLL field If true, content node with size less than view node size can be scrolled ---@field SMALL_CONTENT_SCROLL field If true, content node with size less than view node size can be scrolled
---@field WHEEL_SCROLL_INVERTED field If true, invert direction for touchpad and mouse wheel scroll
---@field WHEEL_SCROLL_SPEED field The scroll speed via mouse wheel scroll or touchpad. Set to 0 to disable wheel scrolling
local druid__scroll__style = {} local druid__scroll__style = {}
@ -680,6 +794,7 @@ local druid__scroll__style = {}
---@field pos vector3 Current pin node position ---@field pos vector3 Current pin node position
---@field start_pos vector3 Start pin node position ---@field start_pos vector3 Start pin node position
---@field target_pos vector3 Targer pin node position ---@field target_pos vector3 Targer pin node position
---@field value number Current slider value
local druid__slider = {} local druid__slider = {}
--- Component init function --- Component init function
@ -703,6 +818,7 @@ function druid__slider.set_steps(self, steps) end
---@class druid.static_grid : druid.base_component ---@class druid.static_grid : druid.base_component
---@field anchor vector3 Item anchor ---@field anchor vector3 Item anchor
---@field border vector4 The size of item content
---@field first_index number The first index of node in grid ---@field first_index number The first index of node in grid
---@field last_index number The last index of node in grid ---@field last_index number The last index of node in grid
---@field node_size vector3 Item size ---@field node_size vector3 Item size
@ -719,7 +835,8 @@ local druid__static_grid = {}
---@param self druid.static_grid ---@param self druid.static_grid
---@param item node Gui node ---@param item node Gui node
---@param index number The item position. By default add as last item ---@param index number The item position. By default add as last item
function druid__static_grid.add(self, item, index) end ---@param shift_policy number How shift nodes, if required. See const.SHIFT
function druid__static_grid.add(self, item, index, shift_policy) end
--- Clear grid nodes array. --- Clear grid nodes array.
---@param self druid.static_grid ---@param self druid.static_grid
@ -731,6 +848,11 @@ function druid__static_grid.clear(self) end
---@return vector3[] All grid node positions ---@return vector3[] All grid node positions
function druid__static_grid.get_all_pos(self) end function druid__static_grid.get_all_pos(self) end
--- Return grid content borders
---@param self druid.static_grid
---@return vector3 The grid content borders
function druid__static_grid.get_borders(self) end
--- Return index for grid pos --- Return index for grid pos
---@param self druid.static_grid ---@param self druid.static_grid
---@param pos vector3 The node position in the grid ---@param pos vector3 The node position in the grid
@ -743,6 +865,11 @@ function druid__static_grid.get_index(self, pos) end
---@return number The node index ---@return number The node index
function druid__static_grid.get_index_by_node(self, node) end function druid__static_grid.get_index_by_node(self, node) end
--- Return StaticGrid offset, where StaticGrid content starts.
---@param self druid.static_grid The StaticGrid instance
---@return vector3 The StaticGrid offset
function druid__static_grid.get_offset(self) end
--- Return pos for grid node index --- Return pos for grid node index
---@param self druid.static_grid ---@param self druid.static_grid
---@param index number The grid element index ---@param index number The grid element index
@ -764,8 +891,9 @@ function druid__static_grid.init(self, parent, element, in_row) end
--- Remove the item from the grid. --- Remove the item from the grid.
---@param self druid.static_grid ---@param self druid.static_grid
---@param index number The grid node index to remove ---@param index number The grid node index to remove
---@param is_shift_nodes bool If true, will shift nodes left after index ---@param shift_policy number How shift nodes, if required. See const.SHIFT
function druid__static_grid.remove(self, index, is_shift_nodes) end ---@return Node The deleted gui node from grid
function druid__static_grid.remove(self, index, shift_policy) end
--- Set grid anchor. --- Set grid anchor.
---@param self druid.static_grid ---@param self druid.static_grid
@ -782,6 +910,7 @@ function druid__static_grid.set_position_function(self, callback) end
---@class druid.swipe : druid.base_component ---@class druid.swipe : druid.base_component
---@field click_zone node Restriction zone ---@field click_zone node Restriction zone
---@field node node Swipe node ---@field node node Swipe node
---@field on_swipe druid_event Trigger on swipe event(self, swipe_side, dist, delta_time
---@field style druid.swipe.style Component style params. ---@field style druid.swipe.style Component style params.
local druid__swipe = {} local druid__swipe = {}
@ -805,6 +934,7 @@ local druid__swipe__style = {}
---@class druid.text : druid.base_component ---@class druid.text : druid.base_component
---@field color vector3 Current text color
---@field is_no_adjust bool Current text size adjust settings ---@field is_no_adjust bool Current text size adjust settings
---@field node node Text node ---@field node node Text node
---@field on_set_pivot druid_event On change pivot callback(self, pivot) ---@field on_set_pivot druid_event On change pivot callback(self, pivot)
@ -867,6 +997,7 @@ function druid__text.set_to(self, set_to) end
---@field on_tick druid_event On timer tick. ---@field on_tick druid_event On timer tick.
---@field on_timer_end druid_event On timer end callback ---@field on_timer_end druid_event On timer end callback
---@field target number Target timer value ---@field target number Target timer value
---@field value number Current timer value
local druid__timer = {} local druid__timer = {}
--- Component init function --- Component init function
@ -894,6 +1025,11 @@ function druid__timer.set_state(self, is_on) end
function druid__timer.set_to(self, set_to) end function druid__timer.set_to(self, set_to) end
---@class druid_const
---@field ALL field Component Interests
local druid_const = {}
---@class druid_event ---@class druid_event
local druid_event = {} local druid_event = {}
@ -914,7 +1050,8 @@ function druid_event.is_exist(self) end
--- Subscribe callback on event --- Subscribe callback on event
---@param self druid_event ---@param self druid_event
---@param callback function Callback itself ---@param callback function Callback itself
function druid_event.subscribe(self, callback) end ---@param context table Additional context as first param to callback call
function druid_event.subscribe(self, callback, context) end
--- Trigger the event and call all subscribed callbacks --- Trigger the event and call all subscribed callbacks
---@param self druid_event ---@param self druid_event
@ -924,17 +1061,19 @@ function druid_event.trigger(self, ...) end
--- Unsubscribe callback on event --- Unsubscribe callback on event
---@param self druid_event ---@param self druid_event
---@param callback function Callback itself ---@param callback function Callback itself
function druid_event.unsubscribe(self, callback) end ---@param context table Additional context as first param to callback call
function druid_event.unsubscribe(self, callback, context) end
---@class druid_instance ---@class druid_instance
local druid_instance = {} local druid_instance = {}
--- Create new druid component --- Create data list basic component
---@param self druid_instance ---@param druid_scroll druid.scroll The Scroll instance for Data List component
---@param component Component Component module ---@param druid_grid druid.grid The Grid instance for Data List component
---@param ... args Other component params to pass it to component:init function ---@param create_function function The create function callback(self, data, index, data_list). Function should return (node, [component])
function druid_instance.create(self, component, ...) end ---@return druid.data_list data_list component
function druid_instance.druid:new_data_list(druid_scroll, druid_grid, create_function) end
--- Call on final function on gui_script. --- Call on final function on gui_script.
---@param self druid_instance ---@param self druid_instance
@ -946,119 +1085,156 @@ function druid_instance.final(self) end
---@param style table Druid style module ---@param style table Druid style module
function druid_instance.initialize(self, context, style) end function druid_instance.initialize(self, context, style) end
--- Create new druid component
---@param self druid_instance
---@param component Component Component module
---@param ... args Other component params to pass it to component:init function
function druid_instance.new(self, component, ...) end
--- Create back_handler basic component --- Create back_handler basic component
---@param self druid_instance ---@param self druid_instance
---@param ... args back_handler init args ---@param callback callback On back button
---@param params any Callback argument
---@return druid.back_handler back_handler component ---@return druid.back_handler back_handler component
function druid_instance.new_back_handler(self, ...) end function druid_instance.new_back_handler(self, callback, params) end
--- Create blocker basic component --- Create blocker basic component
---@param self druid_instance ---@param self druid_instance
---@param ... args blocker init args ---@param node node Gui node
---@return druid.blocker blocker component ---@return druid.blocker blocker component
function druid_instance.new_blocker(self, ...) end function druid_instance.new_blocker(self, node) end
--- Create button basic component --- Create button basic component
---@param self druid_instance ---@param self druid_instance
---@param ... args button init args ---@param node node Gui node
---@param callback function Button callback
---@param params table Button callback params
---@param anim_node node Button anim node (node, if not provided)
---@return druid.button button component ---@return druid.button button component
function druid_instance.new_button(self, ...) end function druid_instance.new_button(self, node, callback, params, anim_node) end
--- Create checkbox component --- Create checkbox component
---@param self druid_instance ---@param self druid_instance
---@param ... args checkbox init args ---@param node node Gui node
---@param callback function Checkbox callback
---@param click_node node Trigger node, by default equals to node
---@return druid.checkbox checkbox component ---@return druid.checkbox checkbox component
function druid_instance.new_checkbox(self, ...) end function druid_instance.new_checkbox(self, node, callback, click_node) end
--- Create checkbox_group component --- Create checkbox_group component
---@param self druid_instance ---@param self druid_instance
---@param ... args checkbox_group init args ---@param nodes node[] Array of gui node
---@param callback function Checkbox callback
---@param click_nodes node[] Array of trigger nodes, by default equals to nodes
---@return druid.checkbox_group checkbox_group component ---@return druid.checkbox_group checkbox_group component
function druid_instance.new_checkbox_group(self, ...) end function druid_instance.new_checkbox_group(self, nodes, callback, click_nodes) end
--- Create drag basic component --- Create drag basic component
---@param self druid_instance ---@param self druid_instance
---@param ... args drag init args ---@param node node GUI node to detect dragging
---@param on_drag_callback function Callback for on_drag_event(self, dx, dy)
---@return druid.drag drag component ---@return druid.drag drag component
function druid_instance.new_drag(self, ...) end function druid_instance.new_drag(self, node, on_drag_callback) end
--- Create dynamic grid component --- Create dynamic grid component
---@param self druid_instance ---@param self druid_instance
---@param ... args grid init args ---@param parent node The gui node parent, where items will be placed
---@return druid.dynamic_grid grid component ---@return druid.dynamic_grid grid component
function druid_instance.new_dynamic_grid(self, ...) end function druid_instance.new_dynamic_grid(self, parent) end
--- Create grid basic component Deprecated --- Create grid basic component Deprecated
---@param self druid_instance ---@param self druid_instance
---@param ... args grid init args ---@param parent node The gui node parent, where items will be placed
---@param element node Element prefab. Need to get it size
---@param in_row number How many nodes in row can be placed
---@return druid.static_grid grid component ---@return druid.static_grid grid component
function druid_instance.new_grid(self, ...) end function druid_instance.new_grid(self, parent, element, in_row) end
--- Create hover basic component --- Create hover basic component
---@param self druid_instance ---@param self druid_instance
---@param ... args hover init args ---@param node node Gui node
---@param on_hover_callback function Hover callback
---@return druid.hover hover component ---@return druid.hover hover component
function druid_instance.new_hover(self, ...) end function druid_instance.new_hover(self, node, on_hover_callback) end
--- Create input component --- Create input component
---@param self druid_instance ---@param self druid_instance
---@param ... args input init args ---@param click_node node Button node to enabled input component
---@param text_node node Text node what will be changed on user input
---@param keyboard_type number Gui keyboard type for input field
---@return druid.input input component ---@return druid.input input component
function druid_instance.new_input(self, ...) end function druid_instance.new_input(self, click_node, text_node, keyboard_type) end
--- Create lang_text component --- Create lang_text component
---@param self druid_instance ---@param self druid_instance
---@param ... args lang_text init args ---@param node node The text node
---@param locale_id string Default locale id
---@param no_adjust bool If true, will not correct text size
---@return druid.lang_text lang_text component ---@return druid.lang_text lang_text component
function druid_instance.new_lang_text(self, ...) end function druid_instance.new_lang_text(self, node, locale_id, no_adjust) end
--- Create progress component --- Create progress component
---@param self druid_instance ---@param self druid_instance
---@param ... args progress init args ---@param node string|node Progress bar fill node or node name
---@param key string Progress bar direction: const.SIDE.X or const.SIDE.Y
---@param init_value number Initial value of progress bar
---@return druid.progress progress component ---@return druid.progress progress component
function druid_instance.new_progress(self, ...) end function druid_instance.new_progress(self, node, key, init_value) end
--- Create radio_group component --- Create radio_group component
---@param self druid_instance ---@param self druid_instance
---@param ... args radio_group init args ---@param nodes node[] Array of gui node
---@param callback function Radio callback
---@param click_nodes node[] Array of trigger nodes, by default equals to nodes
---@return druid.radio_group radio_group component ---@return druid.radio_group radio_group component
function druid_instance.new_radio_group(self, ...) end function druid_instance.new_radio_group(self, nodes, callback, click_nodes) end
--- Create scroll basic component --- Create scroll basic component
---@param self druid_instance ---@param self druid_instance
---@param ... args scroll init args ---@param view_node node GUI view scroll node
---@param content_node node GUI content scroll node
---@return druid.scroll scroll component ---@return druid.scroll scroll component
function druid_instance.new_scroll(self, ...) end function druid_instance.new_scroll(self, view_node, content_node) end
--- Create slider component --- Create slider component
---@param self druid_instance ---@param self druid_instance
---@param ... args slider init args ---@param node node Gui pin node
---@param end_pos vector3 The end position of slider
---@param callback function On slider change callback
---@return druid.slider slider component ---@return druid.slider slider component
function druid_instance.new_slider(self, ...) end function druid_instance.new_slider(self, node, end_pos, callback) end
--- Create static grid basic component --- Create static grid basic component
---@param self druid_instance ---@param self druid_instance
---@param ... args grid init args ---@param parent node The gui node parent, where items will be placed
---@param element node Element prefab. Need to get it size
---@param in_row number How many nodes in row can be placed
---@return druid.static_grid grid component ---@return druid.static_grid grid component
function druid_instance.new_static_grid(self, ...) end function druid_instance.new_static_grid(self, parent, element, in_row) end
--- Create swipe basic component --- Create swipe basic component
---@param self druid_instance ---@param self druid_instance
---@param ... args swipe init args ---@param node node Gui node
---@param on_swipe_callback function Swipe callback for on_swipe_end event
---@return druid.swipe swipe component ---@return druid.swipe swipe component
function druid_instance.new_swipe(self, ...) end function druid_instance.new_swipe(self, node, on_swipe_callback) end
--- Create text basic component --- Create text basic component
---@param self druid_instance ---@param self druid_instance
---@param ... args text init args ---@param node node Gui text node
---@param value string Initial text. Default value is node text from GUI scene.
---@param no_adjust bool If true, text will be not auto-adjust size
---@return Tet text component ---@return Tet text component
function druid_instance.new_text(self, ...) end function druid_instance.new_text(self, node, value, no_adjust) end
--- Create timer component --- Create timer component
---@param self druid_instance ---@param self druid_instance
---@param ... args timer init args ---@param node node Gui text node
---@param seconds_from number Start timer value in seconds
---@param seconds_to number End timer value in seconds
---@param callback function Function on timer end
---@return druid.timer timer component ---@return druid.timer timer component
function druid_instance.new_timer(self, ...) end function druid_instance.new_timer(self, node, seconds_from, seconds_to, callback) end
--- Druid on focus gained interest function. --- Druid on focus gained interest function.
---@param self druid_instance ---@param self druid_instance
@ -1096,6 +1272,27 @@ function druid_instance.remove(self, component) end
function druid_instance.update(self, dt) end function druid_instance.update(self, dt) end
---@class formats
local formats = {}
--- Return number with zero number prefix
---@param num number Number for conversion
---@param count number Count of numerals
---@return string with need count of zero (1,3) -> 001
function formats.add_prefix_zeros(num, count) end
--- Convert seconds to string minutes:seconds
---@param sec number Seconds
---@return string minutes:seconds
function formats.second_string_min(sec) end
--- Interpolate string with named Parameters in Table
---@param s string Target string
---@param tab table Table with parameters
---@return string with replaced parameters
function formats.second_string_min(s, tab) end
---@class helper ---@class helper
local helper = {} local helper = {}
@ -1105,6 +1302,11 @@ local helper = {}
---@param margin number Offset between nodes ---@param margin number Offset between nodes
function helper.centrate_icon_with_text(icon_node, text_node, margin) end function helper.centrate_icon_with_text(icon_node, text_node, margin) end
--- Center several nodes nodes.
---@param margin number Offset between nodes
---@param ... Node Any count of gui Node
function helper.centrate_nodes(margin, ...) end
--- Center two nodes. --- Center two nodes.
---@param text_node text Gui text node ---@param text_node text Gui text node
---@param icon_node box Gui box node ---@param icon_node box Gui box node
@ -1115,9 +1317,11 @@ function helper.centrate_text_with_icon(text_node, icon_node, margin) end
---@param message string The deprecated message ---@param message string The deprecated message
function helper.deprecated(message) end function helper.deprecated(message) end
--- Distance from node to size border --- Distance from node position to his borders
---@return vector4 (left, top, right, down) ---@param node node The gui node to check
function helper.get_border() end ---@param offset vector3 The offset to add to result
---@return vector4 Vector with distance to node border: (left, top, right, down)
function helper.get_border(node, offset) end
--- Get node offset for given gui pivot --- Get node offset for given gui pivot
---@param pivot gui.pivot The node pivot ---@param pivot gui.pivot The node pivot

View File

@ -1 +1 @@
{"content":[{"name":"game.projectc","size":3140,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":5168,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":287011,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":11332,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]} {"content":[{"name":"game.projectc","size":3432,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":10608,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":384566,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":23386,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,8 +1,12 @@
[project] [project]
title = druid title = druid
version = 0.5.0 version = 0.6.459
write_log = 0 write_log = 0
compress_archive = 1 compress_archive = 1
publisher = Insality
developer = Insality
commit_sha = 015564f5b3e0d5e63e422056c69e53826ed689bf
build_time = 2021-04-05T21:00:43Z
[display] [display]
width = 600 width = 600
@ -14,6 +18,7 @@ update_frequency = 0
vsync = 1 vsync = 1
display_profiles = /builtins/render/default.display_profilesc display_profiles = /builtins/render/default.display_profilesc
dynamic_orientation = 0 dynamic_orientation = 0
display_device_info = 0
[render] [render]
clear_color_red = 0 clear_color_red = 0
@ -40,7 +45,7 @@ ray_cast_limit_3d = 128
trigger_overlap_capacity = 16 trigger_overlap_capacity = 16
[bootstrap] [bootstrap]
main_collection = /example/kenney.collectionc main_collection = /example/example.collectionc
render = /builtins/render/default.renderc render = /builtins/render/default.renderc
[graphics] [graphics]
@ -51,6 +56,7 @@ max_characters = 8192
max_debug_vertices = 10000 max_debug_vertices = 10000
texture_profiles = /example/custom.texture_profiles texture_profiles = /example/custom.texture_profiles
verify_graphics_calls = 1 verify_graphics_calls = 1
memory_size = 512
[shader] [shader]
output_spirv = 0 output_spirv = 0
@ -62,6 +68,7 @@ max_sound_buffers = 32
max_sound_sources = 16 max_sound_sources = 16
max_sound_instances = 256 max_sound_instances = 256
max_component_count = 32 max_component_count = 32
use_thread = 1
[resource] [resource]
http_cache = 0 http_cache = 0
@ -84,6 +91,9 @@ max_count = 128
[model] [model]
max_count = 128 max_count = 128
[mesh]
max_count = 128
[gui] [gui]
max_count = 64 max_count = 64
max_particlefx_count = 64 max_particlefx_count = 64
@ -111,7 +121,7 @@ default_language = en
localizations = en localizations = en
[android] [android]
version_code = 1 version_code = 459
minimum_sdk_version = 16 minimum_sdk_version = 16
target_sdk_version = 29 target_sdk_version = 29
package = com.insality.druid package = com.insality.druid
@ -125,6 +135,7 @@ debuggable = 0
[osx] [osx]
infoplist = /builtins/manifests/osx/Info.plist infoplist = /builtins/manifests/osx/Info.plist
bundle_identifier = example.unnamed bundle_identifier = example.unnamed
bundle_version = 1
default_language = en default_language = en
localizations = en localizations = en
@ -151,6 +162,8 @@ auto_finish_transactions = 1
[network] [network]
http_timeout = 0 http_timeout = 0
http_thread_count = 4
http_cache_enabled = 1
[library] [library]
include_dirs = druid include_dirs = druid
@ -167,6 +180,7 @@ track_cpu = 0
[liveupdate] [liveupdate]
settings = /liveupdate.settings settings = /liveupdate.settings
enabled = 1
[tilemap] [tilemap]
max_count = 16 max_count = 16

Binary file not shown.

Binary file not shown.

View File

@ -1,247 +1,374 @@
// file downloader
// wraps XMLHttpRequest and adds retry support and progress updates when the
// content is gzipped (gzipped content doesn't report a computable content length
// on Google Chrome)
var FileLoader = {
options: {
retryCount: 4,
retryInterval: 1000,
},
// do xhr request with retries
request: function(url, method, responseType, currentAttempt) {
if (typeof method === 'undefined') throw "No method specified";
if (typeof method === 'responseType') throw "No responseType specified";
if (typeof currentAttempt === 'undefined') currentAttempt = 0;
var obj = {
send: function() {
var onprogress = this.onprogress;
var onload = this.onload;
var onerror = this.onerror;
var xhr = new XMLHttpRequest();
xhr.open(method, url, true);
xhr.responseType = responseType;
xhr.onprogress = function(e) {
if (onprogress) onprogress(xhr, e);
};
xhr.onerror = function(e) {
if (currentAttempt == FileLoader.options.retryCount) {
if (onerror) onerror(xhr, e);
return;
}
currentAttempt = currentAttempt + 1;
setTimeout(obj.send, FileLoader.options.retryInterval);
};
xhr.onload = function(e) {
if (onload) onload(xhr, e);
};
xhr.send(null);
}
};
return obj;
},
// Do HTTP HEAD request to get size of resource
// callback will receive size or undefined in case of an error
size: function(url, callback) {
var request = FileLoader.request(url, "HEAD", "text");
request.onerror = function(xhr, e) {
callback(undefined);
};
request.onload = function(xhr, e) {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
var total = xhr.getResponseHeader('content-length');
callback(total);
} else {
callback(undefined);
}
}
};
request.send();
},
// Do HTTP GET request
// onprogress(loaded, total)
// onerror(error)
// onload(response)
load: function(url, responseType, estimatedSize, onprogress, onerror, onload) {
var request = FileLoader.request(url, "GET", responseType);
request.onprogress = function(xhr, e) {
if (e.lengthComputable) {
onprogress(e.loaded, e.total);
return;
}
var contentLength = xhr.getResponseHeader('content-length');
var size = contentLength != undefined ? contentLength : estimatedSize;
if (size) {
onprogress(e.loaded, size);
} else {
onprogress(e.loaded, e.loaded);
}
};
request.onerror = function(xhr, e) {
onerror("Error loading '" + url + "' (" + e + ")");
};
request.onload = function(xhr, e) {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
var res = xhr.response;
if (responseType == "json" && typeof res === "string") {
onload(JSON.parse(res));
} else {
onload(res);
}
} else {
onerror("Error loading '" + url + "' (" + e + ")");
}
}
};
request.send();
}
};
var EngineLoader = {
wasm_size: 2000000,
wasm_from: 0,
wasm_to: 40,
wasmjs_size: 250000,
wasmjs_from: 40,
wasmjs_to: 50,
asmjs_size: 4000000,
asmjs_from: 0,
asmjs_to: 50,
// load .wasm and set Module.instantiateWasm to use the loaded .wasm file
// https://github.com/emscripten-core/emscripten/blob/master/tests/manual_wasm_instantiate.html#L170
loadWasmAsync: function(src, fromProgress, toProgress, callback) {
FileLoader.load(src, "arraybuffer", EngineLoader.wasm_size,
function(loaded, total) { Progress.calculateProgress(fromProgress, toProgress, loaded, total); },
function(error) { throw error; },
function(wasm) {
Module.instantiateWasm = function(imports, successCallback) {
var wasmInstantiate = WebAssembly.instantiate(new Uint8Array(wasm), imports).then(function(output) {
successCallback(output.instance);
}).catch(function(e) {
console.log('wasm instantiation failed! ' + e);
throw e;
});
return {}; // Compiling asynchronously, no exports.
}
callback();
});
},
// load and start engine script (asm.js or wasm.js)
loadScriptAsync: function(src, estimatedSize, fromProgress, toProgress) {
FileLoader.load(src, "text", estimatedSize,
function(loaded, total) { Progress.calculateProgress(fromProgress, toProgress, loaded, total); },
function(error) { throw error; },
function(response) {
var tag = document.createElement("script");
tag.text = response;
document.head.appendChild(tag);
});
},
// load engine (asm.js or wasm.js + wasm)
// engine load progress goes from 1-50% for ams.js
// engine load progress goes from 0-40% for .wasm and 40-50% for wasm.js
load: function(appCanvasId, exeName) {
Progress.addProgress(Module.setupCanvas(appCanvasId));
if (Module['isWASMSupported']) {
EngineLoader.loadWasmAsync(exeName + ".wasm", EngineLoader.wasm_from, EngineLoader.wasm_to, function(wasm) {
EngineLoader.loadScriptAsync(exeName + '_wasm.js', EngineLoader.wasmjs_size, EngineLoader.wasmjs_from, EngineLoader.wasmjs_to);
});
} else {
EngineLoader.loadScriptAsync(exeName + '_asmjs.js', EngineLoader.asmjs_size, EngineLoader.asmjs_from, EngineLoader.asmjs_to);
}
}
}
/* ********************************************************************* */ /* ********************************************************************* */
/* Load and combine data that is split into archives */ /* Load and combine game archive data that is split into archives */
/* ********************************************************************* */ /* ********************************************************************* */
var Combine = { var GameArchiveLoader = {
_targets: [], // which files to load
_targetIndex: 0, _files: [],
// target: build target _fileIndex: 0,
// file
// name: intended filepath of built object // name: intended filepath of built object
// size: expected size of built object. // size: expected size of built object.
// data: combined data // data: combined pieces
// downloaded: total amount of data downloaded // downloaded: total bytes downloaded
// pieces: array of name, offset and data objects // pieces: array of name, offset and data objects
// numExpectedFiles: total number of files expected in description // numExpectedFiles: total number of files expected in description
// lastRequestedPiece: index of last data file requested (strictly ascending) // lastRequestedPiece: index of last data file requested (strictly ascending)
// totalLoadedPieces: counts the number of data files received // totalLoadedPieces: counts the number pieces received
//MAX_CONCURRENT_XHR: 6, // remove comment if throttling of XHR is desired. //MAX_CONCURRENT_XHR: 6, // remove comment if throttling of XHR is desired.
isCompleted: false, // status of process isCompleted: false, // status of process
_onCombineCompleted: [], // signature: name, data. _onFileLoadedListeners: [], // signature: name, data.
_onAllTargetsBuilt:[], // signature: void _onArchiveLoadedListeners:[], // signature: void
_onDownloadProgress: [], // signature: downloaded, total _onFileDownloadErrorListeners: [], // signature: name
_currentDownloadBytes: 0, _currentDownloadBytes: 0,
_totalDownloadBytes: 0, _totalDownloadBytes: 0,
_retry_time: 0, // pause before retry file loading after error
_max_retry_count: 0, // how many attempts we do when trying to download a file.
_can_not_download_file_callback: undefined, //Function that is called if you can't download file after 'retry_count' attempts.
_archiveLocationFilter: function(path) { return "split" + path; }, _archiveLocationFilter: function(path) { return "split" + path; },
can_not_download_file: function(file) {
if (typeof Combine._can_not_download_file_callback === 'function') {
Combine._can_not_download_file_callback(file);
}
},
addProgressListener: function(callback) {
if (typeof callback !== 'function') {
throw "Invalid callback registration";
}
this._onDownloadProgress.push(callback);
},
addCombineCompletedListener: function(callback) {
if (typeof callback !== 'function') {
throw "Invalid callback registration";
}
this._onCombineCompleted.push(callback);
},
addAllTargetsBuiltListener: function(callback) {
if (typeof callback !== 'function') {
throw "Invalid callback registration";
}
this._onAllTargetsBuilt.push(callback);
},
// descriptUrl: location of text file describing files to be preloaded
process: function(descriptUrl, attempt_count) {
if (!attempt_count) {
attempt_count = 0;
}
var xhr = new XMLHttpRequest();
xhr.open('GET', descriptUrl);
xhr.responseType = 'text';
xhr.onload = function(evt) {
Combine.onReceiveDescription(xhr);
};
xhr.onerror = function(evt) {
attempt_count += 1;
if (attempt_count < Combine._max_retry_count) {
console.warn("Can't download file '" + descriptUrl + "' . Next try in " + Combine._retry_time + " sec.");
setTimeout(function() {
Combine.process(descriptUrl, attempt_count);
}, Combine._retry_time * 1000);
} else {
Combine.can_not_download_file(descriptUrl);
}
};
xhr.send(null);
},
cleanUp: function() { cleanUp: function() {
this._targets = []; this._files = [];
this._targetIndex = 0; this._fileIndex = 0;
this.isCompleted = false; this.isCompleted = false;
this._onCombineCompleted = []; this._onGameArchiveLoaderCompletedListeners = [];
this._onAllTargetsBuilt = []; this._onAllTargetsBuiltListeners = [];
this._onDownloadProgress = []; this._onFileDownloadErrorListeners = [];
this._currentDownloadBytes = 0; this._currentDownloadBytes = 0;
this._totalDownloadBytes = 0; this._totalDownloadBytes = 0;
}, },
onReceiveDescription: function(xhr) { addListener: function(list, callback) {
var json = JSON.parse(xhr.responseText); if (typeof callback !== 'function') throw "Invalid callback registration";
this._targets = json.content; list.push(callback);
},
notifyListeners: function(list, data) {
for (i=0; i<list.length; ++i) {
list[i](data);
}
},
addFileDownloadErrorListener: function(callback) {
this.addListener(this._onFileDownloadErrorListeners, callback);
},
notifyFileDownloadError: function(url) {
this.notifyListeners(this._onFileDownloadErrorListeners, url);
},
addFileLoadedListener: function(callback) {
this.addListener(this._onFileLoadedListeners, callback);
},
notifyFileLoaded: function(file) {
this.notifyListeners(this._onFileLoadedListeners, { name: file.name, data: file.data });
},
addArchiveLoadedListener: function(callback) {
this.addListener(this._onArchiveLoadedListeners, callback);
},
notifyArchiveLoaded: function() {
this.notifyListeners(this._onArchiveLoadedListeners);
},
setFileLocationFilter: function(filter) {
if (typeof filter !== 'function') throw "Invalid filter";
this._archiveLocationFilter = filter;
},
// load the archive_files.json with the list of files and their individual
// pieces
// descriptionUrl: location of text file describing files to be preloaded
loadArchiveDescription: function(descriptionUrl) {
FileLoader.load(
this._archiveLocationFilter(descriptionUrl),
"json",
undefined,
function (loaded, total) { },
function (error) { GameArchiveLoader.notifyFileDownloadError(descriptionUrl); },
function (json) { GameArchiveLoader.onReceiveDescription(json); });
},
onReceiveDescription: function(json) {
this._files = json.content;
this._totalDownloadBytes = 0; this._totalDownloadBytes = 0;
this._currentDownloadBytes = 0; this._currentDownloadBytes = 0;
var targets = this._targets; // calculate total download size of all files
for(var i=0; i<targets.length; ++i) { for(var i=0; i<this._files.length; ++i) {
this._totalDownloadBytes += targets[i].size; this._totalDownloadBytes += this._files[i].size;
} }
this.requestContent(); this.downloadContent();
}, },
requestContent: function() { downloadContent: function() {
var target = this._targets[this._targetIndex]; var file = this._files[this._fileIndex];
if (1 < target.pieces.length) { // if the file consists of more than one piece we prepare an array to store the pieces in
target.data = new Uint8Array(target.size); if (file.pieces.length > 1) {
file.data = new Uint8Array(file.size);
} }
var limit = target.pieces.length; // how many pieces to download at a time
var limit = file.pieces.length;
if (typeof this.MAX_CONCURRENT_XHR !== 'undefined') { if (typeof this.MAX_CONCURRENT_XHR !== 'undefined') {
limit = Math.min(limit, this.MAX_CONCURRENT_XHR); limit = Math.min(limit, this.MAX_CONCURRENT_XHR);
} }
// download pieces
for (var i=0; i<limit; ++i) { for (var i=0; i<limit; ++i) {
this.requestPiece(target, i); this.downloadPiece(file, i);
} }
}, },
requestPiece: function(target, index, attempt_count) { notifyDownloadProgress: function() {
if (!attempt_count) { Progress.calculateProgress(50, 100, this._currentDownloadBytes, this._totalDownloadBytes);
attempt_count = 0; },
}
if (index < target.lastRequestedPiece) { downloadPiece: function(file, index) {
if (index < file.lastRequestedPiece) {
throw "Request out of order"; throw "Request out of order";
} }
var item = target.pieces[index]; var piece = file.pieces[index];
target.lastRequestedPiece = index; file.lastRequestedPiece = index;
file.totalLoadedPieces = 0;
var total = 0; var total = 0;
var downloaded = 0; var downloaded = 0;
var xhr = new XMLHttpRequest(); var url = this._archiveLocationFilter('/' + piece.name);
var url = this._archiveLocationFilter('/' + item.name);
xhr.open('GET', url, true); FileLoader.load(
xhr.responseType = 'arraybuffer'; url, "arraybuffer", undefined,
// called periodically with information about the transaction function (loaded, total) {
xhr.onprogress = function(evt) { var delta = loaded - downloaded;
if (evt.total && evt.lengthComputable) { downloaded = loaded;
total = evt.total; GameArchiveLoader._currentDownloadBytes += delta;
} GameArchiveLoader.notifyDownloadProgress();
if (evt.loaded && evt.lengthComputable) { },
var delta = evt.loaded - downloaded; function (error) {
downloaded = evt.loaded; GameArchiveLoader.notifyFileDownloadError(error);
Combine._currentDownloadBytes += delta; },
Combine.updateProgress(target); function (response) {
} piece.data = new Uint8Array(response);
}; piece.dataLength = piece.data.length;
// called when the transaction completes successfully total = piece.dataLength;
xhr.onload = function(evt) { downloaded = piece.dataLength;
item.data = new Uint8Array(xhr.response); GameArchiveLoader.onPieceLoaded(file, piece);
item.dataLength = item.data.length; GameArchiveLoader.notifyDownloadProgress();
total = item.dataLength; piece.data = undefined;
downloaded = item.dataLength; });
Combine.copyData(target, item);
Combine.onPieceLoaded(target, item);
Combine.updateProgress(target);
item.data = undefined;
};
// called when the transaction fails
xhr.onerror = function(evt) {
downloaded = 0;
Combine.updateProgress(target);
attempt_count += 1;
if (attempt_count < Combine._max_retry_count) {
console.warn("Can't download file '" + item.name + "' . Next try in " + Combine._retry_time + " sec.");
setTimeout(function() {
Combine.requestPiece(target, index, attempt_count);
}, Combine._retry_time * 1000);
} else {
Combine.can_not_download_file(item.name);
}
};
xhr.send(null);
}, },
updateProgress: function(target) { addPieceToFile: function(file, piece) {
for(i = 0; i<this._onDownloadProgress.length; ++i) { if (1 == file.pieces.length) {
this._onDownloadProgress[i](this._currentDownloadBytes, this._totalDownloadBytes); file.data = piece.data;
}
},
copyData: function(target, item) {
if (1 == target.pieces.length) {
target.data = item.data;
} else { } else {
var start = item.offset; var start = piece.offset;
var end = start + item.data.length; var end = start + piece.data.length;
if (0 > start) { if (0 > start) {
throw "Buffer underflow"; throw "Buffer underflow";
} }
if (end > target.data.length) { if (end > file.data.length) {
throw "Buffer overflow"; throw "Buffer overflow";
} }
target.data.set(item.data, item.offset); file.data.set(piece.data, piece.offset);
} }
}, },
onPieceLoaded: function(target, item) { onPieceLoaded: function(file, piece) {
if (typeof target.totalLoadedPieces === 'undefined') { this.addPieceToFile(file, piece);
target.totalLoadedPieces = 0;
++file.totalLoadedPieces;
// is all pieces of the file loaded?
if (file.totalLoadedPieces == file.pieces.length) {
this.onFileLoaded(file);
} }
++target.totalLoadedPieces; // continue loading more pieces of the file
if (target.totalLoadedPieces == target.pieces.length) { // if not all pieces are already in progress
this.finalizeTarget(target); else {
++this._targetIndex; var next = file.lastRequestedPiece + 1;
for (var i=0; i<this._onCombineCompleted.length; ++i) { if (next < file.pieces.length) {
this._onCombineCompleted[i](target.name, target.data); this.downloadPiece(file, next);
}
if (this._targetIndex < this._targets.length) {
this.requestContent();
} else {
this.isCompleted = true;
for (i=0; i<this._onAllTargetsBuilt.length; ++i) {
this._onAllTargetsBuilt[i]();
}
}
} else {
var next = target.lastRequestedPiece + 1;
if (next < target.pieces.length) {
this.requestPiece(target, next);
} }
} }
}, },
finalizeTarget: function(target) { verifyFile: function(file) {
// verify that we downloaded as much as we were supposed to
var actualSize = 0; var actualSize = 0;
for (var i=0;i<target.pieces.length; ++i) { for (var i=0;i<file.pieces.length; ++i) {
actualSize += target.pieces[i].dataLength; actualSize += file.pieces[i].dataLength;
} }
if (actualSize != target.size) { if (actualSize != file.size) {
throw "Unexpected data size"; throw "Unexpected data size";
} }
if (1 < target.pieces.length) { // verify the pieces
var output = target.data; if (file.pieces.length > 1) {
var pieces = target.pieces; var output = file.data;
var pieces = file.pieces;
for (i=0; i<pieces.length; ++i) { for (i=0; i<pieces.length; ++i) {
var item = pieces[i]; var item = pieces[i];
// Bounds check // Bounds check
@ -261,6 +388,22 @@ var Combine = {
} }
} }
} }
},
onFileLoaded: function(file) {
this.verifyFile(file);
this.notifyFileLoaded(file);
++this._fileIndex;
if (this._fileIndex == this._files.length) {
this.onArchiveLoaded();
} else {
this.downloadContent();
}
},
onArchiveLoaded: function() {
this.isCompleted = true;
this.notifyArchiveLoaded();
} }
}; };
@ -272,6 +415,19 @@ var Progress = {
progress_id: "defold-progress", progress_id: "defold-progress",
bar_id: "defold-progress-bar", bar_id: "defold-progress-bar",
listeners: [],
addListener: function(callback) {
if (typeof callback !== 'function') throw "Invalid callback registration";
this.listeners.push(callback);
},
notifyListeners: function(percentage) {
for (i=0; i<this.listeners.length; ++i) {
this.listeners[i](percentage);
}
},
addProgress : function (canvas) { addProgress : function (canvas) {
/* Insert default progress bar below canvas */ /* Insert default progress bar below canvas */
canvas.insertAdjacentHTML('afterend', '<div id="' + Progress.progress_id + '" class="canvas-app-progress"><div id="' + Progress.bar_id + '" class="canvas-app-progress-bar" style="width: 0%;"></div></div>'); canvas.insertAdjacentHTML('afterend', '<div id="' + Progress.progress_id + '" class="canvas-app-progress"><div id="' + Progress.bar_id + '" class="canvas-app-progress-bar" style="width: 0%;"></div></div>');
@ -279,8 +435,15 @@ var Progress = {
Progress.progress = document.getElementById(Progress.progress_id); Progress.progress = document.getElementById(Progress.progress_id);
}, },
updateProgress: function (percentage, text) { updateProgress: function(percentage) {
Progress.bar.style.width = percentage + "%"; if (Progress.bar) {
Progress.bar.style.width = percentage + "%";
}
Progress.notifyListeners(percentage);
},
calculateProgress: function (from, to, current, total) {
this.updateProgress(from + (current / total) * (to - from));
}, },
removeProgress: function () { removeProgress: function () {
@ -343,6 +506,8 @@ var Module = {
_syncMaxTries: 3, _syncMaxTries: 3,
_syncTries: 0, _syncTries: 0,
arguments: [],
print: function(text) { console.log(text); }, print: function(text) { console.log(text); },
printErr: function(text) { console.error(text); }, printErr: function(text) { console.error(text); },
@ -350,8 +515,7 @@ var Module = {
isWASMSupported: (function() { isWASMSupported: (function() {
try { try {
if (typeof WebAssembly === "object" if (typeof WebAssembly === "object" && typeof WebAssembly.instantiate === "function") {
&& typeof WebAssembly.instantiate === "function") {
const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00)); const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
if (module instanceof WebAssembly.Module) if (module instanceof WebAssembly.Module)
return new WebAssembly.Instance(module) instanceof WebAssembly.Instance; return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;
@ -438,6 +602,13 @@ var Module = {
} }
}, },
setupCanvas: function(appCanvasId) {
appCanvasId = (typeof appCanvasId === 'undefined') ? 'canvas' : appCanvasId;
Module.canvas = document.getElementById(appCanvasId);
return Module.canvas;
},
/** /**
* Module.runApp - Starts the application given a canvas element id * Module.runApp - Starts the application given a canvas element id
* *
@ -470,8 +641,8 @@ var Module = {
* 'can_not_download_file_callback': * 'can_not_download_file_callback':
* Function that is called if you can't download file after 'retry_count' attempts. * Function that is called if you can't download file after 'retry_count' attempts.
**/ **/
runApp: function(app_canvas_id, extra_params) { runApp: function(appCanvasId, extra_params) {
app_canvas_id = (typeof app_canvas_id === 'undefined') ? 'canvas' : app_canvas_id; Module.setupCanvas(appCanvasId);
var params = { var params = {
archive_location_filter: function(path) { return 'split' + path; }, archive_location_filter: function(path) { return 'split' + path; },
@ -491,10 +662,14 @@ var Module = {
} }
} }
Module.canvas = document.getElementById(app_canvas_id);
Module.arguments = params["engine_arguments"]; Module.arguments = params["engine_arguments"];
Module.persistentStorage = params["persistent_storage"]; Module.persistentStorage = params["persistent_storage"];
Module["TOTAL_MEMORY"] = params["custom_heap_size"];
var fullScreenContainer = params["full_screen_container"];
if (typeof fullScreenContainer === "string") {
fullScreenContainer = document.querySelector(fullScreenContainer);
}
Module.fullScreenContainer = fullScreenContainer || Module.canvas;
if (Module.hasWebGLSupport()) { if (Module.hasWebGLSupport()) {
// Override game keys // Override game keys
@ -502,9 +677,6 @@ var Module = {
Module.setupVisibilityChangeListener(); Module.setupVisibilityChangeListener();
// Add progress visuals
Progress.addProgress(Module.canvas);
// Add context menu hide-handler if requested // Add context menu hide-handler if requested
if (params["disable_context_menu"]) if (params["disable_context_menu"])
{ {
@ -513,19 +685,17 @@ var Module = {
}; };
} }
Combine._retry_time = params["retry_time"]; FileLoader.options.retryCount = params["retry_count"];
Combine._max_retry_count = params["retry_count"]; FileLoader.options.retryInterval = params["retry_time"] * 1000;
if (typeof params["can_not_download_file_callback"] === "function") { if (typeof params["can_not_download_file_callback"] === "function") {
Combine._can_not_download_file_callback = params["can_not_download_file_callback"]; GameArchiveLoader.addFileDownloadErrorListener(params["can_not_download_file_callback"]);
} }
// Load and assemble archive // Load and assemble archive
Combine.addCombineCompletedListener(Module.onArchiveFileLoaded); GameArchiveLoader.addFileLoadedListener(Module.onArchiveFileLoaded);
Combine.addAllTargetsBuiltListener(Module.onArchiveLoaded); GameArchiveLoader.addArchiveLoadedListener(Module.onArchiveLoaded);
Combine.addProgressListener(Module.onArchiveLoadProgress); GameArchiveLoader.setFileLocationFilter(params["archive_location_filter"]);
Combine._archiveLocationFilter = params["archive_location_filter"]; GameArchiveLoader.loadArchiveDescription('/archive_files.json');
Combine.process(Combine._archiveLocationFilter('/archive_files.json'));
} else { } else {
Progress.addProgress(Module.canvas);
Progress.updateProgress(100, "Unable to start game, WebGL not supported"); Progress.updateProgress(100, "Unable to start game, WebGL not supported");
Module.setStatus = function(text) { Module.setStatus = function(text) {
if (text) Module.printErr('[missing WebGL] ' + text); if (text) Module.printErr('[missing WebGL] ' + text);
@ -537,16 +707,12 @@ var Module = {
} }
}, },
onArchiveLoadProgress: function(downloaded, total) { onArchiveFileLoaded: function(file) {
Progress.updateProgress(downloaded / total * 100); Module._filesToPreload.push({path: file.name, data: file.data});
},
onArchiveFileLoaded: function(name, data) {
Module._filesToPreload.push({path: name, data: data});
}, },
onArchiveLoaded: function() { onArchiveLoaded: function() {
Combine.cleanUp(); GameArchiveLoader.cleanUp();
Module._archiveLoaded = true; Module._archiveLoaded = true;
Progress.updateProgress(100, "Starting..."); Progress.updateProgress(100, "Starting...");
@ -555,11 +721,11 @@ var Module = {
} }
}, },
toggleFullscreen: function() { toggleFullscreen: function(element) {
if (GLFW.isFullscreen) { if (GLFW.isFullscreen) {
GLFW.cancelFullScreen(); GLFW.cancelFullScreen();
} else { } else {
GLFW.requestFullScreen(); GLFW.requestFullScreen(element);
} }
}, },
@ -654,10 +820,6 @@ var Module = {
if (!Module._archiveLoaded) { if (!Module._archiveLoaded) {
Module._waitingForArchive = true; Module._waitingForArchive = true;
} else { } else {
// Need to set heap size before calling main
TOTAL_MEMORY = Module["TOTAL_MEMORY"] || TOTAL_MEMORY;
Module.preloadAll(); Module.preloadAll();
Progress.removeProgress(); Progress.removeProgress();
if (Module.callMain === undefined) { if (Module.callMain === undefined) {
@ -693,8 +855,10 @@ var Module = {
}; };
window.onerror = function(err, url, line, column, errObj) { window.onerror = function(err, url, line, column, errObj) {
var errorObject = Module.prepareErrorObject(err, url, line, column, errObj); if (typeof Module.ccall !== 'undefined') {
Module.ccall('JSWriteDump', 'null', ['string'], [JSON.stringify(errorObject.stack)]); var errorObject = Module.prepareErrorObject(err, url, line, column, errObj);
Module.ccall('JSWriteDump', 'null', ['string'], [JSON.stringify(errorObject.stack)]);
}
Module.setStatus('Exception thrown, see JavaScript console'); Module.setStatus('Exception thrown, see JavaScript console');
Module.setStatus = function(text) { Module.setStatus = function(text) {
if (text) Module.printErr('[post-exception status] ' + text); if (text) Module.printErr('[post-exception status] ' + text);

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags --> <!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>druid 0.5.0</title> <title>druid 0.6.459</title>
<style type='text/css'> <style type='text/css'>
/* Disable user selection to avoid strange bug in Chrome on Windows: /* Disable user selection to avoid strange bug in Chrome on Windows:
* Selecting a text outside the canvas, then clicking+draging would * Selecting a text outside the canvas, then clicking+draging would
@ -43,6 +43,10 @@
vertical-align: bottom; vertical-align: bottom;
} }
#canvas-container {
position: relative;
}
canvas:focus, canvas:active { canvas:focus, canvas:active {
outline: none; outline: none;
border: 0; border: 0;
@ -118,7 +122,9 @@
<body> <body>
<div id="app-container" class="canvas-app-container"> <div id="app-container" class="canvas-app-container">
<canvas id="canvas" class="canvas-app-canvas" tabindex="1" width="600" height="900"></canvas> <div id="canvas-container" class="canvas-app-canvas-container">
<canvas id="canvas" class="canvas-app-canvas" tabindex="1" width="600" height="900"></canvas>
</div>
<div class="buttons-background"> <div class="buttons-background">
</div> </div>
</div> </div>
@ -132,9 +138,12 @@
}, },
engine_arguments: ["--verify-graphics-calls=false",], engine_arguments: ["--verify-graphics-calls=false",],
custom_heap_size: 67108864, custom_heap_size: 67108864,
full_screen_container: "#canvas-container",
disable_context_menu: true disable_context_menu: true
} }
Module['INITIAL_MEMORY'] = extra_params.custom_heap_size;
Module['onRuntimeInitialized'] = function() { Module['onRuntimeInitialized'] = function() {
Module.runApp("canvas", extra_params); Module.runApp("canvas", extra_params);
}; };
@ -192,20 +201,10 @@
resize_game_canvas(); resize_game_canvas();
window.addEventListener('resize', resize_game_canvas, false); window.addEventListener('resize', resize_game_canvas, false);
window.addEventListener('orientationchange', resize_game_canvas, false); window.addEventListener('orientationchange', resize_game_canvas, false);
function load_engine() {
var engineJS = document.createElement('script');
engineJS.type = 'text/javascript';
if (Module['isWASMSupported']) {
engineJS.src = 'druid_wasm.js';
} else {
engineJS.src = 'druid_asmjs.js';
}
document.head.appendChild(engineJS);
}
</script> </script>
<script id='engine-start' type='text/javascript'> <script id='engine-start' type='text/javascript'>
load_engine(); EngineLoader.load("canvas", "druid");
</script> </script>
</body> </body>
</html> </html>

View File

@ -45,6 +45,7 @@
<li><a href="modules/DruidEvent.html">DruidEvent</a></li> <li><a href="modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="modules/Checkbox.html">Checkbox</a></li> <li><a href="modules/Checkbox.html">Checkbox</a></li>
<li><a href="modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="modules/DataList.html">DataList</a></li>
<li><a href="modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="modules/Input.html">Input</a></li> <li><a href="modules/Input.html">Input</a></li>
<li><a href="modules/LangText.html">LangText</a></li> <li><a href="modules/LangText.html">LangText</a></li>
@ -121,6 +122,10 @@
<td class="name" nowrap><a href="modules/CheckboxGroup.html">CheckboxGroup</a></td> <td class="name" nowrap><a href="modules/CheckboxGroup.html">CheckboxGroup</a></td>
<td class="summary">Checkbox group module</td> <td class="summary">Checkbox group module</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="modules/DataList.html">DataList</a></td>
<td class="summary">Component to manage data for huge dataset in scroll.</td>
</tr>
<tr> <tr>
<td class="name" nowrap><a href="modules/DynamicGrid.html">DynamicGrid</a></td> <td class="name" nowrap><a href="modules/DynamicGrid.html">DynamicGrid</a></td>
<td class="summary">Component to handle placing components in row</td> <td class="summary">Component to handle placing components in row</td>
@ -164,7 +169,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -53,6 +53,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -90,6 +91,10 @@
<td class="name" nowrap><a href="#on_back">on_back</a></td> <td class="name" nowrap><a href="#on_back">on_back</a></td>
<td class="summary">On back handler callback(self, params)</td> <td class="summary">On back handler callback(self, params)</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#params">params</a></td>
<td class="summary">Params to back callback</td>
</tr>
</table> </table>
<br/> <br/>
@ -181,6 +186,26 @@
</dd>
<dt>
<a name = "params"></a>
<strong>params</strong>
</dt>
<dd>
Params to back callback
<ul>
<li><span class="parameter">params</span>
<span class="types"><span class="type">any</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -189,7 +214,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -33,6 +33,7 @@
<h2>Contents</h2> <h2>Contents</h2>
<ul> <ul>
<li><a href="#Functions">Functions</a></li> <li><a href="#Functions">Functions</a></li>
<li><a href="#Fields">Fields</a></li>
</ul> </ul>
@ -52,6 +53,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -92,14 +94,6 @@
<td class="summary">Get current component context</td> <td class="summary">Get current component context</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#increase_input_priority">increase_input_priority(self)</a></td>
<td class="summary">Increase input priority in current input stack</td>
</tr>
<tr>
<td class="name" nowrap><a href="#reset_input_priority">reset_input_priority(self)</a></td>
<td class="summary">Reset input priority in current input stack</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_node">get_node(self, node_or_name)</a></td> <td class="name" nowrap><a href="#get_node">get_node(self, node_or_name)</a></td>
<td class="summary">Get node for component by name.</td> <td class="summary">Get node for component by name.</td>
</tr> </tr>
@ -112,6 +106,22 @@
<td class="summary">Return component name</td> <td class="summary">Return component name</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#get_input_priority">get_input_priority(self)</a></td>
<td class="summary">Return component input priority</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_input_priority">set_input_priority(self, value)</a></td>
<td class="summary">Set component input priority</td>
</tr>
<tr>
<td class="name" nowrap><a href="#reset_input_priority">reset_input_priority(self)</a></td>
<td class="summary">Reset component input priority to default value</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_uid">get_uid(self)</a></td>
<td class="summary">Return component uid.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_input_enabled">set_input_enabled(self, state)</a></td> <td class="name" nowrap><a href="#set_input_enabled">set_input_enabled(self, state)</a></td>
<td class="summary">Set component input state.</td> <td class="summary">Set component input state.</td>
</tr> </tr>
@ -124,6 +134,13 @@
<td class="summary">Setup component context and his style table</td> <td class="summary">Setup component context and his style table</td>
</tr> </tr>
</table> </table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#ALL">ALL</a></td>
<td class="summary">Component Interests</td>
</tr>
</table>
<br/> <br/>
<br/> <br/>
@ -235,48 +252,6 @@
</dd>
<dt>
<a name = "increase_input_priority"></a>
<strong>increase_input_priority(self)</strong>
</dt>
<dd>
Increase input priority in current input stack
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "reset_input_priority"></a>
<strong>reset_input_priority(self)</strong>
</dt>
<dd>
Reset input priority in current input stack
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
</ul>
</dd> </dd>
<dt> <dt>
<a name = "get_node"></a> <a name = "get_node"></a>
@ -366,6 +341,118 @@
</dd>
<dt>
<a name = "get_input_priority"></a>
<strong>get_input_priority(self)</strong>
</dt>
<dd>
Return component input priority
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
The component input priority
</ol>
</dd>
<dt>
<a name = "set_input_priority"></a>
<strong>set_input_priority(self, value)</strong>
</dt>
<dd>
Set component input priority
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
<li><span class="parameter">value</span>
<span class="types"><span class="type">number</span></span>
The new input priority value
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
The component input priority
</ol>
</dd>
<dt>
<a name = "reset_input_priority"></a>
<strong>reset_input_priority(self)</strong>
</dt>
<dd>
Reset component input priority to default value
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
The component input priority
</ol>
</dd>
<dt>
<a name = "get_uid"></a>
<strong>get_uid(self)</strong>
</dt>
<dd>
Return component uid. UID generated in component creation order
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
The component uid
</ol>
</dd> </dd>
<dt> <dt>
<a name = "set_input_enabled"></a> <a name = "set_input_enabled"></a>
@ -464,6 +551,24 @@
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "ALL"></a>
<strong>ALL</strong>
</dt>
<dd>
Component Interests
</dd> </dd>
</dl> </dl>
@ -472,7 +577,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -33,6 +33,7 @@
<h2>Contents</h2> <h2>Contents</h2>
<ul> <ul>
<li><a href="#Functions">Functions</a></li> <li><a href="#Functions">Functions</a></li>
<li><a href="#Fields">Fields</a></li>
</ul> </ul>
@ -52,6 +53,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -87,6 +89,13 @@
<td class="summary">Return blocked enabled state</td> <td class="summary">Return blocked enabled state</td>
</tr> </tr>
</table> </table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#node">node</a></td>
<td class="summary">Trigger node</td>
</tr>
</table>
<br/> <br/>
<br/> <br/>
@ -110,7 +119,7 @@
</li> </li>
<li><span class="parameter">node</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span> <span class="types"><a class="type" href="../modules/Blocker.html#node">node</a></span>
Gui node Gui node
</li> </li>
</ul> </ul>
@ -171,6 +180,30 @@
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "node"></a>
<strong>node</strong>
</dt>
<dd>
Trigger node
<ul>
<li><span class="parameter">node</span>
<span class="types"><a class="type" href="../modules/Blocker.html#node">node</a></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -179,7 +212,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -54,6 +54,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -162,6 +163,10 @@
<td class="name" nowrap><a href="#hover">hover</a></td> <td class="name" nowrap><a href="#hover">hover</a></td>
<td class="summary">Druid hover logic component</td> <td class="summary">Druid hover logic component</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#click_zone">click_zone</a></td>
<td class="summary">Restriction zone</td>
</tr>
</table> </table>
<br/> <br/>
@ -680,6 +685,27 @@
</dd>
<dt>
<a name = "click_zone"></a>
<strong>click_zone</strong>
</dt>
<dd>
Restriction zone
<ul>
<li><span class="parameter">click_zone</span>
<span class="types"><a class="type" href="../modules/Button.html#node">node</a></span>
(<em>optional</em>)
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -688,7 +714,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -54,6 +54,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><strong>Checkbox</strong></li> <li><strong>Checkbox</strong></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -110,6 +111,10 @@
<td class="name" nowrap><a href="#click_node">click_node</a></td> <td class="name" nowrap><a href="#click_node">click_node</a></td>
<td class="summary">Button trigger node</td> <td class="summary">Button trigger node</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#button">button</a></td>
<td class="summary">Button component from click_node</td>
</tr>
</table> </table>
<br/> <br/>
@ -300,6 +305,26 @@
</dd>
<dt>
<a name = "button"></a>
<strong>button</strong>
</dt>
<dd>
Button component from click_node
<ul>
<li><span class="parameter">button</span>
<span class="types"><span class="type">Button</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -308,7 +333,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -53,6 +53,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><strong>CheckboxGroup</strong></li> <li><strong>CheckboxGroup</strong></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -94,6 +95,10 @@
<td class="name" nowrap><a href="#on_checkbox_click">on_checkbox_click</a></td> <td class="name" nowrap><a href="#on_checkbox_click">on_checkbox_click</a></td>
<td class="summary">On any checkbox click callback(self, index)</td> <td class="summary">On any checkbox click callback(self, index)</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#checkboxes">checkboxes</a></td>
<td class="summary">Array of checkbox components</td>
</tr>
</table> </table>
<br/> <br/>
@ -212,6 +217,26 @@
</dd>
<dt>
<a name = "checkboxes"></a>
<strong>checkboxes</strong>
</dt>
<dd>
Array of checkbox components
<ul>
<li><span class="parameter">checkboxes</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -220,7 +245,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

506
docs/modules/DataList.html Normal file
View File

@ -0,0 +1,506 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><strong>DataList</strong></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>DataList</code></h1>
<p>Component to manage data for huge dataset in scroll.</p>
<p>
It requires Druid Scroll and Druid Grid (Static or Dynamic) components</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(self, scroll, grid, create_function)</a></td>
<td class="summary">Data list constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_remove">on_remove(self)</a></td>
<td class="summary">Druid System on_remove function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_data">set_data(self, data)</a></td>
<td class="summary">Set new data set for DataList component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#clear">clear(self)</a></td>
<td class="summary">Clear the DataList and refresh visuals</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_first_index">get_first_index(self)</a></td>
<td class="summary">Return first index from data.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_last_index">get_last_index(self)</a></td>
<td class="summary">Return last index from data</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_length">get_length(self)</a></td>
<td class="summary">Return amount of data</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_index">get_index(self, data)</a></td>
<td class="summary">Return index for data value</td>
</tr>
<tr>
<td class="name" nowrap><a href="#scroll_to_index">scroll_to_index(self, index)</a></td>
<td class="summary">Instant scroll to element with passed index</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#scroll">scroll</a></td>
<td class="summary">The Druid scroll component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#grid">grid</a></td>
<td class="summary">The Druid Grid component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#top_index">top_index</a></td>
<td class="summary">The current visual top data index</td>
</tr>
<tr>
<td class="name" nowrap><a href="#last_index">last_index</a></td>
<td class="summary">The current visual last data index</td>
</tr>
<tr>
<td class="name" nowrap><a href="#scroll_progress">scroll_progress</a></td>
<td class="summary">The current progress of scroll posititon</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_scroll_progress_change">on_scroll_progress_change</a></td>
<td class="summary">Event triggered when scroll progress is changed; event(self, progress_value)</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(self, scroll, grid, create_function)</strong>
</dt>
<dd>
Data list constructor
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DataList</span></span>
</li>
<li><span class="parameter">scroll</span>
<span class="types"><span class="type">druid.scroll</span></span>
The Scroll instance for Data List component
</li>
<li><span class="parameter">grid</span>
<span class="types"><span class="type">druid.grid</span></span>
The Grid instance for Data List component
</li>
<li><span class="parameter">create_function</span>
<span class="types"><span class="type">function</span></span>
The create function callback(self, data, index, data_list). Function should return (node, [component])
</li>
</ul>
</dd>
<dt>
<a name = "on_remove"></a>
<strong>on_remove(self)</strong>
</dt>
<dd>
Druid System on_remove function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DataList</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "set_data"></a>
<strong>set_data(self, data)</strong>
</dt>
<dd>
Set new data set for DataList component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DataList</span></span>
</li>
<li><span class="parameter">data</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
The new data array
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.data_list</span></span>
Current DataList instance
</ol>
</dd>
<dt>
<a name = "clear"></a>
<strong>clear(self)</strong>
</dt>
<dd>
Clear the DataList and refresh visuals
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DataList</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "get_first_index"></a>
<strong>get_first_index(self)</strong>
</dt>
<dd>
Return first index from data. It not always equals to 1
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DataList</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "get_last_index"></a>
<strong>get_last_index(self)</strong>
</dt>
<dd>
Return last index from data
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DataList</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "get_length"></a>
<strong>get_length(self)</strong>
</dt>
<dd>
Return amount of data
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DataList</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "get_index"></a>
<strong>get_index(self, data)</strong>
</dt>
<dd>
Return index for data value
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DataList</span></span>
</li>
<li><span class="parameter">data</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
</li>
</ul>
</dd>
<dt>
<a name = "scroll_to_index"></a>
<strong>scroll_to_index(self, index)</strong>
</dt>
<dd>
Instant scroll to element with passed index
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DataList</span></span>
</li>
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "scroll"></a>
<strong>scroll</strong>
</dt>
<dd>
The Druid scroll component
<ul>
<li><span class="parameter">scroll</span>
<span class="types"><span class="type">druid.scroll</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "grid"></a>
<strong>grid</strong>
</dt>
<dd>
The Druid Grid component
<ul>
<li><span class="parameter">grid</span>
<span class="types"><span class="type">druid.static_grid</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "top_index"></a>
<strong>top_index</strong>
</dt>
<dd>
The current visual top data index
<ul>
<li><span class="parameter">top_index</span>
<span class="types"><span class="type">number</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "last_index"></a>
<strong>last_index</strong>
</dt>
<dd>
The current visual last data index
<ul>
<li><span class="parameter">last_index</span>
<span class="types"><span class="type">number</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "scroll_progress"></a>
<strong>scroll_progress</strong>
</dt>
<dd>
The current progress of scroll posititon
<ul>
<li><span class="parameter">scroll_progress</span>
<span class="types"><span class="type">number</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_scroll_progress_change"></a>
<strong>on_scroll_progress_change</strong>
</dt>
<dd>
Event triggered when scroll progress is changed; event(self, progress_value)
<ul>
<li><span class="parameter">on_scroll_progress_change</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -54,6 +54,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -84,7 +85,7 @@
<td class="summary">Drag component constructor</td> <td class="summary">Drag component constructor</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(self, zone)</a></td> <td class="name" nowrap><a href="#set_click_zone">set_click_zone(self, node)</a></td>
<td class="summary">Strict drag click area.</td> <td class="summary">Strict drag click area.</td>
</tr> </tr>
</table> </table>
@ -141,6 +142,10 @@
<td class="name" nowrap><a href="#y">y</a></td> <td class="name" nowrap><a href="#y">y</a></td>
<td class="summary">Current touch y position</td> <td class="summary">Current touch y position</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#touch_start_pos">touch_start_pos</a></td>
<td class="summary">Touch start position</td>
</tr>
</table> </table>
<br/> <br/>
@ -181,7 +186,7 @@
</dd> </dd>
<dt> <dt>
<a name = "set_click_zone"></a> <a name = "set_click_zone"></a>
<strong>set_click_zone(self, zone)</strong> <strong>set_click_zone(self, node)</strong>
</dt> </dt>
<dd> <dd>
Strict drag click area. Useful for Strict drag click area. Useful for
@ -194,7 +199,7 @@
<span class="types"><span class="type">Drag</span></span> <span class="types"><span class="type">Drag</span></span>
</li> </li>
<li><span class="parameter">zone</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span> <span class="types"><span class="type">node</span></span>
Gui node Gui node
</li> </li>
@ -456,6 +461,26 @@
</dd>
<dt>
<a name = "touch_start_pos"></a>
<strong>touch_start_pos</strong>
</dt>
<dd>
Touch start position
<ul>
<li><span class="parameter">touch_start_pos</span>
<span class="types"><span class="type">vector3</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -464,7 +489,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -52,6 +52,7 @@
<li><strong>DruidEvent</strong></li> <li><strong>DruidEvent</strong></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -79,11 +80,11 @@
<td class="summary">Event constructur</td> <td class="summary">Event constructur</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#subscribe">subscribe(self, callback)</a></td> <td class="name" nowrap><a href="#subscribe">subscribe(self, callback, context)</a></td>
<td class="summary">Subscribe callback on event</td> <td class="summary">Subscribe callback on event</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#unsubscribe">unsubscribe(self, callback)</a></td> <td class="name" nowrap><a href="#unsubscribe">unsubscribe(self, callback, context)</a></td>
<td class="summary">Unsubscribe callback on event</td> <td class="summary">Unsubscribe callback on event</td>
</tr> </tr>
<tr> <tr>
@ -134,7 +135,7 @@
</dd> </dd>
<dt> <dt>
<a name = "subscribe"></a> <a name = "subscribe"></a>
<strong>subscribe(self, callback)</strong> <strong>subscribe(self, callback, context)</strong>
</dt> </dt>
<dd> <dd>
Subscribe callback on event Subscribe callback on event
@ -150,6 +151,10 @@
<span class="types"><span class="type">function</span></span> <span class="types"><span class="type">function</span></span>
Callback itself Callback itself
</li> </li>
<li><span class="parameter">context</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Additional context as first param to callback call
</li>
</ul> </ul>
@ -159,7 +164,7 @@
</dd> </dd>
<dt> <dt>
<a name = "unsubscribe"></a> <a name = "unsubscribe"></a>
<strong>unsubscribe(self, callback)</strong> <strong>unsubscribe(self, callback, context)</strong>
</dt> </dt>
<dd> <dd>
Unsubscribe callback on event Unsubscribe callback on event
@ -175,6 +180,10 @@
<span class="types"><span class="type">function</span></span> <span class="types"><span class="type">function</span></span>
Callback itself Callback itself
</li> </li>
<li><span class="parameter">context</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Additional context as first param to callback call
</li>
</ul> </ul>
@ -262,7 +271,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -52,6 +52,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -95,6 +96,7 @@
<li><a href="../modules/RadioGroup.html#">RadioGroup</a></li> <li><a href="../modules/RadioGroup.html#">RadioGroup</a></li>
<li><a href="../modules/Swipe.html#">Swipe</a></li> <li><a href="../modules/Swipe.html#">Swipe</a></li>
<li><a href="../modules/Drag.html#">Drag</a></li> <li><a href="../modules/Drag.html#">Drag</a></li>
<li><a href="../modules/DataList.html#">DataList</a></li>
<li><a href="../modules/Hover.html#">Hover</a></li> <li><a href="../modules/Hover.html#">Hover</a></li>
</ul> </ul>
@ -106,7 +108,7 @@
<td class="summary">Druid class constructor</td> <td class="summary">Druid class constructor</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#create">create(self, component, ...)</a></td> <td class="name" nowrap><a href="#new">new(self, component, ...)</a></td>
<td class="summary">Create new druid component</td> <td class="summary">Create new druid component</td>
</tr> </tr>
<tr> <tr>
@ -146,80 +148,84 @@
<td class="summary">Druid on language change.</td> <td class="summary">Druid on language change.</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_button">new_button(self, ...)</a></td> <td class="name" nowrap><a href="#new_button">new_button(self, node, callback[, params[, anim_node]])</a></td>
<td class="summary">Create button basic component</td> <td class="summary">Create button basic component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_blocker">new_blocker(self, ...)</a></td> <td class="name" nowrap><a href="#new_blocker">new_blocker(self, node)</a></td>
<td class="summary">Create blocker basic component</td> <td class="summary">Create blocker basic component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_back_handler">new_back_handler(self, ...)</a></td> <td class="name" nowrap><a href="#new_back_handler">new_back_handler(self, callback[, params])</a></td>
<td class="summary">Create back_handler basic component</td> <td class="summary">Create back_handler basic component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_hover">new_hover(self, ...)</a></td> <td class="name" nowrap><a href="#new_hover">new_hover(self, node, on_hover_callback)</a></td>
<td class="summary">Create hover basic component</td> <td class="summary">Create hover basic component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_text">new_text(self, ...)</a></td> <td class="name" nowrap><a href="#new_text">new_text(self, node[, value[, no_adjust]])</a></td>
<td class="summary">Create text basic component</td> <td class="summary">Create text basic component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_grid">new_grid(self, ...)</a></td> <td class="name" nowrap><a href="#new_grid">new_grid(self, parent, element[, in_row=1])</a></td>
<td class="summary">Create grid basic component <td class="summary">Create grid basic component
Deprecated</td> Deprecated</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_static_grid">new_static_grid(self, ...)</a></td> <td class="name" nowrap><a href="#new_static_grid">new_static_grid(self, parent, element[, in_row=1])</a></td>
<td class="summary">Create static grid basic component</td> <td class="summary">Create static grid basic component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_scroll">new_scroll(self, ...)</a></td> <td class="name" nowrap><a href="#new_scroll">new_scroll(self, view_node, content_node)</a></td>
<td class="summary">Create scroll basic component</td> <td class="summary">Create scroll basic component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_swipe">new_swipe(self, ...)</a></td> <td class="name" nowrap><a href="#new_swipe">new_swipe(self, node, on_swipe_callback)</a></td>
<td class="summary">Create swipe basic component</td> <td class="summary">Create swipe basic component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_drag">new_drag(self, ...)</a></td> <td class="name" nowrap><a href="#new_drag">new_drag(self, node, on_drag_callback)</a></td>
<td class="summary">Create drag basic component</td> <td class="summary">Create drag basic component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_dynamic_grid">new_dynamic_grid(self, ...)</a></td> <td class="name" nowrap><a href="#new_dynamic_grid">new_dynamic_grid(self, parent)</a></td>
<td class="summary">Create dynamic grid component</td> <td class="summary">Create dynamic grid component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_lang_text">new_lang_text(self, ...)</a></td> <td class="name" nowrap><a href="#new_lang_text">new_lang_text(self, node, locale_id, no_adjust)</a></td>
<td class="summary">Create lang_text component</td> <td class="summary">Create lang_text component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_slider">new_slider(self, ...)</a></td> <td class="name" nowrap><a href="#new_slider">new_slider(self, node, end_pos[, callback])</a></td>
<td class="summary">Create slider component</td> <td class="summary">Create slider component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_checkbox">new_checkbox(self, ...)</a></td> <td class="name" nowrap><a href="#new_checkbox">new_checkbox(self, node, callback[, click_node=node])</a></td>
<td class="summary">Create checkbox component</td> <td class="summary">Create checkbox component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_input">new_input(self, ...)</a></td> <td class="name" nowrap><a href="#new_input">new_input(self, click_node, text_node[, keyboard_type])</a></td>
<td class="summary">Create input component</td> <td class="summary">Create input component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_checkbox_group">new_checkbox_group(self, ...)</a></td> <td class="name" nowrap><a href="#new_checkbox_group">new_checkbox_group(self, nodes, callback[, click_nodes=node])</a></td>
<td class="summary">Create checkbox_group component</td> <td class="summary">Create checkbox_group component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_radio_group">new_radio_group(self, ...)</a></td> <td class="name" nowrap><a href="#druid:new_data_list">druid:new_data_list(druid_scroll, druid_grid, create_function)</a></td>
<td class="summary">Create data list basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_radio_group">new_radio_group(self, nodes, callback[, click_nodes=node])</a></td>
<td class="summary">Create radio_group component</td> <td class="summary">Create radio_group component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_timer">new_timer(self, ...)</a></td> <td class="name" nowrap><a href="#new_timer">new_timer(self, node, seconds_from[, seconds_to=0[, callback]])</a></td>
<td class="summary">Create timer component</td> <td class="summary">Create timer component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_progress">new_progress(self, ...)</a></td> <td class="name" nowrap><a href="#new_progress">new_progress(self, node, key[, init_value=1])</a></td>
<td class="summary">Create progress component</td> <td class="summary">Create progress component</td>
</tr> </tr>
</table> </table>
@ -261,8 +267,8 @@
</dd> </dd>
<dt> <dt>
<a name = "create"></a> <a name = "new"></a>
<strong>create(self, component, ...)</strong> <strong>new(self, component, ...)</strong>
</dt> </dt>
<dd> <dd>
Create new druid component Create new druid component
@ -508,7 +514,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_button"></a> <a name = "new_button"></a>
<strong>new_button(self, ...)</strong> <strong>new_button(self, node, callback[, params[, anim_node]])</strong>
</dt> </dt>
<dd> <dd>
Create button basic component Create button basic component
@ -520,9 +526,23 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
button init args Gui node
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Button callback
</li>
<li><span class="parameter">params</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Button callback params
(<em>optional</em>)
</li>
<li><span class="parameter">anim_node</span>
<span class="types"><span class="type">node</span></span>
Button anim node (node, if not provided)
(<em>optional</em>)
</li> </li>
</ul> </ul>
@ -539,7 +559,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_blocker"></a> <a name = "new_blocker"></a>
<strong>new_blocker(self, ...)</strong> <strong>new_blocker(self, node)</strong>
</dt> </dt>
<dd> <dd>
Create blocker basic component Create blocker basic component
@ -551,9 +571,9 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
blocker init args Gui node
</li> </li>
</ul> </ul>
@ -570,7 +590,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_back_handler"></a> <a name = "new_back_handler"></a>
<strong>new_back_handler(self, ...)</strong> <strong>new_back_handler(self, callback[, params])</strong>
</dt> </dt>
<dd> <dd>
Create back_handler basic component Create back_handler basic component
@ -582,9 +602,14 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">callback</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">callback</span></span>
back_handler init args On back button
</li>
<li><span class="parameter">params</span>
<span class="types"><span class="type">any</span></span>
Callback argument
(<em>optional</em>)
</li> </li>
</ul> </ul>
@ -601,7 +626,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_hover"></a> <a name = "new_hover"></a>
<strong>new_hover(self, ...)</strong> <strong>new_hover(self, node, on_hover_callback)</strong>
</dt> </dt>
<dd> <dd>
Create hover basic component Create hover basic component
@ -613,9 +638,13 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
hover init args Gui node
</li>
<li><span class="parameter">on_hover_callback</span>
<span class="types"><span class="type">function</span></span>
Hover callback
</li> </li>
</ul> </ul>
@ -632,7 +661,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_text"></a> <a name = "new_text"></a>
<strong>new_text(self, ...)</strong> <strong>new_text(self, node[, value[, no_adjust]])</strong>
</dt> </dt>
<dd> <dd>
Create text basic component Create text basic component
@ -644,9 +673,19 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
text init args Gui text node
</li>
<li><span class="parameter">value</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Initial text. Default value is node text from GUI scene.
(<em>optional</em>)
</li>
<li><span class="parameter">no_adjust</span>
<span class="types"><span class="type">bool</span></span>
If true, text will be not auto-adjust size
(<em>optional</em>)
</li> </li>
</ul> </ul>
@ -663,7 +702,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_grid"></a> <a name = "new_grid"></a>
<strong>new_grid(self, ...)</strong> <strong>new_grid(self, parent, element[, in_row=1])</strong>
</dt> </dt>
<dd> <dd>
Create grid basic component Create grid basic component
@ -676,9 +715,18 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">parent</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
grid init args The gui node parent, where items will be placed
</li>
<li><span class="parameter">element</span>
<span class="types"><span class="type">node</span></span>
Element prefab. Need to get it size
</li>
<li><span class="parameter">in_row</span>
<span class="types"><span class="type">number</span></span>
How many nodes in row can be placed
(<em>default</em> 1)
</li> </li>
</ul> </ul>
@ -695,7 +743,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_static_grid"></a> <a name = "new_static_grid"></a>
<strong>new_static_grid(self, ...)</strong> <strong>new_static_grid(self, parent, element[, in_row=1])</strong>
</dt> </dt>
<dd> <dd>
Create static grid basic component Create static grid basic component
@ -707,9 +755,18 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">parent</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
grid init args The gui node parent, where items will be placed
</li>
<li><span class="parameter">element</span>
<span class="types"><span class="type">node</span></span>
Element prefab. Need to get it size
</li>
<li><span class="parameter">in_row</span>
<span class="types"><span class="type">number</span></span>
How many nodes in row can be placed
(<em>default</em> 1)
</li> </li>
</ul> </ul>
@ -726,7 +783,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_scroll"></a> <a name = "new_scroll"></a>
<strong>new_scroll(self, ...)</strong> <strong>new_scroll(self, view_node, content_node)</strong>
</dt> </dt>
<dd> <dd>
Create scroll basic component Create scroll basic component
@ -738,9 +795,13 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">view_node</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
scroll init args GUI view scroll node
</li>
<li><span class="parameter">content_node</span>
<span class="types"><span class="type">node</span></span>
GUI content scroll node
</li> </li>
</ul> </ul>
@ -757,7 +818,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_swipe"></a> <a name = "new_swipe"></a>
<strong>new_swipe(self, ...)</strong> <strong>new_swipe(self, node, on_swipe_callback)</strong>
</dt> </dt>
<dd> <dd>
Create swipe basic component Create swipe basic component
@ -769,9 +830,13 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
swipe init args Gui node
</li>
<li><span class="parameter">on_swipe_callback</span>
<span class="types"><span class="type">function</span></span>
Swipe callback for on_swipe_end event
</li> </li>
</ul> </ul>
@ -788,7 +853,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_drag"></a> <a name = "new_drag"></a>
<strong>new_drag(self, ...)</strong> <strong>new_drag(self, node, on_drag_callback)</strong>
</dt> </dt>
<dd> <dd>
Create drag basic component Create drag basic component
@ -800,9 +865,13 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
drag init args GUI node to detect dragging
</li>
<li><span class="parameter">on_drag_callback</span>
<span class="types"><span class="type">function</span></span>
Callback for on_drag_event(self, dx, dy)
</li> </li>
</ul> </ul>
@ -819,7 +888,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_dynamic_grid"></a> <a name = "new_dynamic_grid"></a>
<strong>new_dynamic_grid(self, ...)</strong> <strong>new_dynamic_grid(self, parent)</strong>
</dt> </dt>
<dd> <dd>
Create dynamic grid component Create dynamic grid component
@ -831,9 +900,9 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">parent</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
grid init args The gui node parent, where items will be placed
</li> </li>
</ul> </ul>
@ -850,7 +919,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_lang_text"></a> <a name = "new_lang_text"></a>
<strong>new_lang_text(self, ...)</strong> <strong>new_lang_text(self, node, locale_id, no_adjust)</strong>
</dt> </dt>
<dd> <dd>
Create lang_text component Create lang_text component
@ -862,9 +931,17 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
lang_text init args The text node
</li>
<li><span class="parameter">locale_id</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Default locale id
</li>
<li><span class="parameter">no_adjust</span>
<span class="types"><span class="type">bool</span></span>
If true, will not correct text size
</li> </li>
</ul> </ul>
@ -881,7 +958,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_slider"></a> <a name = "new_slider"></a>
<strong>new_slider(self, ...)</strong> <strong>new_slider(self, node, end_pos[, callback])</strong>
</dt> </dt>
<dd> <dd>
Create slider component Create slider component
@ -893,9 +970,18 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
slider init args Gui pin node
</li>
<li><span class="parameter">end_pos</span>
<span class="types"><span class="type">vector3</span></span>
The end position of slider
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
On slider change callback
(<em>optional</em>)
</li> </li>
</ul> </ul>
@ -912,7 +998,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_checkbox"></a> <a name = "new_checkbox"></a>
<strong>new_checkbox(self, ...)</strong> <strong>new_checkbox(self, node, callback[, click_node=node])</strong>
</dt> </dt>
<dd> <dd>
Create checkbox component Create checkbox component
@ -924,9 +1010,18 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
checkbox init args Gui node
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Checkbox callback
</li>
<li><span class="parameter">click_node</span>
<span class="types"><span class="type">node</span></span>
Trigger node, by default equals to node
(<em>default</em> node)
</li> </li>
</ul> </ul>
@ -943,7 +1038,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_input"></a> <a name = "new_input"></a>
<strong>new_input(self, ...)</strong> <strong>new_input(self, click_node, text_node[, keyboard_type])</strong>
</dt> </dt>
<dd> <dd>
Create input component Create input component
@ -955,9 +1050,18 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">click_node</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
input init args Button node to enabled input component
</li>
<li><span class="parameter">text_node</span>
<span class="types"><span class="type">node</span></span>
Text node what will be changed on user input
</li>
<li><span class="parameter">keyboard_type</span>
<span class="types"><span class="type">number</span></span>
Gui keyboard type for input field
(<em>optional</em>)
</li> </li>
</ul> </ul>
@ -974,7 +1078,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_checkbox_group"></a> <a name = "new_checkbox_group"></a>
<strong>new_checkbox_group(self, ...)</strong> <strong>new_checkbox_group(self, nodes, callback[, click_nodes=node])</strong>
</dt> </dt>
<dd> <dd>
Create checkbox_group component Create checkbox_group component
@ -986,9 +1090,18 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">nodes</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node[]</span></span>
checkbox_group init args Array of gui node
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Checkbox callback
</li>
<li><span class="parameter">click_nodes</span>
<span class="types"><span class="type">node[]</span></span>
Array of trigger nodes, by default equals to nodes
(<em>default</em> node)
</li> </li>
</ul> </ul>
@ -1002,10 +1115,45 @@
</dd>
<dt>
<a name = "druid:new_data_list"></a>
<strong>druid:new_data_list(druid_scroll, druid_grid, create_function)</strong>
</dt>
<dd>
Create data list basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">druid_scroll</span>
<span class="types"><span class="type">druid.scroll</span></span>
The Scroll instance for Data List component
</li>
<li><span class="parameter">druid_grid</span>
<span class="types"><span class="type">druid.grid</span></span>
The Grid instance for Data List component
</li>
<li><span class="parameter">create_function</span>
<span class="types"><span class="type">function</span></span>
The create function callback(self, data, index, data_list). Function should return (node, [component])
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">DataList</span></span>
data_list component
</ol>
</dd> </dd>
<dt> <dt>
<a name = "new_radio_group"></a> <a name = "new_radio_group"></a>
<strong>new_radio_group(self, ...)</strong> <strong>new_radio_group(self, nodes, callback[, click_nodes=node])</strong>
</dt> </dt>
<dd> <dd>
Create radio_group component Create radio_group component
@ -1017,9 +1165,18 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">nodes</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node[]</span></span>
radio_group init args Array of gui node
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Radio callback
</li>
<li><span class="parameter">click_nodes</span>
<span class="types"><span class="type">node[]</span></span>
Array of trigger nodes, by default equals to nodes
(<em>default</em> node)
</li> </li>
</ul> </ul>
@ -1036,7 +1193,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_timer"></a> <a name = "new_timer"></a>
<strong>new_timer(self, ...)</strong> <strong>new_timer(self, node, seconds_from[, seconds_to=0[, callback]])</strong>
</dt> </dt>
<dd> <dd>
Create timer component Create timer component
@ -1048,9 +1205,23 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">args</span></span> <span class="types"><span class="type">node</span></span>
timer init args Gui text node
</li>
<li><span class="parameter">seconds_from</span>
<span class="types"><span class="type">number</span></span>
Start timer value in seconds
</li>
<li><span class="parameter">seconds_to</span>
<span class="types"><span class="type">number</span></span>
End timer value in seconds
(<em>default</em> 0)
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Function on timer end
(<em>optional</em>)
</li> </li>
</ul> </ul>
@ -1067,7 +1238,7 @@
</dd> </dd>
<dt> <dt>
<a name = "new_progress"></a> <a name = "new_progress"></a>
<strong>new_progress(self, ...)</strong> <strong>new_progress(self, node, key[, init_value=1])</strong>
</dt> </dt>
<dd> <dd>
Create progress component Create progress component
@ -1079,9 +1250,18 @@
<span class="types"><span class="type">DruidInstance</span></span> <span class="types"><span class="type">DruidInstance</span></span>
</li> </li>
<li><span class="parameter">...</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">args</span></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a> or <span class="type">node</span></span>
progress init args Progress bar fill node or node name
</li>
<li><span class="parameter">key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Progress bar direction: const.SIDE.X or const.SIDE.Y
</li>
<li><span class="parameter">init_value</span>
<span class="types"><span class="type">number</span></span>
Initial value of progress bar
(<em>default</em> 1)
</li> </li>
</ul> </ul>
@ -1103,7 +1283,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -53,6 +53,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><strong>DynamicGrid</strong></li> <li><strong>DynamicGrid</strong></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -84,11 +85,11 @@
<td class="summary">Return pos for grid node index</td> <td class="summary">Return pos for grid node index</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#add">add(self, node[, index[, is_shift_left=false]])</a></td> <td class="name" nowrap><a href="#add">add(self, node[, index[, shift_policy=SHIFT.RIGHT]])</a></td>
<td class="summary">Add new node to the grid</td> <td class="summary">Add new node to the grid</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#remove">remove(self, index[, is_shift_left=false])</a></td> <td class="name" nowrap><a href="#remove">remove(self, index[, shift_policy=SHIFT.RIGHT])</a></td>
<td class="summary">Remove the item from the grid.</td> <td class="summary">Remove the item from the grid.</td>
</tr> </tr>
<tr> <tr>
@ -96,6 +97,14 @@
<td class="summary">Return grid content size</td> <td class="summary">Return grid content size</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#get_offset">get_offset(self)</a></td>
<td class="summary">Return DynamicGrid offset, where DynamicGrid content starts.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_borders">get_borders(self)</a></td>
<td class="summary">Return grid content borders</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_index_by_node">get_index_by_node(self, node)</a></td> <td class="name" nowrap><a href="#get_index_by_node">get_index_by_node(self, node)</a></td>
<td class="summary">Return grid index by node</td> <td class="summary">Return grid index by node</td>
</tr> </tr>
@ -144,7 +153,7 @@
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#nodes">nodes</a></td> <td class="name" nowrap><a href="#nodes">nodes</a></td>
<td class="summary">List of all grid nodes</td> <td class="summary">List of all grid elements.</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#first_index">first_index</a></td> <td class="name" nowrap><a href="#first_index">first_index</a></td>
@ -158,6 +167,10 @@
<td class="name" nowrap><a href="#node_size">node_size</a></td> <td class="name" nowrap><a href="#node_size">node_size</a></td>
<td class="summary">Item size</td> <td class="summary">Item size</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#border">border</a></td>
<td class="summary">The size of item content</td>
</tr>
</table> </table>
<br/> <br/>
@ -234,7 +247,7 @@
</dd> </dd>
<dt> <dt>
<a name = "add"></a> <a name = "add"></a>
<strong>add(self, node[, index[, is_shift_left=false]])</strong> <strong>add(self, node[, index[, shift_policy=SHIFT.RIGHT]])</strong>
</dt> </dt>
<dd> <dd>
Add new node to the grid Add new node to the grid
@ -255,10 +268,10 @@
The node position. By default add as last node The node position. By default add as last node
(<em>optional</em>) (<em>optional</em>)
</li> </li>
<li><span class="parameter">is_shift_left</span> <li><span class="parameter">shift_policy</span>
<span class="types"><span class="type">bool</span></span> <span class="types"><span class="type">number</span></span>
If true, shift all nodes to the left, otherwise shift nodes to the right How shift nodes, if required. See const.SHIFT
(<em>default</em> false) (<em>default</em> SHIFT.RIGHT)
</li> </li>
</ul> </ul>
@ -269,7 +282,7 @@
</dd> </dd>
<dt> <dt>
<a name = "remove"></a> <a name = "remove"></a>
<strong>remove(self, index[, is_shift_left=false])</strong> <strong>remove(self, index[, shift_policy=SHIFT.RIGHT])</strong>
</dt> </dt>
<dd> <dd>
Remove the item from the grid. Note that gui node will be not deleted Remove the item from the grid. Note that gui node will be not deleted
@ -285,13 +298,19 @@
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span></span>
The grid node index to remove The grid node index to remove
</li> </li>
<li><span class="parameter">is_shift_left</span> <li><span class="parameter">shift_policy</span>
<span class="types"><span class="type">bool</span></span> <span class="types"><span class="type">number</span></span>
If true, shift all nodes to the left, otherwise shift nodes to the right How shift nodes, if required. See const.SHIFT
(<em>default</em> false) (<em>default</em> SHIFT.RIGHT)
</li> </li>
</ul> </ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Node</span></span>
The deleted gui node from grid
</ol>
@ -327,6 +346,60 @@
</dd>
<dt>
<a name = "get_offset"></a>
<strong>get_offset(self)</strong>
</dt>
<dd>
Return DynamicGrid offset, where DynamicGrid content starts.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DynamicGrid</span></span>
The DynamicGrid instance
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">vector3</span></span>
The DynamicGrid offset
</ol>
</dd>
<dt>
<a name = "get_borders"></a>
<strong>get_borders(self)</strong>
</dt>
<dd>
Return grid content borders
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DynamicGrid</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">vector3</span></span>
The grid content borders
</ol>
</dd> </dd>
<dt> <dt>
<a name = "get_index_by_node"></a> <a name = "get_index_by_node"></a>
@ -601,7 +674,7 @@
<strong>nodes</strong> <strong>nodes</strong>
</dt> </dt>
<dd> <dd>
List of all grid nodes List of all grid elements. Contains from node, pos, size, pivot
<ul> <ul>
@ -675,6 +748,26 @@
</dd>
<dt>
<a name = "border"></a>
<strong>border</strong>
</dt>
<dd>
The size of item content
<ul>
<li><span class="parameter">border</span>
<span class="types"><span class="type">vector4</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -683,7 +776,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -53,6 +53,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -106,6 +107,10 @@
<td class="name" nowrap><a href="#on_hover">on_hover</a></td> <td class="name" nowrap><a href="#on_hover">on_hover</a></td>
<td class="summary">On hover callback(self, state)</td> <td class="summary">On hover callback(self, state)</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#on_mouse_hover">on_mouse_hover</a></td>
<td class="summary">On mouse hover callback(self, state)</td>
</tr>
</table> </table>
<br/> <br/>
@ -297,6 +302,26 @@
</dd>
<dt>
<a name = "on_mouse_hover"></a>
<strong>on_mouse_hover</strong>
</dt>
<dd>
On mouse hover callback(self, state)
<ul>
<li><span class="parameter">on_mouse_hover</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -305,7 +330,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -54,6 +54,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><strong>Input</strong></li> <li><strong>Input</strong></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -86,6 +87,14 @@
<td class="summary">Set text for input field</td> <td class="summary">Set text for input field</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#select">select(self)</a></td>
<td class="summary">Select input field.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#unselect">unselect(self)</a></td>
<td class="summary">Remove selection from input.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_text">get_text(self)</a></td> <td class="name" nowrap><a href="#get_text">get_text(self)</a></td>
<td class="summary">Return current input field text</td> <td class="summary">Return current input field text</td>
</tr> </tr>
@ -159,6 +168,10 @@
<td class="name" nowrap><a href="#allowerd_characters">allowerd_characters</a></td> <td class="name" nowrap><a href="#allowerd_characters">allowerd_characters</a></td>
<td class="summary">Pattern matching for user input</td> <td class="summary">Pattern matching for user input</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#keyboard_type">keyboard_type</a></td>
<td class="summary">Gui keyboard type for input field</td>
</tr>
</table> </table>
<br/> <br/>
@ -192,6 +205,48 @@
</dd>
<dt>
<a name = "select"></a>
<strong>select(self)</strong>
</dt>
<dd>
Select input field. It will show the keyboard and trigger on_select events
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Input</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "unselect"></a>
<strong>unselect(self)</strong>
</dt>
<dd>
Remove selection from input. It will hide the keyboard and trigger on_unselect events
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Input</span></span>
</li>
</ul>
</dd> </dd>
<dt> <dt>
<a name = "get_text"></a> <a name = "get_text"></a>
@ -332,6 +387,11 @@
Default character mask for password input Default character mask for password input
(<em>default</em> *) (<em>default</em> *)
</li> </li>
<li><span class="parameter">IS_UNSELECT_ON_RESELECT</span>
<span class="types"><span class="type">bool</span></span>
If true, call unselect on select selected input
(<em>default</em> false)
</li>
<li><span class="parameter">on_select</span> <li><span class="parameter">on_select</span>
<span class="types"><span class="type">function</span></span> <span class="types"><span class="type">function</span></span>
(self, button_node) Callback on input field selecting (self, button_node) Callback on input field selecting
@ -600,6 +660,26 @@
</dd>
<dt>
<a name = "keyboard_type"></a>
<strong>keyboard_type</strong>
</dt>
<dd>
Gui keyboard type for input field
<ul>
<li><span class="parameter">keyboard_type</span>
<span class="types"><span class="type">number</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -608,7 +688,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -53,6 +53,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><strong>LangText</strong></li> <li><strong>LangText</strong></li>
@ -95,6 +96,10 @@
<td class="name" nowrap><a href="#on_change">on_change</a></td> <td class="name" nowrap><a href="#on_change">on_change</a></td>
<td class="summary">On change text callback</td> <td class="summary">On change text callback</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#text">text</a></td>
<td class="summary">The text component</td>
</tr>
</table> </table>
<br/> <br/>
@ -124,7 +129,7 @@
</li> </li>
<li><span class="parameter">locale_id</span> <li><span class="parameter">locale_id</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Default locale id Default locale id, optional
</li> </li>
<li><span class="parameter">no_adjust</span> <li><span class="parameter">no_adjust</span>
<span class="types"><span class="type">bool</span></span> <span class="types"><span class="type">bool</span></span>
@ -210,6 +215,26 @@
</dd>
<dt>
<a name = "text"></a>
<strong>text</strong>
</dt>
<dd>
The text component
<ul>
<li><span class="parameter">text</span>
<span class="types"><span class="type">Text</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -218,7 +243,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -54,6 +54,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -139,6 +140,10 @@
<td class="name" nowrap><a href="#max_size">max_size</a></td> <td class="name" nowrap><a href="#max_size">max_size</a></td>
<td class="summary">Maximum size of progress bar</td> <td class="summary">Maximum size of progress bar</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#slice">slice</a></td>
<td class="summary">Progress bar slice9 settings</td>
</tr>
</table> </table>
<br/> <br/>
@ -489,6 +494,26 @@
</dd>
<dt>
<a name = "slice"></a>
<strong>slice</strong>
</dt>
<dd>
Progress bar slice9 settings
<ul>
<li><span class="parameter">slice</span>
<span class="types"><span class="type">vector4</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -497,7 +522,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -53,6 +53,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -94,6 +95,10 @@
<td class="name" nowrap><a href="#on_radio_click">on_radio_click</a></td> <td class="name" nowrap><a href="#on_radio_click">on_radio_click</a></td>
<td class="summary">On any checkbox click</td> <td class="summary">On any checkbox click</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#checkboxes">checkboxes</a></td>
<td class="summary">Array of checkbox components</td>
</tr>
</table> </table>
<br/> <br/>
@ -212,6 +217,26 @@
</dd>
<dt>
<a name = "checkboxes"></a>
<strong>checkboxes</strong>
</dt>
<dd>
Array of checkbox components
<ul>
<li><span class="parameter">checkboxes</span>
<span class="types"><span class="type">Checkbox[]</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -220,7 +245,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -54,6 +54,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -103,7 +104,7 @@
<td class="summary">Return current scroll progress status.</td> <td class="summary">Return current scroll progress status.</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#set_size">set_size(self, size)</a></td> <td class="name" nowrap><a href="#set_size">set_size(self, size, offset)</a></td>
<td class="summary">Set scroll content size.</td> <td class="summary">Set scroll content size.</td>
</tr> </tr>
<tr> <tr>
@ -135,9 +136,17 @@
<td class="summary">Lock or unlock vertical scroll</td> <td class="summary">Lock or unlock vertical scroll</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#is_node_in_view">is_node_in_view(self, node)</a></td>
<td class="summary">Check node if it visible now on scroll.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#bind_grid">bind_grid(self, grid)</a></td> <td class="name" nowrap><a href="#bind_grid">bind_grid(self, grid)</a></td>
<td class="summary">Bind the grid component (Static or Dynamic) to recalculate <td class="summary">Bind the grid component (Static or Dynamic) to recalculate
scroll size on grid changes</td> scroll size on grid changes</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(self, node)</a></td>
<td class="summary">Strict drag scroll area.</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#_cancel_animate">_cancel_animate(self)</a></td> <td class="name" nowrap><a href="#_cancel_animate">_cancel_animate(self)</a></td>
@ -205,6 +214,10 @@
<td class="name" nowrap><a href="#selected">selected</a></td> <td class="name" nowrap><a href="#selected">selected</a></td>
<td class="summary">Current index of points of interests</td> <td class="summary">Current index of points of interests</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#is_animate">is_animate</a></td>
<td class="summary">Flag, if scroll now animating by gui.animate</td>
</tr>
</table> </table>
<br/> <br/>
@ -372,7 +385,7 @@
</dd> </dd>
<dt> <dt>
<a name = "set_size"></a> <a name = "set_size"></a>
<strong>set_size(self, size)</strong> <strong>set_size(self, size, offset)</strong>
</dt> </dt>
<dd> <dd>
Set scroll content size. Set scroll content size.
@ -389,6 +402,10 @@
<span class="types"><span class="type">vector3</span></span> <span class="types"><span class="type">vector3</span></span>
The new size for content node The new size for content node
</li> </li>
<li><span class="parameter">offset</span>
<span class="types"><span class="type">vector3</span></span>
Offset value to set, where content is starts
</li>
</ul> </ul>
<h3>Returns:</h3> <h3>Returns:</h3>
@ -615,6 +632,38 @@
</dd>
<dt>
<a name = "is_node_in_view"></a>
<strong>is_node_in_view(self, node)</strong>
</dt>
<dd>
Check node if it visible now on scroll.
Extra border is not affected. Return true for elements in extra scroll zone
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
The node to check
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
True if node in visible scroll area
</ol>
</dd> </dd>
<dt> <dt>
<a name = "bind_grid"></a> <a name = "bind_grid"></a>
@ -647,6 +696,32 @@
</dd>
<dt>
<a name = "set_click_zone"></a>
<strong>set_click_zone(self, node)</strong>
</dt>
<dd>
Strict drag scroll area. Useful for
restrict events outside stencil node
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Drag</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
</dd> </dd>
<dt> <dt>
<a name = "_cancel_animate"></a> <a name = "_cancel_animate"></a>
@ -729,6 +804,16 @@
If true, content node with size less than view node size can be scrolled If true, content node with size less than view node size can be scrolled
(<em>default</em> false) (<em>default</em> false)
</li> </li>
<li><span class="parameter">WHEEL_SCROLL_SPEED</span>
<span class="types"><span class="type">bool</span></span>
The scroll speed via mouse wheel scroll or touchpad. Set to 0 to disable wheel scrolling
(<em>default</em> 0)
</li>
<li><span class="parameter">WHEEL_SCROLL_INVERTED</span>
<span class="types"><span class="type">bool</span></span>
If true, invert direction for touchpad and mouse wheel scroll
(<em>default</em> false)
</li>
</ul> </ul>
@ -1000,6 +1085,26 @@
</dd>
<dt>
<a name = "is_animate"></a>
<strong>is_animate</strong>
</dt>
<dd>
Flag, if scroll now animating by gui.animate
<ul>
<li><span class="parameter">is_animate</span>
<span class="types"><span class="type">bool</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -1008,7 +1113,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -53,6 +53,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -122,6 +123,10 @@
<td class="name" nowrap><a href="#is_drag">is_drag</a></td> <td class="name" nowrap><a href="#is_drag">is_drag</a></td>
<td class="summary">Current drag state</td> <td class="summary">Current drag state</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#value">value</a></td>
<td class="summary">Current slider value</td>
</tr>
</table> </table>
<br/> <br/>
@ -388,6 +393,26 @@
</dd>
<dt>
<a name = "value"></a>
<strong>value</strong>
</dt>
<dd>
Current slider value
<ul>
<li><span class="parameter">value</span>
<span class="types"><span class="type">number</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -396,7 +421,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -53,6 +53,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -97,11 +98,11 @@
<td class="summary">Set grid anchor.</td> <td class="summary">Set grid anchor.</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#add">add(self, item[, index])</a></td> <td class="name" nowrap><a href="#add">add(self, item[, index[, shift_policy=SHIFT.RIGHT]])</a></td>
<td class="summary">Add new item to the grid</td> <td class="summary">Add new item to the grid</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#remove">remove(self, index, is_shift_nodes)</a></td> <td class="name" nowrap><a href="#remove">remove(self, index[, shift_policy=SHIFT.RIGHT])</a></td>
<td class="summary">Remove the item from the grid.</td> <td class="summary">Remove the item from the grid.</td>
</tr> </tr>
<tr> <tr>
@ -109,6 +110,10 @@
<td class="summary">Return grid content size</td> <td class="summary">Return grid content size</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#get_borders">get_borders(self)</a></td>
<td class="summary">Return grid content borders</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_all_pos">get_all_pos(self)</a></td> <td class="name" nowrap><a href="#get_all_pos">get_all_pos(self)</a></td>
<td class="summary">Return array of all node positions</td> <td class="summary">Return array of all node positions</td>
</tr> </tr>
@ -120,6 +125,10 @@
<td class="name" nowrap><a href="#clear">clear(self)</a></td> <td class="name" nowrap><a href="#clear">clear(self)</a></td>
<td class="summary">Clear grid nodes array.</td> <td class="summary">Clear grid nodes array.</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#get_offset">get_offset(self)</a></td>
<td class="summary">Return StaticGrid offset, where StaticGrid content starts.</td>
</tr>
</table> </table>
<h2><a href="#Fields">Fields</a></h2> <h2><a href="#Fields">Fields</a></h2>
<table class="function_list"> <table class="function_list">
@ -167,6 +176,10 @@
<td class="name" nowrap><a href="#node_size">node_size</a></td> <td class="name" nowrap><a href="#node_size">node_size</a></td>
<td class="summary">Item size</td> <td class="summary">Item size</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#border">border</a></td>
<td class="summary">The size of item content</td>
</tr>
</table> </table>
<br/> <br/>
@ -330,7 +343,7 @@
</dd> </dd>
<dt> <dt>
<a name = "add"></a> <a name = "add"></a>
<strong>add(self, item[, index])</strong> <strong>add(self, item[, index[, shift_policy=SHIFT.RIGHT]])</strong>
</dt> </dt>
<dd> <dd>
Add new item to the grid Add new item to the grid
@ -351,6 +364,11 @@
The item position. By default add as last item The item position. By default add as last item
(<em>optional</em>) (<em>optional</em>)
</li> </li>
<li><span class="parameter">shift_policy</span>
<span class="types"><span class="type">number</span></span>
How shift nodes, if required. See const.SHIFT
(<em>default</em> SHIFT.RIGHT)
</li>
</ul> </ul>
@ -360,7 +378,7 @@
</dd> </dd>
<dt> <dt>
<a name = "remove"></a> <a name = "remove"></a>
<strong>remove(self, index, is_shift_nodes)</strong> <strong>remove(self, index[, shift_policy=SHIFT.RIGHT])</strong>
</dt> </dt>
<dd> <dd>
Remove the item from the grid. Note that gui node will be not deleted Remove the item from the grid. Note that gui node will be not deleted
@ -376,12 +394,19 @@
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span></span>
The grid node index to remove The grid node index to remove
</li> </li>
<li><span class="parameter">is_shift_nodes</span> <li><span class="parameter">shift_policy</span>
<span class="types"><span class="type">bool</span></span> <span class="types"><span class="type">number</span></span>
If true, will shift nodes left after index How shift nodes, if required. See const.SHIFT
(<em>default</em> SHIFT.RIGHT)
</li> </li>
</ul> </ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Node</span></span>
The deleted gui node from grid
</ol>
@ -413,6 +438,33 @@
</dd>
<dt>
<a name = "get_borders"></a>
<strong>get_borders(self)</strong>
</dt>
<dd>
Return grid content borders
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">StaticGrid</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">vector3</span></span>
The grid content borders
</ol>
</dd> </dd>
<dt> <dt>
<a name = "get_all_pos"></a> <a name = "get_all_pos"></a>
@ -500,6 +552,33 @@
</dd>
<dt>
<a name = "get_offset"></a>
<strong>get_offset(self)</strong>
</dt>
<dd>
Return StaticGrid offset, where StaticGrid content starts.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">StaticGrid</span></span>
The StaticGrid instance
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">vector3</span></span>
The StaticGrid offset
</ol>
</dd> </dd>
</dl> </dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2> <h2 class="section-header "><a name="Fields"></a>Fields</h2>
@ -724,6 +803,26 @@
</dd>
<dt>
<a name = "border"></a>
<strong>border</strong>
</dt>
<dd>
The size of item content
<ul>
<li><span class="parameter">border</span>
<span class="types"><span class="type">vector4</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -732,7 +831,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -54,6 +54,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -104,6 +105,10 @@
<td class="name" nowrap><a href="#click_zone">click_zone</a></td> <td class="name" nowrap><a href="#click_zone">click_zone</a></td>
<td class="summary">Restriction zone</td> <td class="summary">Restriction zone</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#on_swipe">on_swipe</a></td>
<td class="summary">Trigger on swipe event(self, swipe_side, dist, delta_time</td>
</tr>
</table> </table>
<br/> <br/>
@ -250,6 +255,26 @@
</dd>
<dt>
<a name = "on_swipe"></a>
<strong>on_swipe</strong>
</dt>
<dd>
Trigger on swipe event(self, swipe_side, dist, delta_time
<ul>
<li><span class="parameter">on_swipe</span>
<span class="types"><span class="type">druid_event</span></span>
)
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -258,7 +283,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -53,6 +53,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -152,6 +153,10 @@
<td class="name" nowrap><a href="#is_no_adjust">is_no_adjust</a></td> <td class="name" nowrap><a href="#is_no_adjust">is_no_adjust</a></td>
<td class="summary">Current text size adjust settings</td> <td class="summary">Current text size adjust settings</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#color">color</a></td>
<td class="summary">Current text color</td>
</tr>
</table> </table>
<br/> <br/>
@ -578,6 +583,26 @@
</dd>
<dt>
<a name = "color"></a>
<strong>color</strong>
</dt>
<dd>
Current text color
<ul>
<li><span class="parameter">color</span>
<span class="types"><span class="type">vector3</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -586,7 +611,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -53,6 +53,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -120,6 +121,10 @@
<td class="name" nowrap><a href="#target">target</a></td> <td class="name" nowrap><a href="#target">target</a></td>
<td class="summary">Target timer value</td> <td class="summary">Target timer value</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#value">value</a></td>
<td class="summary">Current timer value</td>
</tr>
</table> </table>
<br/> <br/>
@ -370,6 +375,26 @@
</dd>
<dt>
<a name = "value"></a>
<strong>value</strong>
</dt>
<dd>
Current timer value
<ul>
<li><span class="parameter">value</span>
<span class="types"><span class="type">number</span></span>
</li>
</ul>
</dd> </dd>
</dl> </dl>
@ -378,7 +403,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -52,6 +52,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -83,6 +84,10 @@
<td class="summary">Center two nodes.</td> <td class="summary">Center two nodes.</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#centrate_nodes">centrate_nodes([margin=0[, ...]])</a></td>
<td class="summary">Center several nodes nodes.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_enabled">is_enabled(node)</a></td> <td class="name" nowrap><a href="#is_enabled">is_enabled(node)</a></td>
<td class="summary">Check if node is enabled in gui hierarchy.</td> <td class="summary">Check if node is enabled in gui hierarchy.</td>
</tr> </tr>
@ -99,8 +104,8 @@
<td class="summary">Check if device is HTML5</td> <td class="summary">Check if device is HTML5</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#get_border">get_border()</a></td> <td class="name" nowrap><a href="#get_border">get_border(node, offset)</a></td>
<td class="summary">Distance from node to size border</td> <td class="summary">Distance from node position to his borders</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#deprecated">deprecated(message)</a></td> <td class="name" nowrap><a href="#deprecated">deprecated(message)</a></td>
@ -181,6 +186,34 @@
</dd>
<dt>
<a name = "centrate_nodes"></a>
<strong>centrate_nodes([margin=0[, ...]])</strong>
</dt>
<dd>
Center several nodes nodes.
Nodes will be center around 0 x position
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">margin</span>
<span class="types"><span class="type">number</span></span>
Offset between nodes
(<em>default</em> 0)
</li>
<li><span class="parameter">...</span>
<span class="types"><span class="type">Node</span></span>
Any count of gui Node
(<em>optional</em>)
</li>
</ul>
</dd> </dd>
<dt> <dt>
<a name = "is_enabled"></a> <a name = "is_enabled"></a>
@ -267,17 +300,28 @@
</dd> </dd>
<dt> <dt>
<a name = "get_border"></a> <a name = "get_border"></a>
<strong>get_border()</strong> <strong>get_border(node, offset)</strong>
</dt> </dt>
<dd> <dd>
Distance from node to size border Distance from node position to his borders
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
The gui node to check
</li>
<li><span class="parameter">offset</span>
<span class="types"><span class="type">vector3</span></span>
The offset to add to result
</li>
</ul>
<h3>Returns:</h3> <h3>Returns:</h3>
<ol> <ol>
vector4 (left, top, right, down) vector4 Vector with distance to node border: (left, top, right, down)
</ol> </ol>
@ -312,7 +356,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -52,6 +52,7 @@
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li> <li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li> <li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li> <li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DataList.html">DataList</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li> <li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li> <li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li> <li><a href="../modules/LangText.html">LangText</a></li>
@ -313,7 +314,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:44:30 </i> <i style="float:right;">Last updated 2021-04-06 00:03:14 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -134,22 +134,44 @@ Also check _component.template.lua_ what you can use for your own custom compone
### Druid 0.6.0: ### Druid 0.6.0:
Desc Hey! Are you tired from **Druid** updates? _(It's a joke)_
- Add EmmyLua annotations. See how to use it FAQ Finally, got a time to release component to process huge amount of data. So introducing: **DataList** component. I can't say what it's "infinity" scroll, but it can help to solve your problem with `GUI nodes limit reached` and helps with scroll optimization. Give feedback about it!
- Lang text now can be initialized without default locale id
- **Fix**: Input component: rename field _selected_ to _is_selected_ (according to the docs) The next important stuff is **EmmyLua** docs. I'm implemented EmmyLua doc generator from LuaDoc and Protofiles, so now you can use EmmyLua annotations inside your IDE instead of website API looking or source code scanning.
- **#92** Setup repo for CI and unit tests. (Yea, successful build and tests badges!)
Also the **Druid examples** is reworked, so each example will be in separate collection. Now it's become a much easier to learn Druid via examples. A lot of stuff in progress now, but you already can see on it!
Input priority got reworked too. Now instead of two input stacks: usual and high, Druid use simple input priority value.
And I should note here is several breaking changes, take a look in changelogs.
Wanna something more? [Add an issues!](https://github.com/Insality/druid/issues)
Have a good day.
**Changelog 0.6.0**
---
- **#43** Add **DataList** Druid extended component. Component used to manage huge amount of data to make stuff like _infinity_ scroll.
- This versions is first basic implementation. But it should be enough for almost all basic stuff.
- Create Data List with `druid:new_data_list(scroll, grid, create_function)`.
- _scroll_ - already created __Scroll__ component
- _grid_ - already created __StaticGrid__ or __DynamicGrid__ component
- _create_function_ - your function to create node instances. This callback have next parameters: `fun(self, data, index, data_list)`
- _self_ - Script/Druid context
- _data_- your element data
- _index_ - element index
- _data_list_ - current __DataList__ component
- Create function should return root node and optionaly, _Druid_ component. It's required to manage create/remove lifecycle
- Set data with `data_list:set_data({...})`
- In current version there is no `add/remove` functions
- Add EmmyLua annotations (_ta-daaa_). See how to [use it FAQ](https://github.com/Insality/druid/blob/develop/docs_md/FAQ.md)!
- Add context argument to Druid Event. You can pass this argument to forward it first in your callbacks (for example - object context)
- Add _SHIFT_POLICY_ for _Static_ and _Dynamic_ Grids. It mean how nodes will be shifted if you append data between nodes. There are `const.SHIFT.RIGHT`, `const.SHIFT.LEFT` and `const.SHIFT.NO_SHIFT`.
- __[BREAKING]__ Please check your `StaticGrid:remove` and `DynamicGrid:remove` functions
- **#102** __[BREAKING]__ Removed `component:increase_input_priority` component function. Use `component:set_input_priority` function instead. The bigger priority value processed first. The value 10 is default for Druid components, the 100 value is maximum priority for acquire input in _drag_ and _input_ components - **#102** __[BREAKING]__ Removed `component:increase_input_priority` component function. Use `component:set_input_priority` function instead. The bigger priority value processed first. The value 10 is default for Druid components, the 100 value is maximum priority for acquire input in _drag_ and _input_ components
- **#103** Add `helper.centate_nodes` function. It can horizontal align several Box and Text nodes - Add constants for priorities: _const.PRIORITY_INPUT_, _const.PRIORITY_INPUT_HIGH_, _const.PRIORITY_INPUT_MAX_.
- **#105** Add `Input:select` and `Input:unselect` function. - __[BREAKING]__ If you use in you custom components interest: `component.ON_INPUT_HIGH` you should replace it with `component.ON_INPUT` and add `const.PRIORITY_INPUT_HIGH` as third param. For example:
- **#106** Add `Input IS_UNSELECT_ON_RESELECT` style param. If true, it will be unselect input on click on input box, not only on outside click.
- **#108** Add component interests const to `component.lua`
- **#116** You can pass Text component in Input component instead of text node
- **#117** Move each Druid example in separate collection. It's a lot of easier now to learn via examples, check it!
- **#124** Add `Scroll:set_click_zone` function. This is just link to `Drag:set_click_zone` function inside scroll component.
-- Add constants for priorities: _const.PRIORITY_INPUT_, _const.PRIORITY_INPUT_HIGH_, _const.PRIORITY_INPUT_MAX_.
-- __[BREAKING]__ If you use in you custom components interest: `component.ON_INPUT_HIGH` you should replace it with `const.PRIORITY_INPUT_HIGH` as third param, and place it with usual `component.ON_INPUT`. For example:
_before:_ _before:_
```lua ```lua
local Drag = component.create("drag", { component.ON_INPUT_HIGH }) local Drag = component.create("drag", { component.ON_INPUT_HIGH })
@ -158,19 +180,25 @@ Desc
```lua ```lua
local Drag = component.create("drag", { component.ON_INPUT }, const.PRIORITY_INPUT_HIGH) local Drag = component.create("drag", { component.ON_INPUT }, const.PRIORITY_INPUT_HIGH)
``` ```
- Lang text now can be initialized without default locale id
- Input component: rename field _selected_ to _is_selected_ (according to the docs)
- **#92** Setup repo for CI and unit tests. (Yea, successful build and tests badges!)
- **#86** Fix a lot of event triggers on scroll inertia moving
- **#101** Fix scroll to other node instead of swipe direction with scroll's points of interest (without inert settings)
- **#103** Add `helper.centate_nodes` function. It can horizontal align several Box and Text nodes
- **#105** Add `Input:select` and `Input:unselect` function.
- **#106** Add `Input.style.IS_UNSELECT_ON_RESELECT` style param. If true, it will be unselect input on click on input box, not only on outside click.
- **#108** Add component interests const to `component.lua`
- **#116** You can pass Text component in Input component instead of text node
- **#117** Move each Druid example in separate collection. It's a lot of easier now to learn via examples, check it!
- Examples in progress, so a lot of stuff are locked now, stay tuned!
- **#118** Druid.scroll freezes if held in one place for a long time
- **#123** Add scroll for Scroll component via mouse wheel or touchpad: - **#123** Add scroll for Scroll component via mouse wheel or touchpad:
-- Added Scroll style params: `WHEEL_SCROLL_SPEED`, `WHEEL_SCROLL_INVERTED` - Added Scroll style params: `WHEEL_SCROLL_SPEED`, `WHEEL_SCROLL_INVERTED`
-- Mouse scroll working when cursor is hover on scroll view node - Mouse scroll working when cursor is hover on scroll view node
-- Vertical scroll have more priority than horizontal - Vertical scroll have more priority than horizontal
-- Fix: When Hover component node became disabled, reset hover state (throw on_hover and on_mouse_hover events) - Fix: When Hover component node became disabled, reset hover state (throw on_hover and on_mouse_hover events)
-- By default mouse scroll is disabled - By default mouse scroll is disabled
-- This is basic implementation, it is work not perfect - This is basic implementation, it is work not perfect
- **#43** Add Data List Druid extended component. Component used to manage huge amount of data to make stuff like "infinity" scroll. - **#124** Add `Scroll:set_click_zone` function. This is just link to `Drag:set_click_zone` function inside scroll component.
- Add context argument to Druid Event. You can pass this argument to forward it first in your callbacks (for example - object context)
- __[BREAKING]__ Add _SHIFT_POLICY_ for _Static_ and _Dynamic_ Grids. It mean how nodes will be shifted if you append data between nodes. There are `const.SHIFT.RIGHT`, `const.SHIFT.LEFT` and `const.SHIFT.NO_SHIFT`.
-- Please check your `StaticGrid:remove` and `DynamicGrid:remove` functions
- **Fix #86** A lot of event triggers on scroll inertia moving
- **Fix #101** Fix scroll to other node instead of swipe direction with scroll's points of intereset (without inert settings)
- **Fix #118** Druid.scroll freezes if held in one place for a long time
- **#127** The `druid:create` is deprecated. Use `druid:new` for creating custom components - **#127** The `druid:create` is deprecated. Use `druid:new` for creating custom components

View File

@ -9,6 +9,7 @@
--- Params to back callback --- Params to back callback
-- @tfield any params -- @tfield any params
---
local Event = require("druid.event") local Event = require("druid.event")
local const = require("druid.const") local const = require("druid.const")

View File

@ -6,6 +6,7 @@
---Trigger node ---Trigger node
-- @tfield node node -- @tfield node node
---
local const = require("druid.const") local const = require("druid.const")
local component = require("druid.component") local component = require("druid.component")

View File

@ -45,6 +45,7 @@
---Restriction zone ---Restriction zone
-- @tfield[opt] node click_zone -- @tfield[opt] node click_zone
---
local Event = require("druid.event") local Event = require("druid.event")
local const = require("druid.const") local const = require("druid.const")

View File

@ -42,6 +42,7 @@
--- Touch start position --- Touch start position
-- @tfield vector3 touch_start_pos -- @tfield vector3 touch_start_pos
---
local Event = require("druid.event") local Event = require("druid.event")
local const = require("druid.const") local const = require("druid.const")

View File

@ -9,6 +9,7 @@
--- On mouse hover callback(self, state) --- On mouse hover callback(self, state)
-- @tfield druid_event on_mouse_hover -- @tfield druid_event on_mouse_hover
---
local Event = require("druid.event") local Event = require("druid.event")
local const = require("druid.const") local const = require("druid.const")

View File

@ -52,6 +52,7 @@
--- Flag, if scroll now animating by gui.animate --- Flag, if scroll now animating by gui.animate
-- @tfield bool is_animate -- @tfield bool is_animate
---
local Event = require("druid.event") local Event = require("druid.event")
local const = require("druid.const") local const = require("druid.const")
@ -384,8 +385,8 @@ end
--- Check node if it visible now on scroll. --- Check node if it visible now on scroll.
-- Extra border is not affected. Return true for elements in extra scroll zone -- Extra border is not affected. Return true for elements in extra scroll zone
-- @tparam Scroll self -- @tparam Scroll self
-- @tparma node node The node to check -- @tparam node node The node to check
-- @treturn boolean True, if node in visible scroll area -- @treturn boolean True if node in visible scroll area
function Scroll.is_node_in_view(self, node) function Scroll.is_node_in_view(self, node)
local node_border = helper.get_border(node, gui.get_position(node)) local node_border = helper.get_border(node, gui.get_position(node))
local view_border = helper.get_border(self.view_node, -(self.position - self._outside_offset_vector)) local view_border = helper.get_border(self.view_node, -(self.position - self._outside_offset_vector))

View File

@ -40,6 +40,7 @@
--- The size of item content --- The size of item content
-- @tfield vector4 border -- @tfield vector4 border
---
local const = require("druid.const") local const = require("druid.const")
local Event = require("druid.event") local Event = require("druid.event")

View File

@ -14,6 +14,7 @@
--- Trigger on swipe event(self, swipe_side, dist, delta_time --- Trigger on swipe event(self, swipe_side, dist, delta_time
-- @tfield druid_event on_swipe) -- @tfield druid_event on_swipe)
---
local Event = require("druid.event") local Event = require("druid.event")
local const = require("druid.const") local const = require("druid.const")

View File

@ -38,6 +38,7 @@
--- Current text color --- Current text color
-- @tfield vector3 color -- @tfield vector3 color
---
local Event = require("druid.event") local Event = require("druid.event")
local const = require("druid.const") local const = require("druid.const")

View File

@ -15,6 +15,7 @@
--- Button component from click_node --- Button component from click_node
-- @tfield Button button -- @tfield Button button
---
local Event = require("druid.event") local Event = require("druid.event")
local component = require("druid.component") local component = require("druid.component")

View File

@ -9,6 +9,7 @@
--- Array of checkbox components --- Array of checkbox components
-- @tfield table checkboxes -- @tfield table checkboxes
---
local Event = require("druid.event") local Event = require("druid.event")
local component = require("druid.component") local component = require("druid.component")

View File

@ -6,10 +6,10 @@
--- The Druid scroll component --- The Druid scroll component
-- @tfield Scroll scroll -- @tfield druid.scroll scroll
--- The Druid Grid component --- The Druid Grid component
-- @tfield StaticGrid grid -- @tfield druid.static_grid grid
--- The current visual top data index --- The current visual top data index
-- @tfield number top_index -- @tfield number top_index
@ -17,9 +17,13 @@
--- The current visual last data index --- The current visual last data index
-- @tfield number last_index -- @tfield number last_index
--- The current progress of scroll posititon (approx.) --- The current progress of scroll posititon
-- @tfield number scroll_progress -- @tfield number scroll_progress
--- Event triggered when scroll progress is changed; event(self, progress_value)
-- @tfield druid_event on_scroll_progress_change
---
local const = require("druid.const") local const = require("druid.const")
local helper = require("druid.helper") local helper = require("druid.helper")
@ -31,8 +35,8 @@ local DataList = component.create("data_list")
--- Data list constructor --- Data list constructor
-- @tparam DataList self -- @tparam DataList self
-- @tparam druid.scroll The Scroll instance for Data List component -- @tparam druid.scroll scroll The Scroll instance for Data List component
-- @tparam druid.grid The Grid instance for Data List component -- @tparam druid.grid grid The Grid instance for Data List component
-- @tparam function create_function The create function callback(self, data, index, data_list). Function should return (node, [component]) -- @tparam function create_function The create function callback(self, data, index, data_list). Function should return (node, [component])
function DataList.init(self, scroll, grid, create_function) function DataList.init(self, scroll, grid, create_function)
self.druid = self:get_druid() self.druid = self:get_druid()
@ -40,7 +44,7 @@ function DataList.init(self, scroll, grid, create_function)
self.grid = grid self.grid = grid
self.scroll:bind_grid(grid) self.scroll:bind_grid(grid)
--- Current visual elements indexes -- Current visual elements indexes
self.top_index = 1 self.top_index = 1
self.last_index = 1 self.last_index = 1
self.scroll_progress = 0 self.scroll_progress = 0

View File

@ -36,6 +36,7 @@
--- The size of item content --- The size of item content
-- @tfield vector4 border -- @tfield vector4 border
---
local const = require("druid.const") local const = require("druid.const")
local Event = require("druid.event") local Event = require("druid.event")
@ -177,7 +178,6 @@ end
--- Remove the item from the grid. Note that gui node will be not deleted --- Remove the item from the grid. Note that gui node will be not deleted
-- @tparam DynamicGrid self -- @tparam DynamicGrid self
-- @tparam number index The grid node index to remove -- @tparam number index The grid node index to remove
-- @tparam[opt=false] bool is_shift_left If true, shift all nodes to the left, otherwise shift nodes to the right
-- @tparam[opt=SHIFT.RIGHT] number shift_policy How shift nodes, if required. See const.SHIFT -- @tparam[opt=SHIFT.RIGHT] number shift_policy How shift nodes, if required. See const.SHIFT
-- @treturn Node The deleted gui node from grid -- @treturn Node The deleted gui node from grid
function DynamicGrid.remove(self, index, shift_policy) function DynamicGrid.remove(self, index, shift_policy)

View File

@ -44,6 +44,7 @@
--- Gui keyboard type for input field --- Gui keyboard type for input field
-- @tfield number keyboard_type -- @tfield number keyboard_type
---
local Event = require("druid.event") local Event = require("druid.event")
local const = require("druid.const") local const = require("druid.const")

View File

@ -10,6 +10,7 @@
--- The text component --- The text component
-- @tfield Text text -- @tfield Text text
---
local Event = require("druid.event") local Event = require("druid.event")
local settings = require("druid.system.settings") local settings = require("druid.system.settings")

View File

@ -25,6 +25,7 @@
--- Progress bar slice9 settings --- Progress bar slice9 settings
-- @tfield vector4 slice -- @tfield vector4 slice
---
local Event = require("druid.event") local Event = require("druid.event")
local const = require("druid.const") local const = require("druid.const")

View File

@ -9,6 +9,7 @@
--- Array of checkbox components --- Array of checkbox components
-- @tfield Checkbox[] checkboxes -- @tfield Checkbox[] checkboxes
---
local Event = require("druid.event") local Event = require("druid.event")
local component = require("druid.component") local component = require("druid.component")

View File

@ -30,6 +30,7 @@
--- Current slider value --- Current slider value
-- @tfield number value -- @tfield number value
---
local Event = require("druid.event") local Event = require("druid.event")

View File

@ -26,6 +26,7 @@
--- Current timer value --- Current timer value
-- @tfield number value -- @tfield number value
---
local Event = require("druid.event") local Event = require("druid.event")
local formats = require("druid.helper.formats") local formats = require("druid.helper.formats")

View File

@ -65,7 +65,7 @@ M["scroll"] = {
INERT_SPEED = 30, -- koef. of inert speed INERT_SPEED = 30, -- koef. of inert speed
EXTRA_STRETCH_SIZE = 100, -- extra size in pixels outside of scroll (stretch effect) EXTRA_STRETCH_SIZE = 100, -- extra size in pixels outside of scroll (stretch effect)
POINTS_DEADZONE = 20, -- Speed to check points of interests in no_inertion mode POINTS_DEADZONE = 20, -- Speed to check points of interests in no_inertion mode
WHEEL_SCROLL_SPEED = 20, WHEEL_SCROLL_SPEED = 0,
WHEEL_SCROLL_INVERTED = false, WHEEL_SCROLL_INVERTED = false,
SMALL_CONTENT_SCROLL = true, -- If true, content node with size less than view node size can be scrolled SMALL_CONTENT_SCROLL = true, -- If true, content node with size less than view node size can be scrolled
} }

View File

@ -26,6 +26,7 @@
-- @see RadioGroup -- @see RadioGroup
-- @see Swipe -- @see Swipe
-- @see Drag -- @see Drag
-- @see DataList
-- @see Hover -- @see Hover
local helper = require("druid.helper") local helper = require("druid.helper")
@ -562,10 +563,13 @@ end
--- Create data list basic component --- Create data list basic component
-- @function druid:new_data_list -- @function druid:new_data_list
-- @tparam args ... drag init args -- @tparam druid.scroll druid_scroll The Scroll instance for Data List component
-- @treturn Component data list component -- @tparam druid.grid druid_grid The Grid instance for Data List component
function DruidInstance.new_data_list(self, ...) -- @tparam function create_function The create function callback(self, data, index, data_list). Function should return (node, [component])
return DruidInstance.new(self, data_list, ...) -- @treturn DataList data_list component
function DruidInstance.new_data_list(self, druid_scroll, druid_grid, create_function)
-- return helper.extended_component("data_list")
return DruidInstance.new(self, data_list, druid_scroll, druid_grid, create_function)
end end

View File

@ -1,5 +1,6 @@
local lang = require("example.lang") --- @type druid
local druid = require("druid.druid") local druid = require("druid.druid")
local lang = require("example.lang")
local function empty_callback(self, param) local function empty_callback(self, param)
print("Empty callback. Param", param) print("Empty callback. Param", param)

View File

@ -10,8 +10,10 @@ height = 900
[project] [project]
title = druid title = druid
version = 0.5.0 version = 0.6.0
dependencies = https://github.com/insalitygames/deftest/archive/master.zip,https://github.com/britzl/monarch/archive/refs/tags/3.3.0.zip dependencies = https://github.com/insalitygames/deftest/archive/master.zip,https://github.com/britzl/monarch/archive/refs/tags/3.3.0.zip
publisher = Insality
developer = Insality
[library] [library]
include_dirs = druid include_dirs = druid