diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 192ca28..0000000 --- a/docs/index.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- - -

Documentation for Druid Framework

- -

Modules

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BackHandlerComponent with event on back and backspace button.
BlockerComponent to consume input in special zone defined by GUI node.
ButtonDruid Component for Handling User Click Interactions: Click, Long Click, Double Click, and More.
DragComponent to handle drag action on node.
HoverComponent to handle hover node interaction
ScrollComponent to handle scroll content.
StaticGridComponent to handle component's position by row and columns.
TextComponent for Wrapping GUI Text Nodes: Druid Text -

## Overview ## -

Druid Text is a component that provides various adjustment modes for text nodes.

BaseComponentBasic class for all Druid components.
RichInputDruid Rich Input custom component.
RichTextDruid Rich Text Custom Component.
DruidDruid UI Component Framework.
DruidEventDruid Event Module -

The Event module provides a simple class for handling callbacks.

DataListComponent to manage data for huge dataset in scroll.
DynamicGridComponent to handle placing components in row
HotkeyDruid hotkey component
InputDruid input text component.
LangTextComponent to wrap over GUI Text nodes with localization helpers -

# Overview # -

• The initialization of druid.set_text_function is required to enable localization - using the localization ID.

LayoutLayout management on node
ProgressDruid component to handle the progress bars.
SliderDruid slider component
SwipeComponent to handle swipe gestures on node.
TimerComponent to handle GUI timers.
HelperHelper module with various usefull GUI functions.
DruidInstanceDruid Instance which you use for component creation.
- -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/ldoc_fixed.css b/docs/ldoc_fixed.css deleted file mode 100644 index e63d191..0000000 --- a/docs/ldoc_fixed.css +++ /dev/null @@ -1,311 +0,0 @@ -/* BEGIN RESET - -Copyright (c) 2010, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.com/yui/license.html -version: 2.8.2r1 -*/ -html { - color: #000; - background: #FFF; -} -body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { - margin: 0; - padding: 0; -} -table { - border-collapse: collapse; - border-spacing: 0; -} -fieldset,img { - border: 0; -} -address,caption,cite,code,dfn,em,strong,th,var,optgroup { - font-style: inherit; - font-weight: inherit; -} -del,ins { - text-decoration: none; -} -li { - margin-left: 20px; -} -caption,th { - text-align: left; -} -h1,h2,h3,h4,h5,h6 { - font-size: 100%; - font-weight: bold; -} -q:before,q:after { - content: ''; -} -abbr,acronym { - border: 0; - font-variant: normal; -} -sup { - vertical-align: baseline; -} -sub { - vertical-align: baseline; -} -legend { - color: #000; -} -input,button,textarea,select,optgroup,option { - font-family: inherit; - font-size: inherit; - font-style: inherit; - font-weight: inherit; -} -input,button,textarea,select {*font-size:100%; -} -/* END RESET */ - -body { - margin-left: 1em; - margin-right: 1em; - font-family: arial, helvetica, geneva, sans-serif; - background-color: #ffffff; margin: 0px; -} - -code, tt { font-family: monospace; font-size: 1.1em; } -span.parameter { font-family:monospace; } -span.parameter:after { content:":"; } -span.types:before { content:"("; } -span.types:after { content:")"; } -.type { font-weight: bold; font-style:italic } - -body, p, td, th { font-size: .95em; line-height: 1.2em;} - -p, ul { margin: 10px 0 0 0px;} - -strong { font-weight: bold;} - -em { font-style: italic;} - -h1 { - font-size: 1.5em; - margin: 0 0 20px 0; -} -h2, h3, h4 { margin: 15px 0 10px 0; } -h2 { font-size: 1.25em; } -h3 { font-size: 1.15em; } -h4 { font-size: 1.06em; } - -a:link { font-weight: bold; color: #004080; text-decoration: none; } -a:visited { font-weight: bold; color: #006699; text-decoration: none; } -a:link:hover { text-decoration: underline; } - -hr { - color:#cccccc; - background: #00007f; - height: 1px; -} - -blockquote { margin-left: 3em; } - -ul { list-style-type: disc; } - -p.name { - font-family: "Andale Mono", monospace; - padding-top: 1em; -} - -pre { - background-color: rgb(245, 245, 245); - border: 1px solid #C0C0C0; /* silver */ - padding: 10px; - margin: 10px 0 10px 0; - overflow: auto; - font-family: "Andale Mono", monospace; -} - -pre.example { - font-size: .85em; -} - -table.index { border: 1px #00007f; } -table.index td { text-align: left; vertical-align: top; } - -#container { - margin-left: 1em; - margin-right: 1em; - background-color: #ffffff; -} - -#product { - text-align: center; - border-bottom: 1px solid #cccccc; - background-color: #ffffff; -} - -#product big { - font-size: 2em; -} - -#main { - background-color:#FFFFFF; // #f0f0f0; - border-left: 1px solid #cccccc; -} - -#navigation { - position: fixed; - top: 0; - left: 0; - float: left; - width: 14em; - vertical-align: top; - background-color:#FFFFFF; // #f0f0f0; - border-right: 2px solid #cccccc; - overflow: visible; - overflow-y: scroll; - height: 100%; - padding-left: 1em; -} - -#navigation h2 { - background-color:#FFFFFF;//:#e7e7e7; - font-size:1.1em; - color:#000000; - text-align: left; - padding:0.2em; - border-bottom:1px solid #dddddd; -} - -#navigation ul -{ - font-size:1em; - list-style-type: none; - margin: 1px 1px 10px 1px; -} - -#navigation li { - text-indent: -1em; - display: block; - margin: 3px 0px 0px 22px; -} - -#navigation li li a { - margin: 0px 3px 0px -1em; -} - -#content { - margin-left: 14em; - padding: 1em; - padding-left: 2em; - width: 900px; - border-left: 2px solid #cccccc; - // border-right: 2px solid #cccccc; - background-color: #ffffff; -} - -#about { - clear: both; - padding-left: 1em; - margin-left: 14em; // avoid the damn sidebar! - border-top: 2px solid #cccccc; - border-left: 2px solid #cccccc; - background-color: #ffffff; -} - -@media print { - body { - font: 12pt "Times New Roman", "TimeNR", Times, serif; - } - a { font-weight: bold; color: #004080; text-decoration: underline; } - - #main { - background-color: #ffffff; - border-left: 0px; - } - - #container { - margin-left: 2%; - margin-right: 2%; - background-color: #ffffff; - } - - #content { - padding: 1em; - background-color: #ffffff; - } - - #navigation { - display: none; - } - pre.example { - font-family: "Andale Mono", monospace; - font-size: 10pt; - page-break-inside: avoid; - } -} - -table.module_list { - border-width: 1px; - border-style: solid; - border-color: #cccccc; - border-collapse: collapse; -} -table.module_list td { - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.module_list td.name { background-color: #f0f0f0; ; min-width: 200px; } -table.module_list td.summary { width: 100%; } - -table.function_list { - border-width: 1px; - border-style: solid; - border-color: #cccccc; - border-collapse: collapse; -} -table.function_list td { - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.function_list td.name { background-color: #f6f6ff; ; min-width: 200px; } -table.function_list td.summary { width: 100%; } - -dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;} -dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;} -dl.table h3, dl.function h3 {font-size: .95em;} - -ul.nowrap { - overflow:auto; - whitespace:nowrap; -} - -/* stop sublists from having initial vertical space */ -ul ul { margin-top: 0px; } -ol ul { margin-top: 0px; } -ol ol { margin-top: 0px; } -ul ol { margin-top: 0px; } - -/* make the target distinct; helps when we're navigating to a function */ -a:target + * { - background-color: #FF9; -} - - -/* styles for prettification of source */ -pre .comment { color: #558817; } -pre .constant { color: #a8660d; } -pre .escape { color: #844631; } -pre .keyword { color: #aa5050; font-weight: bold; } -pre .library { color: #0e7c6b; } -pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; } -pre .string { color: #8080ff; } -pre .number { color: #f8660d; } -pre .operator { color: #2239a8; font-weight: bold; } -pre .preprocessor, pre .prepro { color: #a33243; } -pre .global { color: #800080; } -pre .user-keyword { color: #800080; } -pre .prompt { color: #558817; } -pre .url { color: #272fc2; text-decoration: underline; } - diff --git a/docs/modules/BackHandler.html b/docs/modules/BackHandler.html deleted file mode 100644 index e8f7dc7..0000000 --- a/docs/modules/BackHandler.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module BackHandler

-

Component with event on back and backspace button.

-

- # Overview # -

Back Handler is recommended to put in every game window to close it - or in main screen to call settings window. -

# Notes # -

• Back Handler inheritance BaseComponent, you can use all of its methods in addition to those described here. -

• Back Handler react on release action ACTION_BACK or ACTION_BACKSPACE

-

Usage:

-
    -
    local callback = function(self, params) ... end
    -
    -local params = {}
    -local back_handler = self.druid:new_back_handler(callback, [params])
    -
    -
- - -

Fields

- - - - - - - - - -
on_backThe DruidEvent Event on back handler action.
paramsCustom args to pass in the callback
- -
-
- - -

Fields

- -
-
- - on_back -
-
- The DruidEvent Event on back handler action. -

Trigger on input action ACTION_BACK or ACTION_BACKSPACE - - -

- - - - -

Usage:

-
    -
    -- Subscribe additional callbacks:
    -back_handler.on_back:subscribe(callback)
    -
- -
-
- - params -
-
- Custom args to pass in the callback - - -
    -
  • params - any or nil - -
  • -
- - - - -

Usage:

-
    -
    -- Replace params on runtime:
    -back_handler.params = { ... }
    -
- -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/BaseComponent.html b/docs/modules/BaseComponent.html deleted file mode 100644 index 39eb118..0000000 --- a/docs/modules/BaseComponent.html +++ /dev/null @@ -1,549 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module BaseComponent

-

Basic class for all Druid components.

-

- To create you custom component, use static function `component.create`

-

Usage:

-
    -
    -- Create your component:
    -local component = require("druid.component")
    -
    -local AwesomeComponent = component.create("awesome_component")
    -
    -function AwesomeComponent:init(template, nodes)
    -    self:set_template(template)
    -    self:set_nodes(nodes)
    -    self.druid = self:get_druid()
    -end
    -
    -return AwesomeComponent
    -
    -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get_childrens(self)Return all children components, recursive
get_context(self)Context used as first arg in all Druid events
get_druid(self, template, nodes)Get Druid instance for inner component creation.
get_input_priority(self)Return component input priority
get_name(self)Return component name
get_node(self, node_or_name)Get component node by name.
get_parent_component(self)Return the parent component if exist
get_parent_name(self)Return parent component name
get_template(self)Get current component template name.
get_uid(self)Return component UID.
reset_input_priority(self)Reset component input priority to default value
set_input_enabled(self, state)Set component input state.
set_input_priority(self, value, is_temporary)Set component input priority
- -
-
- - -

Functions

- -
-
- - get_childrens(self) -
-
- Return all children components, recursive - - -

Parameters:

- - -

Returns:

-
    - - table - Array of childrens if the Druid component instance -
- - - - -
-
- - get_context(self) -
-
- Context used as first arg in all Druid events Context is usually self of gui_script. - - -

Parameters:

- - -

Returns:

-
    - - table - BaseComponent context -
- - - - -
-
- - get_druid(self, template, nodes) -
-
- Get Druid instance for inner component creation. - - -

Parameters:

-
    -
  • self - BaseComponent - BaseComponent -
  • -
  • template - string or nil - The template name -
  • -
  • nodes - table or nil - The nodes table -
  • -
- -

Returns:

-
    - - DruidInstance - Druid instance with component context -
- - - - -
-
- - get_input_priority(self) -
-
- Return component input priority - - -

Parameters:

- - -

Returns:

-
    - - number - The component input priority -
- - - - -
-
- - get_name(self) -
-
- Return component name - - -

Parameters:

- - -

Returns:

-
    - - string - The component name -
- - - - -
-
- - get_node(self, node_or_name) -
-
- Get component node by name. -

If component has nodes, node_or_name should be string - It autopick node by template name or from nodes by gui.clone_tree - if they was setup via component:set_nodes, component:set_template. - If node is not found, the exception will fired - - -

Parameters:

-
    -
  • self - BaseComponent - BaseComponent -
  • -
  • node_or_name - string or node - Node name or node itself -
  • -
- -

Returns:

-
    - - node - Gui node -
- - - - -
-
- - get_parent_component(self) -
-
- Return the parent component if exist - - -

Parameters:

- - -

Returns:

-
    - - BaseComponent or nil - The druid component instance or nil -
- - - - -
-
- - get_parent_name(self) -
-
- Return parent component name - - -

Parameters:

- - -

Returns:

-
    - - string or nil - The parent component name if exist or bil -
- - - - -
-
- - get_template(self) -
-
- Get current component template name. - - -

Parameters:

- - -

Returns:

-
    - - string - Component full template name -
- - - - -
-
- - get_uid(self) -
-
- Return component UID. -

UID generated in component creation order. - - -

Parameters:

- - -

Returns:

-
    - - number - The component uid -
- - - - -
-
- - reset_input_priority(self) -
-
- Reset component input priority to default value - - -

Parameters:

- - -

Returns:

-
    - - number - The component input priority -
- - - - -
-
- - set_input_enabled(self, state) -
-
- Set component input state. By default it enabled -

If input is disabled, the component will not receive input events - - -

Parameters:

-
    -
  • self - BaseComponent - BaseComponent -
  • -
  • state - boolean or nil - The component input state -
  • -
- -

Returns:

-
    - - BaseComponent - BaseComponent itself -
- - - - -
-
- - set_input_priority(self, value, is_temporary) -
-
- Set component input priority Default value: 10 - - -

Parameters:

-
    -
  • self - BaseComponent - BaseComponent -
  • -
  • value - number - The new input priority value -
  • -
  • is_temporary - boolean or nil - If true, the reset input priority will return to previous value -
  • -
- -

Returns:

-
    - - number - The component input priority -
- - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Blocker.html b/docs/modules/Blocker.html deleted file mode 100644 index c3ec691..0000000 --- a/docs/modules/Blocker.html +++ /dev/null @@ -1,233 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Blocker

-

Component to consume input in special zone defined by GUI node.

-

- # Overview # -

# Notes # -

Blocker consume input if `gui.pick_node` works on it. -

• Blocker inheritance BaseComponent, you can use all of its methods in addition to those described here. -

• Blocker initial enabled state is `gui.is_enabled(node, true)` -

• The Blocker node should be enabled to capture the input

-

Usage:

-
    -
    local node = gui.get_node("blocker_node")
    -local blocker = self.druid:new_blocker(node)
    -
    -
- - -

Functions

- - - - - - - - - - - - - -
init(self, node)The Blocker constructor
is_enabled(self)Return blocker enabled state
set_enabled(self, state)Set enabled blocker component state.
-

Fields

- - - - - -
nodeBlocker node
- -
-
- - -

Functions

- -
-
- - init(self, node) -
-
- The Blocker constructor - - -

Parameters:

-
    -
  • self - Blocker - Blocker -
  • -
  • node - node - Gui node -
  • -
- - - - - -
-
- - is_enabled(self) -
-
- Return blocker enabled state - - -

Parameters:

- - -

Returns:

-
    - - boolean - @True, if blocker is enabled -
- - - - -
-
- - set_enabled(self, state) -
-
- Set enabled blocker component state. -

Don't change node enabled state itself. - - -

Parameters:

-
    -
  • self - Blocker - Blocker -
  • -
  • state - boolean or nil - Enabled state -
  • -
- - - - - -
-
-

Fields

- -
-
- - node -
-
- Blocker node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Button.html b/docs/modules/Button.html deleted file mode 100644 index 6bcc4cd..0000000 --- a/docs/modules/Button.html +++ /dev/null @@ -1,880 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Button

-

Druid Component for Handling User Click Interactions: Click, Long Click, Double Click, and More.

-

-

# Overview # -

This component provides a versatile solution for handling user click interactions. - It allows you to make any GUI node clickable and define various callbacks for different types of clicks. -

# Notes # -

• The click callback will not trigger if the cursor moves outside the node's - area between the pressed and released states. -

• If a button has a double click event subscriber and the double click event is triggered, - the regular click callback will not be triggered. -

• Buttons can be triggered using a keyboard key by calling the button:set_key_trigger method. -

• To animate a small icon on a big button panel, you can use an animation node. - The trigger node name should be set as "big panel," and the animation node should be set as "small icon." -

Example Link

-

Usage:

-
    -
    local function on_button_click(self, args, button)
    -    print("Button has clicked with params: " .. args)
    -    print("Also the button component is passed in callback params")
    -end
    -
    -local custom_args = "Any variable to pass inside callback"
    -local button = self.druid:new_button("button_name", on_button_click, custom_args)
    -
    -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get_key_trigger(self)Get current key name to trigger this button.
init(self, node, callback, custom_args, anim_node)The Button constructor
is_enabled(self)Get button enabled state.
set_check_function(self, check_function, failure_callback)Set function for additional check for button click availability
set_click_zone(self, zone)Set additional button click area.
set_enabled(self, state)Set button enabled state.
set_key_trigger(self, key)Set key name to trigger this button by keyboard.
set_web_user_interaction(self, is_web_mode)Set Button mode to work inside user HTML5 interaction event.
-

Tables

- - - - - -
styleComponent style params.
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
anim_nodeButton animation node.
click_zoneAdditional button click area, defined by another GUI node
hoverThe Hover: Button Hover component
nodeButton trigger node
node_idThe GUI node id from button node
on_clickThe DruidEvent: Event on successful release action over button.
on_click_outsideThe DruidEvent: Event calls if click event was outside of button.
on_double_clickThe DruidEvent: Event on double tap action over button.
on_hold_callbackThe DruidEvent: Event calls every frame before on_long_click event.
on_long_clickThe DruidEvent: Event on long tap action over button.
on_pressedThe DruidEvent: Event triggered if button was pressed by user.
on_repeated_clickThe DruidEvent: Event on repeated action over button.
paramsCustom args for any Button event.
- -
-
- - -

Functions

- -
-
- - get_key_trigger(self) -
-
- Get current key name to trigger this button. - - -

Parameters:

-
    -
  • self - Button - -
  • -
- -

Returns:

-
    - - hash - The action_id of the input key -
- - - -

Usage:

-
    -
    local key_hash = button:get_key_trigger()
    -
- -
-
- - init(self, node, callback, custom_args, anim_node) -
-
- The Button constructor - - -

Parameters:

-
    -
  • self - Button - Button -
  • -
  • node - string or node - The node_id or gui.get_node(node_id) -
  • -
  • callback - function - On click button callback -
  • -
  • custom_args - any or nil - Button events custom arguments -
  • -
  • anim_node - string, node or nil - Node to animate instead of trigger node. -
  • -
- - - - - -
-
- - is_enabled(self) -
-
- Get button enabled state. -

By default all Buttons is enabled on creating. - - -

Parameters:

-
    -
  • self - Button - Button -
  • -
- -

Returns:

-
    - - boolean - @True, if button is enabled now, False overwise -
- - - -

Usage:

-
    -
    local is_enabled = button:is_enabled()
    -
- -
-
- - set_check_function(self, check_function, failure_callback) -
-
- Set function for additional check for button click availability - - -

Parameters:

-
    -
  • self - Button - -
  • -
  • check_function - function or nil - Should return true or false. If true - button can be pressed. -
  • -
  • failure_callback - function or nil - Function will be called on button click, if check function return false -
  • -
- -

Returns:

-
    - - Button - Current button instance -
- - - - -
-
- - set_click_zone(self, zone) -
-
- Set additional button click area. - Useful to restrict click outside out stencil node or scrollable content. -

This functions calls automatically if you don't disable it in game.project: druid.no_stencil_check - - -

Parameters:

- - -

Returns:

-
    - - Button - Current button instance -
- - - -

Usage:

-
    -
    button:set_click_zone("stencil_node")
    -
- -
-
- - set_enabled(self, state) -
-
- Set button enabled state. - The style.on_set_enabled will be triggered. - Disabled button is not clickable. - - -

Parameters:

-
    -
  • self - Button - Button -
  • -
  • state - boolean or nil - Enabled state -
  • -
- -

Returns:

-
    - - Button - Current button instance -
- - - -

Usage:

-
    -
    button:set_enabled(false)
    -button:set_enabled(true)
    -
- -
-
- - set_key_trigger(self, key) -
-
- Set key name to trigger this button by keyboard. - - -

Parameters:

-
    -
  • self - Button - Button -
  • -
  • key - hash or string - The action_id of the input key -
  • -
- -

Returns:

-
    - - Button - Current button instance -
- - - -

Usage:

-
    -
    button:set_key_trigger("key_space")
    -
- -
-
- - set_web_user_interaction(self, is_web_mode) -
-
- Set Button mode to work inside user HTML5 interaction event. -

It's required to make protected things like copy & paste text, show mobile keyboard, etc - The HTML5 button's doesn't call any events except on_click event. -

If the game is not HTML, html mode will be not enabled - - -

Parameters:

-
    -
  • self - Button - -
  • -
  • is_web_mode - boolean or nil - If true - button will be called inside html5 callback -
  • -
- -

Returns:

-
    - - Button - Current button instance -
- - - -

Usage:

-
    -
    button:set_web_user_interaction(true)
    -
- -
-
-

Tables

- -
-
- - style -
-
- Component style params. - You can override this component styles params in Druid styles table - or create your own style - - -

Fields:

-
    -
  • LONGTAP_TIME - number or nil - Minimum time to trigger on_hold_callback. Default: 0.4 -
  • -
  • AUTOHOLD_TRIGGER - number or nil - Maximum hold time to trigger button release while holding. Default: 0.8 -
  • -
  • DOUBLETAP_TIME - number or nil - Time between double taps. Default: 0.4 -
  • -
  • on_click - function - function(self, node) -
  • -
  • on_click_disabled - function - function(self, node) -
  • -
  • on_hover - function - function(self, node, hover_state) -
  • -
  • on_mouse_hover - function - function(self, node, hover_state) -
  • -
  • on_set_enabled - function - function(self, node, enabled_state) -
  • -
- - - - - -
-
-

Fields

- -
-
- - anim_node -
-
- Button animation node. - In default case equals to clickable node. -

Usecase: You have the big clickable panel, but want to animate only one small icon on it. - - -

    -
  • anim_node - node or nil - Default node -
  • -
- - - - - -
-
- - click_zone -
-
- Additional button click area, defined by another GUI node - - -
    -
  • click_zone - node or nil - -
  • -
- - - - - -
-
- - hover -
-
- The Hover: Button Hover component - - -
    -
  • hover - Hover - Hover -
  • -
- - - - - -
-
- - node -
-
- Button trigger node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - node_id -
-
- The GUI node id from button node - - -
    -
  • node_id - hash - -
  • -
- - - - - -
-
- - on_click -
-
- The DruidEvent: Event on successful release action over button. - - - - - - - -

Usage:

-
    -
    -- Custom args passed in Button constructor
    -button.on_click:subscribe(function(self, custom_args, button_instance)
    -    print("On button click!")
    -end)
    -
- -
-
- - on_click_outside -
-
- The DruidEvent: Event calls if click event was outside of button. -

This event will be triggered for each button what was not clicked on user click action -

Usecase: Hide the popup when click outside - - -

    -
  • on_click_outside - DruidEvent - DruidEvent -
  • -
- - - - -

Usage:

-
    -
    -- Custom args passed in Button constructor
    -button.on_click_outside:subscribe(function(self, custom_args, button_instance)
    -    print("On click Button outside!")
    -end)
    -
- -
-
- - on_double_click -
-
- The DruidEvent: Event on double tap action over button. -

If secondary click was too fast after previous one, the double - click will be called instead usual click (if on_double_click subscriber exists) - - -

- - - - -

Usage:

-
    -
    -- Custom args passed in Button constructor
    -button.on_double_click:subscribe(function(self, custom_args, button_instance, click_amount)
    -    print("On double Button click!")
    -end)
    -
- -
-
- - on_hold_callback -
-
- The DruidEvent: Event calls every frame before on_long_click event. -

If long_click subscriber exists, the on_hold_callback will be called before long_click trigger. -

Usecase: Animate button progress of long tap - - -

    -
  • on_hold_callback - DruidEvent - DruidEvent -
  • -
- - - - -

Usage:

-
    -
    -- Custom args passed in Button constructor
    -button.on_double_click:subscribe(function(self, custom_args, button_instance, time)
    -    print("On hold Button callback!")
    -end)
    -
- -
-
- - on_long_click -
-
- The DruidEvent: Event on long tap action over button. -

This callback will be triggered if user pressed the button and hold the some amount of time. - The amount of time picked from button style param: LONGTAP_TIME - - -

- - - - -

Usage:

-
    -
    -- Custom args passed in Button constructor
    -button.on_long_click:subscribe(function(self, custom_args, button_instance, hold_time)
    -    print("On long Button click!")
    -end)
    -
- -
-
- - on_pressed -
-
- The DruidEvent: Event triggered if button was pressed by user. - - - - - - - -

Usage:

-
    -
    -- Custom args passed in Button constructor
    -button.on_pressed:subscribe(function(self, custom_args, button_instance)
    -    print("On Button pressed!")
    -end)
    -
- -
-
- - on_repeated_click -
-
- The DruidEvent: Event on repeated action over button. -

This callback will be triggered if user hold the button. The repeat rate pick from `input.repeat_interval` in game.project - - -

    -
  • on_repeated_click - DruidEvent - DruidEvent -
  • -
- - - - -

Usage:

-
    -
    -- Custom args passed in Button constructor
    -button.on_repeated_click:subscribe(function(self, custom_args, button_instance, click_count)
    -    print("On repeated Button click!")
    -end)
    -
- -
-
- - params -
-
- Custom args for any Button event. Setup in Button constructor - - -
    -
  • params - any - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Checkbox.html b/docs/modules/Checkbox.html deleted file mode 100644 index fd0aef1..0000000 --- a/docs/modules/Checkbox.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Checkbox

-

Druid checkbox component

-

Example Link

- - -

Functions

- - - - - - - - - - - - - -
get_state(self)Return checkbox state
init(self, node, callback, click_node, initial_state)The Checkbox constructor
set_state(self, state, is_silent, is_instant)Set checkbox state
-

Tables

- - - - - -
styleComponent style params.
-

Fields

- - - - - - - - - - - - - - - - - -
buttonButton component from click_node
click_nodeButton trigger node
nodeVisual node
on_change_stateOn change state callback(self, state)
- -
-
- - -

Functions

- -
-
- - get_state(self) -
-
- Return checkbox state - - -

Parameters:

- - -

Returns:

-
    - - boolean - Checkbox state -
- - - - -
-
- - init(self, node, callback, click_node, initial_state) -
-
- The Checkbox constructor - - -

Parameters:

-
    -
  • self - Checkbox - Checkbox -
  • -
  • node - node - Gui node -
  • -
  • callback - function - Checkbox callback -
  • -
  • click_node - node or nil - Trigger node, by default equals to node. Default: node -
  • -
  • initial_state - boolean or nil - The initial state of checkbox, default - false -
  • -
- - - - - -
-
- - set_state(self, state, is_silent, is_instant) -
-
- Set checkbox state - - -

Parameters:

-
    -
  • self - Checkbox - Checkbox -
  • -
  • state - boolean or nil - Checkbox state -
  • -
  • is_silent - boolean or nil - Don't trigger on_change_state if true -
  • -
  • is_instant - boolean or nil - If instant checkbox change -
  • -
- - - - - -
-
-

Tables

- -
-
- - style -
-
- Component style params. - You can override this component styles params in druid styles table - or create your own style - - -

Fields:

-
    -
  • on_change_state - function - (self, node, state) -
  • -
- - - - - -
-
-

Fields

- -
-
- - button -
-
- Button component from click_node - - -
    -
  • button - Button - Button -
  • -
- - - - - -
-
- - click_node -
-
- Button trigger node - - -
    -
  • click_node - node or nil - -
  • -
- - - - - -
-
- - node -
-
- Visual node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - on_change_state -
-
- On change state callback(self, state) - - - - - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/CheckboxGroup.html b/docs/modules/CheckboxGroup.html deleted file mode 100644 index 5ff8ec1..0000000 --- a/docs/modules/CheckboxGroup.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module CheckboxGroup

-

Checkbox group module

-

Example Link

- - -

Functions

- - - - - - - - - - - - - -
get_state(self)Return checkbox group state
init(self, nodes, callback, click_nodes)The CheckboxGroup constructor
set_state(self, indexes, is_instant)Set checkbox group state
-

Fields

- - - - - - - - - -
checkboxesArray of checkbox components
on_checkbox_clickOn any checkbox click callback(self, index)
- -
-
- - -

Functions

- -
-
- - get_state(self) -
-
- Return checkbox group state - - -

Parameters:

- - -

Returns:

-
    - - boolean[] - Array if checkboxes state -
- - - - -
-
- - init(self, nodes, callback, click_nodes) -
-
- The CheckboxGroup constructor - - -

Parameters:

-
    -
  • self - CheckboxGroup - CheckboxGroup -
  • -
  • nodes - node[] - Array of gui node -
  • -
  • callback - function - Checkbox callback -
  • -
  • click_nodes - node[] or nil - Array of trigger nodes, by default equals to nodes -
  • -
- - - - - -
-
- - set_state(self, indexes, is_instant) -
-
- Set checkbox group state - - -

Parameters:

-
    -
  • self - CheckboxGroup - CheckboxGroup -
  • -
  • indexes - boolean[] - Array of checkbox state -
  • -
  • is_instant - boolean or nil - If instant state change -
  • -
- - - - - -
-
-

Fields

- -
-
- - checkboxes -
-
- Array of checkbox components - - - - - - - - -
-
- - on_checkbox_click -
-
- On any checkbox click callback(self, index) - - -
    -
  • on_checkbox_click - DruidEvent - DruidEvent -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/DataList.html b/docs/modules/DataList.html deleted file mode 100644 index 680d3ce..0000000 --- a/docs/modules/DataList.html +++ /dev/null @@ -1,712 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module DataList

-

Component to manage data for huge dataset in scroll.

-

- It requires Druid Scroll and Druid Grid (Static or Dynamic) components -

Example Link

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
add(self, data, index, shift_policy)Add element to DataList.
clear(self)Clear the DataList and refresh visuals
get_created_components(self)Return all currenly created components in DataList
get_created_nodes(self)Return all currenly created nodes in DataList
get_data(self)Return current data from DataList component
get_index(self, data)Return index for data value
init(self, scroll, grid, create_function)The DataList constructor
on_remove(self)Druid System on_remove function
remove(self, index, shift_policy)Remove element from DataList.
remove_by_data(self, data, shift_policy)Remove element from DataList by data value.
scroll_to_index(self, index)Instant scroll to element with passed index
set_data(self, data)Set new data set for DataList component
set_use_cache(self, is_use_cache)Set refresh function for DataList component
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
gridThe Druid Grid component
last_indexThe current last index of visual elements
on_element_addOn DataList visual element created Event callback(self, index, node, instance)
on_element_removeOn DataList visual element created Event callback(self, index)
on_scroll_progress_changeEvent triggered when scroll progress is changed; event(self, progress_value)
scrollThe Druid scroll component
scroll_progressThe current progress of scroll posititon
top_indexThe current top index of visual elements
- -
-
- - -

Functions

- -
-
- - add(self, data, index, shift_policy) -
-
- Add element to DataList. Currenly untested - - -

Parameters:

-
    -
  • self - DataList - DataList -
  • -
  • data - table - -
  • -
  • index - number or nil - -
  • -
  • shift_policy - number or nil - The constant from const.SHIFT.* -
  • -
- - - - - -
-
- - clear(self) -
-
- Clear the DataList and refresh visuals - - -

Parameters:

- - - - - - -
-
- - get_created_components(self) -
-
- Return all currenly created components in DataList - - -

Parameters:

- - -

Returns:

-
    - - druid.base_component[] - List of created nodes -
- - - - -
-
- - get_created_nodes(self) -
-
- Return all currenly created nodes in DataList - - -

Parameters:

- - -

Returns:

-
    - - node[] - List of created nodes -
- - - - -
-
- - get_data(self) -
-
- Return current data from DataList component - - -

Parameters:

- - -

Returns:

-
    - - table - The current data array -
- - - - -
-
- - get_index(self, data) -
-
- Return index for data value - - -

Parameters:

- - - - - - -
-
- - init(self, scroll, grid, create_function) -
-
- The DataList constructor - - -

Parameters:

-
    -
  • self - DataList - DataList -
  • -
  • scroll - Scroll - The Scroll instance for Data List component -
  • -
  • grid - StaticGrid - The StaticGrid or DynamicGrid instance for Data List component -
  • -
  • create_function - function - The create function callback(self, data, index, data_list). Function should return (node, [component]) -
  • -
- - - - - -
-
- - on_remove(self) -
-
- Druid System on_remove function - - -

Parameters:

- - - - - - -
-
- - remove(self, index, shift_policy) -
-
- Remove element from DataList. Currenly untested - - -

Parameters:

-
    -
  • self - DataList - DataList -
  • -
  • index - number or nil - -
  • -
  • shift_policy - number or nil - The constant from const.SHIFT.* -
  • -
- - - - - -
-
- - remove_by_data(self, data, shift_policy) -
-
- Remove element from DataList by data value. Currenly untested - - -

Parameters:

-
    -
  • self - DataList - DataList -
  • -
  • data - table - -
  • -
  • shift_policy - number or nil - The constant from const.SHIFT.* -
  • -
- - - - - -
-
- - scroll_to_index(self, index) -
-
- Instant scroll to element with passed index - - -

Parameters:

-
    -
  • self - DataList - DataList -
  • -
  • index - number - -
  • -
- - - - - -
-
- - set_data(self, data) -
-
- Set new data set for DataList component - - -

Parameters:

-
    -
  • self - DataList - DataList -
  • -
  • data - table - The new data array -
  • -
- -

Returns:

-
    - - druid.data_list - Current DataList instance -
- - - - -
-
- - set_use_cache(self, is_use_cache) -
-
- Set refresh function for DataList component - - -

Parameters:

-
    -
  • self - DataList - DataList -
  • -
  • is_use_cache - boolean - Use cache version of DataList. Requires make setup of components in on_element_add callback and clean in on_element_remove -
  • -
- -

Returns:

-
    - - druid.data_list - Current DataList instance -
- - - - -
-
-

Fields

- -
-
- - grid -
-
- The Druid Grid component - - - - - - - - -
-
- - last_index -
-
- The current last index of visual elements - - -
    -
  • last_index - number - -
  • -
- - - - - -
-
- - on_element_add -
-
- On DataList visual element created Event callback(self, index, node, instance) - - - - - - - - -
-
- - on_element_remove -
-
- On DataList visual element created Event callback(self, index) - - -
    -
  • on_element_remove - DruidEvent - DruidEvent -
  • -
- - - - - -
-
- - on_scroll_progress_change -
-
- Event triggered when scroll progress is changed; event(self, progress_value) - - -
    -
  • on_scroll_progress_change - DruidEvent - DruidEvent -
  • -
- - - - - -
-
- - scroll -
-
- The Druid scroll component - - -
    -
  • scroll - Scroll - Scroll -
  • -
- - - - - -
-
- - scroll_progress -
-
- The current progress of scroll posititon - - -
    -
  • scroll_progress - number - -
  • -
- - - - - -
-
- - top_index -
-
- The current top index of visual elements - - -
    -
  • top_index - number - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Drag.html b/docs/modules/Drag.html deleted file mode 100644 index 51a7c36..0000000 --- a/docs/modules/Drag.html +++ /dev/null @@ -1,633 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Drag

-

Component to handle drag action on node.

-

- Drag have correct handling for multitouch and swap - touched while dragging. Drag will be processed even - the cursor is outside of node, if drag is already started -

Example Link

- - -

Functions

- - - - - - - - - - - - - - - - - -
init(self, node, on_drag_callback)The Drag constructor
is_enabled(self)Check if Drag component is enabled
set_click_zone(self, node)Strict drag click area.
set_enabled(self, is_enabled)Set Drag input enabled or disabled
-

Tables

- - - - - -
styleComponent style params.
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
can_xIs drag component process vertical dragging.
can_yIs drag component process horizontal.
is_dragIs component now dragging
is_touchIs component now touching
nodeDrag node
on_dragon drag progress callback(self, dx, dy, total_x, total_y, touch)
on_drag_endEvent on drag end callback(self, total_x, total_y, touch)
on_drag_startEvent on drag start callback(self, touch)
on_touch_endEvent on touch end callback(self)
on_touch_startEvent on touch start callback(self)
screen_xCurrent touch x screen position
screen_yCurrent touch y screen position
touch_start_posTouch start position
xCurrent touch x position
yCurrent touch y position
- -
-
- - -

Functions

- -
-
- - init(self, node, on_drag_callback) -
-
- The Drag constructor - - -

Parameters:

-
    -
  • self - Drag - Drag -
  • -
  • node - node - GUI node to detect dragging -
  • -
  • on_drag_callback - function - Callback for on_drag_event(self, dx, dy) -
  • -
- - - - - -
-
- - is_enabled(self) -
-
- Check if Drag component is enabled - - -

Parameters:

-
    -
  • self - Drag - Drag -
  • -
- -

Returns:

-
    - - boolean - -
- - - - -
-
- - set_click_zone(self, node) -
-
- Strict drag click area. Useful for - restrict events outside stencil node - - -

Parameters:

- - - - - - -
-
- - set_enabled(self, is_enabled) -
-
- Set Drag input enabled or disabled - - -

Parameters:

-
    -
  • self - Drag - Drag -
  • -
  • is_enabled - boolean or nil - -
  • -
- - - - - -
-
-

Tables

- -
-
- - style -
-
- Component style params. - You can override this component styles params in druid styles table - or create your own style - - -

Fields:

-
    -
  • DRAG_DEADZONE - number or nil - Distance in pixels to start dragging. Default: 10 -
  • -
  • NO_USE_SCREEN_KOEF - boolean or nil - If screen aspect ratio affects on drag values. Default: false -
  • -
- - - - - -
-
-

Fields

- -
-
- - can_x -
-
- Is drag component process vertical dragging. Default - true - - -
    -
  • can_x - boolean - -
  • -
- - - - - -
-
- - can_y -
-
- Is drag component process horizontal. Default - true - - -
    -
  • can_y - boolean - -
  • -
- - - - - -
-
- - is_drag -
-
- Is component now dragging - - -
    -
  • is_drag - boolean - -
  • -
- - - - - -
-
- - is_touch -
-
- Is component now touching - - -
    -
  • is_touch - boolean - -
  • -
- - - - - -
-
- - node -
-
- Drag node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - on_drag -
-
- on drag progress callback(self, dx, dy, total_x, total_y, touch) - - - - - - - - -
-
- - on_drag_end -
-
- Event on drag end callback(self, total_x, total_y, touch) - - - - - - - - -
-
- - on_drag_start -
-
- Event on drag start callback(self, touch) - - - - - - - - -
-
- - on_touch_end -
-
- Event on touch end callback(self) - - - - - - - - -
-
- - on_touch_start -
-
- Event on touch start callback(self) - - - - - - - - -
-
- - screen_x -
-
- Current touch x screen position - - -
    -
  • screen_x - number - -
  • -
- - - - - -
-
- - screen_y -
-
- Current touch y screen position - - -
    -
  • screen_y - number - -
  • -
- - - - - -
-
- - touch_start_pos -
-
- Touch start position - - -
    -
  • touch_start_pos - vector3 - -
  • -
- - - - - -
-
- - x -
-
- Current touch x position - - -
    -
  • x - number - -
  • -
- - - - - -
-
- - y -
-
- Current touch y position - - -
    -
  • y - number - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Druid.html b/docs/modules/Druid.html deleted file mode 100644 index 0af243a..0000000 --- a/docs/modules/Druid.html +++ /dev/null @@ -1,374 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Druid

-

Druid UI Component Framework.

-

- # Overview # -

Druid - powerful Defold component UI library. Use basic and extended - Druid components or make your own game-specific components to make - amazing GUI in your games. -

To start using Druid, please refer to the Usage section below. -

# Notes # -

• Each Druid instance maintains the self context from the constructor and passes it to each Druid callback. -

See next: DruidInstance -

-

Usage:

-
    -
    local druid = require("druid.druid")
    -
    -local function on_play(self)
    -    print("Gonna play!")
    -end
    -
    -function init(self)
    -    self.druid = druid.new(self)
    -    self.druid:new_button("button_play", on_play)
    -end
    -
    -function final(self)
    -    self.druid:final()
    -end
    -
    -function update(self, dt)
    -    self.druid:update(dt)
    -end
    -
    -function on_message(self, message_id, message, sender)
    -    self.druid:on_message(message_id, message, sender)
    -end
    -
    -function on_input(self, action_id, action)
    -    return self.druid:on_input(action_id, action)
    -end
    -
    -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
druid.new(context, style)Create a new Druid instance for creating GUI components.
druid.on_language_change()Call this function when the game language changes.
druid.on_window_callback(event)Set the window callback to enable on_focus_gain and on_focus_lost functions.
druid.register(name, module)Register a new external Druid component.
druid.set_default_style(style)Set your own default style for all Druid instances.
druid.set_sound_function(callback)Set the Druid sound function to play UI sounds if used.
druid.set_text_function(callback)Set the text function for the LangText component.
- -
-
- - -

Functions

- -
-
- - druid.new(context, style) -
-
- Create a new Druid instance for creating GUI components. - - -

Parameters:

-
    -
  • context - table - The Druid context. Usually, this is the self of the gui_script. It is passed into all Druid callbacks. -
  • -
  • style - table or nil - The Druid style table to override style parameters for this Druid instance. -
  • -
- -

Returns:

-
    - - druid_instance - The Druid instance DruidInstance. -
- - - -

Usage:

-
    -
    local druid = require("druid.druid")
    -
    -function init(self)
    -   self.druid = druid.new(self)
    -end
    -
- -
-
- - druid.on_language_change() -
-
- Call this function when the game language changes. -

This function will translate all current LangText components. - - - - - - -

Usage:

-
    -
    druid.on_language_change()
    -
- -
-
- - druid.on_window_callback(event) -
-
- Set the window callback to enable on_focus_gain and on_focus_lost functions. -

This is used to trigger the on_focus_lost and on_focus_gain functions in Druid components. - - -

Parameters:

-
    -
  • event - string - Event param from window listener -
  • -
- - - - -

Usage:

-
    -
    window.set_listener(function(_, event)
    -   druid.on_window_callback(event)
    -end)
    -
- -
-
- - druid.register(name, module) -
-
- Register a new external Druid component. -

You can register your own components to make new alias: the druid:new_{name} function. - For example, if you want to register a component called "my_component", you can create it using druid:new_my_component(...). - This can be useful if you have your own "basic" components that you don't want to re-create each time. - - -

Parameters:

-
    -
  • name - string - module name -
  • -
  • module - table - lua table with component -
  • -
- - - - -

Usage:

-
    -
    local my_component = require("path.to.my.component")
    -druid.register("my_component", my_component)
    -...
    -local druid = druid.new(self)
    -local component_instance = self.druid:new_my_component(...)
    -
- -
-
- - druid.set_default_style(style) -
-
- Set your own default style for all Druid instances. -

To create your own style file, copy the default style file and make changes to it. - Register the new style before creating your Druid instances. - - -

Parameters:

-
    -
  • style - table - Druid style module -
  • -
- - - - -

Usage:

-
    -
    local my_style = require("path.to.my.style")
    -druid.set_default_style(my_style)
    -
- -
-
- - druid.set_sound_function(callback) -
-
- Set the Druid sound function to play UI sounds if used. -

Set a function to play a sound given a sound_id. This function is used for button clicks to play the "click" sound. - It can also be used to play sounds in your custom components (see the default Druid style file for an example). - - -

Parameters:

-
    -
  • callback - function - Sound play callback -
  • -
- - - - -

Usage:

-
    -
    druid.set_sound_function(function(sound_id)
    -    sound.play(sound_id) -- Replace with your real function
    -end)
    -
- -
-
- - druid.set_text_function(callback) -
-
- Set the text function for the LangText component. -

The Druid locale component will call this function to get translated text. - After setting the text function, all existing locale components will be updated. - - -

Parameters:

-
    -
  • callback - function - Get localized text function -
  • -
- - - - -

Usage:

-
    -
    druid.set_text_function(function(text_id)
    -   return lang_data[text_id] -- Replace with your real function
    -end)
    -
- -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/DruidEvent.html b/docs/modules/DruidEvent.html deleted file mode 100644 index a761399..0000000 --- a/docs/modules/DruidEvent.html +++ /dev/null @@ -1,399 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module DruidEvent

-

Druid Event Module -

The Event module provides a simple class for handling callbacks.

-

It is used in many Druid components. -

You can subscribe to an event using the `:subscribe` method and unsubscribe using the `:unsubscribe` method.

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
clear(self)Clear the all event handlers
create(callback, callback_context)DruidEvent constructor
is_empty(self)Return true, if event not have handler
is_exist(self)Return true, if event have at lease one handler
is_subscribed(self, callback, callback_context)Check is event subscribed.
subscribe(self, callback, callback_context)Subscribe callback on event
trigger(self, ...)Trigger the event and call all subscribed callbacks
unsubscribe(self, callback, callback_context)Unsubscribe callback on event
- -
-
- - -

Functions

- -
-
- - clear(self) -
-
- Clear the all event handlers - - -

Parameters:

- - - - - -

Usage:

-
    -
    button.on_long_click:clear()
    -
- -
-
- - create(callback, callback_context) -
-
- DruidEvent constructor - - -

Parameters:

-
    -
  • callback - function or nil - Subscribe the callback on new event, if callback exist -
  • -
  • callback_context - any or nil - Additional context as first param to callback call -
  • -
- - - - -

Usage:

-
    -
    local Event = require("druid.event")
    -...
    -local event = Event(callback)
    -
- -
-
- - is_empty(self) -
-
- Return true, if event not have handler - - -

Parameters:

- - -

Returns:

-
    - - boolean - True if event not have handlers -
- - - -

Usage:

-
    -
    local is_long_click_handler_not_exists = button.on_long_click:is_empty()
    -
- -
-
- - is_exist(self) -
-
- Return true, if event have at lease one handler - - -

Parameters:

- - -

Returns:

-
    - - boolean - True if event have handlers -
- - - -

Usage:

-
    -
    local is_long_click_handler_exists = button.on_long_click:is_exist()
    -
- -
-
- - is_subscribed(self, callback, callback_context) -
-
- Check is event subscribed. - - -

Parameters:

-
    -
  • self - DruidEvent - DruidEvent -
  • -
  • callback - function - Callback itself -
  • -
  • callback_context - any or nil - Additional context as first param to callback call -
  • -
- -

Returns:

-
    - - boolean, - number|nil @Is event subscribed, return index of callback in event as second param -
- - - - -
-
- - subscribe(self, callback, callback_context) -
-
- Subscribe callback on event - - -

Parameters:

-
    -
  • self - DruidEvent - DruidEvent -
  • -
  • callback - function - Callback itself -
  • -
  • callback_context - any or nil - Additional context as first param to callback call, usually it's self -
  • -
- -

Returns:

-
    - - boolean - True if callback was subscribed -
- - - -

Usage:

-
    -
    local function on_long_callback(self)
    -    print("Long click!")
    -end
    -...
    -local button = self.druid:new_button("button", callback)
    -button.on_long_click:subscribe(on_long_callback, self)
    -
- -
-
- - trigger(self, ...) -
-
- Trigger the event and call all subscribed callbacks - - -

Parameters:

-
    -
  • self - DruidEvent - DruidEvent -
  • -
  • ... - any - All event params -
  • -
- - - - -

Usage:

-
    -
    local Event = require("druid.event")
    -...
    -local event = Event()
    -event:trigger("Param1", "Param2")
    -
- -
-
- - unsubscribe(self, callback, callback_context) -
-
- Unsubscribe callback on event - - -

Parameters:

-
    -
  • self - DruidEvent - DruidEvent -
  • -
  • callback - function - Callback itself -
  • -
  • callback_context - any or nil - Additional context as first param to callback call -
  • -
- - - - -

Usage:

-
    -
    local function on_long_callback(self)
    -    print("Long click!")
    -end
    -...
    -button.on_long_click:unsubscribe(on_long_callback, self)
    -
- -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/DruidInstance.html b/docs/modules/DruidInstance.html deleted file mode 100644 index afa2ecb..0000000 --- a/docs/modules/DruidInstance.html +++ /dev/null @@ -1,1223 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module DruidInstance

-

Druid Instance which you use for component creation.

-

-

# Component List # -

For a list of all available components, please refer to the "See Also" section. -

# Notes # -

Please review the following API pages: -

Helper - A useful set of functions for working with GUI nodes, such as centering nodes, get GUI scale ratio, etc -

DruidEvent - The core event system in Druid. Learn how to subscribe to any event in every Druid component. -

BaseComponent - The parent class of all Druid components. You can find all default component methods there. -

# Tech Info # -

• To use Druid, you need to create a Druid instance first. This instance is used to spawn components. -

• When using Druid components, provide the node name as a string argument directly. Avoid calling gui.get_node() before passing it to the component. Because Druid can get nodes from template and cloned gui nodes. -

• All Druid and component methods are called using the colon operator (e.g., self.druid:new_button()).

-

See also:

- -

Usage:

-
    -
    local druid = require("druid.druid")
    -
    -local function close_window(self)
    -    print("Yeah! You closed the game!")
    -end
    -
    -function init(self)
    -    self.druid = druid.new(self)
    -
    -    -- Call all druid instance function with ":" syntax:
    -    local text = self.druid:new_text("text_header", "Hello Druid!")
    -    local button = self.druid:new_button("button_close", close_window)
    -
    -    -- You not need to save component reference if not need it
    -    self.druid:new_back_handler(close_window)
    -end
    -
    -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
final(self)Call this in gui_script final function.
new_back_handler(self, callback, params)Create BackHandler component
new_blocker(self, node)Create Blocker component
new_button(self, node, callback, params, anim_node)Create Button component
new_data_list(self, druid_scroll, druid_grid, create_function)Create DataList component
new_drag(self, node, on_drag_callback)Create Drag component
new_dynamic_grid(self, parent_node)Create DynamicGrid component - Deprecated
new_hotkey(self, keys_array, callback, callback_argument)Create Hotkey component
new_hover(self, node, on_hover_callback, on_mouse_hover_callback)Create Hover component
new_input(self, click_node, text_node, keyboard_type)Create Input component
new_lang_text(self, node, locale_id, adjust_type)Create LangText component
new_layout(self, node, mode)Create Layout component
new_progress(self, node, key, init_value)Create Progress component
new_rich_input(self, template, nodes)Create RichInput component.
new_rich_text(self, text_node, value)Create RichText component.
new_scroll(self, view_node, content_node)Create Scroll component
new_slider(self, pin_node, end_pos, callback)Create Slider component
new_static_grid(self, parent_node, item, in_row)Create StaticGrid component
new_swipe(self, node, on_swipe_callback)Create Swipe component
new_text(self, node, value, no_adjust)Create Text component
new_timer(self, node, seconds_from, seconds_to, callback)Create Timer component
on_input(self, action_id, action)Call this in gui_script on_input function.
on_message(self, message_id, message, sender)Call this in gui_script on_message function.
remove(self, component)Remove created component from Druid instance.
set_blacklist(self, blacklist_components)Set blacklist components for input processing.
set_whitelist(self, whitelist_components)Set whitelist components for input processing.
update(self, dt)Call this in gui_script update function.
- -
-
- - -

Functions

- -
-
- - final(self) -
-
- Call this in gui_script final function. - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
- - - - - -
-
- - new_back_handler(self, callback, params) -
-
- Create BackHandler component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • callback - function or nil - @The callback(self, custom_args) to call on back event -
  • -
  • params - any or nil - Callback argument -
  • -
- -

Returns:

-
    - - BackHandler - BackHandler component -
- - - - -
-
- - new_blocker(self, node) -
-
- Create Blocker component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • node - string or node - The node_id or gui.get_node(node_id) -
  • -
- -

Returns:

-
    - - Blocker - Blocker component -
- - - - -
-
- - new_button(self, node, callback, params, anim_node) -
-
- Create Button component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • node - string or node - The node_id or gui.get_node(node_id) -
  • -
  • callback - function or nil - Button callback -
  • -
  • params - any or nil - Button callback params -
  • -
  • anim_node - node, string or nil - Button anim node (node, if not provided) -
  • -
- -

Returns:

-
    - - Button - Button component -
- - - - -
-
- - new_data_list(self, druid_scroll, druid_grid, create_function) -
-
- Create DataList component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • druid_scroll - Scroll - The Scroll instance for Data List component -
  • -
  • druid_grid - StaticGrid - The StaticGrid or DynamicGrid instance for Data List component -
  • -
  • create_function - function - The create function callback(self, data, index, data_list). Function should return (node, [component]) -
  • -
- -

Returns:

-
    - - DataList - DataList component -
- - - - -
-
- - new_drag(self, node, on_drag_callback) -
-
- Create Drag component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • node - string or node - The node_id or gui.get_node(node_id). Will used as user input node. -
  • -
  • on_drag_callback - function or nil - Callback for on_drag_event(self, dx, dy) -
  • -
- -

Returns:

-
    - - Drag - Drag component -
- - - - -
-
- - new_dynamic_grid(self, parent_node) -
-
- Create DynamicGrid component - Deprecated - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • parent_node - string or node - The node_id or gui.get_node(node_id). Parent of all Grid items. -
  • -
- -

Returns:

-
    - - DynamicGrid - DynamicGrid component -
- - - - -
-
- - new_hotkey(self, keys_array, callback, callback_argument) -
-
- Create Hotkey component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • keys_array - string or string[] - Keys for trigger action. Should contains one action key and any amount of modificator keys -
  • -
  • callback - function - The callback function -
  • -
  • callback_argument - any or nil - The argument to pass into the callback function -
  • -
- -

Returns:

-
    - - Hotkey - Hotkey component -
- - - - -
-
- - new_hover(self, node, on_hover_callback, on_mouse_hover_callback) -
-
- Create Hover component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • node - string or node - The node_id or gui.get_node(node_id) -
  • -
  • on_hover_callback - function or nil - Hover callback -
  • -
  • on_mouse_hover_callback - function or nil - Mouse hover callback -
  • -
- -

Returns:

-
    - - Hover - Hover component -
- - - - -
-
- - new_input(self, click_node, text_node, keyboard_type) -
-
- Create Input component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • click_node - string or node - Button node to enabled input component -
  • -
  • text_node - string, node or druid.text - Text node what will be changed on user input -
  • -
  • keyboard_type - number or nil - Gui keyboard type for input field -
  • -
- -

Returns:

-
    - - Input - Input component -
- - - - -
-
- - new_lang_text(self, node, locale_id, adjust_type) -
-
- Create LangText component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • node - string or node - The_node id or gui.get_node(node_id) -
  • -
  • locale_id - string or nil - Default locale id or text from node as default -
  • -
  • adjust_type - string or nil - Adjust type for text node. Default: const.TEXT_ADJUST.DOWNSCALE -
  • -
- -

Returns:

-
    - - LangText - LangText component -
- - - - -
-
- - new_layout(self, node, mode) -
-
- Create Layout component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • node - string or node - The_node id or gui.get_node(node_id). -
  • -
  • mode - string - The layout mode -
  • -
- -

Returns:

-
    - - Layout - Layout component -
- - - - -
-
- - new_progress(self, node, key, init_value) -
-
- Create Progress component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • node - string or node - Progress bar fill node or node name -
  • -
  • key - string - Progress bar direction: const.SIDE.X or const.SIDE.Y -
  • -
  • init_value - number or nil - Initial value of progress bar. Default: 1 -
  • -
- -

Returns:

-
    - - Progress - Progress component -
- - - - -
-
- - new_rich_input(self, template, nodes) -
-
- Create RichInput component. - As a template please check rich_input.gui layout. - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • template - string - The template string name -
  • -
  • nodes - table - Nodes table from gui.clone_tree -
  • -
- -

Returns:

-
    - - RichInput - RichInput component -
- - - - -
-
- - new_rich_text(self, text_node, value) -
-
- Create RichText component. - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • text_node - string or node - The text node to make Rich Text -
  • -
  • value - string or nil - The initial text value. Default will be gui.get_text(text_node) -
  • -
- -

Returns:

-
    - - RichText - RichText component -
- - - - -
-
- - new_scroll(self, view_node, content_node) -
-
- Create Scroll component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • view_node - string or node - The node_id or gui.get_node(node_id). Will used as user input node. -
  • -
  • content_node - string or node - The node_id or gui.get_node(node_id). Will used as scrollable node inside view_node. -
  • -
- -

Returns:

-
    - - Scroll - Scroll component -
- - - - -
-
- - new_slider(self, pin_node, end_pos, callback) -
-
- Create Slider component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • pin_node - string or node - The_node id or gui.get_node(node_id). -
  • -
  • end_pos - vector3 - The end position of slider -
  • -
  • callback - function or nil - On slider change callback -
  • -
- -

Returns:

-
    - - Slider - Slider component -
- - - - -
-
- - new_static_grid(self, parent_node, item, in_row) -
-
- Create StaticGrid component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • parent_node - string or node - The node_id or gui.get_node(node_id). Parent of all Grid items. -
  • -
  • item - string or node - Item prefab. Required to get grid's item size. Can be adjusted separately. -
  • -
  • in_row - number or nil - How many nodes in row can be placed -
  • -
- -

Returns:

-
    - - StaticGrid - StaticGrid component -
- - - - -
-
- - new_swipe(self, node, on_swipe_callback) -
-
- Create Swipe component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • node - string or node - The node_id or gui.get_node(node_id). Will used as user input node. -
  • -
  • on_swipe_callback - function or nil - Swipe callback for on_swipe_end event -
  • -
- -

Returns:

-
    - - Swipe - Swipe component -
- - - - -
-
- - new_text(self, node, value, no_adjust) -
-
- Create Text component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • node - string or node - The node_id or gui.get_node(node_id) -
  • -
  • value - string or nil - Initial text. Default value is node text from GUI scene. -
  • -
  • no_adjust - boolean or nil - If true, text will be not auto-adjust size -
  • -
- -

Returns:

-
    - - Text - Text component -
- - - - -
-
- - new_timer(self, node, seconds_from, seconds_to, callback) -
-
- Create Timer component - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • node - string or node - Gui text node -
  • -
  • seconds_from - number - Start timer value in seconds -
  • -
  • seconds_to - number or nil - End timer value in seconds -
  • -
  • callback - function or nil - Function on timer end -
  • -
- -

Returns:

-
    - - Timer - Timer component -
- - - - -
-
- - on_input(self, action_id, action) -
-
- Call this in gui_script on_input function. -

Used for almost all components - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • action_id - hash - Action_id from on_input -
  • -
  • action - table - Action from on_input -
  • -
- -

Returns:

-
    - - boolean - The boolean value is input was consumed -
- - - - -
-
- - on_message(self, message_id, message, sender) -
-
- Call this in gui_script on_message function. -

Used for special actions. See SPECIFIC_UI_MESSAGES table - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • message_id - hash - Message_id from on_message -
  • -
  • message - table - Message from on_message -
  • -
  • sender - url - Sender from on_message -
  • -
- - - - - -
-
- - remove(self, component) -
-
- Remove created component from Druid instance. -

Component `on_remove` function will be invoked, if exist. - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • component - BaseComponent - Component instance -
  • -
- -

Returns:

-
    - - boolean - True if component was removed -
- - - - -
-
- - set_blacklist(self, blacklist_components) -
-
- Set blacklist components for input processing. -

If blacklist is not empty and component contains in this list, - component will be not processed on input step - - -

Parameters:

-
    -
  • self - DruidInstance - DruidInstance -
  • -
  • blacklist_components - table, BaseComponent or nil - The array of component to blacklist -
  • -
- -

Returns:

-
    - - self - DruidInstance -
- - - - -
-
- - set_whitelist(self, whitelist_components) -
-
- Set whitelist components for input processing. -

If whitelist is not empty and component not contains in this list, - component will be not processed on input step - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • whitelist_components - table, BaseComponent or nil - The array of component to whitelist -
  • -
- -

Returns:

-
    - - self - DruidInstance -
- - - - -
-
- - update(self, dt) -
-
- Call this in gui_script update function. -

Used for: scroll, progress, timer components - - -

Parameters:

-
    -
  • self - DruidInstance - -
  • -
  • dt - number - Delta time -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/DynamicGrid.html b/docs/modules/DynamicGrid.html deleted file mode 100644 index d6e7af6..0000000 --- a/docs/modules/DynamicGrid.html +++ /dev/null @@ -1,788 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module DynamicGrid

-

Component to handle placing components in row

-

Example Link

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_get_side_vector(self, side, is_forward)Return side vector to correct node shifting
add(self, node, index, shift_policy, is_instant)Add new node to the grid
clear(self)Clear grid nodes array.
get_all_pos(self)Return array of all node positions
get_borders(self)Return grid content borders
get_index_by_node(self, node)Return grid index by node
get_offset(self)Return DynamicGrid offset, where DynamicGrid content starts.
get_pos(self, index, node, origin_index)Return pos for grid node index
get_size(self, border)Return grid content size
init(self, parent)The DynamicGrid constructor
remove(self, index, shift_policy, is_instant)Remove the item from the grid.
set_position_function(self, callback)Change set position function for grid nodes.
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
borderThe size of item content
first_indexThe first index of node in grid
last_indexThe last index of node in grid
node_sizeItem size
nodesList of all grid elements.
on_add_itemOn item add callback(self, node, index)
on_change_itemsOn item add or remove callback(self, index)
on_clearOn grid clear callback(self)
on_remove_itemOn item remove callback(self, index)
on_update_positionsOn update item positions callback(self)
parentParent gui node
- -
-
- - -

Functions

- -
-
- - _get_side_vector(self, side, is_forward) -
-
- Return side vector to correct node shifting - - -

Parameters:

-
    -
  • self - -
  • -
  • side - -
  • -
  • is_forward - -
  • -
- - - - - -
-
- - add(self, node, index, shift_policy, is_instant) -
-
- Add new node to the grid - - -

Parameters:

-
    -
  • self - DynamicGrid - DynamicGrid -
  • -
  • node - node - Gui node -
  • -
  • index - number or nil - The node position. By default add as last node -
  • -
  • shift_policy - number or nil - How shift nodes, if required. Default: const.SHIFT.RIGHT -
  • -
  • is_instant - boolean or nil - If true, update node positions instantly -
  • -
- - - - - -
-
- - clear(self) -
-
- Clear grid nodes array. GUI nodes will be not deleted! - If you want to delete GUI nodes, use dynamic_grid.nodes array before grid:clear - - -

Parameters:

- - -

Returns:

-
    - - druid.dynamic_grid - Current grid instance -
- - - - -
-
- - get_all_pos(self) -
-
- Return array of all node positions - - -

Parameters:

- - -

Returns:

-
    - - vector3[] - All grid node positions -
- - - - -
-
- - get_borders(self) -
-
- Return grid content borders - - -

Parameters:

- - -

Returns:

-
    - - vector3 - The grid content borders -
- - - - -
-
- - get_index_by_node(self, node) -
-
- Return grid index by node - - -

Parameters:

-
    -
  • self - DynamicGrid - DynamicGrid -
  • -
  • node - node - The gui node in the grid -
  • -
- -

Returns:

-
    - - number - The node index -
- - - - -
-
- - get_offset(self) -
-
- Return DynamicGrid offset, where DynamicGrid content starts. - - -

Parameters:

-
    -
  • self - DynamicGrid - DynamicGrid The DynamicGrid instance -
  • -
- -

Returns:

-
    - - vector3 - The DynamicGrid offset -
- - - - -
-
- - get_pos(self, index, node, origin_index) -
-
- Return pos for grid node index - - -

Parameters:

-
    -
  • self - DynamicGrid - DynamicGrid -
  • -
  • index - number - The grid element index -
  • -
  • node - node - The node to be placed -
  • -
  • origin_index - number or nil - Index of nearby node -
  • -
- -

Returns:

-
    - - vector3 - node position -
- - - - -
-
- - get_size(self, border) -
-
- Return grid content size - - -

Parameters:

-
    -
  • self - DynamicGrid - DynamicGrid -
  • -
  • border - vector3 - -
  • -
- -

Returns:

-
    - - vector3 - The grid content size -
- - - - -
-
- - init(self, parent) -
-
- The DynamicGrid constructor - - -

Parameters:

-
    -
  • self - DynamicGrid - DynamicGrid -
  • -
  • parent - node - The gui node parent, where items will be placed -
  • -
- - - - - -
-
- - remove(self, index, shift_policy, is_instant) -
-
- Remove the item from the grid. Note that gui node will be not deleted - - -

Parameters:

-
    -
  • self - DynamicGrid - DynamicGrid -
  • -
  • index - number - The grid node index to remove -
  • -
  • shift_policy - number or nil - How shift nodes, if required. Default: const.SHIFT.RIGHT -
  • -
  • is_instant - boolean or nil - If true, update node positions instantly -
  • -
- -

Returns:

-
    - - node - The deleted gui node from grid -
- - - - -
-
- - set_position_function(self, callback) -
-
- Change set position function for grid nodes. It will call on - update poses on grid elements. Default: gui.set_position - - -

Parameters:

-
    -
  • self - DynamicGrid - DynamicGrid -
  • -
  • callback - function - Function on node set position -
  • -
- -

Returns:

-
    - - druid.dynamic_grid - Current grid instance -
- - - - -
-
-

Fields

- -
-
- - border -
-
- The size of item content - - -
    -
  • border - vector4 - -
  • -
- - - - - -
-
- - first_index -
-
- The first index of node in grid - - -
    -
  • first_index - number - -
  • -
- - - - - -
-
- - last_index -
-
- The last index of node in grid - - -
    -
  • last_index - number - -
  • -
- - - - - -
-
- - node_size -
-
- Item size - - -
    -
  • node_size - vector3 - -
  • -
- - - - - -
-
- - nodes -
-
- List of all grid elements. Contains from node, pos, size, pivot - - -
    -
  • nodes - node[] - -
  • -
- - - - - -
-
- - on_add_item -
-
- On item add callback(self, node, index) - - - - - - - - -
-
- - on_change_items -
-
- On item add or remove callback(self, index) - - - - - - - - -
-
- - on_clear -
-
- On grid clear callback(self) - - - - - - - - -
-
- - on_remove_item -
-
- On item remove callback(self, index) - - - - - - - - -
-
- - on_update_positions -
-
- On update item positions callback(self) - - -
    -
  • on_update_positions - DruidEvent - DruidEvent -
  • -
- - - - - -
-
- - parent -
-
- Parent gui node - - -
    -
  • parent - node - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Helper.html b/docs/modules/Helper.html deleted file mode 100644 index 1bc2ed6..0000000 --- a/docs/modules/Helper.html +++ /dev/null @@ -1,927 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Helper

-

Helper module with various usefull GUI functions.

-

-

Usage:

-
    -
    local helper = require("druid.helper")
    -helper.centrate_nodes(0, node_1, node_2)
    -
    -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
helper.add_array(target, source)Add all elements from source array to the target array
helper.centrate_nodes(margin, ...)Centerate nodes by x position with margin.
helper.clamp(a, min, max)Clamp value between min and max
helper.contains(t, value)Check if value is in array and return index of it
helper.deepcopy(orig_table)Make a copy table with all nested tables
helper.distance(x1, y1, x2, y2)Calculate distance between two points
helper.get_border(node, offset)Distance from node position to his borders
helper.get_closest_stencil_node(node)Return closest non inverted clipping parent node for given node
helper.get_gui_scale()Get current GUI scale for each side
helper.get_pivot_offset(pivot)Get node offset for given GUI pivot.
helper.get_scaled_size(node)Get node size adjusted by scale
helper.get_scene_scale(node, include_passed_node_scale)Get cumulative parent's node scale
helper.get_screen_aspect_koef()Get current screen stretch multiplier for each side
helper.get_text_metrics_from_node(text_node)Get text metric from GUI node.
helper.insert_with_shift(array, any, index, shift_policy)Add value to array with shift policy
helper.is_mobile()Check if device is native mobile (Android or iOS)
helper.is_multitouch_supported()Check if device is mobile and can support multitouch
helper.is_web()Check if device is HTML5
helper.is_web_mobile()Check if device is HTML5 mobile
helper.lerp(a, b, t)Lerp between two values
helper.remove_with_shift(array, index, shift_policy)Remove value from array with shift policy
helper.round(num, num_decimal_places)Round number to specified decimal places
helper.sign(val)Return sign of value (-1, 0, 1)
helper.step(current, target, step)Move value from current to target value with step amount
helper.table_to_string(t)Simple table to one-line string converter
- -
-
- - -

Functions

- -
-
- - helper.add_array(target, source) -
-
- Add all elements from source array to the target array - - -

Parameters:

-
    -
  • target - any[] - Array to put elements from source -
  • -
  • source - any[] or nil - The source array to get elements from -
  • -
- -

Returns:

-
    - - any[] - The target array -
- - - - -
-
- - helper.centrate_nodes(margin, ...) -
-
- Centerate nodes by x position with margin. -

This functions calculate total width of nodes and set position for each node. - The centrate will be around 0 x position. - - -

Parameters:

-
    -
  • margin - number or nil - Offset between nodes -
  • -
  • ... - Gui nodes -
  • -
- - - - - -
-
- - helper.clamp(a, min, max) -
-
- Clamp value between min and max - - -

Parameters:

-
    -
  • a - number - Value -
  • -
  • min - number - Min value -
  • -
  • max - number - Max value -
  • -
- -

Returns:

-
    - - number - Clamped value -
- - - - -
-
- - helper.contains(t, value) -
-
- Check if value is in array and return index of it - - -

Parameters:

-
    -
  • t - table - Array -
  • -
  • value - Value -
  • -
- -

Returns:

-
    - - number or nil - Index of value or nil -
- - - - -
-
- - helper.deepcopy(orig_table) -
-
- Make a copy table with all nested tables - - -

Parameters:

-
    -
  • orig_table - table - Original table -
  • -
- -

Returns:

-
    - - table - Copy of original table -
- - - - -
-
- - helper.distance(x1, y1, x2, y2) -
-
- Calculate distance between two points - - -

Parameters:

-
    -
  • x1 - number - First point x -
  • -
  • y1 - number - First point y -
  • -
  • x2 - number - Second point x -
  • -
  • y2 - number - Second point y -
  • -
- -

Returns:

-
    - - number - Distance -
- - - - -
-
- - helper.get_border(node, offset) -
-
- Distance from node position to his borders - - -

Parameters:

-
    -
  • node - node - GUI node -
  • -
  • offset - vector3 or nil - Offset from node position. Pass current node position to get non relative border values -
  • -
- -

Returns:

-
    - - vector4 - Vector4 with border values (left, top, right, down) -
- - - - -
-
- - helper.get_closest_stencil_node(node) -
-
- Return closest non inverted clipping parent node for given node - - -

Parameters:

-
    -
  • node - node - GUI node -
  • -
- -

Returns:

-
    - - node or nil - The closest stencil node or nil -
- - - - -
-
- - helper.get_gui_scale() -
-
- Get current GUI scale for each side - - - -

Returns:

-
    -
  1. - number - scale_x
  2. -
  3. - number - scale_y
  4. -
- - - - -
-
- - helper.get_pivot_offset(pivot) -
-
- Get node offset for given GUI pivot. -

Offset shown in [-0.5 .. 0.5] range, where -0.5 is left or bottom, 0.5 is right or top. - - -

Parameters:

-
    -
  • pivot - number - The gui.PIVOT_* constant -
  • -
- -

Returns:

-
    - - vector3 - Vector offset with [-0.5..0.5] values -
- - - - -
-
- - helper.get_scaled_size(node) -
-
- Get node size adjusted by scale - - -

Parameters:

-
    -
  • node - node - GUI node -
  • -
- -

Returns:

-
    - - vector3 - Scaled size -
- - - - -
-
- - helper.get_scene_scale(node, include_passed_node_scale) -
-
- Get cumulative parent's node scale - - -

Parameters:

-
    -
  • node - node - Gui node -
  • -
  • include_passed_node_scale - boolean or nil - True if add current node scale to result -
  • -
- -

Returns:

-
    - - vector3 - The scene node scale -
- - - - -
-
- - helper.get_screen_aspect_koef() -
-
- Get current screen stretch multiplier for each side - - - -

Returns:

-
    -
  1. - number - stretch_x
  2. -
  3. - number - stretch_y
  4. -
- - - - -
-
- - helper.get_text_metrics_from_node(text_node) -
-
- Get text metric from GUI node. - - -

Parameters:

-
    -
  • text_node - node - -
  • -
- -

Returns:

-
    - - GUITextMetrics - -
- - - -

Usage:

-
    -
    type GUITextMetrics = {
    -  width: number,
    -  height: number,
    -  max_ascent: number,
    -  max_descent: number
    -}
    -
- -
-
- - helper.insert_with_shift(array, any, index, shift_policy) -
-
- Add value to array with shift policy Shift policy can be: left, right, no_shift - - -

Parameters:

-
    -
  • array - table - Array -
  • -
  • any - Item to insert -
  • -
  • index - number or nil - Index to insert. If nil, item will be inserted at the end of array -
  • -
  • shift_policy - number or nil - The druid_const.SHIFT.* constant -
  • -
- -

Returns:

-
    - - any - Inserted item -
- - - - -
-
- - helper.is_mobile() -
-
- Check if device is native mobile (Android or iOS) - - - -

Returns:

-
    - - boolean - Is mobile -
- - - - -
-
- - helper.is_multitouch_supported() -
-
- Check if device is mobile and can support multitouch - - - -

Returns:

-
    - - boolean - Is multitouch supported -
- - - - -
-
- - helper.is_web() -
-
- Check if device is HTML5 - - - -

Returns:

-
    - - boolean - Is web -
- - - - -
-
- - helper.is_web_mobile() -
-
- Check if device is HTML5 mobile - - - -

Returns:

-
    - - boolean - Is web mobile -
- - - - -
-
- - helper.lerp(a, b, t) -
-
- Lerp between two values - - -

Parameters:

-
    -
  • a - number - First value -
  • -
  • b - number - Second value -
  • -
  • t - number - Lerp amount -
  • -
- -

Returns:

-
    - - number - Lerped value -
- - - - -
-
- - helper.remove_with_shift(array, index, shift_policy) -
-
- Remove value from array with shift policy Shift policy can be: left, right, no_shift - - -

Parameters:

-
    -
  • array - table - Array -
  • -
  • index - number or nil - Index to remove. If nil, item will be removed from the end of array -
  • -
  • shift_policy - number or nil - The druid_const.SHIFT.* constant -
  • -
- -

Returns:

-
    - - any - Removed item -
- - - - -
-
- - helper.round(num, num_decimal_places) -
-
- Round number to specified decimal places - - -

Parameters:

-
    -
  • num - number - Number -
  • -
  • num_decimal_places - number or nil - Decimal places -
  • -
- -

Returns:

-
    - - number - Rounded number -
- - - - -
-
- - helper.sign(val) -
-
- Return sign of value (-1, 0, 1) - - -

Parameters:

-
    -
  • val - number - Value -
  • -
- -

Returns:

-
    - - number - Sign -
- - - - -
-
- - helper.step(current, target, step) -
-
- Move value from current to target value with step amount - - -

Parameters:

-
    -
  • current - number - Current value -
  • -
  • target - number - Target value -
  • -
  • step - number - Step amount -
  • -
- -

Returns:

-
    - - number - New value -
- - - - -
-
- - helper.table_to_string(t) -
-
- Simple table to one-line string converter - - -

Parameters:

- - -

Returns:

-
    - - string - -
- - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Hotkey.html b/docs/modules/Hotkey.html deleted file mode 100644 index 6237aa5..0000000 --- a/docs/modules/Hotkey.html +++ /dev/null @@ -1,373 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Hotkey

-

Druid hotkey component

-

Example Link

- - -

Functions

- - - - - - - - - - - - - -
add_hotkey(self, keys, callback_argument)Add hotkey for component callback
init(self, keys, callback, callback_argument)The Hotkey constructor
set_repeat(self, is_enabled_repeated)If true, the callback will be triggered on action.repeated
-

Tables

- - - - - -
styleComponent style params.
-

Fields

- - - - - - - - - - - - - - - - - - - - - -
buttonButton component from click_node
click_nodeButton trigger node
nodeVisual node
on_hotkey_pressedOn hotkey released callback(self, argument)
on_hotkey_releasedOn hotkey released callback(self, argument)
- -
-
- - -

Functions

- -
-
- - add_hotkey(self, keys, callback_argument) -
-
- Add hotkey for component callback - - -

Parameters:

-
    -
  • self - Hotkey - Hotkey -
  • -
  • keys - string[], hash[], string or hash - that have to be pressed before key pressed to activate -
  • -
  • callback_argument - any or nil - The argument to pass into the callback function -
  • -
- -

Returns:

-
    - - Hotkey - Current instance -
- - - - -
-
- - init(self, keys, callback, callback_argument) -
-
- The Hotkey constructor - - -

Parameters:

-
    -
  • self - Hotkey - Hotkey -
  • -
  • keys - string[] or string - The keys to be pressed for trigger callback. Should contains one key and any modificator keys -
  • -
  • callback - function - The callback function -
  • -
  • callback_argument - any or nil - The argument to pass into the callback function -
  • -
- - - - - -
-
- - set_repeat(self, is_enabled_repeated) -
-
- If true, the callback will be triggered on action.repeated - - -

Parameters:

-
    -
  • self - Hotkey - Hotkey -
  • -
  • is_enabled_repeated - bool - The flag value -
  • -
- -

Returns:

-
    - - Hotkey - -
- - - - -
-
-

Tables

- -
-
- - style -
-
- Component style params. - You can override this component styles params in druid styles table - or create your own style - - -

Fields:

-
    -
  • MODIFICATORS - string[] - The list of action_id as hotkey modificators -
  • -
- - - - - -
-
-

Fields

- -
-
- - button -
-
- Button component from click_node - - -
    -
  • button - Button - Button -
  • -
- - - - - -
-
- - click_node -
-
- Button trigger node - - -
    -
  • click_node - node or nil - -
  • -
- - - - - -
-
- - node -
-
- Visual node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - on_hotkey_pressed -
-
- On hotkey released callback(self, argument) - - -
    -
  • on_hotkey_pressed - DruidEvent - DruidEvent -
  • -
- - - - - -
-
- - on_hotkey_released -
-
- On hotkey released callback(self, argument) - - -
    -
  • on_hotkey_released - DruidEvent - DruidEvent -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Hover.html b/docs/modules/Hover.html deleted file mode 100644 index 65c7eed..0000000 --- a/docs/modules/Hover.html +++ /dev/null @@ -1,469 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Hover

-

Component to handle hover node interaction

-

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
init(self, node, on_hover_callback, on_mouse_hover)The Hover constructor
is_enabled(self)Return current hover enabled state
is_hovered(self)Return current hover state.
is_mouse_hovered(self)Return current hover state.
set_click_zone(self, zone)Strict hover click area.
set_enabled(self, state)Set enable state of hover component.
set_hover(self, state)Set hover state
set_mouse_hover(self, state)Set mouse hover state
-

Tables

- - - - - -
styleComponent style params.
-

Fields

- - - - - - - - - - - - - -
nodeHover node
on_hoverOn hover callback(self, state, hover_instance)
on_mouse_hoverOn mouse hover callback(self, state, hover_instance)
- -
-
- - -

Functions

- -
-
- - init(self, node, on_hover_callback, on_mouse_hover) -
-
- The Hover constructor - - -

Parameters:

-
    -
  • self - Hover - Hover -
  • -
  • node - node - Gui node -
  • -
  • on_hover_callback - function - Hover callback -
  • -
  • on_mouse_hover - function - On mouse hover callback -
  • -
- - - - - -
-
- - is_enabled(self) -
-
- Return current hover enabled state - - -

Parameters:

-
    -
  • self - Hover - Hover -
  • -
- -

Returns:

-
    - - boolean - The hover enabled state -
- - - - -
-
- - is_hovered(self) -
-
- Return current hover state. True if touch action was on the node at current time - - -

Parameters:

-
    -
  • self - Hover - Hover -
  • -
- -

Returns:

-
    - - boolean - The current hovered state -
- - - - -
-
- - is_mouse_hovered(self) -
-
- Return current hover state. True if nil action_id (usually desktop mouse) was on the node at current time - - -

Parameters:

-
    -
  • self - Hover - Hover -
  • -
- -

Returns:

-
    - - boolean - The current hovered state -
- - - - -
-
- - set_click_zone(self, zone) -
-
- Strict hover click area. Useful for - no click events outside stencil node - - -

Parameters:

- - - - - - -
-
- - set_enabled(self, state) -
-
- Set enable state of hover component. - If hover is not enabled, it will not generate - any hover events - - -

Parameters:

-
    -
  • self - Hover - Hover -
  • -
  • state - boolean or nil - The hover enabled state -
  • -
- - - - - -
-
- - set_hover(self, state) -
-
- Set hover state - - -

Parameters:

-
    -
  • self - Hover - Hover -
  • -
  • state - boolean or nil - The hover state -
  • -
- - - - - -
-
- - set_mouse_hover(self, state) -
-
- Set mouse hover state - - -

Parameters:

-
    -
  • self - Hover - Hover -
  • -
  • state - boolean or nil - The mouse hover state -
  • -
- - - - - -
-
-

Tables

- -
-
- - style -
-
- Component style params. - You can override this component styles params in druid styles table - or create your own style - - -

Fields:

-
    -
  • ON_HOVER_CURSOR - string - Mouse hover style on node hover - (optional) -
  • -
  • ON_MOUSE_HOVER_CURSOR - string - Mouse hover style on node mouse hover - (optional) -
  • -
- - - - - -
-
-

Fields

- -
-
- - node -
-
- Hover node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - on_hover -
-
- On hover callback(self, state, hover_instance) - - - - - - - - -
-
- - on_mouse_hover -
-
- On mouse hover callback(self, state, hover_instance) - - - - - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Input.html b/docs/modules/Input.html deleted file mode 100644 index ee1a9e4..0000000 --- a/docs/modules/Input.html +++ /dev/null @@ -1,1086 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Input

-

Druid input text component.

-

- Carry on user text input -

Example Link

-

Info:

-
    -
  • Author: Part of code from Britzl gooey input component
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get_text(self)Return current input field text
get_text_selected_replaced(self, text)Replace selected text with new text
init(self, click_node, text_node, keyboard_type)The Input constructor
move_selection(self, delta, is_add_to_selection, is_move_to_end)Change cursor position by delta
reset_changes(self)Reset current input selection and return previous value
select(self)Select input field.
select_cursor(self, cursor_index, start_index, end_index)Set cursor position in input field
set_allowed_characters(self, characters)Set allowed charaters for input field.
set_max_length(self, max_length)Set maximum length for input field.
set_text(self, input_text)Set text for input field
unselect(self)Remove selection from input.
-

Tables

- - - - - -
styleComponent style params.
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
allowerd_charactersPattern matching for user input
buttonButton component
current_valueCurrent input value with marked text
cursor_indexThe cursor index.
end_indexTheselection end index.
is_emptyIs current input is empty now
is_selectedIs current input selected now
keyboard_typeGui keyboard type for input field
marked_text_widthMarked text width
marked_valueMarked text for input field.
max_lengthMax length for input text
on_input_emptyOn input field text change to empty string callback(self, input_text)
on_input_fullOn input field text change to max length string callback(self, input_text)
on_input_selectOn input field select callback(self, input_instance)
on_input_textOn input field text change callback(self, input_text)
on_input_unselectOn input field unselect callback(self, input_text, input_instance)
on_input_wrongOn trying user input with not allowed character callback(self, params, input_text)
on_select_cursor_changeOn cursor position change callback(self, cursor_index, start_index, end_index)
previous_valuePrevious input value
start_indexThe selection start index.
textText component
text_widthText width
valueCurrent input value
- -
-
- - -

Functions

- -
-
- - get_text(self) -
-
- Return current input field text - - -

Parameters:

-
    -
  • self - Input - Input -
  • -
- -

Returns:

-
    - - string - The current input field text -
- - - - -
-
- - get_text_selected_replaced(self, text) -
-
- Replace selected text with new text - - -

Parameters:

-
    -
  • self - Input - Input -
  • -
  • text - string - The text to replace selected text -
  • -
- -

Returns:

-
    - - string - New input text -
- - - - -
-
- - init(self, click_node, text_node, keyboard_type) -
-
- The Input constructor - - -

Parameters:

-
    -
  • self - Input - Input -
  • -
  • click_node - node - Node to enabled input component -
  • -
  • text_node - node or Text - Text node what will be changed on user input. You can pass text component instead of text node name Text -
  • -
  • keyboard_type - number or nil - Gui keyboard type for input field -
  • -
- - - - - -
-
- - move_selection(self, delta, is_add_to_selection, is_move_to_end) -
-
- Change cursor position by delta - - -

Parameters:

-
    -
  • self - Input - Input -
  • -
  • delta - number - side for cursor position, -1 for left, 1 for right -
  • -
  • is_add_to_selection - boolean - (Shift key) -
  • -
  • is_move_to_end - boolean - (Ctrl key) -
  • -
- - - - - -
-
- - reset_changes(self) -
-
- Reset current input selection and return previous value - - -

Parameters:

-
    -
  • self - Input - Input -
  • -
- -

Returns:

-
    - - druid.input - Current input instance -
- - - - -
-
- - select(self) -
-
- Select input field. It will show the keyboard and trigger on_select events - - -

Parameters:

-
    -
  • self - Input - Input -
  • -
- - - - - -
-
- - select_cursor(self, cursor_index, start_index, end_index) -
-
- Set cursor position in input field - - -

Parameters:

-
    -
  • self - Input - Input -
  • -
  • cursor_index - number or nil - Cursor index for cursor position, if nil - will be set to the end of the text -
  • -
  • start_index - number or nil - Start index for cursor position, if nil - will be set to the end of the text -
  • -
  • end_index - number or nil - End index for cursor position, if nil - will be set to the start_index -
  • -
- -

Returns:

-
    - - druid.input - Current input instance -
- - - - -
-
- - set_allowed_characters(self, characters) -
-
- Set allowed charaters for input field. - See: https://defold.com/ref/stable/string/ - ex: [%a%d] for alpha and numeric - - -

Parameters:

-
    -
  • self - Input - Input -
  • -
  • characters - string - Regulax exp. for validate user input -
  • -
- -

Returns:

-
    - - druid.input - Current input instance -
- - - - -
-
- - set_max_length(self, max_length) -
-
- Set maximum length for input field. - Pass nil to make input field unliminted (by default) - - -

Parameters:

-
    -
  • self - Input - Input -
  • -
  • max_length - number - Maximum length for input text field -
  • -
- -

Returns:

-
    - - druid.input - Current input instance -
- - - - -
-
- - set_text(self, input_text) -
-
- Set text for input field - - -

Parameters:

-
    -
  • self - Input - Input -
  • -
  • input_text - string - The string to apply for input field -
  • -
- - - - - -
-
- - unselect(self) -
-
- Remove selection from input. It will hide the keyboard and trigger on_unselect events - - -

Parameters:

-
    -
  • self - Input - Input -
  • -
- - - - - -
-
-

Tables

- -
-
- - style -
-
- Component style params. - You can override this component styles params in druid styles table - or create your own style - - -

Fields:

-
    -
  • IS_LONGTAP_ERASE - boolean - Is long tap will erase current input data. Default: false -
  • -
  • MASK_DEFAULT_CHAR - string - Default character mask for password input. Default: *] -
  • -
  • IS_UNSELECT_ON_RESELECT - boolean - If true, call unselect on select selected input. Default: false -
  • -
  • on_select - function - (self, button_node) Callback on input field selecting -
  • -
  • on_unselect - function - (self, button_node) Callback on input field unselecting -
  • -
  • on_input_wrong - function - (self, button_node) Callback on wrong user input -
  • -
- - - - - -
-
-

Fields

- -
-
- - allowerd_characters -
-
- Pattern matching for user input - - -
    -
  • allowerd_characters - string or nil - -
  • -
- - - - - -
-
- - button -
-
- Button component - - -
    -
  • button - Button - Button -
  • -
- - - - - -
-
- - current_value -
-
- Current input value with marked text - - -
    -
  • current_value - string - -
  • -
- - - - - -
-
- - cursor_index -
-
- The cursor index. The index of letter cursor after. Leftmost cursor - 0 - - -
    -
  • cursor_index - number - -
  • -
- - - - - -
-
- - end_index -
-
- Theselection end index. The index of letter cursor before. Rightmost selection - #text - - -
    -
  • end_index - number - -
  • -
- - - - - -
-
- - is_empty -
-
- Is current input is empty now - - -
    -
  • is_empty - boolean - -
  • -
- - - - - -
-
- - is_selected -
-
- Is current input selected now - - -
    -
  • is_selected - boolean - -
  • -
- - - - - -
-
- - keyboard_type -
-
- Gui keyboard type for input field - - -
    -
  • keyboard_type - number - -
  • -
- - - - - -
-
- - marked_text_width -
-
- Marked text width - - -
    -
  • marked_text_width - number - -
  • -
- - - - - -
-
- - marked_value -
-
- Marked text for input field. Info: https://defold.com/manuals/input-key-and-text/#marked-text - - -
    -
  • marked_value - string - -
  • -
- - - - - -
-
- - max_length -
-
- Max length for input text - - -
    -
  • max_length - number or nil - -
  • -
- - - - - -
-
- - on_input_empty -
-
- On input field text change to empty string callback(self, input_text) - - - - - - - - -
-
- - on_input_full -
-
- On input field text change to max length string callback(self, input_text) - - - - - - - - -
-
- - on_input_select -
-
- On input field select callback(self, input_instance) - - - - - - - - -
-
- - on_input_text -
-
- On input field text change callback(self, input_text) - - - - - - - - -
-
- - on_input_unselect -
-
- On input field unselect callback(self, input_text, input_instance) - - -
    -
  • on_input_unselect - DruidEvent - DruidEvent -
  • -
- - - - - -
-
- - on_input_wrong -
-
- On trying user input with not allowed character callback(self, params, input_text) - - - - - - - - -
-
- - on_select_cursor_change -
-
- On cursor position change callback(self, cursor_index, start_index, end_index) - - -
    -
  • on_select_cursor_change - DruidEvent - DruidEvent -
  • -
- - - - - -
-
- - previous_value -
-
- Previous input value - - -
    -
  • previous_value - string - -
  • -
- - - - - -
-
- - start_index -
-
- The selection start index. The index of letter cursor after. Leftmost selection - 0 - - -
    -
  • start_index - number - -
  • -
- - - - - -
-
- - text -
-
- Text component - - -
    -
  • text - Text - Text -
  • -
- - - - - -
-
- - text_width -
-
- Text width - - -
    -
  • text_width - number - -
  • -
- - - - - -
-
- - value -
-
- Current input value - - - - - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/LangText.html b/docs/modules/LangText.html deleted file mode 100644 index be1a8b1..0000000 --- a/docs/modules/LangText.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module LangText

-

Component to wrap over GUI Text nodes with localization helpers -

# Overview # -

• The initialization of druid.set_text_function is required to enable localization - using the localization ID.

-

-

• The LangText component supports up to 7 string format parameters. - This limitation exists due to certain issues with using ... arguments. -

# Notes # -

Example Link

- - -

Functions

- - - - - - - - - - - - - - - - - -
format(self, a, b, c, d, e, f, g)Format string with new text params on localized text
init(self, node, locale_id, adjust_type)The LangText constructor
set_to(self, text)Setup raw text to lang_text component
translate(self, locale_id, a, b, c, d, e, f, g)Translate the text by locale_id
-

Fields

- - - - - - - - - - - - - -
nodeText node
on_changeOn change text callback
textThe text component
- -
-
- - -

Functions

- -
-
- - format(self, a, b, c, d, e, f, g) -
-
- Format string with new text params on localized text - - -

Parameters:

-
    -
  • self - LangText - LangText -
  • -
  • a - string or nil - Optional param to string.format -
  • -
  • b - string or nil - Optional param to string.format -
  • -
  • c - string or nil - Optional param to string.format -
  • -
  • d - string or nil - Optional param to string.format -
  • -
  • e - string or nil - Optional param to string.format -
  • -
  • f - string or nil - Optional param to string.format -
  • -
  • g - string or nil - Optional param to string.format -
  • -
- -

Returns:

-
    - - LangText - Current instance -
- - - - -
-
- - init(self, node, locale_id, adjust_type) -
-
- The LangText constructor - - -

Parameters:

-
    -
  • self - LangText - LangText -
  • -
  • node - string or node - The node_id or gui.get_node(node_id) -
  • -
  • locale_id - string or nil - Default locale id or text from node as default -
  • -
  • adjust_type - string or nil - Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference -
  • -
- - - - - -
-
- - set_to(self, text) -
-
- Setup raw text to lang_text component - - -

Parameters:

-
    -
  • self - LangText - LangText -
  • -
  • text - string - Text for text node -
  • -
- -

Returns:

-
    - - LangText - Current instance -
- - - - -
-
- - translate(self, locale_id, a, b, c, d, e, f, g) -
-
- Translate the text by locale_id - - -

Parameters:

-
    -
  • self - LangText - LangText -
  • -
  • locale_id - string - Locale id -
  • -
  • a - string or nil - Optional param to string.format -
  • -
  • b - string or nil - Optional param to string.format -
  • -
  • c - string or nil - Optional param to string.format -
  • -
  • d - string or nil - Optional param to string.format -
  • -
  • e - string or nil - Optional param to string.format -
  • -
  • f - string or nil - Optional param to string.format -
  • -
  • g - string or nil - Optional param to string.format -
  • -
- -

Returns:

-
    - - LangText - Current instance -
- - - - -
-
-

Fields

- -
-
- - node -
-
- Text node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - on_change -
-
- On change text callback - - - - - - - - -
-
- - text -
-
- The text component - - -
    -
  • text - Text - Text -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Layout.html b/docs/modules/Layout.html deleted file mode 100644 index 0058f48..0000000 --- a/docs/modules/Layout.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Layout

-

Layout management on node

-

Example Link

- - -

Fields

- - - - - - - - - -
modeCurrent layout mode
nodeLayout node
- -
-
- - -

Fields

- -
-
- - mode -
-
- Current layout mode - - - - - - - - -
-
- - node -
-
- Layout node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/PinKnob.html b/docs/modules/PinKnob.html deleted file mode 100644 index d97d64e..0000000 --- a/docs/modules/PinKnob.html +++ /dev/null @@ -1,299 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module PinKnob

-

Druid pin knob custom component.

-

- It's simple rotating input element

- - -

Functions

- - - - - - - - - - - - - -
init(self, callback, template, nodes)The PinKnob constructor
set_angle(self, cur_value, min, max)Set current and min/max angles for component
set_friction(self, value)Set current and min/max angles for component
-

Fields

- - - - - - - - - - - - - -
druidThe component druid instance
is_dragIs currently under user control
nodeThe pin node
- -
-
- - -

Functions

- -
-
- - init(self, callback, template, nodes) -
-
- The PinKnob constructor - - -

Parameters:

-
    -
  • self - PinKnob - PinKnob -
  • -
  • callback - function - Callback(self, value) on value changed -
  • -
  • template - string - The template string name -
  • -
  • nodes - table - Nodes table from gui.clone_tree -
  • -
- - - - - -
-
- - set_angle(self, cur_value, min, max) -
-
- Set current and min/max angles for component - - -

Parameters:

-
    -
  • self - PinKnob - PinKnob -
  • -
  • cur_value - number - The new value for pin knob -
  • -
  • min - number - The minimum value for pin knob -
  • -
  • max - number - The maximum value for pin knob -
  • -
- -

Returns:

-
    - - PinKnob - PinKnob -
- - - - -
-
- - set_friction(self, value) -
-
- Set current and min/max angles for component - - -

Parameters:

-
    -
  • self - PinKnob - PinKnob -
  • -
  • value - number or nil - The spin speed multiplier. Default: 1 -
  • -
- -

Returns:

-
    - - PinKnob - PinKnob -
- - - - -
-
-

Fields

- -
-
- - druid -
-
- The component druid instance - - - - - - - - -
-
- - is_drag -
-
- Is currently under user control - - -
    -
  • is_drag - boolean - -
  • -
- - - - - -
-
- - node -
-
- The pin node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Progress.html b/docs/modules/Progress.html deleted file mode 100644 index d9fa818..0000000 --- a/docs/modules/Progress.html +++ /dev/null @@ -1,569 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Progress

-

Druid component to handle the progress bars.

-

- # Overview # -

# Notes # -

• Progress Node should be fully filled in your GUI scene node. It will be the progress maximum size -

• Progress correct working with Slice9 nodes, it trying to set size by _set_size_ first, if it is not possible, it set up sizing via _set_scale_ -

• Progress bar can fill only by vertical or horizontal size. If you want make diagonal progress bar, just rotate node in GUI scene -

• If you have glitchy or dark texture bug with progress bar, try to disable mipmaps in your texture profiles -

- Example Link

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
empty(self)Empty a progress bar
fill(self)Fill a progress bar and stop progress animation
get(self)Return current progress bar value
init(self, node, key, init_value)The Progress constructor
set_max_size(self, max_size)Set progress bar max node size
set_steps(self, steps, callback)Set points on progress bar to fire the callback
set_to(self, to)Instant fill progress bar to value
to(self, to, callback)Start animation of a progress bar
-

Tables

- - - - - -
styleComponent style params.
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
keyThe progress bar direction.
max_sizeMaximum size of progress bar
nodeProgress bar fill node
on_changeOn progress bar change callback(self, new_value)
scaleCurrent progress bar scale
sizeCurrent progress bar size
sliceProgress bar slice9 settings
- -
-
- - -

Functions

- -
-
- - empty(self) -
-
- Empty a progress bar - - -

Parameters:

- - - - - - -
-
- - fill(self) -
-
- Fill a progress bar and stop progress animation - - -

Parameters:

- - - - - - -
-
- - get(self) -
-
- Return current progress bar value - - -

Parameters:

- - - - - - -
-
- - init(self, node, key, init_value) -
-
- The Progress constructor - - -

Parameters:

-
    -
  • self - Progress - Progress -
  • -
  • node - string or node - Node name or GUI Node itself. -
  • -
  • key - string - Progress bar direction: const.SIDE.X or const.SIDE.Y -
  • -
  • init_value - number or nil - Initial value of progress bar. Default: 1 -
  • -
- - - - - -
-
- - set_max_size(self, max_size) -
-
- Set progress bar max node size - - -

Parameters:

-
    -
  • self - Progress - Progress -
  • -
  • max_size - vector3 - The new node maximum (full) size -
  • -
- -

Returns:

-
    - - Progress - Progress -
- - - - -
-
- - set_steps(self, steps, callback) -
-
- Set points on progress bar to fire the callback - - -

Parameters:

-
    -
  • self - Progress - Progress -
  • -
  • steps - number[] - Array of progress bar values -
  • -
  • callback - function - Callback on intersect step value -
  • -
- - - - -

Usage:

-
    -
    progress:set_steps({0, 0.3, 0.6, 1}, function(self, step) end)
    -
- -
-
- - set_to(self, to) -
-
- Instant fill progress bar to value - - -

Parameters:

-
    -
  • self - Progress - Progress -
  • -
  • to - number - Progress bar value, from 0 to 1 -
  • -
- - - - - -
-
- - to(self, to, callback) -
-
- Start animation of a progress bar - - -

Parameters:

-
    -
  • self - Progress - Progress -
  • -
  • to - number - value between 0..1 -
  • -
  • callback - function or nil - Callback on animation ends -
  • -
- - - - - -
-
-

Tables

- -
-
- - style -
-
- Component style params. - You can override this component styles params in druid styles table - or create your own style - - -

Fields:

-
    -
  • SPEED - number or nil - Progress bas fill rate. More -> faster. Default: 5 -
  • -
  • MIN_DELTA - number or nil - Minimum step to fill progress bar. Default: 0.005 -
  • -
- - - - - -
-
-

Fields

- -
-
- - key -
-
- The progress bar direction. -

The values are: "x" or "y". (const.SIDE.X or const.SIDE.Y) - - -

- - - - - -
-
- - max_size -
-
- Maximum size of progress bar - - -
    -
  • max_size - number - -
  • -
- - - - - -
-
- - node -
-
- Progress bar fill node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - on_change -
-
- On progress bar change callback(self, new_value) - - - - - - - - -
-
- - scale -
-
- Current progress bar scale - - -
    -
  • scale - vector3 - -
  • -
- - - - - -
-
- - size -
-
- Current progress bar size - - -
    -
  • size - vector3 - -
  • -
- - - - - -
-
- - slice -
-
- Progress bar slice9 settings - - -
    -
  • slice - vector4 - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/RadioGroup.html b/docs/modules/RadioGroup.html deleted file mode 100644 index 41f2b10..0000000 --- a/docs/modules/RadioGroup.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module RadioGroup

-

Radio group module

-

Example Link

- - -

Functions

- - - - - - - - - - - - - -
get_state(self)Return radio group state
init(self, nodes, callback, click_nodes)The RadioGroup constructor
set_state(self, index, is_instant)Set radio group state
-

Fields

- - - - - - - - - -
checkboxesArray of checkbox components
on_radio_clickOn any checkbox click
- -
-
- - -

Functions

- -
-
- - get_state(self) -
-
- Return radio group state - - -

Parameters:

- - -

Returns:

-
    - - number - Index in radio group -
- - - - -
-
- - init(self, nodes, callback, click_nodes) -
-
- The RadioGroup constructor - - -

Parameters:

-
    -
  • self - RadioGroup - RadioGroup -
  • -
  • nodes - node[] - Array of gui node -
  • -
  • callback - function - Radio callback -
  • -
  • click_nodes - node[] or nil - Array of trigger nodes, by default equals to nodes. Default - nodes -
  • -
- - - - - -
-
- - set_state(self, index, is_instant) -
-
- Set radio group state - - -

Parameters:

-
    -
  • self - RadioGroup - RadioGroup -
  • -
  • index - number - Index in radio group -
  • -
  • is_instant - boolean or nil - If is instant state change -
  • -
- - - - - -
-
-

Fields

- -
-
- - checkboxes -
-
- Array of checkbox components - - -
    -
  • checkboxes - Checkbox[] - -
  • -
- - - - - -
-
- - on_radio_click -
-
- On any checkbox click - - - - - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/RichInput.html b/docs/modules/RichInput.html deleted file mode 100644 index 6c5cdf8..0000000 --- a/docs/modules/RichInput.html +++ /dev/null @@ -1,567 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module RichInput

-

Druid Rich Input custom component.

-

- It's wrapper on Input component with cursor and placeholder text

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get_text(self)Set input field text
init(self, template, nodes)The RichInput constructor
select(self)Select input field
set_allowed_characters(self, characters)Set allowed charaters for input field.
set_font(self, font)Set input field font
set_placeholder(self, placeholder_text)Set placeholder text
set_text(self, text)Set input field text
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
cursorOn input field text change to empty string callback(self, input_text)
cursor_positionOn input field text change to empty string callback(self, input_text)
cursor_textOn input field text change to empty string callback(self, input_text)
dragOn input field text change to empty string callback(self, input_text)
druidThe component druid instance
inputOn input field text change callback(self, input_text)
input_textOn input field text change to empty string callback(self, input_text)
placeholderOn input field text change to empty string callback(self, input_text)
rootRoot node
text_positionOn input field text change to empty string callback(self, input_text)
- -
-
- - -

Functions

- -
-
- - get_text(self) -
-
- Set input field text - - -

Parameters:

- - - - - - -
-
- - init(self, template, nodes) -
-
- The RichInput constructor - - -

Parameters:

-
    -
  • self - RichInput - RichInput -
  • -
  • template - string - The template string name -
  • -
  • nodes - table - Nodes table from gui.clone_tree -
  • -
- - - - - -
-
- - select(self) -
-
- Select input field - - -

Parameters:

- - - - - - -
-
- - set_allowed_characters(self, characters) -
-
- Set allowed charaters for input field. - See: https://defold.com/ref/stable/string/ - ex: [%a%d] for alpha and numeric - - -

Parameters:

-
    -
  • self - RichInput - RichInput -
  • -
  • characters - string - Regulax exp. for validate user input -
  • -
- -

Returns:

-
    - - RichInput - Current instance -
- - - - -
-
- - set_font(self, font) -
-
- Set input field font - - -

Parameters:

-
    -
  • self - RichInput - RichInput -
  • -
  • font - hash - The font hash -
  • -
- -

Returns:

-
    - - druid.input - Current input instance -
- - - - -
-
- - set_placeholder(self, placeholder_text) -
-
- Set placeholder text - - -

Parameters:

-
    -
  • self - RichInput - RichInput -
  • -
  • placeholder_text - string - The placeholder text -
  • -
- - - - - -
-
- - set_text(self, text) -
-
- Set input field text - - -

Parameters:

- - -

Returns:

-
    - - druid.input - Current input instance -
- - - - -
-
-

Fields

- -
-
- - cursor -
-
- On input field text change to empty string callback(self, input_text) - - -
    -
  • cursor - node - -
  • -
- - - - - -
-
- - cursor_position -
-
- On input field text change to empty string callback(self, input_text) - - -
    -
  • cursor_position - vector3 - -
  • -
- - - - - -
-
- - cursor_text -
-
- On input field text change to empty string callback(self, input_text) - - -
    -
  • cursor_text - node - -
  • -
- - - - - -
-
- - drag -
-
- On input field text change to empty string callback(self, input_text) - - -
    -
  • drag - druid.drag - -
  • -
- - - - - -
-
- - druid -
-
- The component druid instance - - - - - - - - -
-
- - input -
-
- On input field text change callback(self, input_text) - - -
    -
  • input - Input - Input -
  • -
- - - - - -
-
- - input_text -
-
- On input field text change to empty string callback(self, input_text) - - -
    -
  • input_text - druid.text - -
  • -
- - - - - -
-
- - placeholder -
-
- On input field text change to empty string callback(self, input_text) - - -
    -
  • placeholder - druid.text - -
  • -
- - - - - -
-
- - root -
-
- Root node - - -
    -
  • root - node - -
  • -
- - - - - -
-
- - text_position -
-
- On input field text change to empty string callback(self, input_text) - - -
    -
  • text_position - vector3 - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/RichText.html b/docs/modules/RichText.html deleted file mode 100644 index 075846c..0000000 --- a/docs/modules/RichText.html +++ /dev/null @@ -1,560 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module RichText

-

Druid Rich Text Custom Component.

-

- # Overview # -

This custom component is inspired by defold-richtext by britzl. - It uses a similar syntax for tags but currently supports fewer tags. -

Create Rich Text on your GUI Text Node. All properties of the text node will be used as default for the text. -

# Notes # -

• Nested tags are supported -

Example Link

-

Usage:

-
    -
  • local RichText = require("druid.custom.rich_text.rich_text")
    -...
    -self.rich_text = self.druid:new(RichText, "rich_text")
    -self.rich_text:set_text("Hello, Druid Rich Text!")
    -
  • -
  • type druid.rich_text.word = {
    -  node: Node,
    -  relative_scale: number,
    -  color: vector4,
    -  position: vector3,
    -  offset: vector3,
    -  scale: vector3,
    -  size: vector3,
    -  metrics: druid.rich_text.metrics,
    -  pivot: Pivot,
    -  text: string,
    -  shadow: vector4,
    -  outline: vector4,
    -  font: string,
    -  image: druid.rich_text.image,
    -  br: boolean,
    -  nobr: boolean,
    -}
    -
    -type druid.rich_text.word.image = {
    -  texture: string,
    -  anim: string,
    -  width: number,
    -  height: number,
    -}
    -
    -type druid.rich_text.lines_metrics = {
    -  text_width: number,
    -  text_height: number,
    -  lines: table<number, druid.rich_text.metrics>,
    -}
    -
    -type druid.rich_text.metrics = {
    -  width: number,
    -  height: number,
    -  offset_x: number|nil,
    -  offset_y: number|nil,
    -  node_size: vector3|nil @For images only,
    -}
    -
  • -
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
characters(self, word)Split a word into it's characters
clear()Clear all created words.
get_line_metric()Get current line metrics
get_text(self)Get current text
get_words()Get all current words.
init(self, text_node, value)The RichText constructor
set_text(self, text)Set text for Rich Text
tagged(self, tag)Get all words, which has a passed tag.
-

Tables

- - - - - -
styleComponent style params.
-

Fields

- - - - - - - - - - - - - -
druidThe component druid instance
rootThe root node of the Rich Text
text_prefabThe text prefab node
- -
-
- - -

Functions

- -
-
- - characters(self, word) -
-
- Split a word into it's characters - - -

Parameters:

-
    -
  • self - RichText - RichText -
  • -
  • word - druid.rich_text.word - -
  • -
- -

Returns:

-
    - - druid.rich_text.word[] - characters -
- - - - -
-
- - clear() -
-
- Clear all created words. - - - - - - - -
-
- - get_line_metric() -
-
- Get current line metrics - - - -

Returns:

-
    - - druid.rich_text.lines_metrics - -
- - - - -
-
- - get_text(self) -
-
- Get current text - - -

Parameters:

- - -

Returns:

-
    - - string - text -
- - - - -
-
- - get_words() -
-
- Get all current words. - - - -

Returns:

-
    - - table - druid.rich_text.word[] -
- - - - -
-
- - init(self, text_node, value) -
-
- The RichText constructor - - -

Parameters:

-
    -
  • self - RichText - RichText -
  • -
  • text_node - node or string - The text node to make Rich Text -
  • -
  • value - string or nil - The initial text value. Default will be gui.get_text(text_node) -
  • -
- - - - - -
-
- - set_text(self, text) -
-
- Set text for Rich Text - - -

Parameters:

-
    -
  • self - RichText - RichText -
  • -
  • text - string or nil - The text to set -
  • -
- -

Returns:

-
    -
  1. - druid.rich_text.word[] - words
  2. -
  3. - druid.rich_text.lines_metrics - line_metrics
  4. -
- - - -

Usage:

-
    -
    • color: Change text color
    -
    -<color=red>Foobar</color>
    -<color=1.0,0,0,1.0>Foobar</color>
    -<color=#ff0000>Foobar</color>
    -<color=#ff0000ff>Foobar</color>
    -
    -• shadow: Change text shadow
    -
    -<shadow=red>Foobar</shadow>
    -<shadow=1.0,0,0,1.0>Foobar</shadow>
    -<shadow=#ff0000>Foobar</shadow>
    -<shadow=#ff0000ff>Foobar</shadow>
    -
    -• outline: Change text shadow
    -
    -<outline=red>Foobar</outline>
    -<outline=1.0,0,0,1.0>Foobar</outline>
    -<outline=#ff0000>Foobar</outline>
    -<outline=#ff0000ff>Foobar</outline>
    -
    -• font: Change font
    -
    -<font=MyCoolFont>Foobar</font>
    -
    -• size: Change text size, relative to default size
    -
    -<size=2>Twice as large</size>
    -
    -• br: Insert a line break
    -
    -<br/>
    -
    -• nobr: Prevent the text from breaking
    -
    -Words <nobr>inside tag</nobr> won't break
    -
    -• img: Display image
    -
    -<img=texture:image/>
    -<img=texture:image,size/>
    -<img=texture:image,width,height/>
    -
- -
-
- - tagged(self, tag) -
-
- Get all words, which has a passed tag. - - -

Parameters:

- - -

Returns:

-
    - - druid.rich_text.word[] - words -
- - - - -
-
-

Tables

- -
-
- - style -
-
- Component style params. - You can override this component styles params in Druid styles table - or create your own style - - -

Fields:

-
    -
  • COLORS - table or nil - Rich Text color aliases. Default: {} -
  • -
  • ADJUST_STEPS - number or nil - Amount steps of attemps text adjust by height. Default: 20 -
  • -
  • ADJUST_SCALE_DELTA - number or nil - Scale step on each height adjust step. Default: 0.02 -
  • -
- - - - - -
-
-

Fields

- -
-
- - druid -
-
- The component druid instance - - - - - - - - -
-
- - root -
-
- The root node of the Rich Text - - -
    -
  • root - node - -
  • -
- - - - - -
-
- - text_prefab -
-
- The text prefab node - - -
    -
  • text_prefab - node - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Scroll.html b/docs/modules/Scroll.html deleted file mode 100644 index 457f77c..0000000 --- a/docs/modules/Scroll.html +++ /dev/null @@ -1,1183 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Scroll

-

Component to handle scroll content.

-

- # Overview # -

The Scroll component is designed to handle scrollable content and consists of two nodes: the scroll parent and the scroll input. -

The scroll input represents the user input zone and remains static. -

The scroll parent is the movable part of the scroll and changes its position. -

The initial scroll size can be set by adjusting the size of the scroll parent. - If the size of the scroll parent is smaller than the scroll input size, scrolling is not available. -

# Notes # -

• By default, the scroll style includes inertia and extra size for a stretching effect. - These settings can be adjusted using the scroll style settings. - For more details, refer to the scroll style settings. -

• "Points of interest" can be set up for the scroll. - The scroll will always be centered on the closest point of interest. - This feature allows creating a slider without inertia and with points of interest on each scroll element. -

• The scroll content size can be adjusted using the scroll:set_size(node_size) method. - This method sets a new size for the _content node. -

• Inertial scrolling mode can be enabled or disabled using the scroll:set_inert(state) method. -

• The extra stretch size can be adjusted using the scroll:set_extra_stretch_size method. -

• Multitouch is required for scrolling. The scroll component correctly handles - touch ID swaps while dragging the scroll. -

Example Link

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bind_grid(self, grid)Bind the grid component (Static or Dynamic) to recalculate - scroll size on grid changes
get_percent(self)Return current scroll progress status.
get_scroll_size(self)Return vector of scroll size with width and height.
init(self, view_node, content_node)The Scroll constructor
is_inert(self)Return if scroll have inertion.
is_node_in_view(self, node)Check node if it visible now on scroll.
scroll_to(self, point, is_instant)Start scroll to target point.
scroll_to_index(self, index, skip_cb)Scroll to item in scroll by point index.
scroll_to_percent(self, percent, is_instant)Start scroll to target scroll percent
set_click_zone(self, node)Strict drag scroll area.
set_extra_stretch_size(self, stretch_size)Set extra size for scroll stretching.
set_horizontal_scroll(self, state)Lock or unlock horizontal scroll
set_inert(self, state)Enable or disable scroll inert.
set_points(self, points)Set points of interest.
set_size(self, size, offset)Set scroll content size.
set_vertical_scroll(self, state)Lock or unlock vertical scroll
set_view_size(self, size)Set new scroll view size in case the node size was changed.
update_view_size(self)Refresh scroll view size
-

Tables

- - - - - -
styleComponent style params.
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_is_inertFlag, if scroll now moving by inertion
available_posAvailable position for content node: (min_x, max_y, max_x, min_y)
available_sizeSize of available positions: (width, height, 0)
content_nodeScroll content node
dragDrag Druid component
inertionCurrent inert speed
is_animateFlag, if scroll now animating by gui.animate
on_point_scrollOn scroll_to_index function callback(self, index, point)
on_scrollOn scroll move callback(self, position)
on_scroll_toOn scroll_to function callback(self, target, is_instant)
positionCurrent scroll posisition
selectedCurrent index of points of interests
target_positionCurrent scroll target position
view_nodeScroll view node
view_sizeScroll view size
- -
-
- - -

Functions

- -
-
- - bind_grid(self, grid) -
-
- Bind the grid component (Static or Dynamic) to recalculate - scroll size on grid changes - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
  • grid - StaticGrid - Druid grid component -
  • -
- -

Returns:

-
    - - druid.scroll - Current scroll instance -
- - - - -
-
- - get_percent(self) -
-
- Return current scroll progress status. - Values will be in [0..1] interval - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
- -

Returns:

-
    - - vector3 - New vector with scroll progress values -
- - - - -
-
- - get_scroll_size(self) -
-
- Return vector of scroll size with width and height. - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
- -

Returns:

-
    - - vector3 - Available scroll size -
- - - - -
-
- - init(self, view_node, content_node) -
-
- The Scroll constructor - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
  • view_node - string or node - GUI view scroll node -
  • -
  • content_node - string or node - GUI content scroll node -
  • -
- - - - - -
-
- - is_inert(self) -
-
- Return if scroll have inertion. - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
- -

Returns:

-
    - - boolean - @If scroll have inertion -
- - - - -
-
- - is_node_in_view(self, node) -
-
- Check node if it visible now on scroll. - Extra border is not affected. Return true for elements in extra scroll zone - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
  • node - node - The node to check -
  • -
- -

Returns:

-
    - - boolean - True if node in visible scroll area -
- - - - -
-
- - scroll_to(self, point, is_instant) -
-
- Start scroll to target point. - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
  • point - vector3 - Target point -
  • -
  • is_instant - boolean or nil - Instant scroll flag -
  • -
- - - - -

Usage:

-
    -
  • scroll:scroll_to(vmath.vector3(0, 50, 0))
  • -
  • scroll:scroll_to(vmath.vector3(0), true)
  • -
- -
-
- - scroll_to_index(self, index, skip_cb) -
-
- Scroll to item in scroll by point index. - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
  • index - number - Point index -
  • -
  • skip_cb - boolean or nil - If true, skip the point callback -
  • -
- - - - - -
-
- - scroll_to_percent(self, percent, is_instant) -
-
- Start scroll to target scroll percent - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
  • percent - vector3 - target percent -
  • -
  • is_instant - boolean or nil - instant scroll flag -
  • -
- - - - -

Usage:

-
    -
    scroll:scroll_to_percent(vmath.vector3(0.5, 0, 0))
    -
- -
-
- - set_click_zone(self, node) -
-
- Strict drag scroll area. Useful for - restrict events outside stencil node - - -

Parameters:

-
    -
  • self - Drag - -
  • -
  • node - node or string - Gui node -
  • -
- - - - - -
-
- - set_extra_stretch_size(self, stretch_size) -
-
- Set extra size for scroll stretching. - Set 0 to disable stretching effect - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
  • stretch_size - number or nil - Size in pixels of additional scroll area -
  • -
- -

Returns:

-
    - - druid.scroll - Current scroll instance -
- - - - -
-
- - set_horizontal_scroll(self, state) -
-
- Lock or unlock horizontal scroll - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
  • state - boolean or nil - True, if horizontal scroll is enabled -
  • -
- -

Returns:

-
    - - druid.scroll - Current scroll instance -
- - - - -
-
- - set_inert(self, state) -
-
- Enable or disable scroll inert. - If disabled, scroll through points (if exist) - If no points, just simple drag without inertion - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
  • state - boolean or nil - Inert scroll state -
  • -
- -

Returns:

-
    - - druid.scroll - Current scroll instance -
- - - - -
-
- - set_points(self, points) -
-
- Set points of interest. - Scroll will always centered on closer points - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
  • points - table - Array of vector3 points -
  • -
- -

Returns:

-
    - - druid.scroll - Current scroll instance -
- - - - -
-
- - set_size(self, size, offset) -
-
- Set scroll content size. - It will change content gui node size - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
  • size - vector3 - The new size for content node -
  • -
  • offset - vector3 or nil - Offset value to set, where content is starts -
  • -
- -

Returns:

-
    - - druid.scroll - Current scroll instance -
- - - - -
-
- - set_vertical_scroll(self, state) -
-
- Lock or unlock vertical scroll - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
  • state - boolean or nil - True, if vertical scroll is enabled -
  • -
- -

Returns:

-
    - - druid.scroll - Current scroll instance -
- - - - -
-
- - set_view_size(self, size) -
-
- Set new scroll view size in case the node size was changed. - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
  • size - vector3 - The new size for view node -
  • -
- -

Returns:

-
    - - druid.scroll - Current scroll instance -
- - - - -
-
- - update_view_size(self) -
-
- Refresh scroll view size - - -

Parameters:

-
    -
  • self - Scroll - Scroll -
  • -
- - - - - -
-
-

Tables

- -
-
- - style -
-
- Component style params. - You can override this component styles params in druid styles table - or create your own style - - -

Fields:

-
    -
  • FRICT - number or nil - Multiplier for free inertion. Default: 0 -
  • -
  • FRICT_HOLD - number or nil - Multiplier for inertion, while touching. Default: 0 -
  • -
  • INERT_THRESHOLD - number or nil - Scroll speed to stop inertion. Default: 3 -
  • -
  • INERT_SPEED - number or nil - Multiplier for inertion speed. Default: 30 -
  • -
  • POINTS_DEADZONE - number or nil - Speed to check points of interests in no_inertion mode. Default: 20 -
  • -
  • BACK_SPEED - number or nil - Scroll back returning lerp speed. Default: 35 -
  • -
  • ANIM_SPEED - number or nil - Scroll gui.animation speed for scroll_to function. Default: 2 -
  • -
  • EXTRA_STRETCH_SIZE - number or nil - extra size in pixels outside of scroll (stretch effect). Default: 0 -
  • -
  • SMALL_CONTENT_SCROLL - boolean or nil - If true, content node with size less than view node size can be scrolled. Default: false -
  • -
  • WHEEL_SCROLL_SPEED - boolean or nil - The scroll speed via mouse wheel scroll or touchpad. Set to 0 to disable wheel scrolling. Default: 0 -
  • -
  • WHEEL_SCROLL_INVERTED - boolean or nil - If true, invert direction for touchpad and mouse wheel scroll. Default: false -
  • -
  • WHEEL_SCROLL_BY_INERTION - boolean or nil - If true, wheel will add inertion to scroll. Direct set position otherwise.. Default: false -
  • -
- - - - - -
-
-

Fields

- -
-
- - _is_inert -
-
- Flag, if scroll now moving by inertion - - -
    -
  • _is_inert - boolean - -
  • -
- - - - - -
-
- - available_pos -
-
- Available position for content node: (min_x, max_y, max_x, min_y) - - -
    -
  • available_pos - vector4 - -
  • -
- - - - - -
-
- - available_size -
-
- Size of available positions: (width, height, 0) - - -
    -
  • available_size - vector3 - -
  • -
- - - - - -
-
- - content_node -
-
- Scroll content node - - -
    -
  • content_node - node - -
  • -
- - - - - -
-
- - drag -
-
- Drag Druid component - - -
    -
  • drag - Drag - Drag -
  • -
- - - - - -
-
- - inertion -
-
- Current inert speed - - -
    -
  • inertion - vector3 - -
  • -
- - - - - -
-
- - is_animate -
-
- Flag, if scroll now animating by gui.animate - - -
    -
  • is_animate - boolean - -
  • -
- - - - - -
-
- - on_point_scroll -
-
- On scroll_to_index function callback(self, index, point) - - - - - - - - -
-
- - on_scroll -
-
- On scroll move callback(self, position) - - - - - - - - -
-
- - on_scroll_to -
-
- On scroll_to function callback(self, target, is_instant) - - - - - - - - -
-
- - position -
-
- Current scroll posisition - - -
    -
  • position - vector3 - -
  • -
- - - - - -
-
- - selected -
-
- Current index of points of interests - - -
    -
  • selected - number or nil - -
  • -
- - - - - -
-
- - target_position -
-
- Current scroll target position - - -
    -
  • target_position - vector3 - -
  • -
- - - - - -
-
- - view_node -
-
- Scroll view node - - -
    -
  • view_node - node - -
  • -
- - - - - -
-
- - view_size -
-
- Scroll view size - - -
    -
  • view_size - vector3 - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Slider.html b/docs/modules/Slider.html deleted file mode 100644 index 45ce723..0000000 --- a/docs/modules/Slider.html +++ /dev/null @@ -1,531 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Slider

-

Druid slider component

-

Example Link

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - -
init(self, node, end_pos, callback)The Slider constructor
is_enabled(self)Check if Slider component is enabled
set(self, value, is_silent)Set value for slider
set_enabled(self, is_enabled)Set Slider input enabled or disabled
set_input_node(self, input_node)Set input zone for slider.
set_steps(self, steps)Set slider steps.
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
distLength between start and end position
end_posEnd pin node position
is_dragCurrent drag state
nodeSlider pin node
on_change_valueOn change value callback(self, value)
posCurrent pin node position
start_posStart pin node position
target_posTarger pin node position
valueCurrent slider value
- -
-
- - -

Functions

- -
-
- - init(self, node, end_pos, callback) -
-
- The Slider constructor - - -

Parameters:

-
    -
  • self - Slider - Slider -
  • -
  • node - node - Gui pin node -
  • -
  • end_pos - vector3 - The end position of slider -
  • -
  • callback - function or nil - On slider change callback -
  • -
- - - - - -
-
- - is_enabled(self) -
-
- Check if Slider component is enabled - - -

Parameters:

-
    -
  • self - Slider - Slider -
  • -
- -

Returns:

-
    - - boolean - -
- - - - -
-
- - set(self, value, is_silent) -
-
- Set value for slider - - -

Parameters:

-
    -
  • self - Slider - Slider -
  • -
  • value - number - Value from 0 to 1 -
  • -
  • is_silent - boolean or nil - Don't trigger event if true -
  • -
- - - - - -
-
- - set_enabled(self, is_enabled) -
-
- Set Slider input enabled or disabled - - -

Parameters:

-
    -
  • self - Slider - Slider -
  • -
  • is_enabled - boolean - -
  • -
- - - - - -
-
- - set_input_node(self, input_node) -
-
- Set input zone for slider. - User can touch any place of node, pin instantly will - move at this position and node drag will start. - This function require the Defold version 1.3.0+ - - -

Parameters:

- - -

Returns:

-
    - - Slider - Slider -
- - - - -
-
- - set_steps(self, steps) -
-
- Set slider steps. Pin node will - apply closest step position - - -

Parameters:

-
    -
  • self - Slider - Slider -
  • -
  • steps - number[] - Array of steps -
  • -
- -

Returns:

-
    - - Slider - Slider -
- - - -

Usage:

-
    -
    slider:set_steps({0, 0.2, 0.6, 1})
    -
- -
-
-

Fields

- -
-
- - dist -
-
- Length between start and end position - - -
    -
  • dist - vector3 - -
  • -
- - - - - -
-
- - end_pos -
-
- End pin node position - - -
    -
  • end_pos - vector3 - -
  • -
- - - - - -
-
- - is_drag -
-
- Current drag state - - -
    -
  • is_drag - boolean - -
  • -
- - - - - -
-
- - node -
-
- Slider pin node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - on_change_value -
-
- On change value callback(self, value) - - - - - - - - -
-
- - pos -
-
- Current pin node position - - -
    -
  • pos - vector3 - -
  • -
- - - - - -
-
- - start_pos -
-
- Start pin node position - - -
    -
  • start_pos - vector3 - -
  • -
- - - - - -
-
- - target_pos -
-
- Targer pin node position - - -
    -
  • target_pos - vector3 - -
  • -
- - - - - -
-
- - value -
-
- Current slider value - - -
    -
  • value - number - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/StaticGrid.html b/docs/modules/StaticGrid.html deleted file mode 100644 index 5281ef5..0000000 --- a/docs/modules/StaticGrid.html +++ /dev/null @@ -1,1094 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module StaticGrid

-

Component to handle component's position by row and columns.

-

- # Overview # -

The Static Grid component allows for positioning components in rows and columns. - It provides a static grid layout with constant node sizes, allowing for pre-calculated - node positions and the option to include gaps between nodes. -

# Notes # -

• In a static grid, the node size remains constant, enabling the calculation of node - positions before placement. If you want add gaps between nodes, increase the root prefab size, - including the padding and margin. -

• The static grid can automatically shift elements when nodes are added or removed. -

• When a node is added, the grid will set the node's parent to the specified parent_node. -

• You can obtain an array of positions for each element, which can be used to set - points of interest in a scroll component. -

• The size of all elements can be retrieved for setting up the size in a scroll component. -

• The grid can be bound to a scroll component for automatic resizing of the scroll content size. -

• The pivot of the parent_node affects the node placement within the grid. -

• A prefab node is used to determine the node size and anchor. -

• You can specify a position_function for animations using the - _static_grid:set_position_function(node, pos) callback. The default position function is gui.set_position(). -

Example Link

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
add(self, item, index, shift_policy, is_instant)Add new item to the grid
clear(self)Clear grid nodes array.
get_all_pos(self)Return array of all node positions
get_borders(self)Return grid content borders
get_index(self, pos)Return index for grid pos
get_index_by_node(self, node)Return grid index by node
get_offset(self)Return StaticGrid offset, where StaticGrid content starts.
get_pos(self, index)Return pos for grid node index
get_size(self)Return grid content size
init(self, parent, element, in_row)The StaticGrid constructor
refresh(self)Update grid content
remove(self, index, shift_policy, is_instant)Remove the item from the grid.
set_anchor(self, anchor)Set grid anchor.
set_in_row(self, in_row)Set new in_row elements for grid
set_item_size(self[, width[, height]])Set new node size for grid
set_items(self, nodes[, is_instant=false])Set new items to the grid.
set_position_function(self, callback)Change set position function for grid nodes.
sort_nodes(self, comparator)Sort grid nodes by custom comparator function
-

Tables

- - - - - -
styleComponent style params.
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
anchorItem anchor [0..1]
borderThe size of item content
first_indexThe first index of node in grid
last_indexThe last index of node in grid
node_sizeItem size
nodesList of all grid nodes
on_add_itemOn item add callback(self, node, index)
on_change_itemsOn item add, remove or change in_row callback(self, index|nil)
on_clearOn grid clear callback(self)
on_remove_itemOn item remove callback(self, index)
on_update_positionsOn update item positions callback(self)
parentParent gui node
pivotItem pivot [-0.5..0.5]
- -
-
- - -

Functions

- -
-
- - add(self, item, index, shift_policy, is_instant) -
-
- Add new item to the grid - - -

Parameters:

-
    -
  • self - StaticGrid - StaticGrid -
  • -
  • item - node - GUI node -
  • -
  • index - number or nil - The item position. By default add as last item -
  • -
  • shift_policy - number or nil - How shift nodes, if required. Default: const.SHIFT.RIGHT -
  • -
  • is_instant - boolean or nil - If true, update node positions instantly -
  • -
- - - - - -
-
- - clear(self) -
-
- Clear grid nodes array. GUI nodes will be not deleted! - If you want to delete GUI nodes, use static_grid.nodes array before grid:clear - - -

Parameters:

- - -

Returns:

-
    - - druid.static_grid - Current grid instance -
- - - - -
-
- - get_all_pos(self) -
-
- Return array of all node positions - - -

Parameters:

- - -

Returns:

-
    - - vector3[] - All grid node positions -
- - - - -
-
- - get_borders(self) -
-
- Return grid content borders - - -

Parameters:

- - -

Returns:

-
    - - vector3 - The grid content borders -
- - - - -
-
- - get_index(self, pos) -
-
- Return index for grid pos - - -

Parameters:

-
    -
  • self - StaticGrid - StaticGrid -
  • -
  • pos - vector3 - The node position in the grid -
  • -
- -

Returns:

-
    - - number - The node index -
- - - - -
-
- - get_index_by_node(self, node) -
-
- Return grid index by node - - -

Parameters:

-
    -
  • self - StaticGrid - StaticGrid -
  • -
  • node - node - The gui node in the grid -
  • -
- -

Returns:

-
    - - number - The node index -
- - - - -
-
- - get_offset(self) -
-
- Return StaticGrid offset, where StaticGrid content starts. - - -

Parameters:

-
    -
  • self - StaticGrid - StaticGrid The StaticGrid instance -
  • -
- -

Returns:

-
    - - vector3 - The StaticGrid offset -
- - - - -
-
- - get_pos(self, index) -
-
- Return pos for grid node index - - -

Parameters:

-
    -
  • self - StaticGrid - StaticGrid -
  • -
  • index - number - The grid element index -
  • -
- -

Returns:

-
    - - vector3 - @Node position -
- - - - -
-
- - get_size(self) -
-
- Return grid content size - - -

Parameters:

- - -

Returns:

-
    - - vector3 - The grid content size -
- - - - -
-
- - init(self, parent, element, in_row) -
-
- The StaticGrid constructor - - -

Parameters:

-
    -
  • self - StaticGrid - StaticGrid -
  • -
  • parent - string or node - The GUI Node container, where grid's items will be placed -
  • -
  • element - node - Element prefab. Need to get it size -
  • -
  • in_row - number or nil - How many nodes in row can be placed. By default 1 -
  • -
- - - - - -
-
- - refresh(self) -
-
- Update grid content - - -

Parameters:

- - - - - - -
-
- - remove(self, index, shift_policy, is_instant) -
-
- Remove the item from the grid. Note that gui node will be not deleted - - -

Parameters:

-
    -
  • self - StaticGrid - StaticGrid -
  • -
  • index - number - The grid node index to remove -
  • -
  • shift_policy - number or nil - How shift nodes, if required. Default: const.SHIFT.RIGHT -
  • -
  • is_instant - boolean or nil - If true, update node positions instantly -
  • -
- -

Returns:

-
    - - node - The deleted gui node from grid -
- - - - -
-
- - set_anchor(self, anchor) -
-
- Set grid anchor. Default anchor is equal to anchor of grid parent node - - -

Parameters:

-
    -
  • self - StaticGrid - StaticGrid -
  • -
  • anchor - vector3 - Anchor -
  • -
- - - - - -
-
- - set_in_row(self, in_row) -
-
- Set new in_row elements for grid - - -

Parameters:

-
    -
  • self - StaticGrid - StaticGrid -
  • -
  • in_row - number - The new in_row value -
  • -
- -

Returns:

-
    - - druid.static_grid - Current grid instance -
- - - - -
-
- - set_item_size(self[, width[, height]]) -
-
- Set new node size for grid - - -

Parameters:

-
    -
  • self - StaticGrid - StaticGrid -
  • -
  • width - number - The new node width - (optional) -
  • -
  • height - number - The new node height - (optional) -
  • -
- -

Returns:

-
    - - druid.static_grid - Current grid instance -
- - - - -
-
- - set_items(self, nodes[, is_instant=false]) -
-
- Set new items to the grid. All previous items will be removed - - -

Parameters:

-
    -
  • self - StaticGrid - StaticGrid -
  • -
  • nodes - node[] - The new grid nodes -
  • -
  • is_instant - boolean - If true, update node positions instantly - (default false) -
  • -
- - - - - -
-
- - set_position_function(self, callback) -
-
- Change set position function for grid nodes. It will call on - update poses on grid elements. Default: gui.set_position - - -

Parameters:

-
    -
  • self - StaticGrid - StaticGrid -
  • -
  • callback - function - Function on node set position -
  • -
- -

Returns:

-
    - - druid.static_grid - Current grid instance -
- - - - -
-
- - sort_nodes(self, comparator) -
-
- Sort grid nodes by custom comparator function - - -

Parameters:

-
    -
  • self - StaticGrid - StaticGrid -
  • -
  • comparator - function - The comparator function. (a, b) -> boolean -
  • -
- -

Returns:

-
    - - druid.static_grid - Current grid instance -
- - - - -
-
-

Tables

- -
-
- - style -
-
- Component style params. - You can override this component styles params in druid styles table - or create your own style - - -

Fields:

-
    -
  • IS_DYNAMIC_NODE_POSES - boolean or nil - If true, always center grid content as grid pivot sets. Default: false -
  • -
  • IS_ALIGN_LAST_ROW - boolean or nil - If true, always align last row of the grid as grid pivot sets. Default: false -
  • -
- - - - - -
-
-

Fields

- -
-
- - anchor -
-
- Item anchor [0..1] - - -
    -
  • anchor - vector3 - -
  • -
- - - - - -
-
- - border -
-
- The size of item content - - -
    -
  • border - vector4 - -
  • -
- - - - - -
-
- - first_index -
-
- The first index of node in grid - - -
    -
  • first_index - number - -
  • -
- - - - - -
-
- - last_index -
-
- The last index of node in grid - - -
    -
  • last_index - number - -
  • -
- - - - - -
-
- - node_size -
-
- Item size - - -
    -
  • node_size - vector3 - -
  • -
- - - - - -
-
- - nodes -
-
- List of all grid nodes - - -
    -
  • nodes - node[] - -
  • -
- - - - - -
-
- - on_add_item -
-
- On item add callback(self, node, index) - - - - - - - - -
-
- - on_change_items -
-
- On item add, remove or change in_row callback(self, index|nil) - - - - - - - - -
-
- - on_clear -
-
- On grid clear callback(self) - - - - - - - - -
-
- - on_remove_item -
-
- On item remove callback(self, index) - - - - - - - - -
-
- - on_update_positions -
-
- On update item positions callback(self) - - -
    -
  • on_update_positions - DruidEvent - DruidEvent -
  • -
- - - - - -
-
- - parent -
-
- Parent gui node - - -
    -
  • parent - node - -
  • -
- - - - - -
-
- - pivot -
-
- Item pivot [-0.5..0.5] - - -
    -
  • pivot - vector3 - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Swipe.html b/docs/modules/Swipe.html deleted file mode 100644 index 9b7a2a9..0000000 --- a/docs/modules/Swipe.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Swipe

-

Component to handle swipe gestures on node.

-

- Swipe will be triggered, if swipe was started and - ended on one node -

Example Link

- - -

Functions

- - - - - - - - - -
init(self, node, on_swipe_callback)The Swipe constructor
set_click_zone(self, zone)Strict swipe click area.
-

Tables

- - - - - -
styleComponent style params.
-

Fields

- - - - - - - - - - - - - -
click_zoneRestriction zone
nodeSwipe node
on_swipeTrigger on swipe event(self, swipe_side, dist, delta_time)
- -
-
- - -

Functions

- -
-
- - init(self, node, on_swipe_callback) -
-
- The Swipe constructor - - -

Parameters:

-
    -
  • self - Swipe - Swipe -
  • -
  • node - node - Gui node -
  • -
  • on_swipe_callback - function - Swipe callback for on_swipe_end event -
  • -
- - - - - -
-
- - set_click_zone(self, zone) -
-
- Strict swipe click area. Useful for - restrict events outside stencil node - - -

Parameters:

- - - - - - -
-
-

Tables

- -
-
- - style -
-
- Component style params. - You can override this component styles params in druid styles table - or create your own style - - -

Fields:

-
    -
  • SWIPE_TIME - number or nil - Maximum time for swipe trigger. Default: 0.4 -
  • -
  • SWIPE_THRESHOLD - number or nil - Minimum distance for swipe trigger. Default: 50 -
  • -
  • SWIPE_TRIGGER_ON_MOVE - boolean or nil - If true, trigger on swipe moving, not only release action. Default: false -
  • -
- - - - - -
-
-

Fields

- -
-
- - click_zone -
-
- Restriction zone - - -
    -
  • click_zone - node or nil - -
  • -
- - - - - -
-
- - node -
-
- Swipe node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - on_swipe -
-
- Trigger on swipe event(self, swipe_side, dist, delta_time) - - - - - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Text.html b/docs/modules/Text.html deleted file mode 100644 index bcf6e6c..0000000 --- a/docs/modules/Text.html +++ /dev/null @@ -1,942 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Text

-

Component for Wrapping GUI Text Nodes: Druid Text -

## Overview ## -

Druid Text is a component that provides various adjustment modes for text nodes.

-

It allows text to be scaled down to fit within the size of the text node. -

## Notes ## -

• The text pivot can be changed using the text:set_pivot method. - The anchoring will be inside the text node's area size. -

• There are several text adjustment types available. The default is DOWNSCALE. - You can change the default adjustment type in the Text style. Refer to the example below to see all available adjustment types: -

- const.TEXT_ADJUST.DOWNSCALE: Changes the text's scale to fit within the text node's size. -

- const.TEXT_ADJUST.TRIM: Trims the text with a postfix (default: "...", can be overridden in styles) - to fit within the text node's size. -

- const.TEXT_ADJUST.NO_ADJUST: No adjustment is applied, similar - to the default Defold Text Node behavior. -

- const.TEXT_ADJUST.DOWNSCALE_LIMITED: Changes the text's scale - with a limited downscale. You can set the minimum scale using the text:set_minimal_scale() function. -

- const.TEXT_ADJUST.SCROLL: Changes the text's pivot to imitate scrolling within the text box. - For better effect, use with a stencil node. -

- const.TEXT_ADJUST.SCALE_THEN_SCROLL: Combines two modes: limited downscale first, then scroll. -

Example Link

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get_text_adjust(self, adjust_type)Return current text adjust type
get_text_index_by_width(self, width)Get chars count by width
get_text_size(self, text)Calculate text width with font with respect to trailing space
init(self, node, value, adjust_type)The Text constructor
is_multiline(self)Return true, if text with line break
set_alpha(self, alpha)Set alpha
set_color(self, color)Set color
set_minimal_scale(self, minimal_scale)Set minimal scale for DOWNSCALE_LIMITED or SCALE_THEN_SCROLL adjust types
set_pivot(self, pivot)Set text pivot.
set_scale(self, scale)Set scale
set_size(self, size)Set text area size
set_text_adjust(self, adjust_type, minimal_scale)Set text adjust, refresh the current text visuals, if needed
set_to(self, set_to)Set text to text field
-

Tables

- - - - - -
styleComponent style params.
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
adjust_typeCurrent text size adjust settings
colorCurrent text color
last_valueThe last text value
nodeText node
node_idThe node id of text node
on_set_pivotOn change pivot callback(self, pivot)
on_set_textOn set text callback(self, text)
on_update_text_scaleOn adjust text size callback(self, new_scale, text_metrics)
posCurrent text position
scaleCurrent text node scale
start_scaleInitial text node scale
start_sizeInitial text node size
text_areaCurrent text node available are
- -
-
- - -

Functions

- -
-
- - get_text_adjust(self, adjust_type) -
-
- Return current text adjust type - - -

Parameters:

-
    -
  • self - -
  • -
  • adjust_type - -
  • -
- -

Returns:

-
    - - number - The current text adjust type -
- - - - -
-
- - get_text_index_by_width(self, width) -
-
- Get chars count by width - - -

Parameters:

-
    -
  • self - Text - Text -
  • -
  • width - number - -
  • -
- -

Returns:

-
    - - number - Chars count -
- - - - -
-
- - get_text_size(self, text) -
-
- Calculate text width with font with respect to trailing space - - -

Parameters:

-
    -
  • self - Text - Text -
  • -
  • text - string - |nil -
  • -
- -

Returns:

-
    -
  1. - number - Width
  2. -
  3. - number - Height
  4. -
- - - - -
-
- - init(self, node, value, adjust_type) -
-
- The Text constructor - - -

Parameters:

-
    -
  • self - Text - Text -
  • -
  • node - string or node - Node name or GUI Text Node itself -
  • -
  • value - string or nil - Initial text. Default value is node text from GUI scene. Default: nil -
  • -
  • adjust_type - string or nil - Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference. Default: DOWNSCALE -
  • -
- - - - - -
-
- - is_multiline(self) -
-
- Return true, if text with line break - - -

Parameters:

-
    -
  • self - Text - Text -
  • -
- -

Returns:

-
    - - boolean - Is text node with line break -
- - - - -
-
- - set_alpha(self, alpha) -
-
- Set alpha - - -

Parameters:

-
    -
  • self - Text - Text -
  • -
  • alpha - number - Alpha for node -
  • -
- -

Returns:

-
    - - Text - Current text instance -
- - - - -
-
- - set_color(self, color) -
-
- Set color - - -

Parameters:

-
    -
  • self - Text - Text -
  • -
  • color - vector4 - Color for node -
  • -
- -

Returns:

-
    - - Text - Current text instance -
- - - - -
-
- - set_minimal_scale(self, minimal_scale) -
-
- Set minimal scale for DOWNSCALE_LIMITED or SCALE_THEN_SCROLL adjust types - - -

Parameters:

-
    -
  • self - Text - Text -
  • -
  • minimal_scale - number - If pass nil - not use minimal scale -
  • -
- -

Returns:

-
    - - Text - Current text instance -
- - - - -
-
- - set_pivot(self, pivot) -
-
- Set text pivot. Text will re-anchor inside text area - - -

Parameters:

-
    -
  • self - Text - Text -
  • -
  • pivot - number - The gui.PIVOT_* constant -
  • -
- -

Returns:

-
    - - Text - Current text instance -
- - - - -
-
- - set_scale(self, scale) -
-
- Set scale - - -

Parameters:

-
    -
  • self - Text - Text -
  • -
  • scale - vector3 - Scale for node -
  • -
- -

Returns:

-
    - - Text - Current text instance -
- - - - -
-
- - set_size(self, size) -
-
- Set text area size - - -

Parameters:

-
    -
  • self - Text - Text -
  • -
  • size - vector3 - The new text area size -
  • -
- -

Returns:

-
    - - Text - Current text instance -
- - - - -
-
- - set_text_adjust(self, adjust_type, minimal_scale) -
-
- Set text adjust, refresh the current text visuals, if needed - - -

Parameters:

-
    -
  • self - Text - Text -
  • -
  • adjust_type - string or nil - See const.TEXT_ADJUST. If pass nil - use current adjust type -
  • -
  • minimal_scale - number or nil - If pass nil - not use minimal scale -
  • -
- -

Returns:

-
    - - Text - Current text instance -
- - - - -
-
- - set_to(self, set_to) -
-
- Set text to text field - - -

Parameters:

-
    -
  • self - Text - Text -
  • -
  • set_to - string - Text for node -
  • -
- -

Returns:

-
    - - Text - Current text instance -
- - - - -
-
-

Tables

- -
-
- - style -
-
- Component style params. - You can override this component styles params in druid styles table - or create your own style - - -

Fields:

-
    -
  • TRIM_POSTFIX - string or nil - The postfix for TRIM adjust type. Default: ... -
  • -
  • DEFAULT_ADJUST - string or nil - The default adjust type for any text component. Default: DOWNSCALE -
  • -
  • ADJUST_STEPS - string or nil - Amount of iterations for text adjust by height. Default: 20 -
  • -
  • ADJUST_SCALE_DELTA - string or nil - Scale step on each height adjust step. Default: 0.02 -
  • -
- - - - - -
-
-

Fields

- -
-
- - adjust_type -
-
- Current text size adjust settings - - -
    -
  • adjust_type - number - -
  • -
- - - - - -
-
- - color -
-
- Current text color - - -
    -
  • color - vector3 - -
  • -
- - - - - -
-
- - last_value -
-
- The last text value - - - - - - - - -
-
- - node -
-
- Text node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - node_id -
-
- The node id of text node - - -
    -
  • node_id - hash - -
  • -
- - - - - -
-
- - on_set_pivot -
-
- On change pivot callback(self, pivot) - - - - - - - - -
-
- - on_set_text -
-
- On set text callback(self, text) - - - - - - - - -
-
- - on_update_text_scale -
-
- On adjust text size callback(self, new_scale, text_metrics) - - -
    -
  • on_update_text_scale - DruidEvent - DruidEvent -
  • -
- - - - - -
-
- - pos -
-
- Current text position - - -
    -
  • pos - vector3 - -
  • -
- - - - - -
-
- - scale -
-
- Current text node scale - - -
    -
  • scale - vector3 - -
  • -
- - - - - -
-
- - start_scale -
-
- Initial text node scale - - -
    -
  • start_scale - vector3 - -
  • -
- - - - - -
-
- - start_size -
-
- Initial text node size - - -
    -
  • start_size - vector3 - -
  • -
- - - - - -
-
- - text_area -
-
- Current text node available are - - -
    -
  • text_area - vector3 - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/Timer.html b/docs/modules/Timer.html deleted file mode 100644 index 7fabb1b..0000000 --- a/docs/modules/Timer.html +++ /dev/null @@ -1,409 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module Timer

-

Component to handle GUI timers.

-

- Timer updating by game delta time. If game is not focused - - timer will be not updated.

- - -

Functions

- - - - - - - - - - - - - - - - - -
init(self, node, seconds_from, seconds_to, callback)The Timer constructor
set_interval(self, from, to)Set time interval
set_state(self, is_on)Called when update
set_to(self, set_to)Set text to text field
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fromInitial timer value
nodeTrigger node
on_set_enabledOn timer change enabled state callback(self, is_enabled)
on_tickOn timer tick.
on_timer_endOn timer end callback
targetTarget timer value
valueCurrent timer value
- -
-
- - -

Functions

- -
-
- - init(self, node, seconds_from, seconds_to, callback) -
-
- The Timer constructor - - -

Parameters:

-
    -
  • self - Timer - Timer -
  • -
  • node - node - Gui text node -
  • -
  • seconds_from - number or nil - Start timer value in seconds -
  • -
  • seconds_to - number or nil - End timer value in seconds -
  • -
  • callback - function or nil - Function on timer end -
  • -
- - - - - -
-
- - set_interval(self, from, to) -
-
- Set time interval - - -

Parameters:

-
    -
  • self - Timer - Timer -
  • -
  • from - number - Start time in seconds -
  • -
  • to - number - Target time in seconds -
  • -
- - - - - -
-
- - set_state(self, is_on) -
-
- Called when update - - -

Parameters:

-
    -
  • self - Timer - Timer -
  • -
  • is_on - boolean or nil - Timer enable state -
  • -
- - - - - -
-
- - set_to(self, set_to) -
-
- Set text to text field - - -

Parameters:

-
    -
  • self - Timer - Timer -
  • -
  • set_to - number - Value in seconds -
  • -
- - - - - -
-
-

Fields

- -
-
- - from -
-
- Initial timer value - - -
    -
  • from - number - -
  • -
- - - - - -
-
- - node -
-
- Trigger node - - -
    -
  • node - node - -
  • -
- - - - - -
-
- - on_set_enabled -
-
- On timer change enabled state callback(self, is_enabled) - - - - - - - - -
-
- - on_tick -
-
- On timer tick. Fire every second callback(self, value) - - - - - - - - -
-
- - on_timer_end -
-
- On timer end callback - - -
    -
  • on_timer_end - DruidEvent - (self, Timer) DruidEvent -
  • -
- - - - - -
-
- - target -
-
- Target timer value - - -
    -
  • target - number - -
  • -
- - - - - -
-
- - value -
-
- Current timer value - - -
    -
  • value - number - -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/druid.extended.layout.html b/docs/modules/druid.extended.layout.html deleted file mode 100644 index 4f01fd5..0000000 --- a/docs/modules/druid.extended.layout.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module druid.extended.layout

-

Druid layout module -

# Overview # -

Layout component works like Dynamic Grid before - for aligning elements in a row or column.

-

Works like a Figma layout. -

# Notes

- - - -
-
- - - - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- - diff --git a/docs/modules/druid.system.utf8.html b/docs/modules/druid.system.utf8.html deleted file mode 100644 index 0582106..0000000 --- a/docs/modules/druid.system.utf8.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - Defold Druid UI Framework - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module druid.system.utf8

-

-

- - - -
-
- - - - -
-
-
-generated by LDoc TESTING -Last updated 2015-01-01 12:00:00 -
-
- -