mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 18:37:44 +02:00
Compare commits
No commits in common. "master" and "0.9.0" have entirely different histories.
@ -1,2 +0,0 @@
|
||||
/dist
|
||||
/.deployer_cache
|
5
.github/FUNDING.yml
vendored
5
.github/FUNDING.yml
vendored
@ -1,5 +0,0 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: insality
|
||||
ko_fi: insality
|
||||
buy_me_a_coffee: insality
|
17
.github/workflows/ci-workflow.yml
vendored
17
.github/workflows/ci-workflow.yml
vendored
@ -7,22 +7,17 @@ jobs:
|
||||
name: Build and run tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- uses: actions/setup-java@v3
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: '21'
|
||||
java-version: '13'
|
||||
|
||||
- name: Build && Run
|
||||
run: |
|
||||
deployer_url="https://raw.githubusercontent.com/Insality/defold-deployer/1/deployer.sh"
|
||||
curl -s ${deployer_url} | bash -s lbd --headless --settings ./test/test.ini
|
||||
curl -s ${deployer_url} | bash -s lbd --headless --settings ./unit_test.txt
|
||||
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@v4.0.1
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
slug: insality/druid
|
||||
- name: Upload test report
|
||||
run: bash <(curl -s https://codecov.io/bash)
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -10,10 +10,4 @@ Thumbs.db
|
||||
builtins
|
||||
dist
|
||||
deployer_version_settings.txt
|
||||
|
||||
.deployer_cache
|
||||
bob*.jar
|
||||
manifest.private.der
|
||||
manifest.public.der
|
||||
/.editor_settings
|
||||
/.deployer_cache
|
||||
|
52
.luacheckrc
Normal file
52
.luacheckrc
Normal file
@ -0,0 +1,52 @@
|
||||
std = "max"
|
||||
files['.luacheckrc'].global = false
|
||||
unused_args = false
|
||||
|
||||
max_code_line_length = 90
|
||||
max_comment_line_length = false
|
||||
|
||||
globals = {
|
||||
"sys",
|
||||
"go",
|
||||
"gui",
|
||||
"label",
|
||||
"render",
|
||||
"crash",
|
||||
"sprite",
|
||||
"sound",
|
||||
"tilemap",
|
||||
"spine",
|
||||
"particlefx",
|
||||
"physics",
|
||||
"factory",
|
||||
"collectionfactory",
|
||||
"iac",
|
||||
"msg",
|
||||
"vmath",
|
||||
"url",
|
||||
"http",
|
||||
"image",
|
||||
"json",
|
||||
"zlib",
|
||||
"iap",
|
||||
"push",
|
||||
"facebook",
|
||||
"hash",
|
||||
"hash_to_hex",
|
||||
"pprint",
|
||||
"init",
|
||||
"final",
|
||||
"update",
|
||||
"on_input",
|
||||
"on_message",
|
||||
"on_reload",
|
||||
"socket",
|
||||
"table",
|
||||
"debug",
|
||||
"timer",
|
||||
"window",
|
||||
"buffer",
|
||||
"resource",
|
||||
"defos",
|
||||
"html5",
|
||||
}
|
76
.luacov
76
.luacov
@ -1,76 +0,0 @@
|
||||
local reporter = require("luacov.reporter.defold")
|
||||
|
||||
--- Default values for configuration options.
|
||||
-- For project specific configuration create '.luacov' file in your project
|
||||
-- folder. It should be a Lua script setting various options as globals
|
||||
-- or returning table of options.
|
||||
-- @class module
|
||||
-- @name deftest.coverage.configuration
|
||||
return {
|
||||
|
||||
--- Reporter class to use when creating a report. Default: DefaultReporter from reporter.lua
|
||||
reporter = reporter,
|
||||
|
||||
--- Filename to store collected stats. Default: "luacov.stats.out".
|
||||
statsfile = "luacov.stats.out",
|
||||
|
||||
--- Filename to store report. Default: "luacov.report.out".
|
||||
reportfile = "luacov.report.out",
|
||||
|
||||
--- Enable saving coverage data after every `savestepsize` lines?
|
||||
-- Setting this flag to `true` in config is equivalent to running LuaCov
|
||||
-- using `luacov.tick` module. Default: false.
|
||||
tick = false,
|
||||
|
||||
--- Stats file updating frequency for `luacov.tick`.
|
||||
-- The lower this value - the more frequently results will be written out to the stats file.
|
||||
-- You may want to reduce this value (to, for example, 2) to avoid losing coverage data in
|
||||
-- case your program may terminate without triggering luacov exit hooks that are supposed
|
||||
-- to save the data. Default: 100.
|
||||
savestepsize = 100,
|
||||
|
||||
--- Run reporter on completion? Default: true.
|
||||
runreport = true,
|
||||
|
||||
--- Delete stats file after reporting? Default: false.
|
||||
deletestats = true,
|
||||
|
||||
--- Process Lua code loaded from raw strings?
|
||||
-- That is, when the 'source' field in the debug info
|
||||
-- does not start with '@'. Default: true.
|
||||
codefromstrings = true,
|
||||
|
||||
--- Lua patterns for files to include when reporting.
|
||||
-- All will be included if nothing is listed.
|
||||
-- Do not include the '.lua' extension. Path separator is always '/'.
|
||||
-- Overruled by `exclude`.
|
||||
-- @usage
|
||||
-- include = {
|
||||
-- "mymodule$", -- the main module
|
||||
-- "mymodule%/.+$", -- and everything namespaced underneath it
|
||||
-- }
|
||||
include = {},
|
||||
|
||||
--- Lua patterns for files to exclude when reporting.
|
||||
-- Nothing will be excluded if nothing is listed.
|
||||
-- Do not include the '.lua' extension. Path separator is always '/'.
|
||||
-- Overrules `include`.
|
||||
exclude = {
|
||||
"^test%/.+$",
|
||||
"^druid/system/utf8.lua$",
|
||||
},
|
||||
|
||||
--- Table mapping names of modules to be included to their filenames.
|
||||
-- Has no effect if empty.
|
||||
-- Real filenames mentioned here will be used for reporting
|
||||
-- even if the modules have been installed elsewhere.
|
||||
-- Module name can contain '*' wildcard to match groups of modules,
|
||||
-- in this case corresponding path will be used as a prefix directory
|
||||
-- where modules from the group are located.
|
||||
-- @usage
|
||||
-- modules = {
|
||||
-- ["some_rock"] = "src/some_rock.lua",
|
||||
-- ["some_rock.*"] = "src"
|
||||
-- }
|
||||
modules = {},
|
||||
}
|
41
.vscode/settings.json
vendored
41
.vscode/settings.json
vendored
@ -1,41 +0,0 @@
|
||||
{
|
||||
"Lua.diagnostics.globals": [
|
||||
"init",
|
||||
"final",
|
||||
"update",
|
||||
"on_message",
|
||||
"on_input",
|
||||
"describe",
|
||||
"before",
|
||||
"after",
|
||||
"it",
|
||||
"utf8",
|
||||
"defos",
|
||||
"clipboard",
|
||||
"editor"
|
||||
],
|
||||
"Lua.workspace.checkThirdParty": false,
|
||||
"Lua.diagnostics.neededFileStatus": {
|
||||
"undefined-field": "Any",
|
||||
"assign-type-mismatch": "Any",
|
||||
"missing-return": "Any",
|
||||
"missing-fields": "Any",
|
||||
"return-type-mismatch": "Any",
|
||||
"lowercase-global": "Any"
|
||||
},
|
||||
"Lua.workspace.ignoreDir": [
|
||||
".vscode",
|
||||
"test/tests/*.lua",
|
||||
"utils/annotations_manual.lua"
|
||||
],
|
||||
"Lua.runtime.pathStrict": true,
|
||||
"Lua.diagnostics.libraryFiles": "Disable",
|
||||
"Lua.runtime.version": "Lua 5.1",
|
||||
"Lua.workspace.library": [
|
||||
"~/Library/Application Support/Cursor/User/globalStorage/astronachos.defold",
|
||||
"~/Library/Application Support/Cursor/User/workspaceStorage/1446075a23c89451a63f0e82b2291def/astronachos.defold"
|
||||
],
|
||||
"files.exclude": {
|
||||
"**/*.gui": true
|
||||
}
|
||||
}
|
116
CONTRIBUTING.md
116
CONTRIBUTING.md
@ -1,116 +0,0 @@
|
||||
# Contributing to Druid
|
||||
|
||||
Thank you for your interest in contributing to **Druid**! We welcome contributions of all sizes - even small fixes make a big difference.
|
||||
|
||||
## Table of Contents
|
||||
- [How to Report Issues](#how-to-report-issues)
|
||||
- [Small Fixes](#small-fixes)
|
||||
- [Larger Contributions](#larger-contributions)
|
||||
- [Documentation Updates](#documentation-updates)
|
||||
- [Adding or Updating Examples](#adding-or-updating-examples)
|
||||
- [Unit Tests](#unit-tests)
|
||||
|
||||
## How to Report Issues
|
||||
|
||||
Found a bug? Please report it to our [issue tracker](https://github.com/druid-js/druid/issues) with:
|
||||
- A clear description of the problem
|
||||
- Steps to reproduce the issue
|
||||
- Expected vs. actual behavior
|
||||
- Your environment (Defold version, OS, etc.)
|
||||
|
||||
## Small Fixes
|
||||
|
||||
**We highly encourage small improvements!** For bug fixes, typo corrections, or minor improvements, you can create a pull request directly to the `master` or `develop` branch.
|
||||
|
||||
When making these contributions, you **must**:
|
||||
|
||||
1. Update the patch version number in both:
|
||||
- `README.md` file (in the dependency section)
|
||||
- `game.project` file (in the project section)
|
||||
2. Add your changes to `wiki/changelog.md`
|
||||
3. These steps are required to properly tag a new release
|
||||
|
||||
**Example of version updates:**
|
||||
|
||||
For README.md:
|
||||
```
|
||||
# Before
|
||||
https://github.com/Insality/druid/archive/refs/tags/1.1.0.zip
|
||||
|
||||
# After (patch version increased)
|
||||
https://github.com/Insality/druid/archive/refs/tags/1.1.1.zip
|
||||
```
|
||||
|
||||
For game.project:
|
||||
```
|
||||
# Before
|
||||
[project]
|
||||
title = Druid
|
||||
version = 1.1.0
|
||||
|
||||
# After (patch version increased)
|
||||
[project]
|
||||
title = Druid
|
||||
version = 1.1.1
|
||||
```
|
||||
|
||||
## Larger Contributions
|
||||
|
||||
For new features, major improvements, or complex fixes:
|
||||
|
||||
1. Fork the repository
|
||||
2. Create a branch from `develop`
|
||||
3. Make your changes
|
||||
4. Ensure code follows project style guidelines
|
||||
5. Test your changes thoroughly
|
||||
6. Submit a pull request to the `develop` branch
|
||||
7. Include references to any related issues (e.g., "Fixes #123")
|
||||
|
||||
Please keep changes focused on addressing specific issues or features, and maintain the existing code style.
|
||||
|
||||
## Documentation Updates
|
||||
|
||||
To improve documentation:
|
||||
|
||||
1. Fork the repository
|
||||
2. Create a branch for your changes
|
||||
3. Update the relevant documentation files
|
||||
4. Submit a pull request to the `master` or `develop` branch
|
||||
|
||||
Clear, accurate documentation helps everyone, so documentation improvements are always appreciated!
|
||||
|
||||
## Adding or Updating Examples
|
||||
|
||||
Examples are vital for helping users understand how to use Druid. Each example should include:
|
||||
|
||||
1. A GUI scene with a Druid widget
|
||||
2. Information about the example in `examples_list.lua`
|
||||
|
||||
To add a new example:
|
||||
|
||||
1. Create a new GUI file in the `/example/examples` directory
|
||||
2. Add the example information to `examples_list.lua`
|
||||
3. Include your GUI template in `/example/druid.gui`
|
||||
- Place it inside the proper hierarchy: `root -> container_center -> examples -> widgets`
|
||||
4. Test your example by running the game
|
||||
5. Submit a pull request to the `develop` branch
|
||||
|
||||
## Unit Tests
|
||||
|
||||
Unit tests help ensure Druid works correctly. If you're facing an issue, unit tests can be a good starting point to understand or reproduce it.
|
||||
|
||||
All tests are located in the `/test/tests` directory.
|
||||
|
||||
To run tests:
|
||||
1. Set the bootstrap collection to `/test/test.collection`
|
||||
2. Run the project
|
||||
|
||||
To submit new or updated tests:
|
||||
1. Create a branch for your changes
|
||||
2. Add or modify tests
|
||||
3. Verify your tests pass
|
||||
4. Submit a pull request to the `develop` branch
|
||||
|
||||
---
|
||||
|
||||
Thank you for contributing to making Druid better for everyone! ❤️
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 Maxim Tuprikov
|
||||
Copyright (c) 2021 Maxim Tuprikov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
376
README.md
376
README.md
@ -1,79 +1,219 @@
|
||||
|
||||
[](https://insality.github.io/druid/)
|
||||
|
||||
[](https://github.com/Insality/druid/tags)
|
||||
[](https://github.com/Insality/druid/actions)
|
||||
[](https://codecov.io/gh/Insality/druid)
|
||||
[](https://github.com/Insality/druid/releases)
|
||||
[](https://github.com/Insality/druid/actions)
|
||||
[](https://codecov.io/gh/Insality/druid)
|
||||
|
||||
[](https://github.com/sponsors/insality) [](https://ko-fi.com/insality) [](https://www.buymeacoffee.com/insality)
|
||||
**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.
|
||||
|
||||
**Druid** - a powerful, flexible and easy to use **Defold** component UI framework. Contains a wide range of UI components that you can use to create a beautiful, responsive and customizable GUIs. Provides a powerful way to create, compose and manage your custom components and scenes.
|
||||
|
||||
## Druid Example
|
||||
|
||||
Check the [**HTML5 version**](https://insality.github.io/druid/) of the **Druid** example app.
|
||||
|
||||
In this example you can inspect a variety of **Druid** components and see how they work. Each example page provides a direct link to the corresponding example code, making it easier for you to understand how to use **Druid**.
|
||||
|
||||
## Features
|
||||
|
||||
- **Components Rich** - Provides a extensive set of components, from basic buttons to infinity data lists and rich texts
|
||||
- **Customizable** - You can customize components appearance and behaviour with their API and styles
|
||||
- **Widgets** - Powerful way to create your own reusable components
|
||||
- **Input Handling** - Handles input in a stack-based manner and manage input priority
|
||||
- **Event Based** - Uses [Defold Event](https://github.com/Insality/defold-event) for components callbacks and communication between components
|
||||
|
||||
## Quick Links
|
||||
|
||||
- [Basic Usage](wiki/basic_usage.md)
|
||||
- [Quick API Reference](api/quick_api_reference.md)
|
||||
- [List of Components](#druid-components)
|
||||
- [Contributors](#contributors)
|
||||
## Setup
|
||||
|
||||
### [Dependency](https://defold.com/manuals/libraries/#setting-up-library-dependencies)
|
||||
### Dependency
|
||||
|
||||
Open your `game.project` file and add the following lines to the dependencies field under the project section:
|
||||
You can use the **Druid** extension in your own project by adding this project as a [Defold library dependency](https://www.defold.com/manuals/libraries/). Open your game.project file and in the dependencies field under project add:
|
||||
|
||||
> [https://github.com/Insality/druid/archive/master.zip](https://github.com/Insality/druid/archive/master.zip)
|
||||
|
||||
Or point to the ZIP file of a [specific release](https://github.com/Insality/druid/releases).
|
||||
|
||||
### Input bindings
|
||||
|
||||
**Druid** requires the following input bindings:
|
||||
|
||||
- Mouse trigger - `Button 1` -> `touch` _For basic input components_
|
||||
- Mouse trigger - `Wheel up` -> `scroll_up` _For scroll component_
|
||||
- Mouse trigger - `Wheel down` -> `scroll_down` _For scroll component_
|
||||
- Key trigger - `Backspace` -> `key_backspace` _For back_handler component, input component_
|
||||
- Key trigger - `Back` -> `key_back` _For back_handler component, Android back button, input component_
|
||||
- Key trigger - `Enter` -> `key_enter` _For input component, optional_
|
||||
- Key trigger - `Esc` -> `key_esc` _For input component, optional_
|
||||
- Touch triggers - `Touch multi` -> `multitouch` _For scroll component_
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
**[Druid](https://github.com/Insality/druid/)**
|
||||
### Change key bindings [optional]
|
||||
If you have to use your own key bindings (and key name), you can change it in your *game.project* file.
|
||||
|
||||
Here is current default values for key bindings:
|
||||
```
|
||||
https://github.com/Insality/druid/archive/refs/tags/1.1.4.zip
|
||||
[druid]
|
||||
input_text = text
|
||||
input_touch = touch
|
||||
input_marked_text = marked_text
|
||||
input_key_esc = key_esc
|
||||
input_key_back = key_back
|
||||
input_key_enter = key_enter
|
||||
input_key_backspace = key_backspace
|
||||
input_multitouch = multitouch
|
||||
input_scroll_up = scroll_up
|
||||
input_scroll_down = scroll_down
|
||||
```
|
||||
|
||||
**[Defold Event](https://github.com/Insality/defold-event)**
|
||||
|
||||
### Input capturing [optional]
|
||||
|
||||
By default, **Druid** will auto-capture input focus, if any input component will be created. So you don't need to call `msg.post(".", "acquire_input_focus")`
|
||||
|
||||
If you don't need this behaviour, you can disable it by setting `druid.no_auto_input` field in _game.project_:
|
||||
```
|
||||
https://github.com/Insality/defold-event/archive/refs/tags/11.zip
|
||||
[druid]
|
||||
no_auto_input = 1
|
||||
```
|
||||
|
||||
After that, select `Project ▸ Fetch Libraries` to update [library dependencies]((https://defold.com/manuals/libraries/#setting-up-library-dependencies)). This happens automatically whenever you open a project so you will only need to do this if the dependencies change without re-opening the project.
|
||||
|
||||
Here is a list of [all releases](https://github.com/Insality/druid/releases).
|
||||
### Template name check [optional]
|
||||
|
||||
By default, **Druid** will auto check the parent component template name to build the full template name for component.
|
||||
|
||||
If for some reason you want to pass the full template name by yourself, you can disable it by setting `druid.no_auto_template` field in _game.project_:
|
||||
|
||||
```
|
||||
[druid]
|
||||
no_auto_template = 1
|
||||
```
|
||||
|
||||
|
||||
### Library Size
|
||||
### Stencil check [optional]
|
||||
|
||||
> **Note:** The library size is calculated based on the build report per platform. Full size contains all components, they can be stripped out in the build process if you don't need them.
|
||||
|
||||
| Platform | Full Size |
|
||||
| ---------------- | ------------- |
|
||||
| HTML5 | **84.52 KB** |
|
||||
| Desktop / Mobile | **141.03 KB** |
|
||||
When creating input components inside stencil nodes, you probably will use `component:set_click_zone()` to restrict clicks outside this stencil zone.
|
||||
Druid can do it automatically on _late_init_ component step. To enable this feature add next field in your _game.project_ file
|
||||
```
|
||||
[druid]
|
||||
stencil_check = 1
|
||||
```
|
||||
|
||||
|
||||
### Input Bindings
|
||||
### Code [optional]
|
||||
|
||||
**Druid** utilizes the `/builtins/input/all.input_binding` input bindings. Either use this file for your project by setting the `Runtime -> Input -> Game Binding` field in the `game.project` input section to `/builtins/input/all.input_binding`, or add the specific bindings you need to your game's input binding file. For custom input bindings, refer to the Input Binding section in the [Advanced Setup](https://github.com/Insality/druid/blob/master/wiki/advanced-setup.md#input-bindings).
|
||||
Adjust **Druid** settings, if needed:
|
||||
```lua
|
||||
local druid = require("druid.druid")
|
||||
|
||||
-- Used for button component and custom components
|
||||
-- Callback should play sound by name
|
||||
druid.set_sound_function(callback)
|
||||
|
||||
-- Used for lang_text component
|
||||
-- Callback should return localized string by locale id
|
||||
druid.set_text_function(callback)
|
||||
|
||||
-- Used for change default druid style
|
||||
druid.set_default_style(your_style)
|
||||
|
||||
-- Call this function on language changing in the game,
|
||||
-- to retranslate all lang_text components:
|
||||
druid.on_language_change()
|
||||
|
||||
-- Call this function inside window.set_listener
|
||||
-- to catch game focus lost/gained callbacks:
|
||||
druid.on_window_callback(event)
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
## Components
|
||||
|
||||
### Basic usage
|
||||
**Druid** provides the following *basic* components:
|
||||
|
||||
The basic template for `gui_script` is:
|
||||
- **[Button](docs_md/01-components.md#button)** - Basic Druid button input component. Handles all types of interactions (tap, long-tap, hold-tap, double-tap, simple key triggers, etc)
|
||||
|
||||
- **[Text](docs_md/01-components.md#text)** - Basic Druid text component. Wrap on gui text node, handle text size adjusting.
|
||||
|
||||
- **[Scroll](docs_md/01-components.md#scroll)** - Basic Druid scroll component
|
||||
|
||||
- **[Blocker](docs_md/01-components.md#blocker)** - Block input in node zone component
|
||||
|
||||
- **[Back Handler](docs_md/01-components.md#back-handler)** - Handle back button (Android back button, backspace key)
|
||||
|
||||
- **[Static Grid](docs_md/01-components.md#static-grid)** - Component to manage node positions with equal sizes
|
||||
|
||||
- **[Hover](docs_md/01-components.md#hover)** - System Druid component, handle hover node state
|
||||
|
||||
- **[Swipe](docs_md/01-components.md#swipe)** - System Druid component, handle swipe gestures on node
|
||||
|
||||
- **[Drag](docs_md/01-components.md#drag)** - System Druid component, handle drag input on node
|
||||
|
||||
**Druid** also provides the following *extended* components:
|
||||
|
||||
***Note**: In the future, to use extended components, you should register them first. This is required to make **Druid** modular - to exclude unused components from builds*
|
||||
|
||||
- **[Checkbox](docs_md/01-components.md#checkbox)** - Checkbox component
|
||||
|
||||
- **[Checkbox group](docs_md/01-components.md#checkbox-group)** - Several checkboxes in one group
|
||||
|
||||
- **[Dynamic Grid](docs_md/01-components.md#dynamic-grid)** - Component to manage node positions with different sizes. Only in one row or column
|
||||
|
||||
- **[Data List](docs_md/01-components.md#data-list)** - Component to manage data for huge dataset in scroll
|
||||
|
||||
- **[Input](docs_md/01-components.md#input)** - User text input component
|
||||
|
||||
- **[Lang text](docs_md/01-components.md#lang-text)** - Wrap on Text component to handle localization
|
||||
|
||||
- **[Progress](docs_md/01-components.md#progress)** - Progress bar component
|
||||
|
||||
- **[Radio group](docs_md/01-components.md#radio-group)** - Several checkboxes in one group with a single choice
|
||||
|
||||
- **[Slider](docs_md/01-components.md#slider)** - Slider component
|
||||
|
||||
- **[Timer](docs_md/01-components.md#timer)** - Handle timer work on gui text node
|
||||
|
||||
For a complete overview, see: _[components.md](docs_md/01-components.md)_.
|
||||
|
||||
|
||||
## Basic usage
|
||||
|
||||
To use **Druid**, first you should create a Druid instance to spawn components and add Druids main engine functions: *update*, *final*, *on_message* and *on_input*.
|
||||
|
||||
All **Druid** components take node name string as arguments, don't do `gui.get_node()` before.
|
||||
|
||||
All **Druid** and component methods are called with `:` like `self.druid:new_button()`.
|
||||
|
||||
```lua
|
||||
local druid = require("druid.druid")
|
||||
|
||||
local function button_callback(self)
|
||||
print("Button was clicked!")
|
||||
end
|
||||
|
||||
function init(self)
|
||||
self.druid = druid.new(self)
|
||||
self.druid:new_button("button_node_name", button_callback)
|
||||
end
|
||||
|
||||
function final(self)
|
||||
self.druid:final()
|
||||
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
|
||||
|
||||
```
|
||||
|
||||
For all **Druid** instance functions, [see here](https://insality.github.io/druid/modules/druid_instance.html).
|
||||
|
||||
## Druid Events
|
||||
|
||||
Any **Druid** components as callbacks use [Druid Events](https://insality.github.io/druid/modules/druid_event.html). In component API ([button example](https://insality.github.io/druid/modules/druid.button.html#Events)) pointed list of component events. You can manually subscribe to those events with the following API:
|
||||
|
||||
- **event:subscribe**(callback)
|
||||
|
||||
- **event:unsubscribe**(callback)
|
||||
|
||||
- **event:clear**()
|
||||
|
||||
You can subscribe several callbacks to a single event.
|
||||
|
||||
## Druid Lifecycle
|
||||
|
||||
Here is full Druid lifecycle setup for your ***.gui_script** file:
|
||||
```lua
|
||||
local druid = require("druid.druid")
|
||||
|
||||
@ -89,145 +229,59 @@ 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
|
||||
|
||||
function on_message(self, message_id, message, sender)
|
||||
self.druid:on_message(message_id, message, sender)
|
||||
end
|
||||
```
|
||||
|
||||
Read the [Basic Usage](wiki/basic_usage.md) to learn how to use **Druid**, how to create your own components and how to use widgets.
|
||||
- *final* is a **required** function for a correct Druid lifecycle
|
||||
- *on_input* is used in almost all Druid components
|
||||
- *update* in used in progress bar, scroll and timer base components
|
||||
- *on_message* is used for specific Druid events, like language change or layout change
|
||||
|
||||
|
||||
### API Documentation
|
||||
|
||||
Best start is from the [Quick API Reference](api/quick_api_reference.md)
|
||||
|
||||
With next quick links:
|
||||
|
||||
- [Druid Instance](api/druid_instance_api.md) - **Druid** instance returned from `druid.new(self)`
|
||||
- [Helper](api/druid_helper_api.md) - A lot of useful functions
|
||||
- [Widgets](wiki/widgets.md) - About widgets and how to use them
|
||||
|
||||
|
||||
## Druid Components
|
||||
|
||||
Here is full **Druid** components list.
|
||||
|
||||
### Components
|
||||
|
||||
| Name | Description | Example | <div style="width:200px">Preview</div> |
|
||||
|------|-------------|---------|---------|
|
||||
| **[Button](/api/components/base/button_api.md)** | Logic over GUI Node. Handle the user click interactions: click, long click, double click, etc. | [Button Example](https://insality.github.io/druid/?example=ui_example_basic_button) | <img src="media/preview/button.gif" width="200" height="100"> |
|
||||
| **[Text](/api/components/base/text_api.md)** | Logic over GUI Text. By default Text component fit the text inside text node size area with different adjust modes. | [Text Example](https://insality.github.io/druid/?example=ui_example_basic_text) | <img src="media/preview/text.gif" width="200" height="100"> |
|
||||
| **[Scroll](/api/components/base/scroll_api.md)** | Logic over two GUI Nodes: input and content. Provides basic behaviour for scrollable content. | [Scroll Example](https://insality.github.io/druid/?example=ui_example_basic_scroll) | <img src="media/preview/scroll.gif" width="200" height="100"> |
|
||||
| **[Blocker](/api/components/base/blocker_api.md)** | Logic over GUI Node. Don't pass any user input below node area size. | [Blocker Example](https://insality.github.io/druid/?example=ui_example_basic_blocker) | <img src="media/preview/blocker.gif" width="200" height="100"> |
|
||||
| **[Back Handler](/api/components/base/back_handler_api.md)** | Call callback on user "Back" action. It's a Android back button or keyboard backspace key | [Back Handler Example](https://insality.github.io/druid/?example=ui_example_basic_back_handler) | <img src="media/preview/back_handler.gif" width="200" height="100"> |
|
||||
| **[Static Grid](/api/components/base/static_grid_api.md)** | Logic over GUI Node. Component to manage node positions with all equal node sizes. | [Static Gid Example](https://insality.github.io/druid/?example=ui_example_basic_grid) | <img src="media/preview/static_grid.gif" width="200" height="100"> |
|
||||
| **[Hover](/api/components/base/hover_api.md)** | Logic over GUI Node. Handle hover action over node. For both: mobile touch and mouse cursor. | [Hover Example](https://insality.github.io/druid/?example=ui_example_basic_hover) | <img src="media/preview/hover.gif" width="200" height="100"> |
|
||||
| **[Swipe](/api/components/extended/swipe_api.md)** | Logic over GUI Node. Handle swipe gestures over node. | [Swipe Example](https://insality.github.io/druid/?example=ui_example_basic_swipe) | <img src="media/preview/swipe.gif" width="200" height="100"> |
|
||||
| **[Drag](/api/components/base/drag_api.md)** | Logic over GUI Node. Handle drag input actions. Can be useful to make on screen controlls. | [Drag Example](https://insality.github.io/druid/?example=ui_example_basic_drag) | <img src="media/preview/drag.gif" width="200" height="100"> |
|
||||
| **[Data List](/api/components/extended/data_list_api.md)** | Logic over Scroll and Grid components. Create only visible GUI nodes or components to make "infinity" scroll befaviour | [Data List Example](https://insality.github.io/druid/?example=ui_example_data_list_basic) | <img src="media/preview/data_list.gif" width="200" height="100"> |
|
||||
| **[Input](/api/components/extended/input_api.md)** | Logic over GUI Node and GUI Text (or Text component). Provides basic user text input. | [Input Example](https://insality.github.io/druid/?example=ui_example_basic_input) | <img src="media/preview/input.gif" width="200" height="100"> |
|
||||
| **[Lang text](/api/components/extended/lang_text_api.md)** | Logic over Text component to handle localization. Can be translated in real-time with `druid.on_language_change` | [Lang Text Example](https://insality.github.io/druid/?example=ui_example_window_language) | <img src="media/preview/lang_text.gif" width="200" height="100"> |
|
||||
| **[Progress](/api/components/extended/progress_api.md)** | Logic over GUI Node. Handle node size and scale to handle progress node size. | [Progress Example](https://insality.github.io/druid/?example=ui_example_basic_progress_bar) | <img src="media/preview/progress.gif" width="200" height="100"> |
|
||||
| **[Slider](/api/components/extended/slider_api.md)** | Logic over GUI Node. Handle draggable node with position restrictions. | [Slider Example](https://insality.github.io/druid/?example=ui_example_basic_slider) | <img src="media/preview/slider.gif" width="200" height="100"> |
|
||||
| **[Timer](/api/components/extended/timer_api.md)** | Logic over GUI Text. Handle basic timer functions. | [Timer Example](https://insality.github.io/druid/?example=ui_example_basic_timer) | <img src="media/preview/timer.gif" width="200" height="100"> |
|
||||
| **[Hotkey](/api/components/extended/hotkey_api.md)** | Allow to set callbacks for keyboard hotkeys with key modificators. | [Hotkey Example](https://insality.github.io/druid/?example=ui_example_basic_hotkey) | <img src="media/preview/hotkey.gif" width="200" height="100"> |
|
||||
| **[Layout](/api/components/extended/layout_api.md)** | Logic over GUI Node. Arrange nodes inside layout node with margin/paddings settings. | [Layout Example](https://insality.github.io/druid/?example=ui_example_layout_basic) | <img src="media/preview/layout.gif" width="200" height="100"> |
|
||||
| **[Rich Input](/api/components/custom/rich_input_api.md)** | Logic over GUI Node and GUI Text (or Text component). Provides rich text input with different styles and text formatting. | [Rich Input Example](https://insality.github.io/druid/?example=ui_example_basic_rich_input) | <img src="media/preview/rich_input.gif" width="200" height="100"> |
|
||||
| **[Rich Text](/api/components/custom/rich_text_api.md)** | Logic over GUI Text. Provides rich text formatting with different styles and text formatting. | [Rich Text Example](https://insality.github.io/druid/?example=ui_example_basic_rich_text) | <img src="media/preview/rich_text.gif" width="200" height="100"> |
|
||||
|
||||
|
||||
## Druid Events
|
||||
|
||||
All **Druid** components using [Defold Event](https://github.com/Insality/defold-event) for components callbacks. In component API ([button example](/api/components/base/button_api.md#fields)) pointed list of component events. You can manually subscribe to these events with the following API:
|
||||
|
||||
- **event:subscribe**(callback)
|
||||
|
||||
- **event:unsubscribe**(callback)
|
||||
|
||||
You can subscribe several callbacks to a single event.
|
||||
|
||||
Examples:
|
||||
|
||||
```lua
|
||||
button.on_click:subscribe(function(self, args)
|
||||
print("Button clicked!")
|
||||
end)
|
||||
|
||||
scroll.on_scroll:subscribe(function(self, position)
|
||||
print("Scroll scrolled!")
|
||||
end)
|
||||
|
||||
input.on_input_unselect:subscribe(function(self, text)
|
||||
print("User enter input:", text)
|
||||
end)
|
||||
```
|
||||
It is recommended to fully integrate all **Druid** lifecycles functions.
|
||||
|
||||
|
||||
## Details
|
||||
|
||||
- **Druid** processes input in a stack-based manner. The most recently created button will be checked first. Create your input GUI components from back to front.
|
||||
- Remember to include `return` in the `on_input` function: `return self.druid:on_input()`. This is necessary if you have multiple input sources (multiple Druid instances, other input systems, etc.).
|
||||
- Druid automatically calls `acquire_input_focus` if you have input components. Therefore, manual calling of `acquire_input_focus` is not required.
|
||||
- When deleting a **Druid** component node, make sure to remove it using `druid:remove(component)`.
|
||||
- Druid input goes as stack. Last created button will checked first. So create your GUI from back
|
||||
- Don't forget about `return` in `on_input`: `return self.druid:on_input()`. It is needed if you have more than 1 acquire inputs (several Druid, other input system, etc)
|
||||
- By default, Druid will automatically _acquire_input_focus_. So you don't need do it manually. But only if you have components which require _on_input_
|
||||
- If you want to delete a node which has a Druid component, don't forget to remove it via `druid:remove(component)`
|
||||
|
||||
[See full FAQ here](docs_md/FAQ.md)
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
Try the [**HTML5 version**](https://insality.github.io/druid/) of the **Druid** example app.
|
||||
See the [**example folder**](https://github.com/Insality/druid/tree/develop/example) for examples of how to use **Druid**
|
||||
|
||||
Each example page provides a direct link to the corresponding example code, making it easier for you to understand how to use **Druid**.
|
||||
|
||||
Or refer directly to the [**example folder**](https://github.com/Insality/druid/tree/develop/example) for code examples demonstrating how to use **Druid**.
|
||||
Try the [**HTML5 version**](https://insality.github.io/druid/druid/) of the **Druid** example app
|
||||
|
||||
|
||||
## Documentation
|
||||
|
||||
You can find the full **Druid** functions at [Quick API Reference](api/quick_api_reference.md)
|
||||
|
||||
To better understand **Druid**, read the following documentation:
|
||||
- [Druid components](docs_md/01-components.md)
|
||||
- [Create custom components](docs_md/02-creating_custom_components.md)
|
||||
- [See FAQ article](docs_md/FAQ.md)
|
||||
- [Druid styles](docs_md/03-styles.md)
|
||||
|
||||
- [How To GUI in Defold](https://forum.defold.com/t/how-to-gui-in-defold/73256)
|
||||
- [Widgets](wiki/widgets.md)
|
||||
- [Druid styles](wiki/styles.md)
|
||||
- [Advanced Setup](wiki/advanced-setup.md)
|
||||
- [Optimize Druid Size](wiki/optimize_druid_size.md)
|
||||
- [Creating Custom Components](wiki/creating_custom_components.md)
|
||||
- [Changelog](wiki/changelog.md)
|
||||
You can fund the full **Druid** documentation here:
|
||||
https://insality.github.io/druid/
|
||||
|
||||
|
||||
## Licenses
|
||||
## License
|
||||
|
||||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
||||
- Developed and supported by [Insality](https://github.com/Insality)
|
||||
- Original idea by [AGulev](https://github.com/AGulev)
|
||||
- Assets from [Kenney](http://www.kenney.nl/)
|
||||
|
||||
|
||||
## Issues and suggestions
|
||||
|
||||
If you have any issues, questions or suggestions please [create an issue](https://github.com/Insality/druid/issues)
|
||||
|
||||
|
||||
## History
|
||||
For a complete history of the development of **Druid**, please check the [changelog](wiki/changelog.md).
|
||||
|
||||
|
||||
## Contributors
|
||||
|
||||
Original Druid idea by [AGulev](https://github.com/AGulev)
|
||||
|
||||
Special thanks to all the contributors who have helped make **Druid** better!
|
||||
|
||||
<a href="https://github.com/Insality/druid/graphs/contributors">
|
||||
<img src="https://contributors-img.web.app/image?repo=insality/druid"/>
|
||||
</a>
|
||||
|
||||
Read the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information.
|
||||
|
||||
|
||||
## ❤️ Support project ❤️
|
||||
|
||||
Your donation helps me stay engaged in creating valuable projects for **Defold**. If you appreciate what I'm doing, please consider supporting me!
|
||||
|
||||
[](https://github.com/sponsors/insality) [](https://ko-fi.com/insality) [](https://www.buymeacoffee.com/insality)
|
||||
If you have any issues, questions or suggestions please [create an issue](https://github.com/Insality/druid/issues) or contact me: [insality@gmail.com](mailto:insality@gmail.com)
|
||||
|
@ -1,45 +0,0 @@
|
||||
# druid.back_handler API
|
||||
|
||||
> at /druid/base/back_handler.lua
|
||||
|
||||
Component to handle back button. It handles Android back button and Backspace key.
|
||||
|
||||
### Setup
|
||||
Create back handler component with druid: `druid:new_back_handler(callback)`
|
||||
|
||||
### Notes
|
||||
- Key triggers in `input.binding` should be setup for correct working
|
||||
- It uses a key_back and key_backspace action ids
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
|
||||
## Fields
|
||||
|
||||
- [on_back](#on_back)
|
||||
- [params](#params)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
back_handler:init([callback], [params])
|
||||
```
|
||||
|
||||
The Back Handler constructor
|
||||
|
||||
- **Parameters:**
|
||||
- `[callback]` *(function|nil)*: The callback to call when the back handler is triggered
|
||||
- `[params]` *(any)*: Custom args to pass in the callback
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="on_back"></a>
|
||||
- **on_back** (_event_): fun(self: druid.back_handler, params: any?) Trigger on back handler action
|
||||
|
||||
<a name="params"></a>
|
||||
- **params** (_any_): Custom args to pass in the callback
|
||||
|
@ -1,70 +0,0 @@
|
||||
# druid.blocker API
|
||||
|
||||
> at /druid/base/blocker.lua
|
||||
|
||||
Druid component for block input. Use it to block input in special zone.
|
||||
|
||||
### Setup
|
||||
Create blocker component with druid: `druid:new_blocker(node_name)`
|
||||
|
||||
### Notes
|
||||
- Blocker can be used to create safe zones, where you have big buttons
|
||||
- Blocker will capture all input events that hit the node, preventing them from reaching other components
|
||||
- Blocker works placed as usual component in stack, so any other component can be placed on top of it and will work as usual
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_enabled](#set_enabled)
|
||||
- [is_enabled](#is_enabled)
|
||||
|
||||
## Fields
|
||||
|
||||
- [node](#node)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
blocker:init(node)
|
||||
```
|
||||
|
||||
The Blocker constructor
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: The node to use as a blocker
|
||||
|
||||
### set_enabled
|
||||
|
||||
---
|
||||
```lua
|
||||
blocker:set_enabled(state)
|
||||
```
|
||||
|
||||
Set blocker enabled state
|
||||
|
||||
- **Parameters:**
|
||||
- `state` *(boolean)*: The new enabled state
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.blocker)*: The blocker instance
|
||||
|
||||
### is_enabled
|
||||
|
||||
---
|
||||
```lua
|
||||
blocker:is_enabled()
|
||||
```
|
||||
|
||||
Get blocker enabled state
|
||||
|
||||
- **Returns:**
|
||||
- `is_enabled` *(boolean)*: True if the blocker is enabled
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="node"></a>
|
||||
- **node** (_node_): The node that will block input
|
||||
|
@ -1,271 +0,0 @@
|
||||
# druid.button API
|
||||
|
||||
> at /druid/base/button.lua
|
||||
|
||||
Basic Druid input component. Handle input on node and provide different callbacks on touch events.
|
||||
|
||||
### Setup
|
||||
Create button with druid: `button = druid:new_button(node_name, callback, [params], [animation_node])`
|
||||
Where node_name is name of node from GUI scene. You can use `node_name` as input trigger zone and point another node for animation via `animation_node`
|
||||
|
||||
### Notes
|
||||
- Button callback have next params: (self, params, button_instance)
|
||||
- - **self** - Druid self context
|
||||
- - **params** - Additional params, specified on button creating
|
||||
- - **button_instance** - button itself
|
||||
- You can set _params_ on button callback on button creating: `druid:new_button("node_name", callback, params)`.
|
||||
- Button have several events like on_click, on_repeated_click, on_long_click, on_hold_click, on_double_click
|
||||
- Click event will not trigger if between pressed and released state cursor was outside of node zone
|
||||
- Button can have key trigger to use them by key: `button:set_key_trigger`
|
||||
-
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_animations_disabled](#set_animations_disabled)
|
||||
- [set_enabled](#set_enabled)
|
||||
- [is_enabled](#is_enabled)
|
||||
- [set_click_zone](#set_click_zone)
|
||||
- [set_key_trigger](#set_key_trigger)
|
||||
- [get_key_trigger](#get_key_trigger)
|
||||
- [set_check_function](#set_check_function)
|
||||
- [set_web_user_interaction](#set_web_user_interaction)
|
||||
|
||||
## Fields
|
||||
|
||||
- [on_click](#on_click)
|
||||
- [on_pressed](#on_pressed)
|
||||
- [on_repeated_click](#on_repeated_click)
|
||||
- [on_long_click](#on_long_click)
|
||||
- [on_double_click](#on_double_click)
|
||||
- [on_hold_callback](#on_hold_callback)
|
||||
- [on_click_outside](#on_click_outside)
|
||||
- [node](#node)
|
||||
- [node_id](#node_id)
|
||||
- [anim_node](#anim_node)
|
||||
- [params](#params)
|
||||
- [hover](#hover)
|
||||
- [click_zone](#click_zone)
|
||||
- [start_scale](#start_scale)
|
||||
- [start_pos](#start_pos)
|
||||
- [disabled](#disabled)
|
||||
- [key_trigger](#key_trigger)
|
||||
- [style](#style)
|
||||
- [druid](#druid)
|
||||
- [is_repeated_started](#is_repeated_started)
|
||||
- [last_pressed_time](#last_pressed_time)
|
||||
- [last_released_time](#last_released_time)
|
||||
- [click_in_row](#click_in_row)
|
||||
- [can_action](#can_action)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
button:init(node_or_node_id, [callback], [custom_args], [anim_node])
|
||||
```
|
||||
|
||||
The constructor for the button component
|
||||
|
||||
- **Parameters:**
|
||||
- `node_or_node_id` *(string|node)*: Node name or GUI Node itself
|
||||
- `[callback]` *(fun()|nil)*: Callback on button click
|
||||
- `[custom_args]` *(any)*: Custom args for any Button event, will be passed to callbacks
|
||||
- `[anim_node]` *(string|node|nil)*: Node to animate instead of trigger node, useful for animating small icons on big panels
|
||||
|
||||
### set_animations_disabled
|
||||
|
||||
---
|
||||
```lua
|
||||
button:set_animations_disabled()
|
||||
```
|
||||
|
||||
Remove default button style animations
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.button)*: The current button instance
|
||||
|
||||
### set_enabled
|
||||
|
||||
---
|
||||
```lua
|
||||
button:set_enabled([state])
|
||||
```
|
||||
|
||||
Set button enabled state.
|
||||
The style.on_set_enabled will be triggered.
|
||||
Disabled button is not clickable.
|
||||
|
||||
- **Parameters:**
|
||||
- `[state]` *(boolean|nil)*: Enabled state
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.button)*: The current button instance
|
||||
|
||||
### is_enabled
|
||||
|
||||
---
|
||||
```lua
|
||||
button:is_enabled()
|
||||
```
|
||||
|
||||
Get button enabled state.
|
||||
By default all Buttons are enabled on creating.
|
||||
|
||||
- **Returns:**
|
||||
- `is_enabled` *(boolean)*: True, if button is enabled now, False otherwise
|
||||
|
||||
### set_click_zone
|
||||
|
||||
---
|
||||
```lua
|
||||
button:set_click_zone([zone])
|
||||
```
|
||||
|
||||
Set additional button click area.
|
||||
Useful to restrict click outside of stencil node or scrollable content.
|
||||
If button node placed inside stencil node, it will be automatically set to this stencil node.
|
||||
|
||||
- **Parameters:**
|
||||
- `[zone]` *(string|node|nil)*: Gui node
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.button)*: The current button instance
|
||||
|
||||
### set_key_trigger
|
||||
|
||||
---
|
||||
```lua
|
||||
button:set_key_trigger(key)
|
||||
```
|
||||
|
||||
Set key name to trigger this button by keyboard.
|
||||
|
||||
- **Parameters:**
|
||||
- `key` *(string|hash)*: The action_id of the input key. Example: "key_space"
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.button)*: The current button instance
|
||||
|
||||
### get_key_trigger
|
||||
|
||||
---
|
||||
```lua
|
||||
button:get_key_trigger()
|
||||
```
|
||||
|
||||
Get current key name to trigger this button.
|
||||
|
||||
- **Returns:**
|
||||
- `key_trigger` *(hash)*: The action_id of the input key
|
||||
|
||||
### set_check_function
|
||||
|
||||
---
|
||||
```lua
|
||||
button:set_check_function([check_function], [failure_callback])
|
||||
```
|
||||
|
||||
Set function for additional check for button click availability.
|
||||
|
||||
- **Parameters:**
|
||||
- `[check_function]` *(function|nil)*: Should return true or false. If true - button can be pressed.
|
||||
- `[failure_callback]` *(function|nil)*: Function will be called on button click, if check function returns false
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.button)*: The current button instance
|
||||
|
||||
### set_web_user_interaction
|
||||
|
||||
---
|
||||
```lua
|
||||
button:set_web_user_interaction([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 doesn't call any events except on_click event.
|
||||
If the game is not HTML, html mode will be not enabled
|
||||
|
||||
- **Parameters:**
|
||||
- `[is_web_mode]` *(boolean|nil)*: If true - button will be called inside html5 callback
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.button)*: The current button instance
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="on_click"></a>
|
||||
- **on_click** (_event_): fun(self, custom_args, button_instance)
|
||||
|
||||
<a name="on_pressed"></a>
|
||||
- **on_pressed** (_event_): fun(self, custom_args, button_instance)
|
||||
|
||||
<a name="on_repeated_click"></a>
|
||||
- **on_repeated_click** (_event_): fun(self, custom_args, button_instance, click_count) Repeated click callback, while holding the button
|
||||
|
||||
<a name="on_long_click"></a>
|
||||
- **on_long_click** (_event_): fun(self, custom_args, button_instance, hold_time) Callback on long button tap
|
||||
|
||||
<a name="on_double_click"></a>
|
||||
- **on_double_click** (_event_): fun(self, custom_args, button_instance, click_amount) Different callback, if tap button 2+ in row
|
||||
|
||||
<a name="on_hold_callback"></a>
|
||||
- **on_hold_callback** (_event_): fun(self, custom_args, button_instance, press_time) Hold callback, before long_click trigger
|
||||
|
||||
<a name="on_click_outside"></a>
|
||||
- **on_click_outside** (_event_): fun(self, custom_args, button_instance)
|
||||
|
||||
<a name="node"></a>
|
||||
- **node** (_node_): Clickable node
|
||||
|
||||
<a name="node_id"></a>
|
||||
- **node_id** (_hash_): Node id
|
||||
|
||||
<a name="anim_node"></a>
|
||||
- **anim_node** (_node_): Animation node. In default case equals to clickable node
|
||||
|
||||
<a name="params"></a>
|
||||
- **params** (_any_): Custom arguments for any Button event
|
||||
|
||||
<a name="hover"></a>
|
||||
- **hover** (_druid.hover_): Hover component for this button
|
||||
|
||||
<a name="click_zone"></a>
|
||||
- **click_zone** (_node_): Click zone node to restrict click area
|
||||
|
||||
<a name="start_scale"></a>
|
||||
- **start_scale** (_vector3_): Start scale of the button
|
||||
|
||||
<a name="start_pos"></a>
|
||||
- **start_pos** (_vector3_): Start position of the button
|
||||
|
||||
<a name="disabled"></a>
|
||||
- **disabled** (_boolean_): Is button disabled
|
||||
|
||||
<a name="key_trigger"></a>
|
||||
- **key_trigger** (_hash_): Key trigger for this button
|
||||
|
||||
<a name="style"></a>
|
||||
- **style** (_table_): Style for this button
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
||||
<a name="is_repeated_started"></a>
|
||||
- **is_repeated_started** (_boolean_)
|
||||
|
||||
<a name="last_pressed_time"></a>
|
||||
- **last_pressed_time** (_integer_)
|
||||
|
||||
<a name="last_released_time"></a>
|
||||
- **last_released_time** (_integer_)
|
||||
|
||||
<a name="click_in_row"></a>
|
||||
- **click_in_row** (_integer_)
|
||||
|
||||
<a name="can_action"></a>
|
||||
- **can_action** (_boolean_): Can't interact, if touch outside of button
|
||||
|
@ -1,445 +0,0 @@
|
||||
# druid.component API
|
||||
|
||||
> at /druid/component.lua
|
||||
|
||||
## Functions
|
||||
|
||||
- [create](#create)
|
||||
- [create_widget](#create_widget)
|
||||
|
||||
- [init](#init)
|
||||
- [update](#update)
|
||||
- [on_remove](#on_remove)
|
||||
- [on_input](#on_input)
|
||||
- [on_input_interrupt](#on_input_interrupt)
|
||||
- [on_message](#on_message)
|
||||
- [on_late_init](#on_late_init)
|
||||
- [on_focus_lost](#on_focus_lost)
|
||||
- [on_focus_gained](#on_focus_gained)
|
||||
- [on_style_change](#on_style_change)
|
||||
- [on_layout_change](#on_layout_change)
|
||||
- [on_window_resized](#on_window_resized)
|
||||
- [on_language_change](#on_language_change)
|
||||
- [set_style](#set_style)
|
||||
- [set_template](#set_template)
|
||||
- [get_template](#get_template)
|
||||
- [set_nodes](#set_nodes)
|
||||
- [get_context](#get_context)
|
||||
- [get_node](#get_node)
|
||||
- [get_druid](#get_druid)
|
||||
- [get_name](#get_name)
|
||||
- [get_parent_name](#get_parent_name)
|
||||
- [get_input_priority](#get_input_priority)
|
||||
- [set_input_priority](#set_input_priority)
|
||||
- [reset_input_priority](#reset_input_priority)
|
||||
- [get_uid](#get_uid)
|
||||
- [set_input_enabled](#set_input_enabled)
|
||||
- [get_input_enabled](#get_input_enabled)
|
||||
- [get_parent_component](#get_parent_component)
|
||||
- [get_nodes](#get_nodes)
|
||||
- [get_childrens](#get_childrens)
|
||||
|
||||
## Fields
|
||||
|
||||
- [druid](#druid)
|
||||
|
||||
|
||||
|
||||
### create
|
||||
|
||||
---
|
||||
```lua
|
||||
component.create([name], [input_priority])
|
||||
```
|
||||
|
||||
Сreate a new component class, which will inherit from the base Druid component.
|
||||
|
||||
- **Parameters:**
|
||||
- `[name]` *(string|nil)*: The name of the component
|
||||
- `[input_priority]` *(number|nil)*: The input priority. The bigger number processed first. Default value: 10
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.component)*:
|
||||
|
||||
### create_widget
|
||||
|
||||
---
|
||||
```lua
|
||||
component.create_widget(self, widget_class, context)
|
||||
```
|
||||
|
||||
Create the Druid component instance
|
||||
|
||||
- **Parameters:**
|
||||
- `self` *(druid.instance)*: The Druid Factory used to create components
|
||||
- `widget_class` *(druid.widget)*:
|
||||
- `context` *(table)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget)*:
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
component:init()
|
||||
```
|
||||
|
||||
Called when component is created
|
||||
|
||||
### update
|
||||
|
||||
---
|
||||
```lua
|
||||
component:update()
|
||||
```
|
||||
|
||||
Called every frame
|
||||
|
||||
### on_remove
|
||||
|
||||
---
|
||||
```lua
|
||||
component:on_remove()
|
||||
```
|
||||
|
||||
Called when component is removed
|
||||
|
||||
### on_input
|
||||
|
||||
---
|
||||
```lua
|
||||
component:on_input()
|
||||
```
|
||||
|
||||
Called when input event is triggered
|
||||
|
||||
### on_input_interrupt
|
||||
|
||||
---
|
||||
```lua
|
||||
component:on_input_interrupt()
|
||||
```
|
||||
|
||||
Called when input event is consumed before
|
||||
|
||||
### on_message
|
||||
|
||||
---
|
||||
```lua
|
||||
component:on_message()
|
||||
```
|
||||
|
||||
Called when message is received
|
||||
|
||||
### on_late_init
|
||||
|
||||
---
|
||||
```lua
|
||||
component:on_late_init()
|
||||
```
|
||||
|
||||
Called before update once time after GUI init
|
||||
|
||||
### on_focus_lost
|
||||
|
||||
---
|
||||
```lua
|
||||
component:on_focus_lost()
|
||||
```
|
||||
|
||||
Called when app lost focus
|
||||
|
||||
### on_focus_gained
|
||||
|
||||
---
|
||||
```lua
|
||||
component:on_focus_gained()
|
||||
```
|
||||
|
||||
Called when app gained focus
|
||||
|
||||
### on_style_change
|
||||
|
||||
---
|
||||
```lua
|
||||
component:on_style_change()
|
||||
```
|
||||
|
||||
Called when style is changed
|
||||
|
||||
### on_layout_change
|
||||
|
||||
---
|
||||
```lua
|
||||
component:on_layout_change()
|
||||
```
|
||||
|
||||
Called when GUI layout is changed
|
||||
|
||||
### on_window_resized
|
||||
|
||||
---
|
||||
```lua
|
||||
component:on_window_resized()
|
||||
```
|
||||
|
||||
Called when window is resized
|
||||
|
||||
### on_language_change
|
||||
|
||||
---
|
||||
```lua
|
||||
component:on_language_change()
|
||||
```
|
||||
|
||||
Called when language is changed
|
||||
|
||||
### set_style
|
||||
|
||||
---
|
||||
```lua
|
||||
component:set_style([druid_style])
|
||||
```
|
||||
|
||||
Set component style. Pass nil to clear style
|
||||
|
||||
- **Parameters:**
|
||||
- `[druid_style]` *(table|nil)*:
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(<T>)*: The component itself for chaining
|
||||
|
||||
### set_template
|
||||
|
||||
---
|
||||
```lua
|
||||
component:set_template([template])
|
||||
```
|
||||
|
||||
Set component template name. Pass nil to clear template.
|
||||
This template id used to access nodes inside the template on GUI scene.
|
||||
Parent template will be added automatically if exist.
|
||||
|
||||
- **Parameters:**
|
||||
- `[template]` *(string|nil)*:
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(<T>)*: The component itself for chaining
|
||||
|
||||
### get_template
|
||||
|
||||
---
|
||||
```lua
|
||||
component:get_template()
|
||||
```
|
||||
|
||||
Get full template name.
|
||||
|
||||
- **Returns:**
|
||||
- `` *(string)*:
|
||||
|
||||
### set_nodes
|
||||
|
||||
---
|
||||
```lua
|
||||
component:set_nodes([nodes])
|
||||
```
|
||||
|
||||
Set current component nodes, returned from `gui.clone_tree` function.
|
||||
|
||||
- **Parameters:**
|
||||
- `[nodes]` *(string|node|table<hash, node>|nil)*: The nodes table from gui.clone_tree or prefab node to use for clone or node id to clone
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.component)*:
|
||||
|
||||
### get_context
|
||||
|
||||
---
|
||||
```lua
|
||||
component:get_context()
|
||||
```
|
||||
|
||||
Return current component context
|
||||
|
||||
- **Returns:**
|
||||
- `context` *(any)*: Usually it's self of script but can be any other Druid component
|
||||
|
||||
### get_node
|
||||
|
||||
---
|
||||
```lua
|
||||
component:get_node(node_id)
|
||||
```
|
||||
|
||||
Get component node by node_id. Respect to current template and nodes.
|
||||
|
||||
- **Parameters:**
|
||||
- `node_id` *(string|node)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(node)*:
|
||||
|
||||
### get_druid
|
||||
|
||||
---
|
||||
```lua
|
||||
component:get_druid([template], [nodes])
|
||||
```
|
||||
|
||||
Get Druid instance for inner component creation.
|
||||
|
||||
- **Parameters:**
|
||||
- `[template]` *(string|nil)*:
|
||||
- `[nodes]` *(string|node|table<hash, node>|nil)*: The nodes table from gui.clone_tree or prefab node to use for clone or node id to clone
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.instance)*:
|
||||
|
||||
### get_name
|
||||
|
||||
---
|
||||
```lua
|
||||
component:get_name()
|
||||
```
|
||||
|
||||
Get component name
|
||||
|
||||
- **Returns:**
|
||||
- `name` *(string)*: The component name + uid
|
||||
|
||||
### get_parent_name
|
||||
|
||||
---
|
||||
```lua
|
||||
component:get_parent_name()
|
||||
```
|
||||
|
||||
Get parent component name
|
||||
|
||||
- **Returns:**
|
||||
- `parent_name` *(string|nil)*: The parent component name if exist or nil
|
||||
|
||||
### get_input_priority
|
||||
|
||||
---
|
||||
```lua
|
||||
component:get_input_priority()
|
||||
```
|
||||
|
||||
Get component input priority, the bigger number processed first. Default value: 10
|
||||
|
||||
- **Returns:**
|
||||
- `` *(number)*:
|
||||
|
||||
### set_input_priority
|
||||
|
||||
---
|
||||
```lua
|
||||
component:set_input_priority(value, [is_temporary])
|
||||
```
|
||||
|
||||
Set component input priority, the bigger number processed first. Default value: 10
|
||||
|
||||
- **Parameters:**
|
||||
- `value` *(number)*:
|
||||
- `[is_temporary]` *(boolean|nil)*: If true, the reset input priority will return to previous value
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.component)*: The component itself for chaining
|
||||
|
||||
### reset_input_priority
|
||||
|
||||
---
|
||||
```lua
|
||||
component:reset_input_priority()
|
||||
```
|
||||
|
||||
Reset component input priority to it's default value, that was set in `create` function or `set_input_priority`
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.component)*: The component itself for chaining
|
||||
|
||||
### get_uid
|
||||
|
||||
---
|
||||
```lua
|
||||
component:get_uid()
|
||||
```
|
||||
|
||||
Get component UID, unique identifier created in component creation order.
|
||||
|
||||
- **Returns:**
|
||||
- `uid` *(number)*: The component uid
|
||||
|
||||
### set_input_enabled
|
||||
|
||||
---
|
||||
```lua
|
||||
component:set_input_enabled(state)
|
||||
```
|
||||
|
||||
Set component input state. By default it's enabled.
|
||||
If input is disabled, the component will not receive input events.
|
||||
Recursive for all children components.
|
||||
|
||||
- **Parameters:**
|
||||
- `state` *(boolean)*:
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.component)*: The component itself for chaining
|
||||
|
||||
### get_input_enabled
|
||||
|
||||
---
|
||||
```lua
|
||||
component:get_input_enabled()
|
||||
```
|
||||
|
||||
Get component input state. By default it's enabled. Can be disabled by `set_input_enabled` function.
|
||||
|
||||
- **Returns:**
|
||||
- `` *(boolean)*:
|
||||
|
||||
### get_parent_component
|
||||
|
||||
---
|
||||
```lua
|
||||
component:get_parent_component()
|
||||
```
|
||||
|
||||
Get parent component
|
||||
|
||||
- **Returns:**
|
||||
- `parent_component` *(druid.component|nil)*: The parent component if exist or nil
|
||||
|
||||
### get_nodes
|
||||
|
||||
---
|
||||
```lua
|
||||
component:get_nodes()
|
||||
```
|
||||
|
||||
Get current component nodes
|
||||
|
||||
- **Returns:**
|
||||
- `` *(table<hash, node>|nil)*:
|
||||
|
||||
### get_childrens
|
||||
|
||||
---
|
||||
```lua
|
||||
component:get_childrens()
|
||||
```
|
||||
|
||||
Return all children components, recursive
|
||||
|
||||
- **Returns:**
|
||||
- `Array` *(table)*: of childrens if the Druid component instance
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): Druid instance to create inner components
|
||||
|
@ -1,176 +0,0 @@
|
||||
# druid.drag API
|
||||
|
||||
> at /druid/base/drag.lua
|
||||
|
||||
A component that allows you to subscribe to drag events over a node
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_drag_cursors](#set_drag_cursors)
|
||||
- [set_click_zone](#set_click_zone)
|
||||
- [set_enabled](#set_enabled)
|
||||
- [is_enabled](#is_enabled)
|
||||
|
||||
## Fields
|
||||
|
||||
- [node](#node)
|
||||
- [on_touch_start](#on_touch_start)
|
||||
- [on_touch_end](#on_touch_end)
|
||||
- [on_drag_start](#on_drag_start)
|
||||
- [on_drag](#on_drag)
|
||||
- [on_drag_end](#on_drag_end)
|
||||
- [style](#style)
|
||||
- [click_zone](#click_zone)
|
||||
- [is_touch](#is_touch)
|
||||
- [is_drag](#is_drag)
|
||||
- [can_x](#can_x)
|
||||
- [can_y](#can_y)
|
||||
- [dx](#dx)
|
||||
- [dy](#dy)
|
||||
- [touch_id](#touch_id)
|
||||
- [x](#x)
|
||||
- [y](#y)
|
||||
- [screen_x](#screen_x)
|
||||
- [screen_y](#screen_y)
|
||||
- [touch_start_pos](#touch_start_pos)
|
||||
- [druid](#druid)
|
||||
- [hover](#hover)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
drag:init(node_or_node_id, [on_drag_callback])
|
||||
```
|
||||
|
||||
The constructor for Drag component
|
||||
|
||||
- **Parameters:**
|
||||
- `node_or_node_id` *(string|node)*: The node to subscribe to drag events over
|
||||
- `[on_drag_callback]` *(fun(self: any, touch: any))*: The callback to call when a drag occurs
|
||||
|
||||
### set_drag_cursors
|
||||
|
||||
---
|
||||
```lua
|
||||
drag:set_drag_cursors(is_enabled)
|
||||
```
|
||||
|
||||
Set Drag component enabled state.
|
||||
|
||||
- **Parameters:**
|
||||
- `is_enabled` *(boolean)*: True if Drag component is enabled
|
||||
|
||||
### set_click_zone
|
||||
|
||||
---
|
||||
```lua
|
||||
drag:set_click_zone([node])
|
||||
```
|
||||
|
||||
Set Drag click zone
|
||||
|
||||
- **Parameters:**
|
||||
- `[node]` *(string|node|nil)*: Node or node id
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.drag)*: Current instance
|
||||
|
||||
### set_enabled
|
||||
|
||||
---
|
||||
```lua
|
||||
drag:set_enabled(is_enabled)
|
||||
```
|
||||
|
||||
Set Drag component enabled state.
|
||||
|
||||
- **Parameters:**
|
||||
- `is_enabled` *(boolean)*:
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.drag)*: Current instance
|
||||
|
||||
### is_enabled
|
||||
|
||||
---
|
||||
```lua
|
||||
drag:is_enabled()
|
||||
```
|
||||
|
||||
Check if Drag component is capture input
|
||||
|
||||
- **Returns:**
|
||||
- `is_enabled` *(boolean)*: True if Drag component is enabled
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="node"></a>
|
||||
- **node** (_node_): The node to subscribe to drag events over
|
||||
|
||||
<a name="on_touch_start"></a>
|
||||
- **on_touch_start** (_event_): fun(self, touch) The event triggered when a touch starts
|
||||
|
||||
<a name="on_touch_end"></a>
|
||||
- **on_touch_end** (_event_): fun(self, touch) The event triggered when a touch ends
|
||||
|
||||
<a name="on_drag_start"></a>
|
||||
- **on_drag_start** (_event_): fun(self, touch) The event triggered when a drag starts
|
||||
|
||||
<a name="on_drag"></a>
|
||||
- **on_drag** (_event_): fun(self, touch) The event triggered when a drag occurs
|
||||
|
||||
<a name="on_drag_end"></a>
|
||||
- **on_drag_end** (_event_): fun(self, touch) The event triggered when a drag ends
|
||||
|
||||
<a name="style"></a>
|
||||
- **style** (_druid.drag.style_): The style of Drag component
|
||||
|
||||
<a name="click_zone"></a>
|
||||
- **click_zone** (_node_): The click zone of Drag component
|
||||
|
||||
<a name="is_touch"></a>
|
||||
- **is_touch** (_boolean_): True if a touch is active
|
||||
|
||||
<a name="is_drag"></a>
|
||||
- **is_drag** (_boolean_): True if a drag is active
|
||||
|
||||
<a name="can_x"></a>
|
||||
- **can_x** (_boolean_): True if Drag can move horizontally
|
||||
|
||||
<a name="can_y"></a>
|
||||
- **can_y** (_boolean_): True if Drag can move vertically
|
||||
|
||||
<a name="dx"></a>
|
||||
- **dx** (_number_): The horizontal drag distance
|
||||
|
||||
<a name="dy"></a>
|
||||
- **dy** (_number_): The vertical drag distance
|
||||
|
||||
<a name="touch_id"></a>
|
||||
- **touch_id** (_number_): The touch id
|
||||
|
||||
<a name="x"></a>
|
||||
- **x** (_number_): The current x position
|
||||
|
||||
<a name="y"></a>
|
||||
- **y** (_number_): The current y position
|
||||
|
||||
<a name="screen_x"></a>
|
||||
- **screen_x** (_number_): The current screen x position
|
||||
|
||||
<a name="screen_y"></a>
|
||||
- **screen_y** (_number_): The current screen y position
|
||||
|
||||
<a name="touch_start_pos"></a>
|
||||
- **touch_start_pos** (_vector3_): The touch start position
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
||||
<a name="hover"></a>
|
||||
- **hover** (_druid.hover_): The component for handling hover events on a node
|
||||
|
@ -1,144 +0,0 @@
|
||||
# druid.hover API
|
||||
|
||||
> at /druid/base/hover.lua
|
||||
|
||||
The component for handling hover events on a node
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_hover](#set_hover)
|
||||
- [is_hovered](#is_hovered)
|
||||
- [set_mouse_hover](#set_mouse_hover)
|
||||
- [is_mouse_hovered](#is_mouse_hovered)
|
||||
- [set_click_zone](#set_click_zone)
|
||||
- [set_enabled](#set_enabled)
|
||||
- [is_enabled](#is_enabled)
|
||||
|
||||
## Fields
|
||||
|
||||
- [node](#node)
|
||||
- [on_hover](#on_hover)
|
||||
- [on_mouse_hover](#on_mouse_hover)
|
||||
- [style](#style)
|
||||
- [click_zone](#click_zone)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
hover:init(node, on_hover_callback, on_mouse_hover)
|
||||
```
|
||||
|
||||
The constructor for the hover component
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*: Gui node
|
||||
- `on_hover_callback` *(function)*: Hover callback
|
||||
- `on_mouse_hover` *(function)*: On mouse hover callback
|
||||
|
||||
### set_hover
|
||||
|
||||
---
|
||||
```lua
|
||||
hover:set_hover([state])
|
||||
```
|
||||
|
||||
Set hover state
|
||||
|
||||
- **Parameters:**
|
||||
- `[state]` *(boolean|nil)*: The hover state
|
||||
|
||||
### is_hovered
|
||||
|
||||
---
|
||||
```lua
|
||||
hover:is_hovered()
|
||||
```
|
||||
|
||||
Return current hover state. True if touch action was on the node at current time
|
||||
|
||||
- **Returns:**
|
||||
- `is_hovered` *(boolean)*: The current hovered state
|
||||
|
||||
### set_mouse_hover
|
||||
|
||||
---
|
||||
```lua
|
||||
hover:set_mouse_hover([state])
|
||||
```
|
||||
|
||||
Set mouse hover state
|
||||
|
||||
- **Parameters:**
|
||||
- `[state]` *(boolean|nil)*: The mouse hover state
|
||||
|
||||
### is_mouse_hovered
|
||||
|
||||
---
|
||||
```lua
|
||||
hover:is_mouse_hovered()
|
||||
```
|
||||
|
||||
Return current hover state. True if nil action_id (usually desktop mouse) was on the node at current time
|
||||
|
||||
- **Returns:**
|
||||
- `The` *(boolean)*: current hovered state
|
||||
|
||||
### set_click_zone
|
||||
|
||||
---
|
||||
```lua
|
||||
hover:set_click_zone([zone])
|
||||
```
|
||||
|
||||
Strict hover click area. Useful for no click events outside stencil node
|
||||
|
||||
- **Parameters:**
|
||||
- `[zone]` *(string|node|nil)*: Gui node
|
||||
|
||||
### set_enabled
|
||||
|
||||
---
|
||||
```lua
|
||||
hover:set_enabled([state])
|
||||
```
|
||||
|
||||
Set enable state of hover component.
|
||||
If hover is not enabled, it will not generate
|
||||
any hover events
|
||||
|
||||
- **Parameters:**
|
||||
- `[state]` *(boolean|nil)*: The hover enabled state
|
||||
|
||||
### is_enabled
|
||||
|
||||
---
|
||||
```lua
|
||||
hover:is_enabled()
|
||||
```
|
||||
|
||||
Return current hover enabled state
|
||||
|
||||
- **Returns:**
|
||||
- `The` *(boolean)*: hover enabled state
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="node"></a>
|
||||
- **node** (_node_): Gui node
|
||||
|
||||
<a name="on_hover"></a>
|
||||
- **on_hover** (_event_): fun(self: druid.hover, is_hover: boolean) Hover event
|
||||
|
||||
<a name="on_mouse_hover"></a>
|
||||
- **on_mouse_hover** (_event_): fun(self: druid.hover, is_hover: boolean) Mouse hover event
|
||||
|
||||
<a name="style"></a>
|
||||
- **style** (_druid.hover.style_): Style of the hover component
|
||||
|
||||
<a name="click_zone"></a>
|
||||
- **click_zone** (_node_): Click zone of the hover component
|
||||
|
@ -1,395 +0,0 @@
|
||||
# druid.scroll API
|
||||
|
||||
> at /druid/base/scroll.lua
|
||||
|
||||
Basic Druid scroll component. Handles all scrolling behavior in Druid GUI.
|
||||
|
||||
### Setup
|
||||
Create scroll component with druid: `druid:new_scroll(view_node, content_node)`
|
||||
|
||||
### Notes
|
||||
- View_node is the static part that captures user input and recognizes scrolling touches
|
||||
- Content_node is the dynamic part that will change position according to the scroll system
|
||||
- Initial scroll size will be equal to content_node size
|
||||
- The initial view box will be equal to view_node size
|
||||
- Scroll by default style has inertia and extra size for stretching effect
|
||||
- You can setup "points of interest" to make scroll always center on closest point
|
||||
- Scroll events:
|
||||
- - on_scroll(self, position): On scroll move callback
|
||||
- - on_scroll_to(self, position, is_instant): On scroll_to function callback
|
||||
- - on_point_scroll(self, item_index, position): On scroll_to_index function callback
|
||||
- Multitouch is required for scroll. Scroll correctly handles touch_id swap while dragging
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [scroll_to](#scroll_to)
|
||||
- [scroll_to_index](#scroll_to_index)
|
||||
- [scroll_to_percent](#scroll_to_percent)
|
||||
- [get_percent](#get_percent)
|
||||
- [set_size](#set_size)
|
||||
- [set_view_size](#set_view_size)
|
||||
- [update_view_size](#update_view_size)
|
||||
- [set_inert](#set_inert)
|
||||
- [is_inert](#is_inert)
|
||||
- [set_extra_stretch_size](#set_extra_stretch_size)
|
||||
- [get_scroll_size](#get_scroll_size)
|
||||
- [set_points](#set_points)
|
||||
- [set_horizontal_scroll](#set_horizontal_scroll)
|
||||
- [set_vertical_scroll](#set_vertical_scroll)
|
||||
- [is_node_in_view](#is_node_in_view)
|
||||
- [bind_grid](#bind_grid)
|
||||
- [set_click_zone](#set_click_zone)
|
||||
|
||||
## Fields
|
||||
|
||||
- [node](#node)
|
||||
- [click_zone](#click_zone)
|
||||
- [on_scroll](#on_scroll)
|
||||
- [on_scroll_to](#on_scroll_to)
|
||||
- [on_point_scroll](#on_point_scroll)
|
||||
- [view_node](#view_node)
|
||||
- [view_border](#view_border)
|
||||
- [content_node](#content_node)
|
||||
- [view_size](#view_size)
|
||||
- [position](#position)
|
||||
- [target_position](#target_position)
|
||||
- [available_pos](#available_pos)
|
||||
- [available_size](#available_size)
|
||||
- [drag](#drag)
|
||||
- [selected](#selected)
|
||||
- [is_animate](#is_animate)
|
||||
- [style](#style)
|
||||
- [druid](#druid)
|
||||
- [hover](#hover)
|
||||
- [points](#points)
|
||||
- [available_pos_extra](#available_pos_extra)
|
||||
- [available_size_extra](#available_size_extra)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:init(view_node, content_node)
|
||||
```
|
||||
|
||||
The Scroll constructor
|
||||
|
||||
- **Parameters:**
|
||||
- `view_node` *(string|node)*: GUI view scroll node - the static part that captures user input
|
||||
- `content_node` *(string|node)*: GUI content scroll node - the dynamic part that will change position
|
||||
|
||||
### scroll_to
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:scroll_to(point, [is_instant])
|
||||
```
|
||||
|
||||
Start scroll to target point.
|
||||
|
||||
- **Parameters:**
|
||||
- `point` *(vector3)*: Target point
|
||||
- `[is_instant]` *(boolean|nil)*: Instant scroll flag
|
||||
|
||||
### scroll_to_index
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:scroll_to_index(index, [skip_cb])
|
||||
```
|
||||
|
||||
Scroll to item in scroll by point index.
|
||||
|
||||
- **Parameters:**
|
||||
- `index` *(number)*: Point index
|
||||
- `[skip_cb]` *(boolean|nil)*: If true, skip the point callback
|
||||
|
||||
### scroll_to_percent
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:scroll_to_percent(percent, [is_instant])
|
||||
```
|
||||
|
||||
Start scroll to target scroll percent
|
||||
|
||||
- **Parameters:**
|
||||
- `percent` *(vector3)*: target percent
|
||||
- `[is_instant]` *(boolean|nil)*: instant scroll flag
|
||||
|
||||
### get_percent
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:get_percent()
|
||||
```
|
||||
|
||||
Return current scroll progress status.
|
||||
Values will be in [0..1] interval
|
||||
|
||||
- **Returns:**
|
||||
- `New` *(vector3)*: vector with scroll progress values
|
||||
|
||||
### set_size
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:set_size(size, [offset])
|
||||
```
|
||||
|
||||
Set scroll content size.
|
||||
It will change content gui node size
|
||||
|
||||
- **Parameters:**
|
||||
- `size` *(vector3)*: The new size for content node
|
||||
- `[offset]` *(vector3|nil)*: Offset value to set, where content is starts
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.scroll)*: Current scroll instance
|
||||
|
||||
### set_view_size
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:set_view_size(size)
|
||||
```
|
||||
|
||||
Set new scroll view size in case the node size was changed.
|
||||
|
||||
- **Parameters:**
|
||||
- `size` *(vector3)*: The new size for view node
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.scroll)*: Current scroll instance
|
||||
|
||||
### update_view_size
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:update_view_size()
|
||||
```
|
||||
|
||||
Refresh scroll view size, used when view node size is changed
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.scroll)*: Current scroll instance
|
||||
|
||||
### set_inert
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:set_inert(state)
|
||||
```
|
||||
|
||||
Enable or disable scroll inert
|
||||
If disabled, scroll through points (if exist)
|
||||
If no points, just simple drag without inertion
|
||||
|
||||
- **Parameters:**
|
||||
- `state` *(boolean)*: Inert scroll state
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.scroll)*: Current scroll instance
|
||||
|
||||
### is_inert
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:is_inert()
|
||||
```
|
||||
|
||||
Return if scroll have inertion
|
||||
|
||||
- **Returns:**
|
||||
- `is_inert` *(boolean)*: If scroll have inertion
|
||||
|
||||
### set_extra_stretch_size
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:set_extra_stretch_size([stretch_size])
|
||||
```
|
||||
|
||||
Set extra size for scroll stretching
|
||||
Set 0 to disable stretching effect
|
||||
|
||||
- **Parameters:**
|
||||
- `[stretch_size]` *(number|nil)*: Size in pixels of additional scroll area
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.scroll)*: Current scroll instance
|
||||
|
||||
### get_scroll_size
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:get_scroll_size()
|
||||
```
|
||||
|
||||
Return vector of scroll size with width and height.
|
||||
|
||||
- **Returns:**
|
||||
- `Available` *(vector3)*: scroll size
|
||||
|
||||
### set_points
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:set_points(points)
|
||||
```
|
||||
|
||||
Set points of interest.
|
||||
Scroll will always centered on closer points
|
||||
|
||||
- **Parameters:**
|
||||
- `points` *(table)*: Array of vector3 points
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.scroll)*: Current scroll instance
|
||||
|
||||
### set_horizontal_scroll
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:set_horizontal_scroll(state)
|
||||
```
|
||||
|
||||
Lock or unlock horizontal scroll
|
||||
|
||||
- **Parameters:**
|
||||
- `state` *(boolean)*: True, if horizontal scroll is enabled
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.scroll)*: Current scroll instance
|
||||
|
||||
### set_vertical_scroll
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:set_vertical_scroll(state)
|
||||
```
|
||||
|
||||
Lock or unlock vertical scroll
|
||||
|
||||
- **Parameters:**
|
||||
- `state` *(boolean)*: True, if vertical scroll is enabled
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.scroll)*: Current scroll instance
|
||||
|
||||
### is_node_in_view
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:is_node_in_view(node)
|
||||
```
|
||||
|
||||
Check node if it visible now on scroll.
|
||||
Extra border is not affected. Return true for elements in extra scroll zone
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*: The node to check
|
||||
|
||||
- **Returns:**
|
||||
- `True` *(boolean)*: if node in visible scroll area
|
||||
|
||||
### bind_grid
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:bind_grid([grid])
|
||||
```
|
||||
|
||||
Bind the grid component (Static or Dynamic) to recalculate
|
||||
scroll size on grid changes
|
||||
|
||||
- **Parameters:**
|
||||
- `[grid]` *(druid.grid|nil)*: Druid grid component
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.scroll)*: Current scroll instance
|
||||
|
||||
### set_click_zone
|
||||
|
||||
---
|
||||
```lua
|
||||
scroll:set_click_zone(node)
|
||||
```
|
||||
|
||||
Strict drag scroll area. Useful for
|
||||
restrict events outside stencil node
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: Gui node
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="node"></a>
|
||||
- **node** (_node_): The root node
|
||||
|
||||
<a name="click_zone"></a>
|
||||
- **click_zone** (_node_): Optional click zone to restrict scroll area
|
||||
|
||||
<a name="on_scroll"></a>
|
||||
- **on_scroll** (_event_): fun(self: druid.scroll, position: vector3) Triggered on scroll move
|
||||
|
||||
<a name="on_scroll_to"></a>
|
||||
- **on_scroll_to** (_event_): fun(self: druid.scroll, target: vector3, is_instant: boolean) Triggered on scroll_to
|
||||
|
||||
<a name="on_point_scroll"></a>
|
||||
- **on_point_scroll** (_event_): fun(self: druid.scroll, index: number, point: vector3) Triggered on scroll_to_index
|
||||
|
||||
<a name="view_node"></a>
|
||||
- **view_node** (_node_): The scroll view node (static part)
|
||||
|
||||
<a name="view_border"></a>
|
||||
- **view_border** (_vector4_): The scroll view borders
|
||||
|
||||
<a name="content_node"></a>
|
||||
- **content_node** (_node_): The scroll content node (moving part)
|
||||
|
||||
<a name="view_size"></a>
|
||||
- **view_size** (_vector3_): Size of the view node
|
||||
|
||||
<a name="position"></a>
|
||||
- **position** (_vector3_): Current scroll position
|
||||
|
||||
<a name="target_position"></a>
|
||||
- **target_position** (_vector3_): Target scroll position for animations
|
||||
|
||||
<a name="available_pos"></a>
|
||||
- **available_pos** (_vector4_): Available content position (min_x, max_y, max_x, min_y)
|
||||
|
||||
<a name="available_size"></a>
|
||||
- **available_size** (_vector3_): Size of available positions (width, height, 0)
|
||||
|
||||
<a name="drag"></a>
|
||||
- **drag** (_druid.drag_): The drag component instance
|
||||
|
||||
<a name="selected"></a>
|
||||
- **selected** (_number_): Current selected point of interest index
|
||||
|
||||
<a name="is_animate"></a>
|
||||
- **is_animate** (_boolean_): True if scroll is animating
|
||||
|
||||
<a name="style"></a>
|
||||
- **style** (_druid.scroll.style_): Component style parameters
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
||||
<a name="hover"></a>
|
||||
- **hover** (_druid.hover_): The component for handling hover events on a node
|
||||
|
||||
<a name="points"></a>
|
||||
- **points** (_table_)
|
||||
|
||||
<a name="available_pos_extra"></a>
|
||||
- **available_pos_extra** (_vector4_)
|
||||
|
||||
<a name="available_size_extra"></a>
|
||||
- **available_size_extra** (_vector3_)
|
||||
|
@ -1,387 +0,0 @@
|
||||
# druid.grid API
|
||||
|
||||
> at /druid/base/static_grid.lua
|
||||
|
||||
The component for manage the nodes position in the grid with various options
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [get_pos](#get_pos)
|
||||
- [get_index](#get_index)
|
||||
- [get_index_by_node](#get_index_by_node)
|
||||
- [set_anchor](#set_anchor)
|
||||
- [refresh](#refresh)
|
||||
- [set_pivot](#set_pivot)
|
||||
- [add](#add)
|
||||
- [set_items](#set_items)
|
||||
- [remove](#remove)
|
||||
- [get_size](#get_size)
|
||||
- [get_size_for](#get_size_for)
|
||||
- [get_borders](#get_borders)
|
||||
- [get_all_pos](#get_all_pos)
|
||||
- [set_position_function](#set_position_function)
|
||||
- [clear](#clear)
|
||||
- [get_offset](#get_offset)
|
||||
- [set_in_row](#set_in_row)
|
||||
- [set_item_size](#set_item_size)
|
||||
- [sort_nodes](#sort_nodes)
|
||||
|
||||
## Fields
|
||||
|
||||
- [on_add_item](#on_add_item)
|
||||
- [on_remove_item](#on_remove_item)
|
||||
- [on_change_items](#on_change_items)
|
||||
- [on_clear](#on_clear)
|
||||
- [on_update_positions](#on_update_positions)
|
||||
- [parent](#parent)
|
||||
- [nodes](#nodes)
|
||||
- [first_index](#first_index)
|
||||
- [last_index](#last_index)
|
||||
- [anchor](#anchor)
|
||||
- [pivot](#pivot)
|
||||
- [node_size](#node_size)
|
||||
- [border](#border)
|
||||
- [in_row](#in_row)
|
||||
- [style](#style)
|
||||
- [node_pivot](#node_pivot)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:init(parent, element, [in_row])
|
||||
```
|
||||
|
||||
The constructor for the grid component
|
||||
|
||||
- **Parameters:**
|
||||
- `parent` *(string|node)*: The GUI Node container, where grid's items will be placed
|
||||
- `element` *(node)*: Element prefab. Need to get it size
|
||||
- `[in_row]` *(number|nil)*: How many nodes in row can be placed. By default 1
|
||||
|
||||
### get_pos
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:get_pos(index)
|
||||
```
|
||||
|
||||
Return pos for grid node index
|
||||
|
||||
- **Parameters:**
|
||||
- `index` *(number)*: The grid element index
|
||||
|
||||
- **Returns:**
|
||||
- `position` *(vector3)*: Node position
|
||||
|
||||
### get_index
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:get_index(pos)
|
||||
```
|
||||
|
||||
Return grid index by position
|
||||
|
||||
- **Parameters:**
|
||||
- `pos` *(vector3)*: The node position in the grid
|
||||
|
||||
- **Returns:**
|
||||
- `index` *(number)*: The node index
|
||||
|
||||
### get_index_by_node
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:get_index_by_node(node)
|
||||
```
|
||||
|
||||
Return grid index by node
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*: The gui node in the grid
|
||||
|
||||
- **Returns:**
|
||||
- `index` *(number|nil)*: The node index
|
||||
|
||||
### set_anchor
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:set_anchor(anchor)
|
||||
```
|
||||
|
||||
Set grid anchor. Default anchor is equal to anchor of grid parent node
|
||||
|
||||
- **Parameters:**
|
||||
- `anchor` *(vector3)*: Anchor
|
||||
|
||||
### refresh
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:refresh()
|
||||
```
|
||||
|
||||
Instantly update the grid content
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.grid)*: Current grid instance
|
||||
|
||||
### set_pivot
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:set_pivot(pivot)
|
||||
```
|
||||
|
||||
Set grid pivot
|
||||
|
||||
- **Parameters:**
|
||||
- `pivot` *(constant)*: The new pivot
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.grid)*: Current grid instance
|
||||
|
||||
### add
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:add(item, [index], [shift_policy], [is_instant])
|
||||
```
|
||||
|
||||
Add new item to the grid
|
||||
|
||||
- **Parameters:**
|
||||
- `item` *(node)*: GUI node
|
||||
- `[index]` *(number|nil)*: The item position. By default add as last item
|
||||
- `[shift_policy]` *(number|nil)*: How shift nodes, if required. Default: const.SHIFT.RIGHT
|
||||
- `[is_instant]` *(boolean|nil)*: If true, update node positions instantly
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.grid)*: Current grid instance
|
||||
|
||||
### set_items
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:set_items(nodes, [is_instant])
|
||||
```
|
||||
|
||||
Set new items to the grid. All previous items will be removed
|
||||
|
||||
- **Parameters:**
|
||||
- `nodes` *(node[])*: The new grid nodes
|
||||
- `[is_instant]` *(boolean|nil)*: If true, update node positions instantly
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.grid)*: Current grid instance
|
||||
|
||||
### remove
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:remove(index, [shift_policy], [is_instant])
|
||||
```
|
||||
|
||||
Remove the item from the grid. Note that gui node will be not deleted
|
||||
|
||||
- **Parameters:**
|
||||
- `index` *(number)*: The grid node index to remove
|
||||
- `[shift_policy]` *(number|nil)*: How shift nodes, if required. Default: const.SHIFT.RIGHT
|
||||
- `[is_instant]` *(boolean|nil)*: If true, update node positions instantly
|
||||
|
||||
- **Returns:**
|
||||
- `node` *(node)*: The deleted gui node from grid
|
||||
|
||||
### get_size
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:get_size()
|
||||
```
|
||||
|
||||
Return grid content size
|
||||
|
||||
- **Returns:**
|
||||
- `size` *(vector3)*: The grid content size
|
||||
|
||||
### get_size_for
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:get_size_for(count)
|
||||
```
|
||||
|
||||
Return grid content size for given count of nodes
|
||||
|
||||
- **Parameters:**
|
||||
- `count` *(number)*: The count of nodes
|
||||
|
||||
- **Returns:**
|
||||
- `size` *(vector3)*: The grid content size
|
||||
|
||||
### get_borders
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:get_borders()
|
||||
```
|
||||
|
||||
Return grid content borders
|
||||
|
||||
- **Returns:**
|
||||
- `borders` *(vector4)*: The grid content borders
|
||||
|
||||
### get_all_pos
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:get_all_pos()
|
||||
```
|
||||
|
||||
Return array of all node positions
|
||||
|
||||
- **Returns:**
|
||||
- `positions` *(vector3[])*: All grid node positions
|
||||
|
||||
### set_position_function
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:set_position_function(callback)
|
||||
```
|
||||
|
||||
Change set position function for grid nodes. It will call on
|
||||
update poses on grid elements. Default: gui.set_position
|
||||
|
||||
- **Parameters:**
|
||||
- `callback` *(function)*: Function on node set position
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.grid)*: Current grid instance
|
||||
|
||||
### clear
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:clear()
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.grid)*: Current grid instance
|
||||
|
||||
### get_offset
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:get_offset()
|
||||
```
|
||||
|
||||
Return StaticGrid offset, where StaticGrid content starts.
|
||||
|
||||
- **Returns:**
|
||||
- `offset` *(vector3)*: The StaticGrid offset
|
||||
|
||||
### set_in_row
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:set_in_row(in_row)
|
||||
```
|
||||
|
||||
Set new in_row elements for grid
|
||||
|
||||
- **Parameters:**
|
||||
- `in_row` *(number)*: The new in_row value
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.grid)*: Current grid instance
|
||||
|
||||
### set_item_size
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:set_item_size([width], [height])
|
||||
```
|
||||
|
||||
Set new node size for grid
|
||||
|
||||
- **Parameters:**
|
||||
- `[width]` *(number|nil)*: The new node width
|
||||
- `[height]` *(number|nil)*: The new node height
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.grid)*: Current grid instance
|
||||
|
||||
### sort_nodes
|
||||
|
||||
---
|
||||
```lua
|
||||
grid:sort_nodes(comparator)
|
||||
```
|
||||
|
||||
Sort grid nodes by custom comparator function
|
||||
|
||||
- **Parameters:**
|
||||
- `comparator` *(function)*: The comparator function. (a, b) -> boolean
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.grid)*: Current grid instance
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="on_add_item"></a>
|
||||
- **on_add_item** (_event_): fun(self: druid.grid, item: node, index: number) Trigger on add item event
|
||||
|
||||
<a name="on_remove_item"></a>
|
||||
- **on_remove_item** (_event_): fun(self: druid.grid, index: number) Trigger on remove item event
|
||||
|
||||
<a name="on_change_items"></a>
|
||||
- **on_change_items** (_event_): fun(self: druid.grid, index: number) Trigger on change items event
|
||||
|
||||
<a name="on_clear"></a>
|
||||
- **on_clear** (_event_): fun(self: druid.grid) Trigger on clear event
|
||||
|
||||
<a name="on_update_positions"></a>
|
||||
- **on_update_positions** (_event_): fun(self: druid.grid) Trigger on update positions event
|
||||
|
||||
<a name="parent"></a>
|
||||
- **parent** (_node_): Parent node
|
||||
|
||||
<a name="nodes"></a>
|
||||
- **nodes** (_node[]_): Nodes array
|
||||
|
||||
<a name="first_index"></a>
|
||||
- **first_index** (_number_): First index
|
||||
|
||||
<a name="last_index"></a>
|
||||
- **last_index** (_number_): Last index
|
||||
|
||||
<a name="anchor"></a>
|
||||
- **anchor** (_vector3_): Anchor
|
||||
|
||||
<a name="pivot"></a>
|
||||
- **pivot** (_vector3_): Pivot
|
||||
|
||||
<a name="node_size"></a>
|
||||
- **node_size** (_vector3_): Node size
|
||||
|
||||
<a name="border"></a>
|
||||
- **border** (_vector4_): Border
|
||||
|
||||
<a name="in_row"></a>
|
||||
- **in_row** (_number_): In row
|
||||
|
||||
<a name="style"></a>
|
||||
- **style** (_druid.grid.style_): Style
|
||||
|
||||
<a name="node_pivot"></a>
|
||||
- **node_pivot** (_unknown_)
|
||||
|
@ -1,349 +0,0 @@
|
||||
# druid.text API
|
||||
|
||||
> at /druid/base/text.lua
|
||||
|
||||
Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
### Setup
|
||||
Create text node with druid: `text = druid:new_text(node_name, [initial_value], [text_adjust_type])`
|
||||
|
||||
### Notes
|
||||
- Text component by default have auto adjust text sizing. Text never will be bigger, than text node size, which you can setup in GUI scene.
|
||||
- Text pivot can be changed with `text:set_pivot`, and text will save their position inside their text size box
|
||||
- There are several text adjust types:
|
||||
- - **"downscale"** - Change text's scale to fit in the text node size (default)
|
||||
- - **"trim"** - Trim the text with postfix (default - "...") to fit in the text node size
|
||||
- - **"no_adjust"** - No any adjust, like default Defold text node
|
||||
- - **"downscale_limited"** - Change text's scale like downscale, but there is limit for text's scale
|
||||
- - **"scroll"** - Change text's pivot to imitate scrolling in the text box. Use with stencil node for better effect.
|
||||
- - **"scale_then_scroll"** - Combine two modes: first limited downscale, then scroll
|
||||
- - **"trim_left"** - Trim the text with postfix (default - "...") to fit in the text node size
|
||||
- - **"scale_then_trim"** - Combine two modes: first limited downscale, then trim
|
||||
- - **"scale_then_trim_left"** - Combine two modes: first limited downscale, then trim left
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [get_text_size](#get_text_size)
|
||||
- [get_text_index_by_width](#get_text_index_by_width)
|
||||
- [set_to](#set_to)
|
||||
- [set_text](#set_text)
|
||||
- [get_text](#get_text)
|
||||
- [set_size](#set_size)
|
||||
- [set_color](#set_color)
|
||||
- [set_alpha](#set_alpha)
|
||||
- [set_scale](#set_scale)
|
||||
- [set_pivot](#set_pivot)
|
||||
- [is_multiline](#is_multiline)
|
||||
- [set_text_adjust](#set_text_adjust)
|
||||
- [set_minimal_scale](#set_minimal_scale)
|
||||
- [get_text_adjust](#get_text_adjust)
|
||||
|
||||
## Fields
|
||||
|
||||
- [node](#node)
|
||||
- [on_set_text](#on_set_text)
|
||||
- [on_update_text_scale](#on_update_text_scale)
|
||||
- [on_set_pivot](#on_set_pivot)
|
||||
- [style](#style)
|
||||
- [start_pivot](#start_pivot)
|
||||
- [start_scale](#start_scale)
|
||||
- [scale](#scale)
|
||||
- [pos](#pos)
|
||||
- [node_id](#node_id)
|
||||
- [start_size](#start_size)
|
||||
- [text_area](#text_area)
|
||||
- [adjust_type](#adjust_type)
|
||||
- [color](#color)
|
||||
- [last_value](#last_value)
|
||||
- [last_scale](#last_scale)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
text:init(node, [value], adjust_type)
|
||||
```
|
||||
|
||||
The Text constructor
|
||||
```lua
|
||||
adjust_type:
|
||||
| "downscale"
|
||||
| "trim"
|
||||
| "no_adjust"
|
||||
| "downscale_limited"
|
||||
| "scroll"
|
||||
| "scale_then_scroll"
|
||||
| "trim_left"
|
||||
| "scale_then_trim"
|
||||
| "scale_then_trim_left"
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: Node name or GUI Text Node itself
|
||||
- `[value]` *(string|nil)*: Initial text. Default value is node text from GUI scene. Default: nil
|
||||
- `adjust_type` *("downscale"|"downscale_limited"|"no_adjust"|"scale_then_scroll"|"scale_then_trim"...(+5))*: Adjust type for text. By default is "downscale". Options: "downscale", "trim", "no_adjust", "downscale_limited", "scroll", "scale_then_scroll", "trim_left", "scale_then_trim", "scale_then_trim_left"
|
||||
|
||||
### get_text_size
|
||||
|
||||
---
|
||||
```lua
|
||||
text:get_text_size([text])
|
||||
```
|
||||
|
||||
Calculate text width with font with respect to trailing space
|
||||
|
||||
- **Parameters:**
|
||||
- `[text]` *(string|nil)*: The text to calculate the size of, if nil - use current text
|
||||
|
||||
- **Returns:**
|
||||
- `width` *(number)*: The text width
|
||||
- `height` *(number)*: The text height
|
||||
|
||||
### get_text_index_by_width
|
||||
|
||||
---
|
||||
```lua
|
||||
text:get_text_index_by_width(width)
|
||||
```
|
||||
|
||||
Get chars count by width
|
||||
|
||||
- **Parameters:**
|
||||
- `width` *(number)*: The width to get the chars count of
|
||||
|
||||
- **Returns:**
|
||||
- `index` *(number)*: The chars count
|
||||
|
||||
### set_to
|
||||
|
||||
---
|
||||
```lua
|
||||
text:set_to(set_to)
|
||||
```
|
||||
|
||||
Set text to text field
|
||||
|
||||
- **Parameters:**
|
||||
- `set_to` *(string)*: Text for node
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.text)*: Current text instance
|
||||
|
||||
### set_text
|
||||
|
||||
---
|
||||
```lua
|
||||
text:set_text([new_text])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[new_text]` *(any)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.text)*:
|
||||
|
||||
### get_text
|
||||
|
||||
---
|
||||
```lua
|
||||
text:get_text()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `` *(unknown)*:
|
||||
|
||||
### set_size
|
||||
|
||||
---
|
||||
```lua
|
||||
text:set_size(size)
|
||||
```
|
||||
|
||||
Set text area size
|
||||
|
||||
- **Parameters:**
|
||||
- `size` *(vector3)*: The new text area size
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.text)*: Current text instance
|
||||
|
||||
### set_color
|
||||
|
||||
---
|
||||
```lua
|
||||
text:set_color(color)
|
||||
```
|
||||
|
||||
Set color
|
||||
|
||||
- **Parameters:**
|
||||
- `color` *(vector4)*: Color for node
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.text)*: Current text instance
|
||||
|
||||
### set_alpha
|
||||
|
||||
---
|
||||
```lua
|
||||
text:set_alpha(alpha)
|
||||
```
|
||||
|
||||
Set alpha
|
||||
|
||||
- **Parameters:**
|
||||
- `alpha` *(number)*: Alpha for node
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.text)*: Current text instance
|
||||
|
||||
### set_scale
|
||||
|
||||
---
|
||||
```lua
|
||||
text:set_scale(scale)
|
||||
```
|
||||
|
||||
Set scale
|
||||
|
||||
- **Parameters:**
|
||||
- `scale` *(vector3)*: Scale for node
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.text)*: Current text instance
|
||||
|
||||
### set_pivot
|
||||
|
||||
---
|
||||
```lua
|
||||
text:set_pivot(pivot)
|
||||
```
|
||||
|
||||
Set text pivot. Text will re-anchor inside text area
|
||||
|
||||
- **Parameters:**
|
||||
- `pivot` *(userdata)*: The gui.PIVOT_* constant
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.text)*: Current text instance
|
||||
|
||||
### is_multiline
|
||||
|
||||
---
|
||||
```lua
|
||||
text:is_multiline()
|
||||
```
|
||||
|
||||
Return true, if text with line break
|
||||
|
||||
- **Returns:**
|
||||
- `Is` *(boolean)*: text node with line break
|
||||
|
||||
### set_text_adjust
|
||||
|
||||
---
|
||||
```lua
|
||||
text:set_text_adjust(adjust_type, [minimal_scale])
|
||||
```
|
||||
|
||||
Set text adjust, refresh the current text visuals, if needed
|
||||
```lua
|
||||
adjust_type:
|
||||
| "downscale"
|
||||
| "trim"
|
||||
| "no_adjust"
|
||||
| "downscale_limited"
|
||||
| "scroll"
|
||||
| "scale_then_scroll"
|
||||
| "trim_left"
|
||||
| "scale_then_trim"
|
||||
| "scale_then_trim_left"
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `adjust_type` *("downscale"|"downscale_limited"|"no_adjust"|"scale_then_scroll"|"scale_then_trim"...(+5))*: The adjust type to set, values: "downscale", "trim", "no_adjust", "downscale_limited", "scroll", "scale_then_scroll", "trim_left", "scale_then_trim", "scale_then_trim_left"
|
||||
- `[minimal_scale]` *(number|nil)*: To remove minimal scale, use `text:set_minimal_scale(nil)`, if pass nil - not change minimal scale
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.text)*: Current text instance
|
||||
|
||||
### set_minimal_scale
|
||||
|
||||
---
|
||||
```lua
|
||||
text:set_minimal_scale(minimal_scale)
|
||||
```
|
||||
|
||||
Set minimal scale for "downscale_limited" or "scale_then_scroll" adjust types
|
||||
|
||||
- **Parameters:**
|
||||
- `minimal_scale` *(number)*: If pass nil - not use minimal scale
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.text)*: Current text instance
|
||||
|
||||
### get_text_adjust
|
||||
|
||||
---
|
||||
```lua
|
||||
text:get_text_adjust()
|
||||
```
|
||||
|
||||
Return current text adjust type
|
||||
|
||||
- **Returns:**
|
||||
- `adjust_type` *(string)*: The current text adjust type
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="node"></a>
|
||||
- **node** (_node_): The text node
|
||||
|
||||
<a name="on_set_text"></a>
|
||||
- **on_set_text** (_event_): fun(self: druid.text, text: string) The event triggered when the text is set
|
||||
|
||||
<a name="on_update_text_scale"></a>
|
||||
- **on_update_text_scale** (_event_): fun(self: druid.text, scale: vector3, metrics: table) The event triggered when the text scale is updated
|
||||
|
||||
<a name="on_set_pivot"></a>
|
||||
- **on_set_pivot** (_event_): fun(self: druid.text, pivot: userdata) The event triggered when the text pivot is set
|
||||
|
||||
<a name="style"></a>
|
||||
- **style** (_druid.text.style_): The style of the text
|
||||
|
||||
<a name="start_pivot"></a>
|
||||
- **start_pivot** (_userdata_): The start pivot of the text
|
||||
|
||||
<a name="start_scale"></a>
|
||||
- **start_scale** (_vector3_): The start scale of the text
|
||||
|
||||
<a name="scale"></a>
|
||||
- **scale** (_vector3_): The current scale of the text
|
||||
|
||||
<a name="pos"></a>
|
||||
- **pos** (_unknown_)
|
||||
|
||||
<a name="node_id"></a>
|
||||
- **node_id** (_unknown_)
|
||||
|
||||
<a name="start_size"></a>
|
||||
- **start_size** (_unknown_)
|
||||
|
||||
<a name="text_area"></a>
|
||||
- **text_area** (_unknown_)
|
||||
|
||||
<a name="adjust_type"></a>
|
||||
- **adjust_type** (_string|"downscale"|"downscale_limited"|"no_adjust"|"scale_then_scroll"...(+6)_)
|
||||
|
||||
<a name="color"></a>
|
||||
- **color** (_unknown_)
|
||||
|
||||
<a name="last_value"></a>
|
||||
- **last_value** (_unknown_)
|
||||
|
||||
<a name="last_scale"></a>
|
||||
- **last_scale** (_vector3_)
|
||||
|
@ -1,168 +0,0 @@
|
||||
# druid.rich_input API
|
||||
|
||||
> at /druid/custom/rich_input/rich_input.lua
|
||||
|
||||
The component that handles a rich text input field, it's a wrapper around the druid.input component
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_placeholder](#set_placeholder)
|
||||
- [select](#select)
|
||||
- [set_text](#set_text)
|
||||
- [set_font](#set_font)
|
||||
- [get_text](#get_text)
|
||||
- [set_allowed_characters](#set_allowed_characters)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [input](#input)
|
||||
- [cursor](#cursor)
|
||||
- [cursor_text](#cursor_text)
|
||||
- [cursor_position](#cursor_position)
|
||||
- [druid](#druid)
|
||||
- [is_lshift](#is_lshift)
|
||||
- [is_lctrl](#is_lctrl)
|
||||
- [is_button_input_enabled](#is_button_input_enabled)
|
||||
- [drag](#drag)
|
||||
- [placeholder](#placeholder)
|
||||
- [text_position](#text_position)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_input:init(template, nodes)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `template` *(string)*: The template string name
|
||||
- `nodes` *(table)*: Nodes table from gui.clone_tree
|
||||
|
||||
### set_placeholder
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_input:set_placeholder(placeholder_text)
|
||||
```
|
||||
|
||||
Set placeholder text
|
||||
|
||||
- **Parameters:**
|
||||
- `placeholder_text` *(string)*: The placeholder text
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.rich_input)*: Current instance
|
||||
|
||||
### select
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_input:select()
|
||||
```
|
||||
|
||||
Select input field
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.rich_input)*: Current instance
|
||||
|
||||
### set_text
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_input:set_text(text)
|
||||
```
|
||||
|
||||
Set input field text
|
||||
|
||||
- **Parameters:**
|
||||
- `text` *(string)*: The input text
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.rich_input)*: Current instance
|
||||
|
||||
### set_font
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_input:set_font(font)
|
||||
```
|
||||
|
||||
Set input field font
|
||||
|
||||
- **Parameters:**
|
||||
- `font` *(hash)*: The font hash
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.rich_input)*: Current instance
|
||||
|
||||
### get_text
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_input:get_text()
|
||||
```
|
||||
|
||||
Set input field text
|
||||
|
||||
- **Returns:**
|
||||
- `` *(string)*:
|
||||
|
||||
### set_allowed_characters
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_input:set_allowed_characters(characters)
|
||||
```
|
||||
|
||||
Set allowed charaters for input field.
|
||||
See: https://defold.com/ref/stable/string/
|
||||
ex: [%a%d] for alpha and numeric
|
||||
|
||||
- **Parameters:**
|
||||
- `characters` *(string)*: Regular expression for validate user input
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.rich_input)*: Current instance
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_): The root node of the rich input
|
||||
|
||||
<a name="input"></a>
|
||||
- **input** (_druid.input_): The input component
|
||||
|
||||
<a name="cursor"></a>
|
||||
- **cursor** (_node_): The cursor node
|
||||
|
||||
<a name="cursor_text"></a>
|
||||
- **cursor_text** (_node_): The cursor text node
|
||||
|
||||
<a name="cursor_position"></a>
|
||||
- **cursor_position** (_vector3_): The position of the cursor
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
||||
<a name="is_lshift"></a>
|
||||
- **is_lshift** (_boolean_)
|
||||
|
||||
<a name="is_lctrl"></a>
|
||||
- **is_lctrl** (_boolean_)
|
||||
|
||||
<a name="is_button_input_enabled"></a>
|
||||
- **is_button_input_enabled** (_unknown_)
|
||||
|
||||
<a name="drag"></a>
|
||||
- **drag** (_druid.drag_): A component that allows you to subscribe to drag events over a node
|
||||
|
||||
<a name="placeholder"></a>
|
||||
- **placeholder** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="text_position"></a>
|
||||
- **text_position** (_unknown_)
|
||||
|
@ -1,153 +0,0 @@
|
||||
# druid.rich_text API
|
||||
|
||||
> at /druid/custom/rich_text/rich_text.lua
|
||||
|
||||
The component that handles a rich text display, allows to custom color, size, font, etc. of the parts of the text
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_text](#set_text)
|
||||
- [get_text](#get_text)
|
||||
- [clear](#clear)
|
||||
- [tagged](#tagged)
|
||||
- [get_words](#get_words)
|
||||
- [get_line_metric](#get_line_metric)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [text_prefab](#text_prefab)
|
||||
- [style](#style)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_text:init(text_node, [value])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `text_node` *(string|node)*: The text node to make Rich Text
|
||||
- `[value]` *(string|nil)*: The initial text value. Default will be gui.get_text(text_node)
|
||||
|
||||
### set_text
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_text:set_text([text])
|
||||
```
|
||||
|
||||
Set text for Rich Text
|
||||
|
||||
- **Parameters:**
|
||||
- `[text]` *(string|nil)*: The text to set
|
||||
|
||||
- **Returns:**
|
||||
- `words` *(druid.rich_text.word[])*:
|
||||
- `line_metrics` *(druid.rich_text.lines_metrics)*:
|
||||
|
||||
- **Example Usage:**
|
||||
|
||||
```lua
|
||||
-- Color
|
||||
rich_text:set_text("<color=red>Foobar</color>")
|
||||
rich_text:set_text("<color=1.0,0,0,1.0>Foobar</color>")
|
||||
rich_text:set_text("<color=#ff0000>Foobar</color>")
|
||||
rich_text:set_text("<color=#ff0000ff>Foobar</color>")
|
||||
-- Shadow
|
||||
rich_text:set_text("<shadow=red>Foobar</shadow>")
|
||||
rich_text:set_text("<shadow=1.0,0,0,1.0>Foobar</shadow>")
|
||||
rich_text:set_text("<shadow=#ff0000>Foobar</shadow>")
|
||||
rich_text:set_text("<shadow=#ff0000ff>Foobar</shadow>")
|
||||
-- Outline
|
||||
rich_text:set_text("<outline=red>Foobar</outline>")
|
||||
rich_text:set_text("<outline=1.0,0,0,1.0>Foobar</outline>")
|
||||
rich_text:set_text("<outline=#ff0000>Foobar</outline>")
|
||||
rich_text:set_text("<outline=#ff0000ff>Foobar</outline>")
|
||||
-- Font
|
||||
rich_text:set_text("<font=MyCoolFont>Foobar</font>")
|
||||
-- Size
|
||||
rich_text:set_text("<size=2>Twice as large</size>")
|
||||
-- Line break
|
||||
rich_text:set_text("<br/>Insert a line break")
|
||||
-- No break
|
||||
rich_text:set_text("<nobr>Prevent the text from breaking")
|
||||
-- Image
|
||||
rich_text:set_text("<img=texture:image>Display image")
|
||||
rich_text:set_text("<img=texture:image,size>Display image with size")
|
||||
rich_text:set_text("<img=texture:image,width,height>Display image with width and height")
|
||||
```
|
||||
### get_text
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_text:get_text()
|
||||
```
|
||||
|
||||
Get the current text of the rich text
|
||||
|
||||
- **Returns:**
|
||||
- `text` *(string)*: The current text of the rich text
|
||||
|
||||
### clear
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_text:clear()
|
||||
```
|
||||
|
||||
Clear all created words.
|
||||
|
||||
### tagged
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_text:tagged(tag)
|
||||
```
|
||||
|
||||
Get all words, which has a passed tag.
|
||||
|
||||
- **Parameters:**
|
||||
- `tag` *(string)*: The tag to get the words for
|
||||
|
||||
- **Returns:**
|
||||
- `words` *(druid.rich_text.word[])*: The words with the passed tag
|
||||
|
||||
### get_words
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_text:get_words()
|
||||
```
|
||||
|
||||
Get all current created words, each word is a table that contains the information about the word
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.rich_text.word[])*:
|
||||
|
||||
### get_line_metric
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_text:get_line_metric()
|
||||
```
|
||||
|
||||
Get the current line metrics
|
||||
|
||||
- **Returns:**
|
||||
- `lines_metrics` *(druid.rich_text.lines_metrics)*: The line metrics of the rich text
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_): The root node of the rich text
|
||||
|
||||
<a name="text_prefab"></a>
|
||||
- **text_prefab** (_node_): The text prefab node
|
||||
|
||||
<a name="style"></a>
|
||||
- **style** (_table_)
|
||||
|
@ -1,394 +0,0 @@
|
||||
# druid.container API
|
||||
|
||||
> at /druid/extended/container.lua
|
||||
|
||||
Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
### Setup
|
||||
Create container component with druid: `container = druid:new_container(node, mode, callback)`
|
||||
|
||||
### Notes
|
||||
- Container can be used to create adaptable layouts that respond to window size changes
|
||||
- Container supports different layout modes: FIT, STRETCH, STRETCH_X, STRETCH_Y
|
||||
- Container can be nested inside other containers
|
||||
- Container supports fixed margins and percentage-based sizing
|
||||
- Container can be positioned using pivot points
|
||||
- Container supports minimum size constraints
|
||||
- Container can be fitted into window or custom size
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [refresh_origins](#refresh_origins)
|
||||
- [set_pivot](#set_pivot)
|
||||
- [set_size](#set_size)
|
||||
- [get_position](#get_position)
|
||||
- [set_position](#set_position)
|
||||
- [get_size](#get_size)
|
||||
- [get_scale](#get_scale)
|
||||
- [fit_into_size](#fit_into_size)
|
||||
- [fit_into_window](#fit_into_window)
|
||||
- [add_container](#add_container)
|
||||
- [remove_container_by_node](#remove_container_by_node)
|
||||
- [set_parent_container](#set_parent_container)
|
||||
- [refresh](#refresh)
|
||||
- [refresh_scale](#refresh_scale)
|
||||
- [update_child_containers](#update_child_containers)
|
||||
- [create_draggable_corners](#create_draggable_corners)
|
||||
- [clear_draggable_corners](#clear_draggable_corners)
|
||||
- [fit_into_node](#fit_into_node)
|
||||
- [set_min_size](#set_min_size)
|
||||
- [set_max_size](#set_max_size)
|
||||
|
||||
## Fields
|
||||
|
||||
- [node](#node)
|
||||
- [druid](#druid)
|
||||
- [node_offset](#node_offset)
|
||||
- [origin_size](#origin_size)
|
||||
- [size](#size)
|
||||
- [origin_position](#origin_position)
|
||||
- [position](#position)
|
||||
- [pivot_offset](#pivot_offset)
|
||||
- [center_offset](#center_offset)
|
||||
- [mode](#mode)
|
||||
- [fit_size](#fit_size)
|
||||
- [min_size_x](#min_size_x)
|
||||
- [min_size_y](#min_size_y)
|
||||
- [max_size_x](#max_size_x)
|
||||
- [max_size_y](#max_size_y)
|
||||
- [on_size_changed](#on_size_changed)
|
||||
- [node_fill_x](#node_fill_x)
|
||||
- [node_fill_y](#node_fill_y)
|
||||
- [x_koef](#x_koef)
|
||||
- [y_koef](#y_koef)
|
||||
- [x_anchor](#x_anchor)
|
||||
- [y_anchor](#y_anchor)
|
||||
- [style](#style)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
container:init(node, mode, [callback])
|
||||
```
|
||||
|
||||
The Container constructor
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*: Gui node
|
||||
- `mode` *(string)*: Layout mode
|
||||
- `[callback]` *(fun(self: druid.container, size: vector3)|nil)*: Callback on size changed
|
||||
|
||||
### refresh_origins
|
||||
|
||||
---
|
||||
```lua
|
||||
container:refresh_origins()
|
||||
```
|
||||
|
||||
Refresh the origins of the container, origins is the size and position of the container when it was created
|
||||
|
||||
### set_pivot
|
||||
|
||||
---
|
||||
```lua
|
||||
container:set_pivot(pivot)
|
||||
```
|
||||
|
||||
Set the pivot of the container
|
||||
|
||||
- **Parameters:**
|
||||
- `pivot` *(constant)*: The pivot to set
|
||||
|
||||
### set_size
|
||||
|
||||
---
|
||||
```lua
|
||||
container:set_size([width], [height], [anchor_pivot])
|
||||
```
|
||||
|
||||
Set new size of layout node
|
||||
|
||||
- **Parameters:**
|
||||
- `[width]` *(number|nil)*: The width to set
|
||||
- `[height]` *(number|nil)*: The height to set
|
||||
- `[anchor_pivot]` *(constant|nil)*: If set will keep the corner position relative to the new size
|
||||
|
||||
- **Returns:**
|
||||
- `Container` *(druid.container)*:
|
||||
|
||||
### get_position
|
||||
|
||||
---
|
||||
```lua
|
||||
container:get_position()
|
||||
```
|
||||
|
||||
Get the position of the container
|
||||
|
||||
- **Returns:**
|
||||
- `position` *(vector3)*: The position of the container
|
||||
|
||||
### set_position
|
||||
|
||||
---
|
||||
```lua
|
||||
container:set_position(pos_x, pos_y)
|
||||
```
|
||||
|
||||
Set the position of the container
|
||||
|
||||
- **Parameters:**
|
||||
- `pos_x` *(number)*: The x position to set
|
||||
- `pos_y` *(number)*: The y position to set
|
||||
|
||||
### get_size
|
||||
|
||||
---
|
||||
```lua
|
||||
container:get_size()
|
||||
```
|
||||
|
||||
Get the current size of the layout node
|
||||
|
||||
- **Returns:**
|
||||
- `size` *(vector3)*: The current size of the layout node
|
||||
|
||||
### get_scale
|
||||
|
||||
---
|
||||
```lua
|
||||
container:get_scale()
|
||||
```
|
||||
|
||||
Get the current scale of the layout node
|
||||
|
||||
- **Returns:**
|
||||
- `scale` *(vector3)*: The current scale of the layout node
|
||||
|
||||
### fit_into_size
|
||||
|
||||
---
|
||||
```lua
|
||||
container:fit_into_size(target_size)
|
||||
```
|
||||
|
||||
Set size for layout node to fit inside it
|
||||
|
||||
- **Parameters:**
|
||||
- `target_size` *(vector3)*: The target size to fit into
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.container)*: Current container instance
|
||||
|
||||
### fit_into_window
|
||||
|
||||
---
|
||||
```lua
|
||||
container:fit_into_window()
|
||||
```
|
||||
|
||||
Set current size for layout node to fit inside it
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.container)*: Current container instance
|
||||
|
||||
### add_container
|
||||
|
||||
---
|
||||
```lua
|
||||
container:add_container(node_or_container, [mode], [on_resize_callback])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `node_or_container` *(string|table|druid.container|node)*: The node or container to add
|
||||
- `[mode]` *(string|nil)*: stretch, fit, stretch_x, stretch_y. Default: Pick from node, "fit" or "stretch"
|
||||
- `[on_resize_callback]` *(fun(self: userdata, size: vector3)|nil)*:
|
||||
|
||||
- **Returns:**
|
||||
- `Container` *(druid.container)*: New created layout instance
|
||||
|
||||
### remove_container_by_node
|
||||
|
||||
---
|
||||
```lua
|
||||
container:remove_container_by_node([node])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[node]` *(any)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.container|nil)*:
|
||||
|
||||
### set_parent_container
|
||||
|
||||
---
|
||||
```lua
|
||||
container:set_parent_container([parent_container])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[parent_container]` *(druid.container|nil)*: Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
### refresh
|
||||
|
||||
---
|
||||
```lua
|
||||
container:refresh()
|
||||
```
|
||||
|
||||
### refresh_scale
|
||||
|
||||
---
|
||||
```lua
|
||||
container:refresh_scale()
|
||||
```
|
||||
|
||||
### update_child_containers
|
||||
|
||||
---
|
||||
```lua
|
||||
container:update_child_containers()
|
||||
```
|
||||
|
||||
### create_draggable_corners
|
||||
|
||||
---
|
||||
```lua
|
||||
container:create_draggable_corners()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.container)*: Current container instance
|
||||
|
||||
### clear_draggable_corners
|
||||
|
||||
---
|
||||
```lua
|
||||
container:clear_draggable_corners()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.container)*: Current container instance
|
||||
|
||||
### fit_into_node
|
||||
|
||||
---
|
||||
```lua
|
||||
container:fit_into_node(node)
|
||||
```
|
||||
|
||||
Set node for layout node to fit inside it. Pass nil to reset
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: The node_id or gui.get_node(node_id)
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.container)*: Current container instance
|
||||
|
||||
### set_min_size
|
||||
|
||||
---
|
||||
```lua
|
||||
container:set_min_size([min_size_x], [min_size_y])
|
||||
```
|
||||
|
||||
Set the minimum size of the container
|
||||
|
||||
- **Parameters:**
|
||||
- `[min_size_x]` *(number|nil)*: The minimum size x
|
||||
- `[min_size_y]` *(number|nil)*: The minimum size y
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.container)*: Current container instance
|
||||
|
||||
### set_max_size
|
||||
|
||||
---
|
||||
```lua
|
||||
container:set_max_size([max_size_x], [max_size_y])
|
||||
```
|
||||
|
||||
Set the maximum size of the container
|
||||
|
||||
- **Parameters:**
|
||||
- `[max_size_x]` *(number|nil)*: The maximum size x
|
||||
- `[max_size_y]` *(number|nil)*: The maximum size y
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.container)*: Current container instance
|
||||
|
||||
## Fields
|
||||
<a name="node"></a>
|
||||
- **node** (_node_): The gui node
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The druid instance
|
||||
|
||||
<a name="node_offset"></a>
|
||||
- **node_offset** (_vector4_): The node offset
|
||||
|
||||
<a name="origin_size"></a>
|
||||
- **origin_size** (_vector3_): The origin size
|
||||
|
||||
<a name="size"></a>
|
||||
- **size** (_vector3_): The current size
|
||||
|
||||
<a name="origin_position"></a>
|
||||
- **origin_position** (_vector3_): The origin position
|
||||
|
||||
<a name="position"></a>
|
||||
- **position** (_vector3_): The current position
|
||||
|
||||
<a name="pivot_offset"></a>
|
||||
- **pivot_offset** (_vector3_): The pivot offset
|
||||
|
||||
<a name="center_offset"></a>
|
||||
- **center_offset** (_vector3_): The center offset
|
||||
|
||||
<a name="mode"></a>
|
||||
- **mode** (_string_): The layout mode
|
||||
|
||||
<a name="fit_size"></a>
|
||||
- **fit_size** (_vector3_): The fit size
|
||||
|
||||
<a name="min_size_x"></a>
|
||||
- **min_size_x** (_number_): The minimum size x
|
||||
|
||||
<a name="min_size_y"></a>
|
||||
- **min_size_y** (_number_): The minimum size y
|
||||
|
||||
<a name="max_size_x"></a>
|
||||
- **max_size_x** (_number_): The maximum size x
|
||||
|
||||
<a name="max_size_y"></a>
|
||||
- **max_size_y** (_number_): The maximum size y
|
||||
|
||||
<a name="on_size_changed"></a>
|
||||
- **on_size_changed** (_event_): fun(self: druid.container, size: vector3) The event triggered when the size changes
|
||||
|
||||
<a name="node_fill_x"></a>
|
||||
- **node_fill_x** (_nil_)
|
||||
|
||||
<a name="node_fill_y"></a>
|
||||
- **node_fill_y** (_nil_)
|
||||
|
||||
<a name="x_koef"></a>
|
||||
- **x_koef** (_number_)
|
||||
|
||||
<a name="y_koef"></a>
|
||||
- **y_koef** (_number_)
|
||||
|
||||
<a name="x_anchor"></a>
|
||||
- **x_anchor** (_unknown_)
|
||||
|
||||
<a name="y_anchor"></a>
|
||||
- **y_anchor** (_unknown_)
|
||||
|
||||
<a name="style"></a>
|
||||
- **style** (_table_)
|
||||
|
@ -1,239 +0,0 @@
|
||||
# druid.data_list API
|
||||
|
||||
> at /druid/extended/data_list.lua
|
||||
|
||||
Druid component to manage a list of data with a scrollable view, used to manage huge list data and render only visible elements.
|
||||
|
||||
### Setup
|
||||
Create data list component with druid: `data_list = druid:new_data_list(scroll, grid, create_function)`
|
||||
|
||||
### Notes
|
||||
- Data List uses a scroll component for scrolling and a grid component for layout
|
||||
- Data List only renders visible elements for better performance
|
||||
- Data List supports caching of elements for better performance
|
||||
- Data List supports adding, removing and updating elements
|
||||
- Data List supports scrolling to specific elements
|
||||
- Data List supports custom element creation and cleanup
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_use_cache](#set_use_cache)
|
||||
- [set_data](#set_data)
|
||||
- [get_data](#get_data)
|
||||
- [add](#add)
|
||||
- [remove](#remove)
|
||||
- [remove_by_data](#remove_by_data)
|
||||
- [clear](#clear)
|
||||
- [get_index](#get_index)
|
||||
- [get_created_nodes](#get_created_nodes)
|
||||
- [get_created_components](#get_created_components)
|
||||
- [scroll_to_index](#scroll_to_index)
|
||||
|
||||
## Fields
|
||||
|
||||
- [scroll](#scroll)
|
||||
- [grid](#grid)
|
||||
- [on_scroll_progress_change](#on_scroll_progress_change)
|
||||
- [on_element_add](#on_element_add)
|
||||
- [on_element_remove](#on_element_remove)
|
||||
- [top_index](#top_index)
|
||||
- [last_index](#last_index)
|
||||
- [scroll_progress](#scroll_progress)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
data_list:init(scroll, grid, create_function)
|
||||
```
|
||||
|
||||
The DataList constructor
|
||||
|
||||
- **Parameters:**
|
||||
- `scroll` *(druid.scroll)*: The Scroll instance for Data List component
|
||||
- `grid` *(druid.grid)*: The StaticGrid instance for Data List component
|
||||
- `create_function` *(function)*: The create function callback(self, data, index, data_list). Function should return (node, [component])
|
||||
|
||||
### set_use_cache
|
||||
|
||||
---
|
||||
```lua
|
||||
data_list:set_use_cache(is_use_cache)
|
||||
```
|
||||
|
||||
Set use cache version of DataList. Requires make setup of components in on_element_add callback and clean in on_element_remove
|
||||
|
||||
- **Parameters:**
|
||||
- `is_use_cache` *(boolean)*: Use cache version of DataList
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.data_list)*: Current DataList instance
|
||||
|
||||
### set_data
|
||||
|
||||
---
|
||||
```lua
|
||||
data_list:set_data(data)
|
||||
```
|
||||
|
||||
Set new data set for DataList component
|
||||
|
||||
- **Parameters:**
|
||||
- `data` *(table)*: The new data array
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.data_list)*: Current DataList instance
|
||||
|
||||
### get_data
|
||||
|
||||
---
|
||||
```lua
|
||||
data_list:get_data()
|
||||
```
|
||||
|
||||
Return current data from DataList component
|
||||
|
||||
- **Returns:**
|
||||
- `data` *(table)*: The current data array
|
||||
|
||||
### add
|
||||
|
||||
---
|
||||
```lua
|
||||
data_list:add(data, [index], [shift_policy])
|
||||
```
|
||||
|
||||
Add element to DataList
|
||||
|
||||
- **Parameters:**
|
||||
- `data` *(table)*: The data to add
|
||||
- `[index]` *(number|nil)*: The index to add the data at
|
||||
- `[shift_policy]` *(number|nil)*: The constant from const.SHIFT.*
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.data_list)*: Current DataList instance
|
||||
|
||||
### remove
|
||||
|
||||
---
|
||||
```lua
|
||||
data_list:remove([index], [shift_policy])
|
||||
```
|
||||
|
||||
Remove element from DataList
|
||||
|
||||
- **Parameters:**
|
||||
- `[index]` *(number|nil)*: The index to remove the data at
|
||||
- `[shift_policy]` *(number|nil)*: The constant from const.SHIFT.*
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.data_list)*: Current DataList instance
|
||||
|
||||
### remove_by_data
|
||||
|
||||
---
|
||||
```lua
|
||||
data_list:remove_by_data(data, [shift_policy])
|
||||
```
|
||||
|
||||
Remove element from DataList by data value
|
||||
|
||||
- **Parameters:**
|
||||
- `data` *(table)*: The data to remove
|
||||
- `[shift_policy]` *(number|nil)*: The constant from const.SHIFT.*
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.data_list)*: Current DataList instance
|
||||
|
||||
### clear
|
||||
|
||||
---
|
||||
```lua
|
||||
data_list:clear()
|
||||
```
|
||||
|
||||
Clear the DataList and refresh visuals
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.data_list)*: Current DataList instance
|
||||
|
||||
### get_index
|
||||
|
||||
---
|
||||
```lua
|
||||
data_list:get_index(data)
|
||||
```
|
||||
|
||||
Return index for data value
|
||||
|
||||
- **Parameters:**
|
||||
- `data` *(table)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(unknown|nil)*:
|
||||
|
||||
### get_created_nodes
|
||||
|
||||
---
|
||||
```lua
|
||||
data_list:get_created_nodes()
|
||||
```
|
||||
|
||||
Return all currently created nodes in DataList
|
||||
|
||||
- **Returns:**
|
||||
- `List` *(node[])*: of created nodes
|
||||
|
||||
### get_created_components
|
||||
|
||||
---
|
||||
```lua
|
||||
data_list:get_created_components()
|
||||
```
|
||||
|
||||
Return all currently created components in DataList
|
||||
|
||||
- **Returns:**
|
||||
- `components` *(druid.component[])*: List of created components
|
||||
|
||||
### scroll_to_index
|
||||
|
||||
---
|
||||
```lua
|
||||
data_list:scroll_to_index(index)
|
||||
```
|
||||
|
||||
Instant scroll to element with passed index
|
||||
|
||||
- **Parameters:**
|
||||
- `index` *(number)*: The index to scroll to
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="scroll"></a>
|
||||
- **scroll** (_druid.scroll_): The scroll instance for Data List component
|
||||
|
||||
<a name="grid"></a>
|
||||
- **grid** (_druid.grid_): The StaticGrid or DynamicGrid instance for Data List component
|
||||
|
||||
<a name="on_scroll_progress_change"></a>
|
||||
- **on_scroll_progress_change** (_event_): fun(self: druid.data_list, progress: number) The event triggered when the scroll progress changes
|
||||
|
||||
<a name="on_element_add"></a>
|
||||
- **on_element_add** (_event_): fun(self: druid.data_list, index: number, node: node, instance: druid.component, data: table) The event triggered when a new element is added
|
||||
|
||||
<a name="on_element_remove"></a>
|
||||
- **on_element_remove** (_event_): fun(self: druid.data_list, index: number, node: node, instance: druid.component, data: table) The event triggered when an element is removed
|
||||
|
||||
<a name="top_index"></a>
|
||||
- **top_index** (_number_): The top index of the visible elements
|
||||
|
||||
<a name="last_index"></a>
|
||||
- **last_index** (_number_): The last index of the visible elements
|
||||
|
||||
<a name="scroll_progress"></a>
|
||||
- **scroll_progress** (_number_): The scroll progress
|
||||
|
@ -1,102 +0,0 @@
|
||||
# druid.hotkey API
|
||||
|
||||
> at /druid/extended/hotkey.lua
|
||||
|
||||
Druid component to manage hotkeys and trigger callbacks when hotkeys are pressed.
|
||||
|
||||
### Setup
|
||||
Create hotkey component with druid: `hotkey = druid:new_hotkey(keys, callback, callback_argument)`
|
||||
|
||||
### Notes
|
||||
- Hotkey can be triggered by pressing a single key or a combination of keys
|
||||
- Hotkey supports modificator keys (e.g. Ctrl, Shift, Alt)
|
||||
- Hotkey can be triggered on key press, release or repeat
|
||||
- Hotkey can be added or removed at runtime
|
||||
- Hotkey can be enabled or disabled
|
||||
- Hotkey can be set to repeat on key hold
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [add_hotkey](#add_hotkey)
|
||||
- [is_processing](#is_processing)
|
||||
- [set_repeat](#set_repeat)
|
||||
|
||||
## Fields
|
||||
|
||||
- [on_hotkey_pressed](#on_hotkey_pressed)
|
||||
- [on_hotkey_released](#on_hotkey_released)
|
||||
- [style](#style)
|
||||
- [druid](#druid)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
hotkey:init(keys, callback, [callback_argument])
|
||||
```
|
||||
|
||||
The Hotkey constructor
|
||||
|
||||
- **Parameters:**
|
||||
- `keys` *(string|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)*: The argument to pass into the callback function
|
||||
|
||||
### add_hotkey
|
||||
|
||||
---
|
||||
```lua
|
||||
hotkey:add_hotkey(keys, [callback_argument])
|
||||
```
|
||||
|
||||
Add hotkey for component callback
|
||||
|
||||
- **Parameters:**
|
||||
- `keys` *(string|hash|hash[]|string[])*: that have to be pressed before key pressed to activate
|
||||
- `[callback_argument]` *(any)*: The argument to pass into the callback function
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.hotkey)*: Current instance
|
||||
|
||||
### is_processing
|
||||
|
||||
---
|
||||
```lua
|
||||
hotkey:is_processing()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `` *(boolean)*:
|
||||
|
||||
### set_repeat
|
||||
|
||||
---
|
||||
```lua
|
||||
hotkey:set_repeat(is_enabled_repeated)
|
||||
```
|
||||
|
||||
If true, the callback will be triggered on action.repeated
|
||||
|
||||
- **Parameters:**
|
||||
- `is_enabled_repeated` *(boolean)*: The flag value
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.hotkey)*: Current instance
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="on_hotkey_pressed"></a>
|
||||
- **on_hotkey_pressed** (_event_): fun(self, context, callback_argument) The event triggered when a hotkey is pressed
|
||||
|
||||
<a name="on_hotkey_released"></a>
|
||||
- **on_hotkey_released** (_event_): fun(self, context, callback_argument) The event triggered when a hotkey is released
|
||||
|
||||
<a name="style"></a>
|
||||
- **style** (_druid.hotkey.style_): The style of the hotkey component
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
@ -1,307 +0,0 @@
|
||||
# druid.input API
|
||||
|
||||
> at /druid/extended/input.lua
|
||||
|
||||
Basic Druid text input component. Handles user text input via component with button and text.
|
||||
|
||||
### Setup
|
||||
Create input component with druid: `input = druid:new_input(button_node_name, text_node_name, keyboard_type)`
|
||||
|
||||
### Notes
|
||||
- Input component handles user text input. Input contains button and text components
|
||||
- Button needed for selecting/unselecting input field
|
||||
- Click outside of button to unselect input field
|
||||
- On focus lost (game minimized) input field will be unselected
|
||||
- You can setup max length of the text
|
||||
- You can setup allowed characters. On add not allowed characters `on_input_wrong` will be called
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [get_text_selected](#get_text_selected)
|
||||
- [get_text_selected_replaced](#get_text_selected_replaced)
|
||||
- [set_text](#set_text)
|
||||
- [select](#select)
|
||||
- [unselect](#unselect)
|
||||
- [get_text](#get_text)
|
||||
- [set_max_length](#set_max_length)
|
||||
- [set_allowed_characters](#set_allowed_characters)
|
||||
- [reset_changes](#reset_changes)
|
||||
- [select_cursor](#select_cursor)
|
||||
- [move_selection](#move_selection)
|
||||
|
||||
## Fields
|
||||
|
||||
- [on_input_select](#on_input_select)
|
||||
- [on_input_unselect](#on_input_unselect)
|
||||
- [on_input_text](#on_input_text)
|
||||
- [on_input_empty](#on_input_empty)
|
||||
- [on_input_full](#on_input_full)
|
||||
- [on_input_wrong](#on_input_wrong)
|
||||
- [on_select_cursor_change](#on_select_cursor_change)
|
||||
- [style](#style)
|
||||
- [druid](#druid)
|
||||
- [text](#text)
|
||||
- [is_selected](#is_selected)
|
||||
- [value](#value)
|
||||
- [previous_value](#previous_value)
|
||||
- [current_value](#current_value)
|
||||
- [marked_value](#marked_value)
|
||||
- [is_empty](#is_empty)
|
||||
- [text_width](#text_width)
|
||||
- [market_text_width](#market_text_width)
|
||||
- [total_width](#total_width)
|
||||
- [cursor_index](#cursor_index)
|
||||
- [start_index](#start_index)
|
||||
- [end_index](#end_index)
|
||||
- [max_length](#max_length)
|
||||
- [allowed_characters](#allowed_characters)
|
||||
- [keyboard_type](#keyboard_type)
|
||||
- [button](#button)
|
||||
- [marked_text_width](#marked_text_width)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
input:init(click_node, text_node, [keyboard_type])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `click_node` *(node)*: Node to enabled input component
|
||||
- `text_node` *(druid.text|node)*: Text node what will be changed on user input. You can pass text component instead of text node name Text
|
||||
- `[keyboard_type]` *(constant|nil)*: Gui keyboard type for input field
|
||||
|
||||
### get_text_selected
|
||||
|
||||
---
|
||||
```lua
|
||||
input:get_text_selected()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `` *(string|unknown)*:
|
||||
|
||||
### get_text_selected_replaced
|
||||
|
||||
---
|
||||
```lua
|
||||
input:get_text_selected_replaced(text)
|
||||
```
|
||||
|
||||
Replace selected text with new text
|
||||
|
||||
- **Parameters:**
|
||||
- `text` *(string)*: The text to replace selected text
|
||||
|
||||
- **Returns:**
|
||||
- `new_text` *(string)*: New input text
|
||||
|
||||
### set_text
|
||||
|
||||
---
|
||||
```lua
|
||||
input:set_text([input_text])
|
||||
```
|
||||
|
||||
Set text for input field
|
||||
|
||||
- **Parameters:**
|
||||
- `[input_text]` *(string?)*: The string to apply for input field, if nil - will be set to empty string
|
||||
|
||||
### select
|
||||
|
||||
---
|
||||
```lua
|
||||
input:select()
|
||||
```
|
||||
|
||||
Select input field. It will show the keyboard and trigger on_select events
|
||||
|
||||
### unselect
|
||||
|
||||
---
|
||||
```lua
|
||||
input:unselect()
|
||||
```
|
||||
|
||||
Remove selection from input. It will hide the keyboard and trigger on_unselect events
|
||||
|
||||
### get_text
|
||||
|
||||
---
|
||||
```lua
|
||||
input:get_text()
|
||||
```
|
||||
|
||||
Return current input field text
|
||||
|
||||
- **Returns:**
|
||||
- `text` *(string)*: The current input field text
|
||||
|
||||
### set_max_length
|
||||
|
||||
---
|
||||
```lua
|
||||
input:set_max_length(max_length)
|
||||
```
|
||||
|
||||
Set maximum length for input field.
|
||||
Pass nil to make input field unliminted (by default)
|
||||
|
||||
- **Parameters:**
|
||||
- `max_length` *(number)*: Maximum length for input text field
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.input)*: Current input instance
|
||||
|
||||
### set_allowed_characters
|
||||
|
||||
---
|
||||
```lua
|
||||
input:set_allowed_characters(characters)
|
||||
```
|
||||
|
||||
Set allowed charaters for input field.
|
||||
See: https://defold.com/ref/stable/string/
|
||||
ex: [%a%d] for alpha and numeric
|
||||
ex: [abcdef] to allow only these characters
|
||||
ex: [^%s] to allow only non-space characters
|
||||
|
||||
- **Parameters:**
|
||||
- `characters` *(string)*: Regular expression for validate user input
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.input)*: Current input instance
|
||||
|
||||
### reset_changes
|
||||
|
||||
---
|
||||
```lua
|
||||
input:reset_changes()
|
||||
```
|
||||
|
||||
Reset current input selection and return previous value
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.input)*: Current input instance
|
||||
|
||||
### select_cursor
|
||||
|
||||
---
|
||||
```lua
|
||||
input:select_cursor([cursor_index], [start_index], [end_index])
|
||||
```
|
||||
|
||||
Set cursor position in input field
|
||||
|
||||
- **Parameters:**
|
||||
- `[cursor_index]` *(number|nil)*: Cursor index for cursor position, if nil - will be set to the end of the text
|
||||
- `[start_index]` *(number|nil)*: Start index for cursor position, if nil - will be set to the end of the text
|
||||
- `[end_index]` *(number|nil)*: End index for cursor position, if nil - will be set to the start_index
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.input)*: Current input instance
|
||||
|
||||
### move_selection
|
||||
|
||||
---
|
||||
```lua
|
||||
input:move_selection(delta, is_add_to_selection, is_move_to_end)
|
||||
```
|
||||
|
||||
Change cursor position by delta
|
||||
|
||||
- **Parameters:**
|
||||
- `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)
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.input)*: Current input instance
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="on_input_select"></a>
|
||||
- **on_input_select** (_event_): fun(self: druid.input, input: druid.input) The event triggered when the input field is selected
|
||||
|
||||
<a name="on_input_unselect"></a>
|
||||
- **on_input_unselect** (_event_): fun(self: druid.input, text: string, input: druid.input) The event triggered when the input field is unselected
|
||||
|
||||
<a name="on_input_text"></a>
|
||||
- **on_input_text** (_event_): fun(self: druid.input) The event triggered when the input field is changed
|
||||
|
||||
<a name="on_input_empty"></a>
|
||||
- **on_input_empty** (_event_): fun(self: druid.input) The event triggered when the input field is empty
|
||||
|
||||
<a name="on_input_full"></a>
|
||||
- **on_input_full** (_event_): fun(self: druid.input) The event triggered when the input field is full
|
||||
|
||||
<a name="on_input_wrong"></a>
|
||||
- **on_input_wrong** (_event_): fun(self: druid.input) The event triggered when the input field is wrong
|
||||
|
||||
<a name="on_select_cursor_change"></a>
|
||||
- **on_select_cursor_change** (_event_): fun(self: druid.input, cursor_index: number, start_index: number, end_index: number) The event triggered when the cursor index is changed
|
||||
|
||||
<a name="style"></a>
|
||||
- **style** (_druid.input.style_): The style of the input component
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
||||
<a name="text"></a>
|
||||
- **text** (_druid.text|node_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="is_selected"></a>
|
||||
- **is_selected** (_boolean_)
|
||||
|
||||
<a name="value"></a>
|
||||
- **value** (_unknown_)
|
||||
|
||||
<a name="previous_value"></a>
|
||||
- **previous_value** (_unknown_)
|
||||
|
||||
<a name="current_value"></a>
|
||||
- **current_value** (_unknown_)
|
||||
|
||||
<a name="marked_value"></a>
|
||||
- **marked_value** (_string_)
|
||||
|
||||
<a name="is_empty"></a>
|
||||
- **is_empty** (_boolean_)
|
||||
|
||||
<a name="text_width"></a>
|
||||
- **text_width** (_integer_)
|
||||
|
||||
<a name="market_text_width"></a>
|
||||
- **market_text_width** (_integer_)
|
||||
|
||||
<a name="total_width"></a>
|
||||
- **total_width** (_integer_)
|
||||
|
||||
<a name="cursor_index"></a>
|
||||
- **cursor_index** (_integer_)
|
||||
|
||||
<a name="start_index"></a>
|
||||
- **start_index** (_number_)
|
||||
|
||||
<a name="end_index"></a>
|
||||
- **end_index** (_number_)
|
||||
|
||||
<a name="max_length"></a>
|
||||
- **max_length** (_nil_)
|
||||
|
||||
<a name="allowed_characters"></a>
|
||||
- **allowed_characters** (_nil_)
|
||||
|
||||
<a name="keyboard_type"></a>
|
||||
- **keyboard_type** (_constant_)
|
||||
|
||||
<a name="button"></a>
|
||||
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
|
||||
|
||||
<a name="marked_text_width"></a>
|
||||
- **marked_text_width** (_number_)
|
||||
|
@ -1,122 +0,0 @@
|
||||
# druid.lang_text API
|
||||
|
||||
> at /druid/extended/lang_text.lua
|
||||
|
||||
The component used for displaying localized text, can automatically update text when locale is changed.
|
||||
It wraps the Text component to handle localization using druid's get_text_function to set text by its id.
|
||||
|
||||
### Setup
|
||||
Create lang text component with druid: `text = druid:new_lang_text(node_name, locale_id)`
|
||||
|
||||
### Notes
|
||||
- Component automatically updates text when locale is changed
|
||||
- Uses druid's get_text_function to get localized text by id
|
||||
- Supports string formatting with additional parameters
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_to](#set_to)
|
||||
- [set_text](#set_text)
|
||||
- [translate](#translate)
|
||||
- [format](#format)
|
||||
|
||||
## Fields
|
||||
|
||||
- [text](#text)
|
||||
- [node](#node)
|
||||
- [on_change](#on_change)
|
||||
- [druid](#druid)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
lang_text:init(node, [locale_id], [adjust_type])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: The node_id or gui.get_node(node_id)
|
||||
- `[locale_id]` *(string|nil)*: Default locale id or text from node as default. If not provided, will use text from the node
|
||||
- `[adjust_type]` *(string|nil)*: Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.lang_text)*:
|
||||
|
||||
### set_to
|
||||
|
||||
---
|
||||
```lua
|
||||
lang_text:set_to(text)
|
||||
```
|
||||
|
||||
Setup raw text to lang_text component. This will clear any locale settings.
|
||||
|
||||
- **Parameters:**
|
||||
- `text` *(string)*: Text for text node
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.lang_text)*: Current instance
|
||||
|
||||
### set_text
|
||||
|
||||
---
|
||||
```lua
|
||||
lang_text:set_text(text)
|
||||
```
|
||||
|
||||
Setup raw text to lang_text component. This will clear any locale settings.
|
||||
|
||||
- **Parameters:**
|
||||
- `text` *(string)*: Text for text node
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.lang_text)*: Current instance
|
||||
|
||||
### translate
|
||||
|
||||
---
|
||||
```lua
|
||||
lang_text:translate(locale_id, ...)
|
||||
```
|
||||
|
||||
Translate the text by locale_id. The text will be automatically updated when locale changes.
|
||||
|
||||
- **Parameters:**
|
||||
- `locale_id` *(string)*: Locale id to get text from
|
||||
- `...` *(...)*: vararg
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.lang_text)*: Current instance
|
||||
|
||||
### format
|
||||
|
||||
---
|
||||
```lua
|
||||
lang_text:format(...)
|
||||
```
|
||||
|
||||
Format string with new text params on localized text. Keeps the current locale but updates the format parameters.
|
||||
|
||||
- **Parameters:**
|
||||
- `...` *(...)*: vararg
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.lang_text)*: Current instance
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="text"></a>
|
||||
- **text** (_druid.text_): The text component
|
||||
|
||||
<a name="node"></a>
|
||||
- **node** (_node_): The node of the text component
|
||||
|
||||
<a name="on_change"></a>
|
||||
- **on_change** (_event_): fun(self: druid.lang_text) The event triggered when the text is changed
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
@ -1,344 +0,0 @@
|
||||
# druid.layout API
|
||||
|
||||
> at /druid/extended/layout.lua
|
||||
|
||||
Druid component to manage the layout of nodes, placing them inside the node size with respect to the size and pivot of each node.
|
||||
|
||||
### Setup
|
||||
Create layout component with druid: `layout = druid:new_layout(node, layout_type)`
|
||||
|
||||
### Notes
|
||||
- Layout can be horizontal, vertical or horizontal with wrapping
|
||||
- Layout can resize parent node to fit content
|
||||
- Layout can justify content
|
||||
- Layout supports margins and padding
|
||||
- Layout automatically updates when nodes are added or removed
|
||||
- Layout can be manually updated by calling set_dirty()
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [update](#update)
|
||||
- [get_entities](#get_entities)
|
||||
- [set_node_index](#set_node_index)
|
||||
- [set_margin](#set_margin)
|
||||
- [set_padding](#set_padding)
|
||||
- [set_dirty](#set_dirty)
|
||||
- [set_justify](#set_justify)
|
||||
- [set_type](#set_type)
|
||||
- [set_hug_content](#set_hug_content)
|
||||
- [add](#add)
|
||||
- [remove](#remove)
|
||||
- [get_size](#get_size)
|
||||
- [get_content_size](#get_content_size)
|
||||
- [refresh_layout](#refresh_layout)
|
||||
- [clear_layout](#clear_layout)
|
||||
- [get_node_size](#get_node_size)
|
||||
- [calculate_rows_data](#calculate_rows_data)
|
||||
- [set_node_position](#set_node_position)
|
||||
|
||||
## Fields
|
||||
|
||||
- [node](#node)
|
||||
- [rows_data](#rows_data)
|
||||
- [is_dirty](#is_dirty)
|
||||
- [entities](#entities)
|
||||
- [margin](#margin)
|
||||
- [padding](#padding)
|
||||
- [type](#type)
|
||||
- [is_resize_width](#is_resize_width)
|
||||
- [is_resize_height](#is_resize_height)
|
||||
- [is_justify](#is_justify)
|
||||
- [on_size_changed](#on_size_changed)
|
||||
- [size](#size)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:init(node_or_node_id, layout_type)
|
||||
```
|
||||
|
||||
```lua
|
||||
layout_type:
|
||||
| "horizontal"
|
||||
| "vertical"
|
||||
| "horizontal_wrap"
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `node_or_node_id` *(string|node)*: The node to manage the layout of
|
||||
- `layout_type` *("horizontal"|"horizontal_wrap"|"vertical")*: The type of layout (horizontal, vertical, horizontal_wrap)
|
||||
|
||||
### update
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:update()
|
||||
```
|
||||
|
||||
### get_entities
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:get_entities()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `entities` *(node[])*: The entities to manage the layout of
|
||||
|
||||
### set_node_index
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:set_node_index(node, index)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*: The node to set the index of
|
||||
- `index` *(number)*: The index to set the node to
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.layout)*: for chaining
|
||||
|
||||
### set_margin
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:set_margin([margin_x], [margin_y])
|
||||
```
|
||||
|
||||
Set the margin of the layout
|
||||
|
||||
- **Parameters:**
|
||||
- `[margin_x]` *(number|nil)*: The margin x
|
||||
- `[margin_y]` *(number|nil)*: The margin y
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.layout)*: Current layout instance
|
||||
|
||||
### set_padding
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:set_padding([padding_x], [padding_y], [padding_z], [padding_w])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[padding_x]` *(number|nil)*: The padding x
|
||||
- `[padding_y]` *(number|nil)*: The padding y
|
||||
- `[padding_z]` *(number|nil)*: The padding z
|
||||
- `[padding_w]` *(number|nil)*: The padding w
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.layout)*: Current layout instance
|
||||
|
||||
### set_dirty
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:set_dirty()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.layout)*: Current layout instance
|
||||
|
||||
### set_justify
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:set_justify(is_justify)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `is_justify` *(boolean)*:
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.layout)*: Current layout instance
|
||||
|
||||
### set_type
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:set_type(layout_type)
|
||||
```
|
||||
|
||||
```lua
|
||||
layout_type:
|
||||
| "horizontal"
|
||||
| "vertical"
|
||||
| "horizontal_wrap"
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `layout_type` *("horizontal"|"horizontal_wrap"|"vertical")*:
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.layout)*: Current layout instance
|
||||
|
||||
### set_hug_content
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:set_hug_content(is_hug_width, is_hug_height)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `is_hug_width` *(boolean)*:
|
||||
- `is_hug_height` *(boolean)*:
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.layout)*: Current layout instance
|
||||
|
||||
### add
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:add(node_or_node_id)
|
||||
```
|
||||
|
||||
Add node to layout
|
||||
|
||||
- **Parameters:**
|
||||
- `node_or_node_id` *(string|node)*: node_or_node_id
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.layout)*: Current layout instance
|
||||
|
||||
### remove
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:remove(node_or_node_id)
|
||||
```
|
||||
|
||||
Remove node from layout
|
||||
|
||||
- **Parameters:**
|
||||
- `node_or_node_id` *(string|node)*: node_or_node_id
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.layout)*: for chaining
|
||||
|
||||
### get_size
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:get_size()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `` *(vector3)*:
|
||||
|
||||
### get_content_size
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:get_content_size()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `` *(number)*:
|
||||
- `` *(number)*:
|
||||
|
||||
### refresh_layout
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:refresh_layout()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.layout)*: Current layout instance
|
||||
|
||||
### clear_layout
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:clear_layout()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.layout)*: Current layout instance
|
||||
|
||||
### get_node_size
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:get_node_size(node)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*:
|
||||
|
||||
- **Returns:**
|
||||
- `width` *(number)*: The width of the node
|
||||
- `height` *(number)*: The height of the node
|
||||
|
||||
### calculate_rows_data
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:calculate_rows_data()
|
||||
```
|
||||
|
||||
Calculate rows data for layout. Contains total width, height and rows info (width, height, count of elements in row)
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.layout.rows_data)*:
|
||||
|
||||
### set_node_position
|
||||
|
||||
---
|
||||
```lua
|
||||
layout:set_node_position(node, x, y)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*:
|
||||
- `x` *(number)*:
|
||||
- `y` *(number)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(node)*:
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="node"></a>
|
||||
- **node** (_node_): The node to manage the layout of
|
||||
|
||||
<a name="rows_data"></a>
|
||||
- **rows_data** (_druid.layout.rows_data_): Last calculated rows data
|
||||
|
||||
<a name="is_dirty"></a>
|
||||
- **is_dirty** (_boolean_): True if layout needs to be updated
|
||||
|
||||
<a name="entities"></a>
|
||||
- **entities** (_node[]_): The entities to manage the layout of
|
||||
|
||||
<a name="margin"></a>
|
||||
- **margin** (_{ x: number, y: number }_): The margin of the layout
|
||||
|
||||
<a name="padding"></a>
|
||||
- **padding** (_vector4_): The padding of the layout
|
||||
|
||||
<a name="type"></a>
|
||||
- **type** (_string_): The type of the layout
|
||||
|
||||
<a name="is_resize_width"></a>
|
||||
- **is_resize_width** (_boolean_): True if the layout should resize the width of the node
|
||||
|
||||
<a name="is_resize_height"></a>
|
||||
- **is_resize_height** (_boolean_): True if the layout should resize the height of the node
|
||||
|
||||
<a name="is_justify"></a>
|
||||
- **is_justify** (_boolean_): True if the layout should justify the nodes
|
||||
|
||||
<a name="on_size_changed"></a>
|
||||
- **on_size_changed** (_event.on_size_changed_): fun(self: druid.layout, size: vector3) The event triggered when the size of the layout is changed
|
||||
|
||||
<a name="size"></a>
|
||||
- **size** (_unknown_)
|
||||
|
@ -1,215 +0,0 @@
|
||||
# druid.progress API
|
||||
|
||||
> at /druid/extended/progress.lua
|
||||
|
||||
Basic Druid progress bar component. Changes the size or scale of a node to represent progress.
|
||||
|
||||
### Setup
|
||||
Create progress bar component with druid: `progress = druid:new_progress(node_name, key, init_value)`
|
||||
|
||||
### Notes
|
||||
- Node should have maximum node size in GUI scene, it represents the progress bar's maximum size
|
||||
- Key is value from druid const: "x" or "y"
|
||||
- Progress works correctly with 9slice nodes, it tries to set size by _set_size_ first until minimum size is reached, then it continues sizing via _set_scale_
|
||||
- Progress bar can fill only by vertical or horizontal size. For diagonal progress bar, just rotate the node in GUI scene
|
||||
- If you have glitchy or dark texture bugs with progress bar, try to disable mipmaps in your texture profiles
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [update](#update)
|
||||
- [fill](#fill)
|
||||
- [empty](#empty)
|
||||
- [set_to](#set_to)
|
||||
- [get](#get)
|
||||
- [set_steps](#set_steps)
|
||||
- [to](#to)
|
||||
- [set_max_size](#set_max_size)
|
||||
|
||||
## Fields
|
||||
|
||||
- [node](#node)
|
||||
- [on_change](#on_change)
|
||||
- [style](#style)
|
||||
- [key](#key)
|
||||
- [prop](#prop)
|
||||
- [scale](#scale)
|
||||
- [size](#size)
|
||||
- [max_size](#max_size)
|
||||
- [slice](#slice)
|
||||
- [last_value](#last_value)
|
||||
- [slice_size](#slice_size)
|
||||
- [target](#target)
|
||||
- [steps](#steps)
|
||||
- [step_callback](#step_callback)
|
||||
- [target_callback](#target_callback)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
progress:init(node, key, [init_value])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: Node name or GUI Node itself.
|
||||
- `key` *(string)*: Progress bar direction: "x" or "y"
|
||||
- `[init_value]` *(number|nil)*: Initial value of progress bar (0 to 1). Default: 1
|
||||
|
||||
### update
|
||||
|
||||
---
|
||||
```lua
|
||||
progress:update(dt)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `dt` *(number)*: Delta time
|
||||
|
||||
### fill
|
||||
|
||||
---
|
||||
```lua
|
||||
progress:fill()
|
||||
```
|
||||
|
||||
Fill the progress bar
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.progress)*: Current progress instance
|
||||
|
||||
### empty
|
||||
|
||||
---
|
||||
```lua
|
||||
progress:empty()
|
||||
```
|
||||
|
||||
Empty the progress bar
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.progress)*: Current progress instance
|
||||
|
||||
### set_to
|
||||
|
||||
---
|
||||
```lua
|
||||
progress:set_to(to)
|
||||
```
|
||||
|
||||
Instant fill progress bar to value
|
||||
|
||||
- **Parameters:**
|
||||
- `to` *(number)*: Progress bar value, from 0 to 1
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.progress)*: Current progress instance
|
||||
|
||||
### get
|
||||
|
||||
---
|
||||
```lua
|
||||
progress:get()
|
||||
```
|
||||
|
||||
Return the current value of the progress bar
|
||||
|
||||
- **Returns:**
|
||||
- `value` *(number)*: The current value of the progress bar
|
||||
|
||||
### set_steps
|
||||
|
||||
---
|
||||
```lua
|
||||
progress:set_steps(steps, callback)
|
||||
```
|
||||
|
||||
Set points on progress bar to fire the callback
|
||||
|
||||
- **Parameters:**
|
||||
- `steps` *(number[])*: Array of progress bar values
|
||||
- `callback` *(function)*: Callback on intersect step value
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.progress)*: Current progress instance
|
||||
|
||||
### to
|
||||
|
||||
---
|
||||
```lua
|
||||
progress:to(to, [callback])
|
||||
```
|
||||
|
||||
Start animation of a progress bar
|
||||
|
||||
- **Parameters:**
|
||||
- `to` *(number)*: value between 0..1
|
||||
- `[callback]` *(function|nil)*: Callback on animation ends
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.progress)*: Current progress instance
|
||||
|
||||
### set_max_size
|
||||
|
||||
---
|
||||
```lua
|
||||
progress:set_max_size(max_size)
|
||||
```
|
||||
|
||||
Set progress bar max node size
|
||||
|
||||
- **Parameters:**
|
||||
- `max_size` *(vector3)*: The new node maximum (full) size
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.progress)*: Current progress instance
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="node"></a>
|
||||
- **node** (_node_): The progress bar node
|
||||
|
||||
<a name="on_change"></a>
|
||||
- **on_change** (_event_): fun(self: druid.progress, value: number) Event triggered when progress value changes
|
||||
|
||||
<a name="style"></a>
|
||||
- **style** (_druid.progress.style_): Component style parameters
|
||||
|
||||
<a name="key"></a>
|
||||
- **key** (_string_): Progress bar direction: "x" or "y"
|
||||
|
||||
<a name="prop"></a>
|
||||
- **prop** (_hash_): Property for scaling the progress bar
|
||||
|
||||
<a name="scale"></a>
|
||||
- **scale** (_unknown_)
|
||||
|
||||
<a name="size"></a>
|
||||
- **size** (_unknown_)
|
||||
|
||||
<a name="max_size"></a>
|
||||
- **max_size** (_unknown_)
|
||||
|
||||
<a name="slice"></a>
|
||||
- **slice** (_unknown_)
|
||||
|
||||
<a name="last_value"></a>
|
||||
- **last_value** (_number_)
|
||||
|
||||
<a name="slice_size"></a>
|
||||
- **slice_size** (_unknown_)
|
||||
|
||||
<a name="target"></a>
|
||||
- **target** (_nil_)
|
||||
|
||||
<a name="steps"></a>
|
||||
- **steps** (_number[]_)
|
||||
|
||||
<a name="step_callback"></a>
|
||||
- **step_callback** (_function_)
|
||||
|
||||
<a name="target_callback"></a>
|
||||
- **target_callback** (_function|nil_)
|
||||
|
@ -1,135 +0,0 @@
|
||||
# druid.slider API
|
||||
|
||||
> at /druid/extended/slider.lua
|
||||
|
||||
Basic Druid slider component. Creates a draggable node over a line with progress reporting.
|
||||
|
||||
### Setup
|
||||
Create slider component with druid: `slider = druid:new_slider(node_name, end_pos, callback)`
|
||||
|
||||
### Notes
|
||||
- Pin node should be placed in initial position at zero progress
|
||||
- It will be available to move Pin node between start pos and end pos
|
||||
- You can setup points of interests on slider via `slider:set_steps`. If steps exist, slider values will be only from these steps (notched slider)
|
||||
- Start pos and end pos should be on vertical or horizontal line (their x or y value should be equal)
|
||||
- To catch input across all slider, you can setup input node via `slider:set_input_node`
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set](#set)
|
||||
- [set_steps](#set_steps)
|
||||
- [set_input_node](#set_input_node)
|
||||
- [set_enabled](#set_enabled)
|
||||
- [is_enabled](#is_enabled)
|
||||
|
||||
## Fields
|
||||
|
||||
- [node](#node)
|
||||
- [on_change_value](#on_change_value)
|
||||
- [style](#style)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
slider:init(node, end_pos, [callback])
|
||||
```
|
||||
|
||||
The Slider constructor
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*: GUI node to drag as a slider
|
||||
- `end_pos` *(vector3)*: The end position of slider, should be on the same axis as the node
|
||||
- `[callback]` *(function|nil)*: On slider change callback
|
||||
|
||||
### set
|
||||
|
||||
---
|
||||
```lua
|
||||
slider:set(value, [is_silent])
|
||||
```
|
||||
|
||||
Set value for slider
|
||||
|
||||
- **Parameters:**
|
||||
- `value` *(number)*: Value from 0 to 1
|
||||
- `[is_silent]` *(boolean|nil)*: Don't trigger event if true
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.slider)*: Current slider instance
|
||||
|
||||
### set_steps
|
||||
|
||||
---
|
||||
```lua
|
||||
slider:set_steps(steps)
|
||||
```
|
||||
|
||||
Set slider steps. Pin node will
|
||||
apply closest step position
|
||||
|
||||
- **Parameters:**
|
||||
- `steps` *(number[])*: Array of steps
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.slider)*: Current slider instance
|
||||
|
||||
### set_input_node
|
||||
|
||||
---
|
||||
```lua
|
||||
slider:set_input_node([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:**
|
||||
- `[input_node]` *(string|node|nil)*:
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.slider)*: Current slider instance
|
||||
|
||||
### set_enabled
|
||||
|
||||
---
|
||||
```lua
|
||||
slider:set_enabled(is_enabled)
|
||||
```
|
||||
|
||||
Set Slider input enabled or disabled
|
||||
|
||||
- **Parameters:**
|
||||
- `is_enabled` *(boolean)*: True if slider is enabled
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.slider)*: Current slider instance
|
||||
|
||||
### is_enabled
|
||||
|
||||
---
|
||||
```lua
|
||||
slider:is_enabled()
|
||||
```
|
||||
|
||||
Check if Slider component is enabled
|
||||
|
||||
- **Returns:**
|
||||
- `is_enabled` *(boolean)*: True if slider is enabled
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="node"></a>
|
||||
- **node** (_node_): The node to manage the slider
|
||||
|
||||
<a name="on_change_value"></a>
|
||||
- **on_change_value** (_event_): fun(self: druid.slider, value: number) The event triggered when the slider value changes
|
||||
|
||||
<a name="style"></a>
|
||||
- **style** (_table_): The style of the slider
|
||||
|
@ -1,57 +0,0 @@
|
||||
# druid.swipe API
|
||||
|
||||
> at /druid/extended/swipe.lua
|
||||
|
||||
The component to manage swipe events over a node
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_click_zone](#set_click_zone)
|
||||
|
||||
## Fields
|
||||
|
||||
- [node](#node)
|
||||
- [on_swipe](#on_swipe)
|
||||
- [style](#style)
|
||||
- [click_zone](#click_zone)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
swipe:init(node_or_node_id, on_swipe_callback)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `node_or_node_id` *(string|node)*:
|
||||
- `on_swipe_callback` *(function)*:
|
||||
|
||||
### set_click_zone
|
||||
|
||||
---
|
||||
```lua
|
||||
swipe:set_click_zone([zone])
|
||||
```
|
||||
|
||||
Set the click zone for the swipe, useful for restricting events outside stencil node
|
||||
|
||||
- **Parameters:**
|
||||
- `[zone]` *(string|node|nil)*: Gui node
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="node"></a>
|
||||
- **node** (_node_): The node to manage the swipe
|
||||
|
||||
<a name="on_swipe"></a>
|
||||
- **on_swipe** (_event_): fun(context, side, dist, dt) The event triggered when a swipe is detected
|
||||
|
||||
<a name="style"></a>
|
||||
- **style** (_druid.swipe.style_): The style of the swipe
|
||||
|
||||
<a name="click_zone"></a>
|
||||
- **click_zone** (_node_): The click zone of the swipe
|
||||
|
@ -1,130 +0,0 @@
|
||||
# druid.timer API
|
||||
|
||||
> at /druid/extended/timer.lua
|
||||
|
||||
Druid component to handle timer work on gui text node. Displays time in a formatted way.
|
||||
|
||||
### Setup
|
||||
Create timer component with druid: `timer = druid:new_timer(text_node, from_seconds, to_seconds, callback)`
|
||||
|
||||
### Notes
|
||||
- Timer fires callback when timer value equals to _to_seconds_
|
||||
- Timer will set text node with current timer value
|
||||
- Timer uses update function to handle time
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_to](#set_to)
|
||||
- [set_state](#set_state)
|
||||
- [set_interval](#set_interval)
|
||||
|
||||
## Fields
|
||||
|
||||
- [on_tick](#on_tick)
|
||||
- [on_set_enabled](#on_set_enabled)
|
||||
- [on_timer_end](#on_timer_end)
|
||||
- [node](#node)
|
||||
- [from](#from)
|
||||
- [target](#target)
|
||||
- [value](#value)
|
||||
- [is_on](#is_on)
|
||||
- [temp](#temp)
|
||||
- [last_value](#last_value)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
timer:init(node, [seconds_from], [seconds_to], [callback])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*: Gui text node
|
||||
- `[seconds_from]` *(number|nil)*: Start timer value in seconds
|
||||
- `[seconds_to]` *(number|nil)*: End timer value in seconds
|
||||
- `[callback]` *(function|nil)*: Function that triggers when timer value equals to seconds_to
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.timer)*:
|
||||
|
||||
### set_to
|
||||
|
||||
---
|
||||
```lua
|
||||
timer:set_to(set_to)
|
||||
```
|
||||
|
||||
Set the timer to a specific value
|
||||
|
||||
- **Parameters:**
|
||||
- `set_to` *(number)*: Value in seconds
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.timer)*: Current timer instance
|
||||
|
||||
### set_state
|
||||
|
||||
---
|
||||
```lua
|
||||
timer:set_state([is_on])
|
||||
```
|
||||
|
||||
Set the timer to a specific value
|
||||
|
||||
- **Parameters:**
|
||||
- `[is_on]` *(boolean|nil)*: Timer enable state
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.timer)*: Current timer instance
|
||||
|
||||
### set_interval
|
||||
|
||||
---
|
||||
```lua
|
||||
timer:set_interval(from, to)
|
||||
```
|
||||
|
||||
Set the timer interval
|
||||
|
||||
- **Parameters:**
|
||||
- `from` *(number)*: Start time in seconds
|
||||
- `to` *(number)*: Target time in seconds
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.timer)*: Current timer instance
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="on_tick"></a>
|
||||
- **on_tick** (_event_): fun(context, value) The event triggered when the timer ticks
|
||||
|
||||
<a name="on_set_enabled"></a>
|
||||
- **on_set_enabled** (_event_): fun(context, is_on) The event triggered when the timer is enabled
|
||||
|
||||
<a name="on_timer_end"></a>
|
||||
- **on_timer_end** (_event_): fun(context) The event triggered when the timer ends
|
||||
|
||||
<a name="node"></a>
|
||||
- **node** (_node_): The node to display the timer
|
||||
|
||||
<a name="from"></a>
|
||||
- **from** (_number_): The start time of the timer
|
||||
|
||||
<a name="target"></a>
|
||||
- **target** (_number_): The target time of the timer
|
||||
|
||||
<a name="value"></a>
|
||||
- **value** (_number_): The current value of the timer
|
||||
|
||||
<a name="is_on"></a>
|
||||
- **is_on** (_boolean_): True if the timer is on
|
||||
|
||||
<a name="temp"></a>
|
||||
- **temp** (_unknown_)
|
||||
|
||||
<a name="last_value"></a>
|
||||
- **last_value** (_number_)
|
||||
|
@ -1,93 +0,0 @@
|
||||
# druid.widget.fps_panel API
|
||||
|
||||
> at /druid/widget/fps_panel/fps_panel.lua
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [on_remove](#on_remove)
|
||||
- [update](#update)
|
||||
- [push_fps_value](#push_fps_value)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [delta_time](#delta_time)
|
||||
- [collect_time](#collect_time)
|
||||
- [collect_time_counter](#collect_time_counter)
|
||||
- [graph_samples](#graph_samples)
|
||||
- [fps_samples](#fps_samples)
|
||||
- [mini_graph](#mini_graph)
|
||||
- [text_min_fps](#text_min_fps)
|
||||
- [text_fps](#text_fps)
|
||||
- [timer_id](#timer_id)
|
||||
- [previous_time](#previous_time)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
fps_panel:init()
|
||||
```
|
||||
|
||||
### on_remove
|
||||
|
||||
---
|
||||
```lua
|
||||
fps_panel:on_remove()
|
||||
```
|
||||
|
||||
### update
|
||||
|
||||
---
|
||||
```lua
|
||||
fps_panel:update([dt])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[dt]` *(any)*:
|
||||
|
||||
### push_fps_value
|
||||
|
||||
---
|
||||
```lua
|
||||
fps_panel:push_fps_value()
|
||||
```
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_)
|
||||
|
||||
<a name="delta_time"></a>
|
||||
- **delta_time** (_number_): in seconds
|
||||
|
||||
<a name="collect_time"></a>
|
||||
- **collect_time** (_integer_): in seconds
|
||||
|
||||
<a name="collect_time_counter"></a>
|
||||
- **collect_time_counter** (_integer_)
|
||||
|
||||
<a name="graph_samples"></a>
|
||||
- **graph_samples** (_number_)
|
||||
|
||||
<a name="fps_samples"></a>
|
||||
- **fps_samples** (_table_): Store frame time in seconds last collect_time seconds
|
||||
|
||||
<a name="mini_graph"></a>
|
||||
- **mini_graph** (_druid.widget.mini_graph_): Widget to display a several lines with different height in a row
|
||||
|
||||
<a name="text_min_fps"></a>
|
||||
- **text_min_fps** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="text_fps"></a>
|
||||
- **text_fps** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="timer_id"></a>
|
||||
- **timer_id** (_unknown_)
|
||||
|
||||
<a name="previous_time"></a>
|
||||
- **previous_time** (_unknown_)
|
||||
|
@ -1,101 +0,0 @@
|
||||
# druid.widget.memory_panel API
|
||||
|
||||
> at /druid/widget/memory_panel/memory_panel.lua
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [on_remove](#on_remove)
|
||||
- [set_low_memory_limit](#set_low_memory_limit)
|
||||
- [push_next_value](#push_next_value)
|
||||
- [update_text_memory](#update_text_memory)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [delta_time](#delta_time)
|
||||
- [samples_count](#samples_count)
|
||||
- [memory_limit](#memory_limit)
|
||||
- [mini_graph](#mini_graph)
|
||||
- [max_value](#max_value)
|
||||
- [text_per_second](#text_per_second)
|
||||
- [text_memory](#text_memory)
|
||||
- [memory](#memory)
|
||||
- [memory_samples](#memory_samples)
|
||||
- [timer_id](#timer_id)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
memory_panel:init()
|
||||
```
|
||||
|
||||
### on_remove
|
||||
|
||||
---
|
||||
```lua
|
||||
memory_panel:on_remove()
|
||||
```
|
||||
|
||||
### set_low_memory_limit
|
||||
|
||||
---
|
||||
```lua
|
||||
memory_panel:set_low_memory_limit([limit])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[limit]` *(any)*:
|
||||
|
||||
### push_next_value
|
||||
|
||||
---
|
||||
```lua
|
||||
memory_panel:push_next_value()
|
||||
```
|
||||
|
||||
### update_text_memory
|
||||
|
||||
---
|
||||
```lua
|
||||
memory_panel:update_text_memory()
|
||||
```
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_)
|
||||
|
||||
<a name="delta_time"></a>
|
||||
- **delta_time** (_number_)
|
||||
|
||||
<a name="samples_count"></a>
|
||||
- **samples_count** (_integer_)
|
||||
|
||||
<a name="memory_limit"></a>
|
||||
- **memory_limit** (_integer_)
|
||||
|
||||
<a name="mini_graph"></a>
|
||||
- **mini_graph** (_druid.widget.mini_graph_): Widget to display a several lines with different height in a row
|
||||
|
||||
<a name="max_value"></a>
|
||||
- **max_value** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="text_per_second"></a>
|
||||
- **text_per_second** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="text_memory"></a>
|
||||
- **text_memory** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="memory"></a>
|
||||
- **memory** (_unknown_)
|
||||
|
||||
<a name="memory_samples"></a>
|
||||
- **memory_samples** (_table_)
|
||||
|
||||
<a name="timer_id"></a>
|
||||
- **timer_id** (_unknown_)
|
||||
|
@ -1,233 +0,0 @@
|
||||
# druid.widget.mini_graph API
|
||||
|
||||
> at /druid/widget/mini_graph/mini_graph.lua
|
||||
|
||||
Widget to display a several lines with different height in a row
|
||||
Init, set amount of samples and max value of value means that the line will be at max height
|
||||
Use `push_line_value` to add a new value to the line
|
||||
Or `set_line_value` to set a value to the line by index
|
||||
Setup colors inside template file (at minimum and maximum)
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [on_remove](#on_remove)
|
||||
- [clear](#clear)
|
||||
- [set_samples](#set_samples)
|
||||
- [get_samples](#get_samples)
|
||||
- [set_line_value](#set_line_value)
|
||||
- [get_line_value](#get_line_value)
|
||||
- [push_line_value](#push_line_value)
|
||||
- [set_max_value](#set_max_value)
|
||||
- [set_line_height](#set_line_height)
|
||||
- [get_lowest_value](#get_lowest_value)
|
||||
- [get_highest_value](#get_highest_value)
|
||||
- [on_drag_widget](#on_drag_widget)
|
||||
- [toggle_hide](#toggle_hide)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [text_header](#text_header)
|
||||
- [icon_drag](#icon_drag)
|
||||
- [content](#content)
|
||||
- [layout](#layout)
|
||||
- [prefab_line](#prefab_line)
|
||||
- [color_zero](#color_zero)
|
||||
- [color_one](#color_one)
|
||||
- [is_hidden](#is_hidden)
|
||||
- [max_value](#max_value)
|
||||
- [lines](#lines)
|
||||
- [values](#values)
|
||||
- [container](#container)
|
||||
- [default_size](#default_size)
|
||||
- [samples](#samples)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:init()
|
||||
```
|
||||
|
||||
### on_remove
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:on_remove()
|
||||
```
|
||||
|
||||
### clear
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:clear()
|
||||
```
|
||||
|
||||
### set_samples
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:set_samples([samples])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[samples]` *(any)*:
|
||||
|
||||
### get_samples
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:get_samples()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `` *(unknown)*:
|
||||
|
||||
### set_line_value
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:set_line_value(index, value)
|
||||
```
|
||||
|
||||
Set normalized to control the color of the line
|
||||
|
||||
- **Parameters:**
|
||||
- `index` *(number)*:
|
||||
- `value` *(number)*: The normalized value from 0 to 1
|
||||
|
||||
- **Example Usage:**
|
||||
|
||||
```lua
|
||||
for index = 1, mini_graph:get_samples() do
|
||||
mini_graph:set_line_value(index, math.random())
|
||||
end
|
||||
```
|
||||
### get_line_value
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:get_line_value([index])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[index]` *(any)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(number)*:
|
||||
|
||||
### push_line_value
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:push_line_value([value])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[value]` *(any)*:
|
||||
|
||||
### set_max_value
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:set_max_value([max_value])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[max_value]` *(any)*:
|
||||
|
||||
### set_line_height
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:set_line_height([index])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[index]` *(any)*:
|
||||
|
||||
### get_lowest_value
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:get_lowest_value()
|
||||
```
|
||||
|
||||
### get_highest_value
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:get_highest_value()
|
||||
```
|
||||
|
||||
### on_drag_widget
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:on_drag_widget([dx], [dy])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[dx]` *(any)*:
|
||||
- `[dy]` *(any)*:
|
||||
|
||||
### toggle_hide
|
||||
|
||||
---
|
||||
```lua
|
||||
mini_graph:toggle_hide()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.mini_graph)*:
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_)
|
||||
|
||||
<a name="text_header"></a>
|
||||
- **text_header** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="icon_drag"></a>
|
||||
- **icon_drag** (_node_)
|
||||
|
||||
<a name="content"></a>
|
||||
- **content** (_node_)
|
||||
|
||||
<a name="layout"></a>
|
||||
- **layout** (_druid.layout_): Druid component to manage the layout of nodes, placing them inside the node size with respect to the size and pivot of each node.
|
||||
|
||||
<a name="prefab_line"></a>
|
||||
- **prefab_line** (_node_)
|
||||
|
||||
<a name="color_zero"></a>
|
||||
- **color_zero** (_unknown_)
|
||||
|
||||
<a name="color_one"></a>
|
||||
- **color_one** (_unknown_)
|
||||
|
||||
<a name="is_hidden"></a>
|
||||
- **is_hidden** (_boolean_)
|
||||
|
||||
<a name="max_value"></a>
|
||||
- **max_value** (_integer_): in this value line will be at max height
|
||||
|
||||
<a name="lines"></a>
|
||||
- **lines** (_table_)
|
||||
|
||||
<a name="values"></a>
|
||||
- **values** (_table_)
|
||||
|
||||
<a name="container"></a>
|
||||
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
<a name="default_size"></a>
|
||||
- **default_size** (_vector3_)
|
||||
|
||||
<a name="samples"></a>
|
||||
- **samples** (_any_)
|
||||
|
@ -1,97 +0,0 @@
|
||||
# druid.widget.property_button API
|
||||
|
||||
> at /druid/widget/properties_panel/properties/property_button.lua
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [on_click](#on_click)
|
||||
- [set_text_property](#set_text_property)
|
||||
- [set_text_button](#set_text_button)
|
||||
- [set_color](#set_color)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [container](#container)
|
||||
- [text_name](#text_name)
|
||||
- [button](#button)
|
||||
- [text_button](#text_button)
|
||||
- [druid](#druid)
|
||||
- [selected](#selected)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
property_button:init()
|
||||
```
|
||||
|
||||
### on_click
|
||||
|
||||
---
|
||||
```lua
|
||||
property_button:on_click()
|
||||
```
|
||||
|
||||
### set_text_property
|
||||
|
||||
---
|
||||
```lua
|
||||
property_button:set_text_property(text)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `text` *(string)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.property_button)*:
|
||||
|
||||
### set_text_button
|
||||
|
||||
---
|
||||
```lua
|
||||
property_button:set_text_button(text)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `text` *(string)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.property_button)*:
|
||||
|
||||
### set_color
|
||||
|
||||
---
|
||||
```lua
|
||||
property_button:set_color([color_value])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[color_value]` *(any)*:
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_)
|
||||
|
||||
<a name="container"></a>
|
||||
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
<a name="text_name"></a>
|
||||
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="button"></a>
|
||||
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
|
||||
|
||||
<a name="text_button"></a>
|
||||
- **text_button** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
||||
<a name="selected"></a>
|
||||
- **selected** (_node_)
|
||||
|
@ -1,111 +0,0 @@
|
||||
# druid.widget.property_checkbox API
|
||||
|
||||
> at /druid/widget/properties_panel/properties/property_checkbox.lua
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_value](#set_value)
|
||||
- [get_value](#get_value)
|
||||
- [on_click](#on_click)
|
||||
- [set_text_property](#set_text_property)
|
||||
- [on_change](#on_change)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [druid](#druid)
|
||||
- [text_name](#text_name)
|
||||
- [button](#button)
|
||||
- [selected](#selected)
|
||||
- [icon](#icon)
|
||||
- [container](#container)
|
||||
- [on_change_value](#on_change_value)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
property_checkbox:init()
|
||||
```
|
||||
|
||||
### set_value
|
||||
|
||||
---
|
||||
```lua
|
||||
property_checkbox:set_value(value, [is_instant])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `value` *(boolean)*:
|
||||
- `[is_instant]` *(any)*:
|
||||
|
||||
### get_value
|
||||
|
||||
---
|
||||
```lua
|
||||
property_checkbox:get_value()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `` *(boolean)*:
|
||||
|
||||
### on_click
|
||||
|
||||
---
|
||||
```lua
|
||||
property_checkbox:on_click()
|
||||
```
|
||||
|
||||
### set_text_property
|
||||
|
||||
---
|
||||
```lua
|
||||
property_checkbox:set_text_property(text)
|
||||
```
|
||||
|
||||
Set the text property of the checkbox
|
||||
|
||||
- **Parameters:**
|
||||
- `text` *(string)*:
|
||||
|
||||
### on_change
|
||||
|
||||
---
|
||||
```lua
|
||||
property_checkbox:on_change(callback)
|
||||
```
|
||||
|
||||
Set the callback function for when the checkbox value changes
|
||||
|
||||
- **Parameters:**
|
||||
- `callback` *(function)*:
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_)
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
||||
<a name="text_name"></a>
|
||||
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="button"></a>
|
||||
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
|
||||
|
||||
<a name="selected"></a>
|
||||
- **selected** (_node_)
|
||||
|
||||
<a name="icon"></a>
|
||||
- **icon** (_node_)
|
||||
|
||||
<a name="container"></a>
|
||||
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
<a name="on_change_value"></a>
|
||||
- **on_change_value** (_unknown_)
|
||||
|
@ -1,93 +0,0 @@
|
||||
# druid.widget.property_input API
|
||||
|
||||
> at /druid/widget/properties_panel/properties/property_input.lua
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_text_property](#set_text_property)
|
||||
- [set_text_value](#set_text_value)
|
||||
- [on_change](#on_change)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [container](#container)
|
||||
- [text_name](#text_name)
|
||||
- [button](#button)
|
||||
- [druid](#druid)
|
||||
- [selected](#selected)
|
||||
- [rich_input](#rich_input)
|
||||
- [on_change_value](#on_change_value)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
property_input:init()
|
||||
```
|
||||
|
||||
### set_text_property
|
||||
|
||||
---
|
||||
```lua
|
||||
property_input:set_text_property(text)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `text` *(string)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.property_input)*:
|
||||
|
||||
### set_text_value
|
||||
|
||||
---
|
||||
```lua
|
||||
property_input:set_text_value(text)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `text` *(string|number)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.property_input)*:
|
||||
|
||||
### on_change
|
||||
|
||||
---
|
||||
```lua
|
||||
property_input:on_change(callback, [callback_context])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `callback` *(fun(self: druid.widget.property_input, text: string))*:
|
||||
- `[callback_context]` *(any)*:
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_)
|
||||
|
||||
<a name="container"></a>
|
||||
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
<a name="text_name"></a>
|
||||
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="button"></a>
|
||||
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
||||
<a name="selected"></a>
|
||||
- **selected** (_node_)
|
||||
|
||||
<a name="rich_input"></a>
|
||||
- **rich_input** (_druid.rich_input_): The component that handles a rich text input field, it's a wrapper around the druid.input component
|
||||
|
||||
<a name="on_change_value"></a>
|
||||
- **on_change_value** (_event.event_): fun(text) Event triggered when the value of the input changes.
|
@ -1,171 +0,0 @@
|
||||
# druid.widget.property_left_right_selector API
|
||||
|
||||
> at /druid/widget/properties_panel/properties/property_left_right_selector.lua
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_text](#set_text)
|
||||
- [on_button_left](#on_button_left)
|
||||
- [on_button_right](#on_button_right)
|
||||
- [add_step](#add_step)
|
||||
- [set_number_type](#set_number_type)
|
||||
- [set_array_type](#set_array_type)
|
||||
- [set_value](#set_value)
|
||||
- [get_value](#get_value)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [druid](#druid)
|
||||
- [text_name](#text_name)
|
||||
- [button](#button)
|
||||
- [selected](#selected)
|
||||
- [value](#value)
|
||||
- [on_change_value](#on_change_value)
|
||||
- [text_value](#text_value)
|
||||
- [button_left](#button_left)
|
||||
- [button_right](#button_right)
|
||||
- [container](#container)
|
||||
- [number_type](#number_type)
|
||||
- [array_type](#array_type)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
property_left_right_selector:init()
|
||||
```
|
||||
|
||||
### set_text
|
||||
|
||||
---
|
||||
```lua
|
||||
property_left_right_selector:set_text([text])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[text]` *(any)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.property_left_right_selector)*:
|
||||
|
||||
### on_button_left
|
||||
|
||||
---
|
||||
```lua
|
||||
property_left_right_selector:on_button_left()
|
||||
```
|
||||
|
||||
### on_button_right
|
||||
|
||||
---
|
||||
```lua
|
||||
property_left_right_selector:on_button_right()
|
||||
```
|
||||
|
||||
### add_step
|
||||
|
||||
---
|
||||
```lua
|
||||
property_left_right_selector:add_step(koef)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `koef` *(number)*: -1 0 1, on 0 will not move
|
||||
|
||||
### set_number_type
|
||||
|
||||
---
|
||||
```lua
|
||||
property_left_right_selector:set_number_type([min], [max], [is_loop], [steps])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[min]` *(any)*:
|
||||
- `[max]` *(any)*:
|
||||
- `[is_loop]` *(any)*:
|
||||
- `[steps]` *(any)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.property_left_right_selector)*:
|
||||
|
||||
### set_array_type
|
||||
|
||||
---
|
||||
```lua
|
||||
property_left_right_selector:set_array_type([array], [is_loop], [steps])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[array]` *(any)*:
|
||||
- `[is_loop]` *(any)*:
|
||||
- `[steps]` *(any)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.property_left_right_selector)*:
|
||||
|
||||
### set_value
|
||||
|
||||
---
|
||||
```lua
|
||||
property_left_right_selector:set_value(value, [is_instant])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `value` *(string|number)*:
|
||||
- `[is_instant]` *(any)*:
|
||||
|
||||
### get_value
|
||||
|
||||
---
|
||||
```lua
|
||||
property_left_right_selector:get_value()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `` *(string|number)*:
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_)
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
||||
<a name="text_name"></a>
|
||||
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="button"></a>
|
||||
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
|
||||
|
||||
<a name="selected"></a>
|
||||
- **selected** (_node_)
|
||||
|
||||
<a name="value"></a>
|
||||
- **value** (_string_)
|
||||
|
||||
<a name="on_change_value"></a>
|
||||
- **on_change_value** (_event_): fun(value: string|number)
|
||||
|
||||
<a name="text_value"></a>
|
||||
- **text_value** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="button_left"></a>
|
||||
- **button_left** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
|
||||
|
||||
<a name="button_right"></a>
|
||||
- **button_right** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
|
||||
|
||||
<a name="container"></a>
|
||||
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
<a name="number_type"></a>
|
||||
- **number_type** (_table_)
|
||||
|
||||
<a name="array_type"></a>
|
||||
- **array_type** (_table_)
|
||||
|
@ -1,150 +0,0 @@
|
||||
# druid.widget.property_slider API
|
||||
|
||||
> at /druid/widget/properties_panel/properties/property_slider.lua
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_text_function](#set_text_function)
|
||||
- [set_text_property](#set_text_property)
|
||||
- [on_change](#on_change)
|
||||
- [set_value](#set_value)
|
||||
- [get_value](#get_value)
|
||||
- [update_value](#update_value)
|
||||
- [set_number_type](#set_number_type)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [container](#container)
|
||||
- [druid](#druid)
|
||||
- [text_name](#text_name)
|
||||
- [text_value](#text_value)
|
||||
- [slider](#slider)
|
||||
- [on_change_value](#on_change_value)
|
||||
- [selected](#selected)
|
||||
- [min](#min)
|
||||
- [max](#max)
|
||||
- [step](#step)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:init()
|
||||
```
|
||||
|
||||
### set_text_function
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:set_text_function(callback)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `callback` *(fun(value: number):string)*:
|
||||
|
||||
### set_text_property
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:set_text_property(text)
|
||||
```
|
||||
|
||||
Sets the text property of the slider
|
||||
|
||||
- **Parameters:**
|
||||
- `text` *(string)*:
|
||||
|
||||
### on_change
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:on_change(callback)
|
||||
```
|
||||
|
||||
Sets the callback function for when the slider value changes
|
||||
|
||||
- **Parameters:**
|
||||
- `callback` *(fun(value: number))*:
|
||||
|
||||
### set_value
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:set_value(value, [is_instant])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `value` *(number)*:
|
||||
- `[is_instant]` *(any)*:
|
||||
|
||||
### get_value
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:get_value()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `` *(number)*:
|
||||
|
||||
### update_value
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:update_value([value])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[value]` *(any)*:
|
||||
|
||||
### set_number_type
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:set_number_type([min], [max], [step])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[min]` *(any)*:
|
||||
- `[max]` *(any)*:
|
||||
- `[step]` *(any)*:
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_)
|
||||
|
||||
<a name="container"></a>
|
||||
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
||||
<a name="text_name"></a>
|
||||
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="text_value"></a>
|
||||
- **text_value** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="slider"></a>
|
||||
- **slider** (_druid.slider_): Basic Druid slider component. Creates a draggable node over a line with progress reporting.
|
||||
|
||||
<a name="on_change_value"></a>
|
||||
- **on_change_value** (_event_): fun(value:number)
|
||||
|
||||
<a name="selected"></a>
|
||||
- **selected** (_node_)
|
||||
|
||||
<a name="min"></a>
|
||||
- **min** (_integer_)
|
||||
|
||||
<a name="max"></a>
|
||||
- **max** (_integer_)
|
||||
|
||||
<a name="step"></a>
|
||||
- **step** (_number_)
|
||||
|
@ -1,66 +0,0 @@
|
||||
# druid.widget.property_text API
|
||||
|
||||
> at /druid/widget/properties_panel/properties/property_text.lua
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_text_property](#set_text_property)
|
||||
- [set_text_value](#set_text_value)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [container](#container)
|
||||
- [text_name](#text_name)
|
||||
- [text_right](#text_right)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
property_text:init()
|
||||
```
|
||||
|
||||
### set_text_property
|
||||
|
||||
---
|
||||
```lua
|
||||
property_text:set_text_property(text)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `text` *(string)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.property_text)*:
|
||||
|
||||
### set_text_value
|
||||
|
||||
---
|
||||
```lua
|
||||
property_text:set_text_value([text])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[text]` *(string|nil)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.property_text)*:
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_)
|
||||
|
||||
<a name="container"></a>
|
||||
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
<a name="text_name"></a>
|
||||
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="text_right"></a>
|
||||
- **text_right** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
@ -1,104 +0,0 @@
|
||||
# druid.widget.property_vector3 API
|
||||
|
||||
> at /druid/widget/properties_panel/properties/property_vector3.lua
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_text_property](#set_text_property)
|
||||
- [set_value](#set_value)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [container](#container)
|
||||
- [text_name](#text_name)
|
||||
- [button](#button)
|
||||
- [druid](#druid)
|
||||
- [selected_x](#selected_x)
|
||||
- [selected_y](#selected_y)
|
||||
- [selected_z](#selected_z)
|
||||
- [rich_input_x](#rich_input_x)
|
||||
- [rich_input_y](#rich_input_y)
|
||||
- [rich_input_z](#rich_input_z)
|
||||
- [value](#value)
|
||||
- [on_change](#on_change)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
property_vector3:init()
|
||||
```
|
||||
|
||||
### set_text_property
|
||||
|
||||
---
|
||||
```lua
|
||||
property_vector3:set_text_property(text)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `text` *(string)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.property_vector3)*:
|
||||
|
||||
### set_value
|
||||
|
||||
---
|
||||
```lua
|
||||
property_vector3:set_value(x, y, z)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `x` *(number)*:
|
||||
- `y` *(number)*:
|
||||
- `z` *(number)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.property_vector3)*:
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_)
|
||||
|
||||
<a name="container"></a>
|
||||
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
<a name="text_name"></a>
|
||||
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="button"></a>
|
||||
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
||||
<a name="selected_x"></a>
|
||||
- **selected_x** (_node_)
|
||||
|
||||
<a name="selected_y"></a>
|
||||
- **selected_y** (_node_)
|
||||
|
||||
<a name="selected_z"></a>
|
||||
- **selected_z** (_node_)
|
||||
|
||||
<a name="rich_input_x"></a>
|
||||
- **rich_input_x** (_druid.rich_input_): The component that handles a rich text input field, it's a wrapper around the druid.input component
|
||||
|
||||
<a name="rich_input_y"></a>
|
||||
- **rich_input_y** (_druid.rich_input_): The component that handles a rich text input field, it's a wrapper around the druid.input component
|
||||
|
||||
<a name="rich_input_z"></a>
|
||||
- **rich_input_z** (_druid.rich_input_): The component that handles a rich text input field, it's a wrapper around the druid.input component
|
||||
|
||||
<a name="value"></a>
|
||||
- **value** (_unknown_)
|
||||
|
||||
<a name="on_change"></a>
|
||||
- **on_change** (_unknown_)
|
||||
|
@ -1,389 +0,0 @@
|
||||
# druid.widget.properties_panel API
|
||||
|
||||
> at /druid/widget/properties_panel/properties_panel.lua
|
||||
|
||||
# Properties API:
|
||||
- [property_button](properties_panel/property_button_api.md)
|
||||
- [property_checkbox](properties_panel/property_checkbox_api.md)
|
||||
- [property_slider](properties_panel/property_slider_api.md)
|
||||
- [property_input](properties_panel/property_input_api.md)
|
||||
- [property_text](properties_panel/property_text_api.md)
|
||||
- [property_left_right_selector](properties_panel/property_left_right_selector_api.md)
|
||||
- [property_vector3](properties_panel/property_vector3_api.md)
|
||||
|
||||
## Functions
|
||||
|
||||
- [properties_constructors](#properties_constructors)
|
||||
- [init](#init)
|
||||
- [on_remove](#on_remove)
|
||||
- [on_drag_widget](#on_drag_widget)
|
||||
- [clear_created_properties](#clear_created_properties)
|
||||
- [clear](#clear)
|
||||
- [on_size_changed](#on_size_changed)
|
||||
- [update](#update)
|
||||
- [add_checkbox](#add_checkbox)
|
||||
- [add_slider](#add_slider)
|
||||
- [add_button](#add_button)
|
||||
- [add_input](#add_input)
|
||||
- [add_text](#add_text)
|
||||
- [add_left_right_selector](#add_left_right_selector)
|
||||
- [add_vector3](#add_vector3)
|
||||
- [add_inner_widget](#add_inner_widget)
|
||||
- [add_widget](#add_widget)
|
||||
- [remove](#remove)
|
||||
- [set_hidden](#set_hidden)
|
||||
- [is_hidden](#is_hidden)
|
||||
- [set_properties_per_page](#set_properties_per_page)
|
||||
- [set_page](#set_page)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [scroll](#scroll)
|
||||
- [layout](#layout)
|
||||
- [container](#container)
|
||||
- [container_content](#container_content)
|
||||
- [container_scroll_view](#container_scroll_view)
|
||||
- [contaienr_scroll_content](#contaienr_scroll_content)
|
||||
- [button_hidden](#button_hidden)
|
||||
- [text_header](#text_header)
|
||||
- [paginator](#paginator)
|
||||
- [properties](#properties)
|
||||
- [content](#content)
|
||||
- [default_size](#default_size)
|
||||
- [current_page](#current_page)
|
||||
- [properties_per_page](#properties_per_page)
|
||||
- [property_checkbox_prefab](#property_checkbox_prefab)
|
||||
- [property_slider_prefab](#property_slider_prefab)
|
||||
- [property_button_prefab](#property_button_prefab)
|
||||
- [property_input_prefab](#property_input_prefab)
|
||||
- [property_text_prefab](#property_text_prefab)
|
||||
- [property_left_right_selector_prefab](#property_left_right_selector_prefab)
|
||||
- [property_vector3_prefab](#property_vector3_prefab)
|
||||
- [is_dirty](#is_dirty)
|
||||
|
||||
|
||||
|
||||
### properties_constructors
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:properties_constructors()
|
||||
```
|
||||
|
||||
List of properties functions to create a new widget. Used to not spawn non-visible widgets but keep the reference
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:init()
|
||||
```
|
||||
|
||||
### on_remove
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:on_remove()
|
||||
```
|
||||
|
||||
### on_drag_widget
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:on_drag_widget([dx], [dy])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[dx]` *(any)*:
|
||||
- `[dy]` *(any)*:
|
||||
|
||||
### clear_created_properties
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:clear_created_properties()
|
||||
```
|
||||
|
||||
### clear
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:clear()
|
||||
```
|
||||
|
||||
### on_size_changed
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:on_size_changed([new_size])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[new_size]` *(any)*:
|
||||
|
||||
### update
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:update([dt])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[dt]` *(any)*:
|
||||
|
||||
### add_checkbox
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:add_checkbox([on_create])
|
||||
```
|
||||
|
||||
Inspect Property Checkbox API [here](properties_panel/property_checkbox_api.md)
|
||||
|
||||
- **Parameters:**
|
||||
- `[on_create]` *(fun(checkbox: druid.widget.property_checkbox)|nil)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.properties_panel)*:
|
||||
|
||||
### add_slider
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:add_slider([on_create])
|
||||
```
|
||||
|
||||
Inspect Property Slider API [here](properties_panel/property_slider_api.md)
|
||||
|
||||
- **Parameters:**
|
||||
- `[on_create]` *(fun(slider: druid.widget.property_slider)|nil)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.properties_panel)*:
|
||||
|
||||
### add_button
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:add_button([on_create])
|
||||
```
|
||||
|
||||
Inspect Property Button API [here](properties_panel/property_button_api.md)
|
||||
|
||||
- **Parameters:**
|
||||
- `[on_create]` *(fun(button: druid.widget.property_button)|nil)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.properties_panel)*:
|
||||
|
||||
### add_input
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:add_input([on_create])
|
||||
```
|
||||
|
||||
Inspect Property Input API [here](properties_panel/property_input_api.md)
|
||||
|
||||
- **Parameters:**
|
||||
- `[on_create]` *(fun(input: druid.widget.property_input)|nil)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.properties_panel)*:
|
||||
|
||||
### add_text
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:add_text([on_create])
|
||||
```
|
||||
|
||||
Inspect Property Text API [here](properties_panel/property_text_api.md)
|
||||
|
||||
- **Parameters:**
|
||||
- `[on_create]` *(fun(text: druid.widget.property_text)|nil)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.properties_panel)*:
|
||||
|
||||
### add_left_right_selector
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:add_left_right_selector([on_create])
|
||||
```
|
||||
|
||||
Inspect Property Left Right Selector API [here](properties_panel/property_left_right_selector_api.md)
|
||||
|
||||
- **Parameters:**
|
||||
- `[on_create]` *(fun(selector: druid.widget.property_left_right_selector)|nil)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.properties_panel)*:
|
||||
|
||||
### add_vector3
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:add_vector3([on_create])
|
||||
```
|
||||
|
||||
Inspect Property Vector3 API [here](properties_panel/property_vector3_api.md)
|
||||
|
||||
- **Parameters:**
|
||||
- `[on_create]` *(fun(vector3: druid.widget.property_vector3)|nil)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.properties_panel)*:
|
||||
|
||||
### add_inner_widget
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:add_inner_widget(widget_class, [template], [nodes], [on_create])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `widget_class` *(<T:druid.widget>)*:
|
||||
- `[template]` *(string|nil)*:
|
||||
- `[nodes]` *(node|table<hash, node>|nil)*:
|
||||
- `[on_create]` *(fun(widget: <T:druid.widget>)|nil)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.properties_panel)*:
|
||||
|
||||
### add_widget
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:add_widget(create_widget_callback)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `create_widget_callback` *(fun():druid.widget)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.widget.properties_panel)*:
|
||||
|
||||
### remove
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:remove([widget])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[widget]` *(any)*:
|
||||
|
||||
### set_hidden
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:set_hidden([is_hidden])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[is_hidden]` *(any)*:
|
||||
|
||||
### is_hidden
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:is_hidden()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `` *(unknown)*:
|
||||
|
||||
### set_properties_per_page
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:set_properties_per_page(properties_per_page)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `properties_per_page` *(number)*:
|
||||
|
||||
### set_page
|
||||
|
||||
---
|
||||
```lua
|
||||
properties_panel:set_page([page])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[page]` *(any)*:
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_)
|
||||
|
||||
<a name="scroll"></a>
|
||||
- **scroll** (_druid.scroll_): Basic Druid scroll component. Handles all scrolling behavior in Druid GUI.
|
||||
|
||||
<a name="layout"></a>
|
||||
- **layout** (_druid.layout_): Druid component to manage the layout of nodes, placing them inside the node size with respect to the size and pivot of each node.
|
||||
|
||||
<a name="container"></a>
|
||||
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
<a name="container_content"></a>
|
||||
- **container_content** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
<a name="container_scroll_view"></a>
|
||||
- **container_scroll_view** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
<a name="contaienr_scroll_content"></a>
|
||||
- **contaienr_scroll_content** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
<a name="button_hidden"></a>
|
||||
- **button_hidden** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
|
||||
|
||||
<a name="text_header"></a>
|
||||
- **text_header** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="paginator"></a>
|
||||
- **paginator** (_druid.widget.property_left_right_selector_)
|
||||
|
||||
<a name="properties"></a>
|
||||
- **properties** (_druid.widget[]_): List of created properties
|
||||
|
||||
<a name="content"></a>
|
||||
- **content** (_node_)
|
||||
|
||||
<a name="default_size"></a>
|
||||
- **default_size** (_vector3_)
|
||||
|
||||
<a name="current_page"></a>
|
||||
- **current_page** (_integer_)
|
||||
|
||||
<a name="properties_per_page"></a>
|
||||
- **properties_per_page** (_integer_)
|
||||
|
||||
<a name="property_checkbox_prefab"></a>
|
||||
- **property_checkbox_prefab** (_node_)
|
||||
|
||||
<a name="property_slider_prefab"></a>
|
||||
- **property_slider_prefab** (_node_)
|
||||
|
||||
<a name="property_button_prefab"></a>
|
||||
- **property_button_prefab** (_node_)
|
||||
|
||||
<a name="property_input_prefab"></a>
|
||||
- **property_input_prefab** (_node_)
|
||||
|
||||
<a name="property_text_prefab"></a>
|
||||
- **property_text_prefab** (_node_)
|
||||
|
||||
<a name="property_left_right_selector_prefab"></a>
|
||||
- **property_left_right_selector_prefab** (_node_)
|
||||
|
||||
<a name="property_vector3_prefab"></a>
|
||||
- **property_vector3_prefab** (_node_)
|
||||
|
||||
<a name="is_dirty"></a>
|
||||
- **is_dirty** (_boolean_)
|
||||
|
172
api/druid_api.md
172
api/druid_api.md
@ -1,172 +0,0 @@
|
||||
# druid API
|
||||
|
||||
> at /druid/druid.lua
|
||||
|
||||
Entry point for Druid UI Framework.
|
||||
Create a new Druid instance and adjust the Druid settings here.
|
||||
|
||||
## Functions
|
||||
|
||||
- [new](#new)
|
||||
- [register](#register)
|
||||
- [set_default_style](#set_default_style)
|
||||
- [set_text_function](#set_text_function)
|
||||
- [set_sound_function](#set_sound_function)
|
||||
- [init_window_listener](#init_window_listener)
|
||||
- [on_window_callback](#on_window_callback)
|
||||
- [on_language_change](#on_language_change)
|
||||
- [get_widget](#get_widget)
|
||||
- [register_druid_as_widget](#register_druid_as_widget)
|
||||
- [unregister_druid_as_widget](#unregister_druid_as_widget)
|
||||
|
||||
|
||||
|
||||
### new
|
||||
|
||||
---
|
||||
```lua
|
||||
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|nil)*: The Druid style table to override style parameters for this Druid instance.
|
||||
|
||||
- **Returns:**
|
||||
- `druid_instance` *(druid.instance)*: The new Druid instance
|
||||
|
||||
### register
|
||||
|
||||
---
|
||||
```lua
|
||||
druid.register(name, module)
|
||||
```
|
||||
|
||||
Register a new external Druid component.
|
||||
Register component just makes the druid:new_{name} function.
|
||||
For example, if you 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 require in every file.
|
||||
The default way to create component is `druid_instance:new(component_class, ...)`.
|
||||
|
||||
- **Parameters:**
|
||||
- `name` *(string)*: Module name
|
||||
- `module` *(table)*: Lua table with component
|
||||
|
||||
### set_default_style
|
||||
|
||||
---
|
||||
```lua
|
||||
druid.set_default_style(style)
|
||||
```
|
||||
|
||||
Set the default style for all Druid instances.
|
||||
|
||||
- **Parameters:**
|
||||
- `style` *(table)*: Default style
|
||||
|
||||
### set_text_function
|
||||
|
||||
---
|
||||
```lua
|
||||
druid.set_text_function(callback)
|
||||
```
|
||||
|
||||
Set the text function for the LangText component.
|
||||
|
||||
- **Parameters:**
|
||||
- `callback` *(fun(text_id: string):string)*: Get localized text function
|
||||
|
||||
### set_sound_function
|
||||
|
||||
---
|
||||
```lua
|
||||
druid.set_sound_function(callback)
|
||||
```
|
||||
|
||||
Set the sound function to able components to play sounds.
|
||||
|
||||
- **Parameters:**
|
||||
- `callback` *(fun(sound_id: string))*: Sound play callback
|
||||
|
||||
### init_window_listener
|
||||
|
||||
---
|
||||
```lua
|
||||
druid.init_window_listener()
|
||||
```
|
||||
|
||||
Subscribe Druid to the window listener. It will override your previous
|
||||
window listener, so if you have one, you should call M.on_window_callback manually.
|
||||
|
||||
### on_window_callback
|
||||
|
||||
---
|
||||
```lua
|
||||
druid.on_window_callback(window_event)
|
||||
```
|
||||
|
||||
Set the window callback to enable Druid window events.
|
||||
|
||||
- **Parameters:**
|
||||
- `window_event` *(constant)*: Event param from window listener
|
||||
|
||||
### on_language_change
|
||||
|
||||
---
|
||||
```lua
|
||||
druid.on_language_change()
|
||||
```
|
||||
|
||||
Call this function when the game language changes.
|
||||
It will notify all Druid instances to update the lang text components.
|
||||
|
||||
### get_widget
|
||||
|
||||
---
|
||||
```lua
|
||||
druid.get_widget(widget_class, gui_url)
|
||||
```
|
||||
|
||||
Create a widget from the binded Druid GUI instance.
|
||||
The widget will be created and all widget functions can be called from Game Object contexts.
|
||||
This allow use only `druid_widget.gui_script` for GUI files and call this widget functions from Game Object script file.
|
||||
Widget class here is a your lua file for the GUI scene (a widgets in Druid)
|
||||
|
||||
- **Parameters:**
|
||||
- `widget_class` *(<T:druid.widget>)*: The class of the widget to return
|
||||
- `gui_url` *(url)*: GUI url
|
||||
|
||||
- **Returns:**
|
||||
- `widget` *(<T:druid.widget>?)*: The new created widget,
|
||||
|
||||
- **Example Usage:**
|
||||
|
||||
```lua
|
||||
msg.url(nil, nil, "gui_widget") -- current game object
|
||||
msg.url(nil, object_url, "gui_widget") -- other game object
|
||||
```
|
||||
### register_druid_as_widget
|
||||
|
||||
---
|
||||
```lua
|
||||
druid.register_druid_as_widget(druid)
|
||||
```
|
||||
|
||||
Bind a Druid GUI instance to the current game object.
|
||||
This instance now can produce widgets from `druid.get_widget()` function.
|
||||
Only one widget can be set per game object.
|
||||
|
||||
- **Parameters:**
|
||||
- `druid` *(druid.instance)*: The druid instance to register
|
||||
|
||||
### unregister_druid_as_widget
|
||||
|
||||
---
|
||||
```lua
|
||||
druid.unregister_druid_as_widget()
|
||||
```
|
||||
|
||||
Should be called on final, where druid instance is destroyed.
|
||||
|
@ -1,540 +0,0 @@
|
||||
# druid.helper API
|
||||
|
||||
> at /druid/helper.lua
|
||||
|
||||
The helper module contains various functions that are used in the Druid library.
|
||||
You can use these functions in your projects as well.
|
||||
|
||||
## Functions
|
||||
|
||||
- [centrate_text_with_icon](#centrate_text_with_icon)
|
||||
- [centrate_icon_with_text](#centrate_icon_with_text)
|
||||
- [centrate_nodes](#centrate_nodes)
|
||||
- [get_node](#get_node)
|
||||
- [get_screen_aspect_koef](#get_screen_aspect_koef)
|
||||
- [get_gui_scale](#get_gui_scale)
|
||||
- [step](#step)
|
||||
- [clamp](#clamp)
|
||||
- [distance](#distance)
|
||||
- [sign](#sign)
|
||||
- [round](#round)
|
||||
- [lerp](#lerp)
|
||||
- [contains](#contains)
|
||||
- [deepcopy](#deepcopy)
|
||||
- [add_array](#add_array)
|
||||
- [pick_node](#pick_node)
|
||||
- [get_scaled_size](#get_scaled_size)
|
||||
- [get_scene_scale](#get_scene_scale)
|
||||
- [get_closest_stencil_node](#get_closest_stencil_node)
|
||||
- [get_pivot_offset](#get_pivot_offset)
|
||||
- [is_desktop](#is_desktop)
|
||||
- [is_mobile](#is_mobile)
|
||||
- [is_web](#is_web)
|
||||
- [is_web_mobile](#is_web_mobile)
|
||||
- [is_multitouch_supported](#is_multitouch_supported)
|
||||
- [table_to_string](#table_to_string)
|
||||
- [get_border](#get_border)
|
||||
- [get_text_metrics_from_node](#get_text_metrics_from_node)
|
||||
- [insert_with_shift](#insert_with_shift)
|
||||
- [remove_with_shift](#remove_with_shift)
|
||||
- [get_full_position](#get_full_position)
|
||||
- [get_animation_data_from_node](#get_animation_data_from_node)
|
||||
|
||||
|
||||
|
||||
### centrate_text_with_icon
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.centrate_text_with_icon([text_node], [icon_node], margin)
|
||||
```
|
||||
|
||||
Center two nodes.
|
||||
Nodes will be center around 0 x position
|
||||
text_node will be first (at left side)
|
||||
|
||||
- **Parameters:**
|
||||
- `[text_node]` *(node|nil)*: Gui text node
|
||||
- `[icon_node]` *(node|nil)*: Gui box node
|
||||
- `margin` *(number)*: Offset between nodes
|
||||
|
||||
- **Returns:**
|
||||
- `` *(unknown)*:
|
||||
|
||||
### centrate_icon_with_text
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.centrate_icon_with_text([icon_node], [text_node], [margin])
|
||||
```
|
||||
|
||||
Center two nodes.
|
||||
Nodes will be center around 0 x position
|
||||
icon_node will be first (at left side)
|
||||
|
||||
- **Parameters:**
|
||||
- `[icon_node]` *(node|nil)*: Gui box node
|
||||
- `[text_node]` *(node|nil)*: Gui text node
|
||||
- `[margin]` *(number|nil)*: Offset between nodes
|
||||
|
||||
- **Returns:**
|
||||
- `` *(unknown)*:
|
||||
|
||||
### centrate_nodes
|
||||
|
||||
---
|
||||
```lua
|
||||
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|nil)*: Offset between nodes
|
||||
- `...` *(...)*: vararg
|
||||
|
||||
- **Returns:**
|
||||
- `` *(unknown)*:
|
||||
|
||||
### get_node
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.get_node(node_id, [template], [nodes])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `node_id` *(string|node)*:
|
||||
- `[template]` *(string|nil)*: Full Path to the template
|
||||
- `[nodes]` *(table<hash, node>|nil)*: Nodes what created with gui.clone_tree
|
||||
|
||||
- **Returns:**
|
||||
- `` *(node)*:
|
||||
|
||||
### get_screen_aspect_koef
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.get_screen_aspect_koef()
|
||||
```
|
||||
|
||||
Get current screen stretch multiplier for each side
|
||||
|
||||
- **Returns:**
|
||||
- `stretch_x` *(number)*:
|
||||
- `stretch_y` *(number)*:
|
||||
|
||||
### get_gui_scale
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.get_gui_scale()
|
||||
```
|
||||
|
||||
Get current GUI scale for each side
|
||||
|
||||
- **Returns:**
|
||||
- `scale_x` *(number)*:
|
||||
|
||||
### step
|
||||
|
||||
---
|
||||
```lua
|
||||
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:**
|
||||
- `New` *(number)*: value
|
||||
|
||||
### clamp
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.clamp(value, [v1], [v2])
|
||||
```
|
||||
|
||||
Clamp value between min and max. Works with nil values and swap min and max if needed.
|
||||
|
||||
- **Parameters:**
|
||||
- `value` *(number)*: Value
|
||||
- `[v1]` *(number|nil)*: Min value. If nil, value will be clamped to positive infinity
|
||||
- `[v2]` *(number|nil)*: Max value If nil, value will be clamped to negative infinity
|
||||
|
||||
- **Returns:**
|
||||
- `value` *(number)*: Clamped value
|
||||
|
||||
### distance
|
||||
|
||||
---
|
||||
```lua
|
||||
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:**
|
||||
- `distance` *(number)*:
|
||||
|
||||
### sign
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.sign(val)
|
||||
```
|
||||
|
||||
Return sign of value
|
||||
|
||||
- **Parameters:**
|
||||
- `val` *(number)*: Value
|
||||
|
||||
- **Returns:**
|
||||
- `sign` *(number)*: Sign of value, -1, 0 or 1
|
||||
|
||||
### round
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.round(num, [num_decimal_places])
|
||||
```
|
||||
|
||||
Round number to specified decimal places
|
||||
|
||||
- **Parameters:**
|
||||
- `num` *(number)*: Number
|
||||
- `[num_decimal_places]` *(number|nil)*: Decimal places
|
||||
|
||||
- **Returns:**
|
||||
- `value` *(number)*: Rounded number
|
||||
|
||||
### lerp
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.lerp(a, b, t)
|
||||
```
|
||||
|
||||
Lerp between two values
|
||||
|
||||
- **Parameters:**
|
||||
- `a` *(number)*: First value
|
||||
- `b` *(number)*: Second value
|
||||
- `t` *(number)*: Lerp amount
|
||||
|
||||
- **Returns:**
|
||||
- `value` *(number)*: Lerped value
|
||||
|
||||
### contains
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.contains([array], [value])
|
||||
```
|
||||
|
||||
Check if value contains in array
|
||||
|
||||
- **Parameters:**
|
||||
- `[array]` *(any[])*: Array to check
|
||||
- `[value]` *(any)*: Value
|
||||
|
||||
- **Returns:**
|
||||
- `index` *(number|nil)*: Index of value in array or nil if value not found
|
||||
|
||||
### deepcopy
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.deepcopy(orig_table)
|
||||
```
|
||||
|
||||
Make a copy table with all nested tables
|
||||
|
||||
- **Parameters:**
|
||||
- `orig_table` *(table)*: Original table
|
||||
|
||||
- **Returns:**
|
||||
- `Copy` *(table)*: of original table
|
||||
|
||||
### add_array
|
||||
|
||||
---
|
||||
```lua
|
||||
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[]|nil)*: The source array to get elements from
|
||||
|
||||
- **Returns:**
|
||||
- `The` *(any[])*: target array
|
||||
|
||||
### pick_node
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.pick_node(node, x, y, [node_click_area])
|
||||
```
|
||||
|
||||
Make a check with gui.pick_node, but with additional node_click_area check.
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*:
|
||||
- `x` *(number)*:
|
||||
- `y` *(number)*:
|
||||
- `[node_click_area]` *(node|nil)*: Additional node to check for click area. If nil, only node will be checked
|
||||
|
||||
- **Returns:**
|
||||
- `` *(unknown)*:
|
||||
|
||||
### get_scaled_size
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.get_scaled_size(node)
|
||||
```
|
||||
|
||||
Get size of node with scale multiplier
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*: GUI node
|
||||
|
||||
- **Returns:**
|
||||
- `scaled_size` *(vector3)*:
|
||||
|
||||
### get_scene_scale
|
||||
|
||||
---
|
||||
```lua
|
||||
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|nil)*: True if add current node scale to result
|
||||
|
||||
- **Returns:**
|
||||
- `The` *(vector3)*: scene node scale
|
||||
|
||||
### get_closest_stencil_node
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.get_closest_stencil_node(node)
|
||||
```
|
||||
|
||||
Return closest non inverted clipping parent node for given node
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*: GUI node
|
||||
|
||||
- **Returns:**
|
||||
- `stencil_node` *(node|nil)*: The closest stencil node or nil
|
||||
|
||||
### get_pivot_offset
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.get_pivot_offset(pivot_or_node)
|
||||
```
|
||||
|
||||
Get pivot offset for given pivot or node
|
||||
Offset shown in [-0.5 .. 0.5] range, where -0.5 is left or bottom, 0.5 is right or top.
|
||||
|
||||
- **Parameters:**
|
||||
- `pivot_or_node` *(number|node)*: GUI pivot or node
|
||||
|
||||
- **Returns:**
|
||||
- `offset` *(vector3)*: The pivot offset
|
||||
|
||||
### is_desktop
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.is_desktop()
|
||||
```
|
||||
|
||||
Check if device is desktop
|
||||
|
||||
- **Returns:**
|
||||
- `` *(boolean)*:
|
||||
|
||||
### is_mobile
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.is_mobile()
|
||||
```
|
||||
|
||||
Check if device is native mobile (Android or iOS)
|
||||
|
||||
- **Returns:**
|
||||
- `Is` *(boolean)*: mobile
|
||||
|
||||
### is_web
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.is_web()
|
||||
```
|
||||
|
||||
Check if device is HTML5
|
||||
|
||||
- **Returns:**
|
||||
- `` *(boolean)*:
|
||||
|
||||
### is_web_mobile
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.is_web_mobile()
|
||||
```
|
||||
|
||||
Check if device is HTML5 mobile
|
||||
|
||||
- **Returns:**
|
||||
- `` *(boolean)*:
|
||||
|
||||
### is_multitouch_supported
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.is_multitouch_supported()
|
||||
```
|
||||
|
||||
Check if device is mobile and can support multitouch
|
||||
|
||||
- **Returns:**
|
||||
- `is_multitouch` *(boolean)*: Is multitouch supported
|
||||
|
||||
### table_to_string
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.table_to_string(t)
|
||||
```
|
||||
|
||||
Simple table to one-line string converter
|
||||
|
||||
- **Parameters:**
|
||||
- `t` *(table)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(string)*:
|
||||
|
||||
### get_border
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.get_border(node, [offset])
|
||||
```
|
||||
|
||||
Distance from node position to his borders
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*: GUI node
|
||||
- `[offset]` *(vector3|nil)*: Offset from node position. Pass current node position to get non relative border values
|
||||
|
||||
- **Returns:**
|
||||
- `border` *(vector4)*: Vector4 with border values (left, top, right, down)
|
||||
|
||||
### get_text_metrics_from_node
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.get_text_metrics_from_node(text_node)
|
||||
```
|
||||
|
||||
Get text metric from GUI node.
|
||||
|
||||
- **Parameters:**
|
||||
- `text_node` *(node)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(GUITextMetrics)*:
|
||||
|
||||
### insert_with_shift
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.insert_with_shift(array, [item], [index], [shift_policy])
|
||||
```
|
||||
|
||||
Add value to array with shift policy
|
||||
Shift policy can be: left, right, no_shift
|
||||
|
||||
- **Parameters:**
|
||||
- `array` *(table)*: Array
|
||||
- `[item]` *(any)*: Item to insert
|
||||
- `[index]` *(number|nil)*: Index to insert. If nil, item will be inserted at the end of array
|
||||
- `[shift_policy]` *(number|nil)*: The druid_const.SHIFT.* constant
|
||||
|
||||
- **Returns:**
|
||||
- `Inserted` *(any)*: item
|
||||
|
||||
### remove_with_shift
|
||||
|
||||
---
|
||||
```lua
|
||||
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]` *(any[])*: Array
|
||||
- `[index]` *(number|nil)*: Index to remove. If nil, item will be removed from the end of array
|
||||
- `[shift_policy]` *(number|nil)*: The druid_const.SHIFT.* constant
|
||||
|
||||
- **Returns:**
|
||||
- `Removed` *(any)*: item
|
||||
|
||||
### get_full_position
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.get_full_position(node, [root])
|
||||
```
|
||||
|
||||
Get full position of node in the GUI tree
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*: GUI node
|
||||
- `[root]` *(node|nil)*: GUI root node to stop search
|
||||
|
||||
- **Returns:**
|
||||
- `` *(unknown)*:
|
||||
|
||||
### get_animation_data_from_node
|
||||
|
||||
---
|
||||
```lua
|
||||
helper.get_animation_data_from_node(node, atlas_path)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(node)*:
|
||||
- `atlas_path` *(string)*: Path to the atlas
|
||||
|
||||
- **Returns:**
|
||||
- `` *(druid.system.animation_data)*:
|
||||
|
@ -1,540 +0,0 @@
|
||||
# druid.instance API
|
||||
|
||||
> at /druid/system/druid_instance.lua
|
||||
|
||||
The Druid Factory used to create components
|
||||
|
||||
## Functions
|
||||
|
||||
- [create_druid_instance](#create_druid_instance)
|
||||
|
||||
- [new](#new)
|
||||
- [final](#final)
|
||||
- [remove](#remove)
|
||||
- [update](#update)
|
||||
- [on_input](#on_input)
|
||||
- [on_message](#on_message)
|
||||
- [on_window_event](#on_window_event)
|
||||
- [set_whitelist](#set_whitelist)
|
||||
- [set_blacklist](#set_blacklist)
|
||||
- [new_widget](#new_widget)
|
||||
- [new_button](#new_button)
|
||||
- [new_blocker](#new_blocker)
|
||||
- [new_back_handler](#new_back_handler)
|
||||
- [new_hover](#new_hover)
|
||||
- [new_text](#new_text)
|
||||
- [new_grid](#new_grid)
|
||||
- [new_scroll](#new_scroll)
|
||||
- [new_drag](#new_drag)
|
||||
- [new_swipe](#new_swipe)
|
||||
- [new_lang_text](#new_lang_text)
|
||||
- [new_slider](#new_slider)
|
||||
- [new_input](#new_input)
|
||||
- [new_data_list](#new_data_list)
|
||||
- [new_timer](#new_timer)
|
||||
- [new_progress](#new_progress)
|
||||
- [new_layout](#new_layout)
|
||||
- [new_container](#new_container)
|
||||
- [new_hotkey](#new_hotkey)
|
||||
- [new_rich_text](#new_rich_text)
|
||||
- [new_rich_input](#new_rich_input)
|
||||
|
||||
|
||||
|
||||
### create_druid_instance
|
||||
|
||||
---
|
||||
```lua
|
||||
instance.create_druid_instance(context, [style])
|
||||
```
|
||||
|
||||
Druid class constructor which used to create a Druid's components
|
||||
|
||||
- **Parameters:**
|
||||
- `context` *(table)*: Druid context. Usually it is self of gui script
|
||||
- `[style]` *(table?)*: Druid style table
|
||||
|
||||
- **Returns:**
|
||||
- `instance` *(druid.instance)*: The new Druid instance
|
||||
|
||||
### new
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new(component, ...)
|
||||
```
|
||||
|
||||
Create new Druid component instance
|
||||
|
||||
- **Parameters:**
|
||||
- `component` *(<T:druid.component>)*: The component class to create
|
||||
- `...` *(...)*: vararg
|
||||
|
||||
- **Returns:**
|
||||
- `instance` *(<T:druid.component>)*: The new ready to use component
|
||||
|
||||
### final
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:final()
|
||||
```
|
||||
|
||||
Call this in gui_script final function.
|
||||
|
||||
### remove
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:remove(component)
|
||||
```
|
||||
|
||||
Remove created component from Druid instance.
|
||||
Component `on_remove` function will be invoked, if exist.
|
||||
|
||||
- **Parameters:**
|
||||
- `component` *(<T:druid.component>)*: Component instance
|
||||
|
||||
- **Returns:**
|
||||
- `is_removed` *(boolean)*: True if component was removed
|
||||
|
||||
### update
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:update(dt)
|
||||
```
|
||||
|
||||
Call this in gui_script update function.
|
||||
|
||||
- **Parameters:**
|
||||
- `dt` *(number)*: Delta time
|
||||
|
||||
### on_input
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:on_input(action_id, action)
|
||||
```
|
||||
|
||||
Call this in gui_script on_input function.
|
||||
|
||||
- **Parameters:**
|
||||
- `action_id` *(hash)*: Action_id from on_input
|
||||
- `action` *(table)*: Action from on_input
|
||||
|
||||
- **Returns:**
|
||||
- `is_input_consumed` *(boolean)*: The boolean value is input was consumed
|
||||
|
||||
### on_message
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:on_message(message_id, message, sender)
|
||||
```
|
||||
|
||||
Call this in gui_script on_message function.
|
||||
|
||||
- **Parameters:**
|
||||
- `message_id` *(hash)*: Message_id from on_message
|
||||
- `message` *(table)*: Message from on_message
|
||||
- `sender` *(url)*: Sender from on_message
|
||||
|
||||
### on_window_event
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:on_window_event(window_event)
|
||||
```
|
||||
|
||||
Called when the window event occurs
|
||||
|
||||
- **Parameters:**
|
||||
- `window_event` *(number)*: The window event
|
||||
|
||||
### set_whitelist
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:set_whitelist(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:**
|
||||
- `whitelist_components` *(table|druid.component[])*: The array of component to whitelist
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.instance)*: The Druid instance
|
||||
|
||||
### set_blacklist
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:set_blacklist(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 DruidInstance
|
||||
|
||||
- **Parameters:**
|
||||
- `blacklist_components` *(table|druid.component[])*: The array of component to blacklist
|
||||
|
||||
- **Returns:**
|
||||
- `self` *(druid.instance)*: The Druid instance
|
||||
|
||||
### new_widget
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_widget(widget, [template], [nodes], ...)
|
||||
```
|
||||
|
||||
Create new Druid widget instance
|
||||
|
||||
- **Parameters:**
|
||||
- `widget` *(<T:druid.component>)*: The widget class to create
|
||||
- `[template]` *(string|nil)*: The template name used by widget
|
||||
- `[nodes]` *(string|node|table<hash, node>|nil)*: The nodes table from gui.clone_tree or prefab node to use for clone or node id to clone
|
||||
- `...` *(...)*: vararg
|
||||
|
||||
- **Returns:**
|
||||
- `widget` *(<T:druid.component>)*: The new ready to use widget
|
||||
|
||||
### new_button
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_button(node, [callback], [params], [anim_node])
|
||||
```
|
||||
|
||||
Create Button component
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: The node_id or gui.get_node(node_id)
|
||||
- `[callback]` *(function|event|nil)*: Button callback
|
||||
- `[params]` *(any)*: Button callback params
|
||||
- `[anim_node]` *(string|node|nil)*: Button anim node (node, if not provided)
|
||||
|
||||
- **Returns:**
|
||||
- `button` *(druid.button)*: The new button component
|
||||
|
||||
### new_blocker
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_blocker(node)
|
||||
```
|
||||
|
||||
Create Blocker component
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: The node_id or gui.get_node(node_id)
|
||||
|
||||
- **Returns:**
|
||||
- `blocker` *(druid.blocker)*: The new blocker component
|
||||
|
||||
### new_back_handler
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_back_handler([callback], [params])
|
||||
```
|
||||
|
||||
Create BackHandler component
|
||||
|
||||
- **Parameters:**
|
||||
- `[callback]` *(function|event|nil)*: The callback(self, custom_args) to call on back event
|
||||
- `[params]` *(any)*: Callback argument
|
||||
|
||||
- **Returns:**
|
||||
- `back_handler` *(druid.back_handler)*: The new back handler component
|
||||
|
||||
### new_hover
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_hover(node, [on_hover_callback], [on_mouse_hover_callback])
|
||||
```
|
||||
|
||||
Create Hover component
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: The node_id or gui.get_node(node_id)
|
||||
- `[on_hover_callback]` *(function|nil)*: Hover callback
|
||||
- `[on_mouse_hover_callback]` *(function|nil)*: Mouse hover callback
|
||||
|
||||
- **Returns:**
|
||||
- `hover` *(druid.hover)*: The new hover component
|
||||
|
||||
### new_text
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_text(node, [value], [adjust_type])
|
||||
```
|
||||
|
||||
Create Text component
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|druid.text|node)*: The node_id or gui.get_node(node_id)
|
||||
- `[value]` *(string|nil)*: Initial text. Default value is node text from GUI scene.
|
||||
- `[adjust_type]` *(string|nil)*: Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference
|
||||
|
||||
- **Returns:**
|
||||
- `text` *(druid.text)*: The new text component
|
||||
|
||||
### new_grid
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_grid(parent_node, item, [in_row])
|
||||
```
|
||||
|
||||
Create Grid component
|
||||
|
||||
- **Parameters:**
|
||||
- `parent_node` *(string|node)*: The node_id or gui.get_node(node_id). Parent of all Grid items.
|
||||
- `item` *(string|node)*: Item prefab. Required to get grid's item size. Can be adjusted separately.
|
||||
- `[in_row]` *(number|nil)*: How many nodes in row can be placed
|
||||
|
||||
- **Returns:**
|
||||
- `grid` *(druid.grid)*: The new grid component
|
||||
|
||||
### new_scroll
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_scroll(view_node, content_node)
|
||||
```
|
||||
|
||||
Create Scroll component
|
||||
|
||||
- **Parameters:**
|
||||
- `view_node` *(string|node)*: The node_id or gui.get_node(node_id). Will used as user input node.
|
||||
- `content_node` *(string|node)*: The node_id or gui.get_node(node_id). Will used as scrollable node inside view_node.
|
||||
|
||||
- **Returns:**
|
||||
- `scroll` *(druid.scroll)*: The new scroll component
|
||||
|
||||
### new_drag
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_drag(node, [on_drag_callback])
|
||||
```
|
||||
|
||||
Create Drag component
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: The node_id or gui.get_node(node_id). Will used as user input node.
|
||||
- `[on_drag_callback]` *(function|nil)*: Callback for on_drag_event(self, dx, dy)
|
||||
|
||||
- **Returns:**
|
||||
- `drag` *(druid.drag)*: The new drag component
|
||||
|
||||
### new_swipe
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_swipe(node, [on_swipe_callback])
|
||||
```
|
||||
|
||||
Create Swipe component
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: The node_id or gui.get_node(node_id). Will used as user input node.
|
||||
- `[on_swipe_callback]` *(function|nil)*: Swipe callback for on_swipe_end event
|
||||
|
||||
- **Returns:**
|
||||
- `swipe` *(druid.swipe)*: The new swipe component
|
||||
|
||||
### new_lang_text
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_lang_text(node, [locale_id], [adjust_type])
|
||||
```
|
||||
|
||||
Create LangText component
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: The_node id or gui.get_node(node_id)
|
||||
- `[locale_id]` *(string|nil)*: Default locale id or text from node as default
|
||||
- `[adjust_type]` *(string|nil)*: Adjust type for text node. Default: "downscale"
|
||||
|
||||
- **Returns:**
|
||||
- `lang_text` *(druid.lang_text)*: The new lang text component
|
||||
|
||||
### new_slider
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_slider(pin_node, end_pos, [callback])
|
||||
```
|
||||
|
||||
Create Slider component
|
||||
|
||||
- **Parameters:**
|
||||
- `pin_node` *(string|node)*: The_node id or gui.get_node(node_id).
|
||||
- `end_pos` *(vector3)*: The end position of slider
|
||||
- `[callback]` *(function|nil)*: On slider change callback
|
||||
|
||||
- **Returns:**
|
||||
- `slider` *(druid.slider)*: The new slider component
|
||||
|
||||
### new_input
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_input(click_node, text_node, [keyboard_type])
|
||||
```
|
||||
|
||||
Create Input component
|
||||
|
||||
- **Parameters:**
|
||||
- `click_node` *(string|node)*: Button node to enabled input component
|
||||
- `text_node` *(string|druid.text|node)*: Text node what will be changed on user input
|
||||
- `[keyboard_type]` *(number|nil)*: Gui keyboard type for input field
|
||||
|
||||
- **Returns:**
|
||||
- `input` *(druid.input)*: The new input component
|
||||
|
||||
### new_data_list
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_data_list(druid_scroll, druid_grid, create_function)
|
||||
```
|
||||
|
||||
Create DataList component
|
||||
|
||||
- **Parameters:**
|
||||
- `druid_scroll` *(druid.scroll)*: The Scroll instance for Data List component
|
||||
- `druid_grid` *(druid.grid)*: The Grid instance for Data List component
|
||||
- `create_function` *(function)*: The create function callback(self, data, index, data_list). Function should return (node, [component])
|
||||
|
||||
- **Returns:**
|
||||
- `data_list` *(druid.data_list)*: The new data list component
|
||||
|
||||
### new_timer
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_timer(node, [seconds_from], [seconds_to], [callback])
|
||||
```
|
||||
|
||||
Create Timer component
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: Gui text node
|
||||
- `[seconds_from]` *(number|nil)*: Start timer value in seconds
|
||||
- `[seconds_to]` *(number|nil)*: End timer value in seconds
|
||||
- `[callback]` *(function|nil)*: Function on timer end
|
||||
|
||||
- **Returns:**
|
||||
- `timer` *(druid.timer)*: The new timer component
|
||||
|
||||
### new_progress
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_progress(node, key, [init_value])
|
||||
```
|
||||
|
||||
Create Progress component
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: Progress bar fill node or node name
|
||||
- `key` *(string)*: Progress bar direction: "x" or "y"
|
||||
- `[init_value]` *(number|nil)*: Initial value of progress bar. Default: 1
|
||||
|
||||
- **Returns:**
|
||||
- `progress` *(druid.progress)*: The new progress component
|
||||
|
||||
### new_layout
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_layout(node, [mode])
|
||||
```
|
||||
|
||||
Create Layout component
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: The_node id or gui.get_node(node_id).
|
||||
- `[mode]` *(string|nil)*: vertical|horizontal|horizontal_wrap. Default: horizontal
|
||||
|
||||
- **Returns:**
|
||||
- `layout` *(druid.layout)*: The new layout component
|
||||
|
||||
### new_container
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_container(node, [mode], [callback])
|
||||
```
|
||||
|
||||
Create Container component
|
||||
|
||||
- **Parameters:**
|
||||
- `node` *(string|node)*: The_node id or gui.get_node(node_id).
|
||||
- `[mode]` *(string|nil)*: Layout mode
|
||||
- `[callback]` *(fun(self: druid.container, size: vector3)|nil)*: Callback on size changed
|
||||
|
||||
- **Returns:**
|
||||
- `container` *(druid.container)*: The new container component
|
||||
|
||||
### new_hotkey
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_hotkey(keys_array, [callback], [callback_argument])
|
||||
```
|
||||
|
||||
Create Hotkey component
|
||||
|
||||
- **Parameters:**
|
||||
- `keys_array` *(string|string[])*: Keys for trigger action. Should contains one action key and any amount of modificator keys
|
||||
- `[callback]` *(function|event|nil)*: The callback function
|
||||
- `[callback_argument]` *(any)*: The argument to pass into the callback function
|
||||
|
||||
- **Returns:**
|
||||
- `hotkey` *(druid.hotkey)*: The new hotkey component
|
||||
|
||||
### new_rich_text
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_rich_text(text_node, [value])
|
||||
```
|
||||
|
||||
Create RichText component.
|
||||
|
||||
- **Parameters:**
|
||||
- `text_node` *(string|node)*: The text node to make Rich Text
|
||||
- `[value]` *(string|nil)*: The initial text value. Default will be gui.get_text(text_node)
|
||||
|
||||
- **Returns:**
|
||||
- `rich_text` *(druid.rich_text)*: The new rich text component
|
||||
|
||||
### new_rich_input
|
||||
|
||||
---
|
||||
```lua
|
||||
instance:new_rich_input(template, [nodes])
|
||||
```
|
||||
|
||||
Create RichInput component.
|
||||
As a template please check rich_input.gui layout.
|
||||
|
||||
- **Parameters:**
|
||||
- `template` *(string)*: The template string name
|
||||
- `[nodes]` *(table|nil)*: Nodes table from gui.clone_tree
|
||||
|
||||
- **Returns:**
|
||||
- `rich_input` *(druid.rich_input)*: The new rich input component
|
||||
|
@ -1,643 +0,0 @@
|
||||
# Quick API Reference
|
||||
|
||||
# Table of Contents
|
||||
1. [Druid](#druid)
|
||||
2. [Druid Instance](#druid-instance)
|
||||
3. [Components](#components)
|
||||
1. [Base Component](#base-component)
|
||||
2. [Blocker](#blocker)
|
||||
3. [Button](#button)
|
||||
4. [Container](#container)
|
||||
5. [Data List](#data-list)
|
||||
6. [Drag](#drag)
|
||||
7. [Grid](#grid)
|
||||
8. [Hotkey](#hotkey)
|
||||
9. [Hover](#hover)
|
||||
10. [Input](#input)
|
||||
11. [Lang Text](#lang-text)
|
||||
12. [Layout](#layout)
|
||||
13. [Progress](#progress)
|
||||
14. [Rich Input](#rich-input)
|
||||
15. [Rich Text](#rich-text)
|
||||
16. [Scroll](#scroll)
|
||||
17. [Slider](#slider)
|
||||
18. [Swipe](#swipe)
|
||||
19. [Text](#text)
|
||||
20. [Timer](#timer)
|
||||
4. [Helper](#helper)
|
||||
5. [Widgets](#widgets)
|
||||
|
||||
# API Reference
|
||||
|
||||
## [Druid](druid_api.md)
|
||||
|
||||
Inspect [API Here](druid_api.md)
|
||||
|
||||
```lua
|
||||
local druid = require("druid.druid")
|
||||
|
||||
druid.init_window_listener()
|
||||
druid.on_language_change()
|
||||
druid.on_window_callback(window_event)
|
||||
druid.set_default_style(style)
|
||||
druid.set_sound_function(callback)
|
||||
druid.set_text_function(callback)
|
||||
|
||||
self.druid = druid.new(context, [style])
|
||||
```
|
||||
|
||||
## [Druid Instance](druid_instance_api.md)
|
||||
|
||||
Inspect [API Here](druid_instance_api.md)
|
||||
|
||||
```lua
|
||||
-- Lifecycle
|
||||
self.druid:final()
|
||||
self.druid:update(dt)
|
||||
self.druid:on_input(action_id, action)
|
||||
self.druid:on_message(message_id, message, sender)
|
||||
|
||||
-- Custom components
|
||||
self.druid:new(component, ...)
|
||||
self.druid:new_widget(widget, [template], [nodes], ...)
|
||||
|
||||
-- Built-in components
|
||||
self.druid:new_button(node, [callback], [params], [anim_node])
|
||||
self.druid:new_text(node, [value], [no_adjust])
|
||||
self.druid:new_grid(parent_node, item, [in_row])
|
||||
self.druid:new_scroll(view_node, content_node)
|
||||
self.druid:new_data_list(druid_scroll, druid_grid, create_function)
|
||||
self.druid:new_progress(node, key, [init_value])
|
||||
self.druid:new_lang_text(node, [locale_id], [adjust_type])
|
||||
self.druid:new_rich_text(text_node, [value])
|
||||
self.druid:new_back_handler([callback], [params])
|
||||
self.druid:new_blocker(node)
|
||||
self.druid:new_hover(node, [on_hover_callback], [on_mouse_hover_callback])
|
||||
self.druid:new_drag(node, [on_drag_callback])
|
||||
self.druid:new_swipe(node, [on_swipe_callback])
|
||||
self.druid:new_input(click_node, text_node, [keyboard_type])
|
||||
self.druid:new_rich_input(template, [nodes])
|
||||
self.druid:new_layout(node, [mode])
|
||||
self.druid:new_container(node, [mode], [callback])
|
||||
self.druid:new_hotkey(keys_array, [callback], [callback_argument])
|
||||
self.druid:new_slider(pin_node, end_pos, [callback])
|
||||
self.druid:new_timer(node, [seconds_from], [seconds_to], [callback])
|
||||
|
||||
-- Operational
|
||||
self.druid:remove(component)
|
||||
self.druid:set_blacklist(blacklist_components)
|
||||
self.druid:set_whitelist(whitelist_components)
|
||||
```
|
||||
|
||||
## Components
|
||||
|
||||
### [Base Component](components/base/component_api.md)
|
||||
|
||||
Inspect [API Here](components/base/component_api.md)
|
||||
|
||||
Basic methods for all components and widgets.
|
||||
|
||||
```lua
|
||||
component:get_childrens()
|
||||
component:get_context()
|
||||
component:get_druid([template], [nodes])
|
||||
component:get_input_priority()
|
||||
component:get_node(node_id)
|
||||
component:get_nodes()
|
||||
component:get_parent_component()
|
||||
component:get_template()
|
||||
component:reset_input_priority()
|
||||
component:set_input_enabled(state)
|
||||
component:set_input_priority(value, [is_temporary])
|
||||
component:set_nodes(nodes)
|
||||
component:set_style([druid_style])
|
||||
component:set_template([template])
|
||||
|
||||
-- All widgets goes with created Druid instance
|
||||
-- All other component's functions also exists
|
||||
widget.druid
|
||||
```
|
||||
|
||||
### [Blocker](components/base/blocker_api.md)
|
||||
|
||||
Inspect [API Here](components/base/blocker_api.md)
|
||||
|
||||
```lua
|
||||
local blocker = self.druid:new_blocker(node)
|
||||
|
||||
blocker:is_enabled()
|
||||
blocker:set_enabled(state)
|
||||
```
|
||||
|
||||
### [Button](components/base/button_api.md)
|
||||
|
||||
Inspect [API Here](components/base/button_api.md)
|
||||
|
||||
```lua
|
||||
local button = require("druid.base.button")
|
||||
|
||||
button:init(node_or_node_id, [callback], [custom_args], [anim_node])
|
||||
button:set_animations_disabled()
|
||||
button:set_enabled([state])
|
||||
button:is_enabled()
|
||||
button:set_click_zone([zone])
|
||||
button:set_key_trigger(key)
|
||||
button:get_key_trigger()
|
||||
button:set_check_function([check_function], [failure_callback])
|
||||
button:set_web_user_interaction([is_web_mode])
|
||||
|
||||
button.on_click
|
||||
button.on_pressed
|
||||
button.on_repeated_click
|
||||
button.on_long_click
|
||||
button.on_double_click
|
||||
button.on_hold_callback
|
||||
button.on_click_outside
|
||||
```
|
||||
|
||||
### [Container](components/extended/container_api.md)
|
||||
|
||||
Inspect [API Here](components/extended/container_api.md)
|
||||
|
||||
```lua
|
||||
local container = self.druid:new_container(node, [mode], [callback])
|
||||
|
||||
container:add_container(node_or_container, [mode], [on_resize_callback])
|
||||
container:clear_draggable_corners()
|
||||
container:create_draggable_corners()
|
||||
container:fit_into_node(node)
|
||||
container:fit_into_size(target_size)
|
||||
container:fit_into_window()
|
||||
container:get_position()
|
||||
container:get_scale()
|
||||
container:get_size()
|
||||
container:on_window_resized()
|
||||
container:refresh()
|
||||
container:refresh_origins()
|
||||
container:refresh_scale()
|
||||
container:remove_container_by_node([node])
|
||||
container:set_min_size([min_size_x], [min_size_y])
|
||||
container:set_max_size([max_size_x], [max_size_y])
|
||||
container:set_parent_container([parent_container])
|
||||
container:set_pivot(pivot)
|
||||
container:set_position(pos_x, pos_y)
|
||||
container:set_size([width], [height], [anchor_pivot])
|
||||
container:update_child_containers()
|
||||
|
||||
container.on_size_changeed
|
||||
```
|
||||
|
||||
### [Data List](components/extended/data_list_api.md)
|
||||
|
||||
Inspect [API Here](components/extended/data_list_api.md)
|
||||
|
||||
```lua
|
||||
local data_list = self.druid:new_data_list(druid_scroll, druid_grid, create_function)
|
||||
|
||||
data_list:add(data, [index], [shift_policy])
|
||||
data_list:clear()
|
||||
data_list:get_created_components()
|
||||
data_list:get_created_nodes()
|
||||
data_list:get_data()
|
||||
data_list:get_index(data)
|
||||
data_list:remove([index], [shift_policy])
|
||||
data_list:remove_by_data(data, [shift_policy])
|
||||
data_list:scroll_to_index(index)
|
||||
data_list:set_data(data)
|
||||
data_list:set_use_cache(is_use_cache)
|
||||
|
||||
data_list.on_scroll_progress_change
|
||||
data_list.on_element_add
|
||||
data_list.on_element_remove
|
||||
```
|
||||
|
||||
### [Drag](components/base/drag_api.md)
|
||||
|
||||
Inspect [API Here](components/base/drag_api.md)
|
||||
|
||||
```lua
|
||||
local drag = self.druid:new_drag(node, [on_drag_callback])
|
||||
|
||||
drag:is_enabled()
|
||||
drag:on_window_resized()
|
||||
drag:set_click_zone([node])
|
||||
drag:set_drag_cursors(is_enabled)
|
||||
drag:set_enabled(is_enabled)
|
||||
|
||||
drag.on_touch_start
|
||||
drag.on_touch_end
|
||||
drag.on_drag_start
|
||||
drag.on_drag
|
||||
drag.on_drag_end
|
||||
```
|
||||
|
||||
### [Grid](components/base/static_grid_api.md)
|
||||
|
||||
Inspect [API Here](components/base/static_grid_api.md)
|
||||
|
||||
```lua
|
||||
local grid = self.druid:new_grid(parent_node, item, [in_row])
|
||||
|
||||
grid:add(item, [index], [shift_policy], [is_instant])
|
||||
grid:clear()
|
||||
grid:get_all_pos()
|
||||
grid:get_borders()
|
||||
grid:get_index(pos)
|
||||
grid:get_index_by_node(node)
|
||||
grid:get_offset()
|
||||
grid:get_pos(index)
|
||||
grid:get_size()
|
||||
grid:get_size_for([count])
|
||||
grid:refresh()
|
||||
grid:remove(index, [shift_policy], [is_instant])
|
||||
grid:set_anchor(anchor)
|
||||
grid:set_in_row(in_row)
|
||||
grid:set_item_size([width], [height])
|
||||
grid:set_items(nodes, [is_instant])
|
||||
grid:set_pivot([pivot])
|
||||
grid:set_position_function(callback)
|
||||
grid:sort_nodes(comparator)
|
||||
|
||||
grid.on_add_item
|
||||
grid.on_remove_item
|
||||
grid.on_change_items
|
||||
grid.on_clear
|
||||
grid.on_update_positions
|
||||
```
|
||||
|
||||
### [Hotkey](components/extended/hotkey_api.md)
|
||||
|
||||
Inspect [API Here](components/extended/hotkey_api.md)
|
||||
|
||||
```lua
|
||||
local hotkey = self.druid:new_hotkey(keys_array, [callback], [callback_argument])
|
||||
|
||||
hotkey:add_hotkey(keys, [callback_argument])
|
||||
hotkey:is_processing()
|
||||
hotkey:on_focus_gained()
|
||||
hotkey:set_repeat(is_enabled_repeated)
|
||||
|
||||
hotkey.on_hotkey_pressed
|
||||
hotkey.on_hotkey_released
|
||||
```
|
||||
|
||||
### [Hover](components/base/hover_api.md)
|
||||
|
||||
Inspect [API Here](components/base/hover_api.md)
|
||||
|
||||
```lua
|
||||
local hover = self.druid:new_hover(node, [on_hover_callback], [on_mouse_hover_callback])
|
||||
|
||||
hover:is_enabled()
|
||||
hover:is_hovered()
|
||||
hover:is_mouse_hovered()
|
||||
hover:set_click_zone([zone])
|
||||
hover:set_enabled([state])
|
||||
hover:set_hover([state])
|
||||
hover:set_mouse_hover([state])
|
||||
|
||||
hover.on_hover
|
||||
hover.on_mouse_hover
|
||||
```
|
||||
|
||||
### [Input](components/extended/input_api.md)
|
||||
|
||||
Inspect [API Here](components/extended/input_api.md)
|
||||
|
||||
```lua
|
||||
local input = self.druid:new_input(click_node, text_node, [keyboard_type])
|
||||
|
||||
input:get_text()
|
||||
input:get_text_selected()
|
||||
input:get_text_selected_replaced(text)
|
||||
input:move_selection(delta, is_add_to_selection, is_move_to_end)
|
||||
input:on_focus_lost()
|
||||
input:reset_changes()
|
||||
input:select()
|
||||
input:select_cursor([cursor_index], [start_index], [end_index])
|
||||
input:set_allowed_characters(characters)
|
||||
input:set_max_length(max_length)
|
||||
input:set_text(input_text)
|
||||
input:unselect()
|
||||
|
||||
input.on_input_select
|
||||
input.on_input_unselect
|
||||
input.on_input_text
|
||||
input.on_input_empty
|
||||
input.on_input_full
|
||||
input.on_input_wrong
|
||||
input.on_select_cursor_change
|
||||
```
|
||||
|
||||
### [Lang Text](components/extended/lang_text_api.md)
|
||||
|
||||
Inspect [API Here](components/extended/lang_text_api.md)
|
||||
|
||||
```lua
|
||||
local lang_text = self.druid:new_lang_text(node, [locale_id], [adjust_type])
|
||||
|
||||
lang_text:format([a], [b], [c], [d], [e], [f], [g])
|
||||
lang_text:on_language_change()
|
||||
lang_text:set_text(text)
|
||||
lang_text:set_to(text)
|
||||
lang_text:translate(locale_id, [a], [b], [c], [d], [e], [f], [g])
|
||||
|
||||
lang_text.on_change
|
||||
```
|
||||
|
||||
### [Layout](components/extended/layout_api.md)
|
||||
|
||||
Inspect [API Here](components/extended/layout_api.md)
|
||||
|
||||
```lua
|
||||
local layout = self.druid:new_layout(node, [mode])
|
||||
|
||||
layout:add(node_or_node_id)
|
||||
layout:calculate_rows_data()
|
||||
layout:clear_layout()
|
||||
layout:get_content_size()
|
||||
layout:get_entities()
|
||||
layout:get_node_size(node)
|
||||
layout:get_size()
|
||||
layout:refresh_layout()
|
||||
layout:remove(node_or_node_id)
|
||||
layout:set_dirty()
|
||||
layout:set_hug_content(is_hug_width, is_hug_height)
|
||||
layout:set_justify(is_justify)
|
||||
layout:set_margin([margin_x], [margin_y])
|
||||
layout:set_node_index([node], [index])
|
||||
layout:set_node_position(node, x, y)
|
||||
layout:set_padding([padding_x], [padding_y], [padding_z], [padding_w])
|
||||
layout:set_type(type)
|
||||
layout:update()
|
||||
|
||||
layout.on_size_changed
|
||||
```
|
||||
|
||||
### [Progress](components/extended/progress_api.md)
|
||||
|
||||
Inspect [API Here](components/extended/progress_api.md)
|
||||
|
||||
```lua
|
||||
local progress = self.druid:new_progress(node, key, [init_value])
|
||||
|
||||
progress:empty()
|
||||
progress:fill()
|
||||
progress:get()
|
||||
progress:set_max_size(max_size)
|
||||
progress:set_steps(steps, callback)
|
||||
progress:set_to(to)
|
||||
progress:to(to, [callback])
|
||||
progress:update([dt])
|
||||
|
||||
progress.on_change
|
||||
```
|
||||
|
||||
### [Rich Input](components/custom/rich_input_api.md)
|
||||
|
||||
Inspect [API Here](components/custom/rich_input_api.md)
|
||||
|
||||
```lua
|
||||
local rich_input = self.druid:new_rich_input(template, [nodes])
|
||||
|
||||
rich_input:get_text()
|
||||
rich_input:select()
|
||||
rich_input:set_allowed_characters(characters)
|
||||
rich_input:set_font(font)
|
||||
rich_input:set_placeholder(placeholder_text)
|
||||
rich_input:set_text(text)
|
||||
```
|
||||
|
||||
### [Rich Text](components/custom/rich_text_api.md)
|
||||
|
||||
Inspect [API Here](components/custom/rich_text_api.md)
|
||||
|
||||
```lua
|
||||
local rich_text = self.druid:new_rich_text(text_node, [value])
|
||||
|
||||
rich_text:characters(word)
|
||||
rich_text:clear()
|
||||
rich_text:get_line_metric()
|
||||
rich_text:get_text()
|
||||
rich_text:get_words()
|
||||
rich_text:set_text([text])
|
||||
rich_text:tagged(tag)
|
||||
```
|
||||
|
||||
### [Scroll](components/base/scroll_api.md)
|
||||
|
||||
Inspect [API Here](components/base/scroll_api.md)
|
||||
|
||||
```lua
|
||||
local scroll = self.druid:new_scroll(view_node, content_node)
|
||||
|
||||
scroll:bind_grid([grid])
|
||||
scroll:get_percent()
|
||||
scroll:get_scroll_size()
|
||||
scroll:is_inert()
|
||||
scroll:is_node_in_view(node)
|
||||
scroll:scroll_to(point, [is_instant])
|
||||
scroll:scroll_to_index(index, [skip_cb])
|
||||
scroll:scroll_to_percent(percent, [is_instant])
|
||||
scroll:set_click_zone(node)
|
||||
scroll:set_extra_stretch_size([stretch_size])
|
||||
scroll:set_horizontal_scroll(state)
|
||||
scroll:set_inert(state)
|
||||
scroll:set_points(points)
|
||||
scroll:set_size(size, [offset])
|
||||
scroll:set_vertical_scroll(state)
|
||||
scroll:set_view_size(size)
|
||||
scroll:update([dt])
|
||||
scroll:update_view_size()
|
||||
|
||||
scroll.on_scroll
|
||||
scroll.on_scroll_to
|
||||
scroll.on_point_scroll
|
||||
```
|
||||
|
||||
### [Slider](components/extended/slider_api.md)
|
||||
|
||||
Inspect [API Here](components/extended/slider_api.md)
|
||||
|
||||
```lua
|
||||
local slider = self.druid:new_slider(pin_node, end_pos, [callback])
|
||||
|
||||
slider:is_enabled()
|
||||
slider:set(value, [is_silent])
|
||||
slider:set_enabled(is_enabled)
|
||||
slider:set_input_node([input_node])
|
||||
slider:set_steps(steps)
|
||||
|
||||
slider.on_change_value
|
||||
```
|
||||
|
||||
### [Swipe](components/extended/swipe_api.md)
|
||||
|
||||
Inspect [API Here](components/extended/swipe_api.md)
|
||||
|
||||
```lua
|
||||
local swipe = self.druid:new_swipe(node, [on_swipe_callback])
|
||||
|
||||
swipe:set_click_zone([zone])
|
||||
|
||||
swipe.on_swipe
|
||||
```
|
||||
|
||||
### [Text](components/base/text_api.md)
|
||||
|
||||
Inspect [API Here](components/base/text_api.md)
|
||||
|
||||
```lua
|
||||
local text = self.druid:new_text(node, [value], [no_adjust])
|
||||
|
||||
text:get_text()
|
||||
text:get_text_adjust()
|
||||
text:get_text_index_by_width(width)
|
||||
text:get_text_size([text])
|
||||
text:is_multiline()
|
||||
text:set_alpha(alpha)
|
||||
text:set_color(color)
|
||||
text:set_minimal_scale(minimal_scale)
|
||||
text:set_pivot(pivot)
|
||||
text:set_scale(scale)
|
||||
text:set_size(size)
|
||||
text:set_text([new_text])
|
||||
text:set_text_adjust([adjust_type], [minimal_scale])
|
||||
text:set_to(set_to)
|
||||
|
||||
text.on_set_text
|
||||
text.on_update_text_scale
|
||||
text.on_set_pivot
|
||||
```
|
||||
|
||||
### [Timer](components/extended/timer_api.md)
|
||||
|
||||
Inspect [API Here](components/extended/timer_api.md)
|
||||
|
||||
```lua
|
||||
local timer = self.druid:new_timer(node, [seconds_from], [seconds_to], [callback])
|
||||
|
||||
timer:set_interval(from, to)
|
||||
timer:set_state([is_on])
|
||||
timer:set_to(set_to)
|
||||
timer:update([dt])
|
||||
|
||||
timer.on_tick
|
||||
timer.on_set_enabled
|
||||
timer.on_timer_end
|
||||
```
|
||||
|
||||
## [Helper](druid_helper_api.md)
|
||||
|
||||
Inspect [API Here](druid_helper_api.md)
|
||||
|
||||
```lua
|
||||
local helper = require("druid.helper")
|
||||
|
||||
helper.add_array([target], [source])
|
||||
helper.centrate_icon_with_text([icon_node], [text_node], [margin])
|
||||
helper.centrate_nodes([margin], ...)
|
||||
helper.centrate_text_with_icon([text_node], [icon_node], margin)
|
||||
helper.clamp(value, [v1], [v2])
|
||||
helper.contains([array], [value])
|
||||
helper.deepcopy(orig_table)
|
||||
helper.distance(x1, y1, x2, y2)
|
||||
helper.get_animation_data_from_node(node, atlas_path)
|
||||
helper.get_border(node, [offset])
|
||||
helper.get_closest_stencil_node(node)
|
||||
helper.get_full_position(node, [root])
|
||||
helper.get_gui_scale()
|
||||
helper.get_node(node_id, [template], [nodes])
|
||||
helper.get_pivot_offset(pivot_or_node)
|
||||
helper.get_scaled_size(node)
|
||||
helper.get_scene_scale(node, [include_passed_node_scale])
|
||||
helper.get_screen_aspect_koef()
|
||||
helper.get_text_metrics_from_node(text_node)
|
||||
helper.insert_with_shift(array, [item], [index], [shift_policy])
|
||||
helper.is_mobile()
|
||||
helper.is_multitouch_supported()
|
||||
helper.is_web()
|
||||
helper.is_web_mobile()
|
||||
helper.lerp(a, b, t)
|
||||
helper.pick_node(node, x, y, [node_click_area])
|
||||
helper.remove_with_shift([array], [index], [shift_policy])
|
||||
helper.round(num, [num_decimal_places])
|
||||
helper.sign(val)
|
||||
helper.step(current, target, step)
|
||||
helper.table_to_string(t)
|
||||
```
|
||||
|
||||
## [Widgets](widgets_api.md)
|
||||
|
||||
Inspect [API Here](widgets_api.md)
|
||||
|
||||
### [FPS Panel](/api/components/widgets/fps_panel_api.md)
|
||||
|
||||
Inspect [API Here](/api/components/widgets/fps_panel_api.md)
|
||||
|
||||
```lua
|
||||
local fps_panel = require("druid.widget.fps_panel.fps_panel")
|
||||
|
||||
fps_panel:init()
|
||||
fps_panel:push_fps_value()
|
||||
```
|
||||
|
||||
### [Memory Panel](/api/components/widgets/memory_panel_api.md)
|
||||
|
||||
Inspect [API Here](/api/components/widgets/memory_panel_api.md)
|
||||
|
||||
```lua
|
||||
local memory_panel = require("druid.widget.memory_panel.memory_panel")
|
||||
|
||||
memory_panel:init()
|
||||
memory_panel:set_low_memory_limit([limit])
|
||||
memory_panel:push_next_value()
|
||||
memory_panel:update_text_memory()
|
||||
```
|
||||
|
||||
### [Mini Graph](/api/components/widgets/mini_graph_api.md)
|
||||
|
||||
Inspect [API Here](/api/components/widgets/mini_graph_api.md)
|
||||
|
||||
```lua
|
||||
local mini_graph = require("druid.widget.mini_graph.mini_graph")
|
||||
|
||||
mini_graph:clear()
|
||||
mini_graph:set_samples([samples])
|
||||
mini_graph:get_samples()
|
||||
mini_graph:set_line_value(index, value)
|
||||
mini_graph:get_line_value([index])
|
||||
mini_graph:push_line_value([value])
|
||||
mini_graph:set_max_value([max_value])
|
||||
mini_graph:set_line_height([index])
|
||||
mini_graph:get_lowest_value()
|
||||
mini_graph:get_highest_value()
|
||||
mini_graph:toggle_hide()
|
||||
```
|
||||
|
||||
### [Properties Panel](/api/components/widgets/properties_panel_api.md)
|
||||
|
||||
Inspect [API Here](/api/components/widgets/properties_panel_api.md)
|
||||
|
||||
```lua
|
||||
local properties_panel = require("druid.widget.properties_panel.properties_panel")
|
||||
|
||||
properties_panel:properties_constructors()
|
||||
properties_panel:init()
|
||||
properties_panel:clear_created_properties()
|
||||
properties_panel:clear()
|
||||
properties_panel:add_checkbox([on_create])
|
||||
properties_panel:add_slider([on_create])
|
||||
properties_panel:add_button([on_create])
|
||||
properties_panel:add_input([on_create])
|
||||
properties_panel:add_text([on_create])
|
||||
properties_panel:add_left_right_selector([on_create])
|
||||
properties_panel:add_vector3([on_create])
|
||||
properties_panel:add_inner_widget(widget_class, [template], [nodes], [on_create])
|
||||
properties_panel:add_widget(create_widget_callback)
|
||||
properties_panel:remove([widget])
|
||||
properties_panel:set_hidden([is_hidden])
|
||||
properties_panel:is_hidden()
|
||||
properties_panel:set_properties_per_page(properties_per_page)
|
||||
properties_panel:set_page([page])
|
||||
```
|
18
config.ld
Normal file
18
config.ld
Normal file
@ -0,0 +1,18 @@
|
||||
project='Druid'
|
||||
title='Defold Druid UI Library'
|
||||
description='Documentation for Druid Library'
|
||||
file={"./druid",
|
||||
exclude = {
|
||||
"./druid/styles/",
|
||||
"./druid/system/middleclass.lua",
|
||||
"./druid/templates/",
|
||||
"./druid/annotations.lua",
|
||||
}
|
||||
}
|
||||
package='druid'
|
||||
sort=true
|
||||
dir='./docs'
|
||||
style='!fixed'
|
||||
topics={}
|
||||
use_markdown_titles=true
|
||||
no_space_before_args=true
|
7
deployer_build_stats.csv
Normal file
7
deployer_build_stats.csv
Normal file
@ -0,0 +1,7 @@
|
||||
date,sha,version,build_size,build_time,platform,mode,is_cache_using,commits_count
|
||||
2022-02-28T19:06:43Z,3b329f9c25c9672e4030edb039b0225fa46f7ce1,0.8.521,4356,68,armv7-android,debug,true,521
|
||||
2022-02-28T19:14:56Z,3b329f9c25c9672e4030edb039b0225fa46f7ce1,0.8.521,4356,51,armv7-android,debug,true,521
|
||||
2022-02-28T19:16:23Z,3b329f9c25c9672e4030edb039b0225fa46f7ce1,0.8.521,4356,11,armv7-android,debug,true,521
|
||||
2022-02-28T19:19:46Z,3b329f9c25c9672e4030edb039b0225fa46f7ce1,0.8.521,4356,11,armv7-android,debug,true,521
|
||||
2022-02-28T19:22:51Z,3b329f9c25c9672e4030edb039b0225fa46f7ce1,0.8.521,4356,11,armv7-android,debug,true,521
|
||||
2022-03-12T10:01:30Z,d0f3d6641a08b0d6b719b13017aa85907d1667e5,0.8.564,2200,44,js-web,release,true,564
|
|
BIN
docs/Druid.wasm
BIN
docs/Druid.wasm
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
{"content":[{"name":"game.projectc","size":4552,"pieces":[{"name":"game0.projectc","offset":0}]},{"name":"game.arci","size":15008,"pieces":[{"name":"game0.arci","offset":0}]},{"name":"game.arcd","size":3789178,"pieces":[{"name":"game0.arcd","offset":0},{"name":"game1.arcd","offset":2097152}]},{"name":"game.dmanifest","size":17041,"pieces":[{"name":"game0.dmanifest","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game0.public.der","offset":0}]}],"total_size":3825941}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1172
docs/dmloader.js
1172
docs/dmloader.js
File diff suppressed because it is too large
Load Diff
1
docs/druid/archive/archive_files.json
Normal file
1
docs/druid/archive/archive_files.json
Normal file
@ -0,0 +1 @@
|
||||
{"content":[{"name":"game.projectc","size":3808,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":17168,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":417873,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":17838,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]}
|
BIN
docs/druid/archive/game.arcd0
Normal file
BIN
docs/druid/archive/game.arcd0
Normal file
Binary file not shown.
BIN
docs/druid/archive/game.arci0
Normal file
BIN
docs/druid/archive/game.arci0
Normal file
Binary file not shown.
BIN
docs/druid/archive/game.dmanifest0
Normal file
BIN
docs/druid/archive/game.dmanifest0
Normal file
Binary file not shown.
@ -1,25 +1,23 @@
|
||||
[project]
|
||||
title = Druid
|
||||
version = 1.1.0
|
||||
title = druid
|
||||
version = 0.8.564
|
||||
write_log = 0
|
||||
minimum_log_level = 1
|
||||
compress_archive = 1
|
||||
publisher = Insality
|
||||
developer = Maksim Tuprikov
|
||||
custom_resources = /example/locales
|
||||
commit_sha = 423a5239036790befe5fd0afd5b7a653314ad8be
|
||||
title_as_file_name = Druid
|
||||
developer = Insality
|
||||
commit_sha = d0f3d6641a08b0d6b719b13017aa85907d1667e5
|
||||
build_date = 2022-03-12T10:01:30Z
|
||||
title_as_file_name = druid
|
||||
|
||||
[display]
|
||||
width = 1920
|
||||
height = 1080
|
||||
high_dpi = 1
|
||||
width = 600
|
||||
height = 900
|
||||
high_dpi = 0
|
||||
samples = 0
|
||||
fullscreen = 0
|
||||
update_frequency = 60
|
||||
swap_interval = 1
|
||||
update_frequency = 0
|
||||
vsync = 1
|
||||
display_profiles = /builtins/render/default.display_profilesc
|
||||
display_profiles = /example/custom.display_profilesc
|
||||
dynamic_orientation = 1
|
||||
display_device_info = 0
|
||||
|
||||
@ -27,12 +25,10 @@ display_device_info = 0
|
||||
clear_color_red = 0
|
||||
clear_color_green = 0
|
||||
clear_color_blue = 0
|
||||
clear_color_alpha = 1
|
||||
clear_color_alpha = 0
|
||||
|
||||
[physics]
|
||||
type = 2D
|
||||
max_collision_object_count = 128
|
||||
use_fixed_timestep = 0
|
||||
gravity_y = -10
|
||||
debug = 0
|
||||
debug_alpha = 0.9
|
||||
@ -49,23 +45,19 @@ ray_cast_limit_2d = 64
|
||||
ray_cast_limit_3d = 128
|
||||
trigger_overlap_capacity = 16
|
||||
velocity_threshold = 1
|
||||
max_fixed_timesteps = 2
|
||||
|
||||
[bootstrap]
|
||||
main_collection = /example/druid.collectionc
|
||||
main_collection = /example/example.collectionc
|
||||
render = /builtins/render/default.renderc
|
||||
|
||||
[graphics]
|
||||
default_texture_min_filter = linear
|
||||
default_texture_mag_filter = linear
|
||||
max_draw_calls = 128
|
||||
max_draw_calls = 1024
|
||||
max_characters = 8192
|
||||
max_font_batches = 128
|
||||
max_debug_vertices = 10000
|
||||
texture_profiles = /builtins/graphics/default.texture_profiles
|
||||
verify_graphics_calls = 0
|
||||
opengl_version_hint = 33
|
||||
opengl_core_profile_hint = true
|
||||
texture_profiles = /example/custom.texture_profiles
|
||||
verify_graphics_calls = 1
|
||||
memory_size = 512
|
||||
|
||||
[shader]
|
||||
@ -88,101 +80,89 @@ max_resources = 1024
|
||||
repeat_delay = 0.5
|
||||
repeat_interval = 0.2
|
||||
gamepads = /builtins/input/default.gamepadsc
|
||||
game_binding = /builtins/input/all.input_bindingc
|
||||
game_binding = /input/game.input_bindingc
|
||||
use_accelerometer = 0
|
||||
|
||||
[sprite]
|
||||
max_count = 16
|
||||
max_count = 128
|
||||
subpixels = 1
|
||||
|
||||
[model]
|
||||
max_count = 0
|
||||
split_meshes = 0
|
||||
max_count = 128
|
||||
|
||||
[mesh]
|
||||
max_count = 0
|
||||
max_count = 128
|
||||
|
||||
[gui]
|
||||
max_count = 64
|
||||
max_particlefx_count = 64
|
||||
max_particle_count = 1024
|
||||
max_animation_count = 1024
|
||||
|
||||
[collection]
|
||||
max_instances = 128
|
||||
max_instances = 1024
|
||||
max_input_stack_entries = 16
|
||||
|
||||
[collection_proxy]
|
||||
max_count = 8
|
||||
|
||||
[collectionfactory]
|
||||
max_count = 64
|
||||
max_count = 128
|
||||
|
||||
[factory]
|
||||
max_count = 16
|
||||
max_count = 128
|
||||
|
||||
[ios]
|
||||
launch_screen = /builtins/manifests/ios/LaunchScreen.storyboardc
|
||||
pre_renderered_icons = 0
|
||||
bundle_identifier = example.unnamed
|
||||
bundle_name =
|
||||
infoplist = /builtins/manifests/ios/Info.plist
|
||||
privacymanifest = /builtins/manifests/ios/PrivacyInfo.xcprivacy
|
||||
default_language = en
|
||||
localizations = en
|
||||
|
||||
[android]
|
||||
version_code = 970
|
||||
minimum_sdk_version = 19
|
||||
target_sdk_version = 35
|
||||
version_code = 564
|
||||
minimum_sdk_version = 16
|
||||
target_sdk_version = 30
|
||||
package = com.insality.druid
|
||||
gcm_sender_id =
|
||||
manifest = /builtins/manifests/android/AndroidManifest.xml
|
||||
iap_provider = GooglePlay
|
||||
input_method = HiddenInputField
|
||||
immersive_mode = 0
|
||||
display_cutout = 1
|
||||
debuggable = 0
|
||||
proguard =
|
||||
extract_native_libs = 1
|
||||
|
||||
[osx]
|
||||
app_icon =
|
||||
infoplist = /builtins/manifests/osx/Info.plist
|
||||
privacymanifest = /builtins/manifests/osx/PrivacyInfo.xcprivacy
|
||||
bundle_identifier = example.unnamed
|
||||
bundle_name =
|
||||
bundle_version = 1
|
||||
default_language = en
|
||||
localizations = en
|
||||
|
||||
[windows]
|
||||
app_icon =
|
||||
|
||||
[html5]
|
||||
custom_heap_size = 0
|
||||
heap_size = 64
|
||||
htmlfile = /builtins/manifests/web/engine_template.html
|
||||
cssfile = /builtins/manifests/web/dark_theme.css
|
||||
splash_image = /media/druid_logo.png
|
||||
cssfile = /builtins/manifests/web/light_theme.css
|
||||
archive_location_prefix = archive
|
||||
archive_location_suffix =
|
||||
engine_arguments = --verify-graphics-calls=false
|
||||
wasm_streaming = 0
|
||||
show_fullscreen_button = 0
|
||||
show_made_with_defold = 0
|
||||
show_console_banner = 0
|
||||
scale_mode = stretch
|
||||
transparent_graphics_context = 0
|
||||
show_console_banner = 1
|
||||
scale_mode = fit
|
||||
engine_arguments = --verify-graphics-calls=false
|
||||
splash_image = /media/druid_logo.png
|
||||
|
||||
[particle_fx]
|
||||
max_count = 0
|
||||
max_emitter_count = 0
|
||||
max_particle_count = 0
|
||||
max_count = 64
|
||||
max_emitter_count = 64
|
||||
max_particle_count = 1024
|
||||
|
||||
[iap]
|
||||
auto_finish_transactions = 1
|
||||
|
||||
[network]
|
||||
http_timeout = 0
|
||||
ssl_certificates =
|
||||
http_thread_count = 4
|
||||
http_cache_enabled = 1
|
||||
|
||||
@ -193,29 +173,27 @@ include_dirs = druid
|
||||
shared_state = 1
|
||||
|
||||
[label]
|
||||
max_count = 0
|
||||
max_count = 64
|
||||
subpixels = 1
|
||||
|
||||
[profiler]
|
||||
track_cpu = 0
|
||||
sleep_between_server_updates = 0
|
||||
|
||||
[liveupdate]
|
||||
settings = /liveupdate.settings
|
||||
enabled = 1
|
||||
mount_on_start = 1
|
||||
|
||||
[tilemap]
|
||||
max_count = 0
|
||||
max_tile_count = 0
|
||||
max_count = 16
|
||||
max_tile_count = 2048
|
||||
|
||||
[engine]
|
||||
run_while_iconified = 0
|
||||
fixed_update_frequency = 60
|
||||
max_time_step = 0.5
|
||||
|
||||
[druid]
|
||||
no_auto_input = 0
|
||||
stencil_check = 0
|
||||
no_auto_template = 0
|
||||
input_text = text
|
||||
input_touch = touch
|
||||
input_marked_text = marked_text
|
||||
@ -223,21 +201,10 @@ input_key_esc = key_esc
|
||||
input_key_back = key_back
|
||||
input_key_enter = key_enter
|
||||
input_key_backspace = key_backspace
|
||||
input_multitouch = touch_multi
|
||||
input_scroll_up = mouse_wheel_up
|
||||
input_scroll_down = mouse_wheel_down
|
||||
input_multitouch = multitouch
|
||||
input_scroll_up = scroll_up
|
||||
input_scroll_down = scroll_down
|
||||
|
||||
[native_extension]
|
||||
app_manifest =
|
||||
|
||||
[saver]
|
||||
autosave_timer = 2
|
||||
|
||||
[lang]
|
||||
path = /example/locales
|
||||
langs = en,ru,es,de,fr,ja,pt,it,kr,zh
|
||||
default = es
|
||||
|
||||
[event]
|
||||
use_xpcall = 1
|
||||
app_manifest = /example/game.appmanifest
|
||||
|
BIN
docs/druid/archive/game.public.der0
Normal file
BIN
docs/druid/archive/game.public.der0
Normal file
Binary file not shown.
835
docs/druid/dmloader.js
Normal file
835
docs/druid/dmloader.js
Normal file
@ -0,0 +1,835 @@
|
||||
// file downloader
|
||||
// wraps XMLHttpRequest and adds retry support and progress updates when the
|
||||
// content is gzipped (gzipped content doesn't report a computable content length
|
||||
// on Google Chrome)
|
||||
var FileLoader = {
|
||||
options: {
|
||||
retryCount: 4,
|
||||
retryInterval: 1000,
|
||||
},
|
||||
// do xhr request with retries
|
||||
request: function(url, method, responseType, currentAttempt) {
|
||||
if (typeof method === 'undefined') throw "No method specified";
|
||||
if (typeof method === 'responseType') throw "No responseType specified";
|
||||
if (typeof currentAttempt === 'undefined') currentAttempt = 0;
|
||||
var obj = {
|
||||
send: function() {
|
||||
var onprogress = this.onprogress;
|
||||
var onload = this.onload;
|
||||
var onerror = this.onerror;
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open(method, url, true);
|
||||
xhr.responseType = responseType;
|
||||
xhr.onprogress = function(e) {
|
||||
if (onprogress) onprogress(xhr, e);
|
||||
};
|
||||
xhr.onerror = function(e) {
|
||||
if (currentAttempt == FileLoader.options.retryCount) {
|
||||
if (onerror) onerror(xhr, e);
|
||||
return;
|
||||
}
|
||||
currentAttempt = currentAttempt + 1;
|
||||
setTimeout(obj.send.bind(obj), FileLoader.options.retryInterval);
|
||||
};
|
||||
xhr.onload = function(e) {
|
||||
if (onload) onload(xhr, e);
|
||||
};
|
||||
xhr.send(null);
|
||||
}
|
||||
};
|
||||
return obj;
|
||||
},
|
||||
// Do HTTP HEAD request to get size of resource
|
||||
// callback will receive size or undefined in case of an error
|
||||
size: function(url, callback) {
|
||||
var request = FileLoader.request(url, "HEAD", "text");
|
||||
request.onerror = function(xhr, e) {
|
||||
callback(undefined);
|
||||
};
|
||||
request.onload = function(xhr, e) {
|
||||
if (xhr.readyState === 4) {
|
||||
if (xhr.status === 200) {
|
||||
var total = xhr.getResponseHeader('content-length');
|
||||
callback(total);
|
||||
} else {
|
||||
callback(undefined);
|
||||
}
|
||||
}
|
||||
};
|
||||
request.send();
|
||||
},
|
||||
// Do HTTP GET request
|
||||
// onprogress(loaded, total)
|
||||
// onerror(error)
|
||||
// onload(response)
|
||||
load: function(url, responseType, estimatedSize, onprogress, onerror, onload) {
|
||||
var request = FileLoader.request(url, "GET", responseType);
|
||||
request.onprogress = function(xhr, e) {
|
||||
if (e.lengthComputable) {
|
||||
onprogress(e.loaded, e.total);
|
||||
return;
|
||||
}
|
||||
var contentLength = xhr.getResponseHeader('content-length');
|
||||
var size = contentLength != undefined ? contentLength : estimatedSize;
|
||||
if (size) {
|
||||
onprogress(e.loaded, size);
|
||||
} else {
|
||||
onprogress(e.loaded, e.loaded);
|
||||
}
|
||||
};
|
||||
request.onerror = function(xhr, e) {
|
||||
onerror("Error loading '" + url + "' (" + e + ")");
|
||||
};
|
||||
request.onload = function(xhr, e) {
|
||||
if (xhr.readyState === 4) {
|
||||
if (xhr.status === 200) {
|
||||
var res = xhr.response;
|
||||
if (responseType == "json" && typeof res === "string") {
|
||||
onload(JSON.parse(res));
|
||||
} else {
|
||||
onload(res);
|
||||
}
|
||||
} else {
|
||||
onerror("Error loading '" + url + "' (" + e + ")");
|
||||
}
|
||||
}
|
||||
};
|
||||
request.send();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var EngineLoader = {
|
||||
wasm_size: 2000000,
|
||||
wasm_from: 0,
|
||||
wasm_to: 40,
|
||||
|
||||
wasmjs_size: 250000,
|
||||
wasmjs_from: 40,
|
||||
wasmjs_to: 50,
|
||||
|
||||
asmjs_size: 4000000,
|
||||
asmjs_from: 0,
|
||||
asmjs_to: 50,
|
||||
|
||||
stream_wasm: true,
|
||||
|
||||
loadAndInstantiateWasmAsync: function(src, fromProgress, toProgress, callback) {
|
||||
FileLoader.load(src, "arraybuffer", EngineLoader.wasm_size,
|
||||
function(loaded, total) { Progress.calculateProgress(fromProgress, toProgress, loaded, total); },
|
||||
function(error) { throw error; },
|
||||
function(wasm) {
|
||||
Module.instantiateWasm = function(imports, successCallback) {
|
||||
var wasmInstantiate = WebAssembly.instantiate(new Uint8Array(wasm), imports).then(function(output) {
|
||||
successCallback(output.instance);
|
||||
}).catch(function(e) {
|
||||
console.log('wasm instantiation failed! ' + e);
|
||||
throw e;
|
||||
});
|
||||
return {}; // Compiling asynchronously, no exports.
|
||||
}
|
||||
callback();
|
||||
});
|
||||
},
|
||||
|
||||
streamAndInstantiateWasmAsync: function(src, fromProgress, toProgress, callback) {
|
||||
Module.instantiateWasm = function(imports, successCallback) {
|
||||
WebAssembly.instantiateStreaming(fetch(src), imports).then(function(output) {
|
||||
Progress.calculateProgress(fromProgress, toProgress, 1, 1);
|
||||
successCallback(output.instance);
|
||||
}).catch(function(e) {
|
||||
console.log('wasm streaming instantiation failed! ' + e);
|
||||
throw e;
|
||||
});
|
||||
return {}; // Compiling asynchronously, no exports.
|
||||
}
|
||||
callback();
|
||||
},
|
||||
|
||||
// instantiate the .wasm file either by streaming it or first loading and then instantiate it
|
||||
// https://github.com/emscripten-core/emscripten/blob/master/tests/manual_wasm_instantiate.html#L170
|
||||
loadWasmAsync: function(src, fromProgress, toProgress, callback) {
|
||||
if (EngineLoader.stream_wasm && (typeof WebAssembly.instantiateStreaming === "function")) {
|
||||
EngineLoader.streamAndInstantiateWasmAsync(src, fromProgress, toProgress, callback);
|
||||
}
|
||||
else {
|
||||
EngineLoader.loadAndInstantiateWasmAsync(src, fromProgress, toProgress, callback);
|
||||
}
|
||||
},
|
||||
|
||||
// load and start engine script (asm.js or wasm.js)
|
||||
loadScriptAsync: function(src, estimatedSize, fromProgress, toProgress) {
|
||||
FileLoader.load(src, "text", estimatedSize,
|
||||
function(loaded, total) { Progress.calculateProgress(fromProgress, toProgress, loaded, total); },
|
||||
function(error) { throw error; },
|
||||
function(response) {
|
||||
var tag = document.createElement("script");
|
||||
tag.text = response;
|
||||
document.head.appendChild(tag);
|
||||
});
|
||||
},
|
||||
|
||||
// load engine (asm.js or wasm.js + wasm)
|
||||
// engine load progress goes from 1-50% for ams.js
|
||||
// engine load progress goes from 0-40% for .wasm and 40-50% for wasm.js
|
||||
load: function(appCanvasId, exeName) {
|
||||
Progress.addProgress(Module.setupCanvas(appCanvasId));
|
||||
if (Module['isWASMSupported']) {
|
||||
EngineLoader.loadWasmAsync(exeName + ".wasm", EngineLoader.wasm_from, EngineLoader.wasm_to, function(wasm) {
|
||||
EngineLoader.loadScriptAsync(exeName + '_wasm.js', EngineLoader.wasmjs_size, EngineLoader.wasmjs_from, EngineLoader.wasmjs_to);
|
||||
});
|
||||
} else {
|
||||
EngineLoader.loadScriptAsync(exeName + '_asmjs.js', EngineLoader.asmjs_size, EngineLoader.asmjs_from, EngineLoader.asmjs_to);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ********************************************************************* */
|
||||
/* Load and combine game archive data that is split into archives */
|
||||
/* ********************************************************************* */
|
||||
|
||||
var GameArchiveLoader = {
|
||||
// which files to load
|
||||
_files: [],
|
||||
_fileIndex: 0,
|
||||
// file
|
||||
// name: intended filepath of built object
|
||||
// size: expected size of built object.
|
||||
// data: combined pieces
|
||||
// downloaded: total bytes downloaded
|
||||
// pieces: array of name, offset and data objects
|
||||
// numExpectedFiles: total number of files expected in description
|
||||
// lastRequestedPiece: index of last data file requested (strictly ascending)
|
||||
// totalLoadedPieces: counts the number pieces received
|
||||
|
||||
//MAX_CONCURRENT_XHR: 6, // remove comment if throttling of XHR is desired.
|
||||
|
||||
isCompleted: false, // status of process
|
||||
|
||||
_onFileLoadedListeners: [], // signature: name, data.
|
||||
_onArchiveLoadedListeners:[], // signature: void
|
||||
_onFileDownloadErrorListeners: [], // signature: name
|
||||
|
||||
_currentDownloadBytes: 0,
|
||||
_totalDownloadBytes: 0,
|
||||
|
||||
_archiveLocationFilter: function(path) { return "split" + path; },
|
||||
|
||||
cleanUp: function() {
|
||||
this._files = [];
|
||||
this._fileIndex = 0;
|
||||
this.isCompleted = false;
|
||||
this._onGameArchiveLoaderCompletedListeners = [];
|
||||
this._onAllTargetsBuiltListeners = [];
|
||||
this._onFileDownloadErrorListeners = [];
|
||||
|
||||
this._currentDownloadBytes = 0;
|
||||
this._totalDownloadBytes = 0;
|
||||
},
|
||||
|
||||
addListener: function(list, callback) {
|
||||
if (typeof callback !== 'function') throw "Invalid callback registration";
|
||||
list.push(callback);
|
||||
},
|
||||
notifyListeners: function(list, data) {
|
||||
for (i=0; i<list.length; ++i) {
|
||||
list[i](data);
|
||||
}
|
||||
},
|
||||
|
||||
addFileDownloadErrorListener: function(callback) {
|
||||
this.addListener(this._onFileDownloadErrorListeners, callback);
|
||||
},
|
||||
notifyFileDownloadError: function(url) {
|
||||
this.notifyListeners(this._onFileDownloadErrorListeners, url);
|
||||
},
|
||||
|
||||
addFileLoadedListener: function(callback) {
|
||||
this.addListener(this._onFileLoadedListeners, callback);
|
||||
},
|
||||
notifyFileLoaded: function(file) {
|
||||
this.notifyListeners(this._onFileLoadedListeners, { name: file.name, data: file.data });
|
||||
},
|
||||
|
||||
addArchiveLoadedListener: function(callback) {
|
||||
this.addListener(this._onArchiveLoadedListeners, callback);
|
||||
},
|
||||
notifyArchiveLoaded: function() {
|
||||
this.notifyListeners(this._onArchiveLoadedListeners);
|
||||
},
|
||||
|
||||
setFileLocationFilter: function(filter) {
|
||||
if (typeof filter !== 'function') throw "Invalid filter";
|
||||
this._archiveLocationFilter = filter;
|
||||
},
|
||||
|
||||
// load the archive_files.json with the list of files and their individual
|
||||
// pieces
|
||||
// descriptionUrl: location of text file describing files to be preloaded
|
||||
loadArchiveDescription: function(descriptionUrl) {
|
||||
FileLoader.load(
|
||||
this._archiveLocationFilter(descriptionUrl),
|
||||
"json",
|
||||
undefined,
|
||||
function (loaded, total) { },
|
||||
function (error) { GameArchiveLoader.notifyFileDownloadError(descriptionUrl); },
|
||||
function (json) { GameArchiveLoader.onReceiveDescription(json); });
|
||||
},
|
||||
|
||||
onReceiveDescription: function(json) {
|
||||
this._files = json.content;
|
||||
this._totalDownloadBytes = 0;
|
||||
this._currentDownloadBytes = 0;
|
||||
|
||||
// calculate total download size of all files
|
||||
for(var i=0; i<this._files.length; ++i) {
|
||||
this._totalDownloadBytes += this._files[i].size;
|
||||
}
|
||||
this.downloadContent();
|
||||
},
|
||||
|
||||
downloadContent: function() {
|
||||
var file = this._files[this._fileIndex];
|
||||
// if the file consists of more than one piece we prepare an array to store the pieces in
|
||||
if (file.pieces.length > 1) {
|
||||
file.data = new Uint8Array(file.size);
|
||||
}
|
||||
// how many pieces to download at a time
|
||||
var limit = file.pieces.length;
|
||||
if (typeof this.MAX_CONCURRENT_XHR !== 'undefined') {
|
||||
limit = Math.min(limit, this.MAX_CONCURRENT_XHR);
|
||||
}
|
||||
// download pieces
|
||||
for (var i=0; i<limit; ++i) {
|
||||
this.downloadPiece(file, i);
|
||||
}
|
||||
},
|
||||
|
||||
notifyDownloadProgress: function() {
|
||||
Progress.calculateProgress(50, 100, this._currentDownloadBytes, this._totalDownloadBytes);
|
||||
},
|
||||
|
||||
downloadPiece: function(file, index) {
|
||||
if (index < file.lastRequestedPiece) {
|
||||
throw "Request out of order";
|
||||
}
|
||||
|
||||
var piece = file.pieces[index];
|
||||
file.lastRequestedPiece = index;
|
||||
file.totalLoadedPieces = 0;
|
||||
|
||||
var total = 0;
|
||||
var downloaded = 0;
|
||||
var url = this._archiveLocationFilter('/' + piece.name);
|
||||
|
||||
FileLoader.load(
|
||||
url, "arraybuffer", undefined,
|
||||
function (loaded, total) {
|
||||
var delta = loaded - downloaded;
|
||||
downloaded = loaded;
|
||||
GameArchiveLoader._currentDownloadBytes += delta;
|
||||
GameArchiveLoader.notifyDownloadProgress();
|
||||
},
|
||||
function (error) {
|
||||
GameArchiveLoader.notifyFileDownloadError(error);
|
||||
},
|
||||
function (response) {
|
||||
piece.data = new Uint8Array(response);
|
||||
piece.dataLength = piece.data.length;
|
||||
total = piece.dataLength;
|
||||
downloaded = piece.dataLength;
|
||||
GameArchiveLoader.onPieceLoaded(file, piece);
|
||||
GameArchiveLoader.notifyDownloadProgress();
|
||||
piece.data = undefined;
|
||||
});
|
||||
},
|
||||
|
||||
addPieceToFile: function(file, piece) {
|
||||
if (1 == file.pieces.length) {
|
||||
file.data = piece.data;
|
||||
} else {
|
||||
var start = piece.offset;
|
||||
var end = start + piece.data.length;
|
||||
if (0 > start) {
|
||||
throw "Buffer underflow";
|
||||
}
|
||||
if (end > file.data.length) {
|
||||
throw "Buffer overflow";
|
||||
}
|
||||
file.data.set(piece.data, piece.offset);
|
||||
}
|
||||
},
|
||||
|
||||
onPieceLoaded: function(file, piece) {
|
||||
this.addPieceToFile(file, piece);
|
||||
|
||||
++file.totalLoadedPieces;
|
||||
// is all pieces of the file loaded?
|
||||
if (file.totalLoadedPieces == file.pieces.length) {
|
||||
this.onFileLoaded(file);
|
||||
}
|
||||
// continue loading more pieces of the file
|
||||
// if not all pieces are already in progress
|
||||
else {
|
||||
var next = file.lastRequestedPiece + 1;
|
||||
if (next < file.pieces.length) {
|
||||
this.downloadPiece(file, next);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
verifyFile: function(file) {
|
||||
// verify that we downloaded as much as we were supposed to
|
||||
var actualSize = 0;
|
||||
for (var i=0;i<file.pieces.length; ++i) {
|
||||
actualSize += file.pieces[i].dataLength;
|
||||
}
|
||||
if (actualSize != file.size) {
|
||||
throw "Unexpected data size";
|
||||
}
|
||||
|
||||
// verify the pieces
|
||||
if (file.pieces.length > 1) {
|
||||
var output = file.data;
|
||||
var pieces = file.pieces;
|
||||
for (i=0; i<pieces.length; ++i) {
|
||||
var item = pieces[i];
|
||||
// Bounds check
|
||||
var start = item.offset;
|
||||
var end = start + item.dataLength;
|
||||
if (0 < i) {
|
||||
var previous = pieces[i - 1];
|
||||
if (previous.offset + previous.dataLength > start) {
|
||||
throw "Segment underflow";
|
||||
}
|
||||
}
|
||||
if (pieces.length - 2 > i) {
|
||||
var next = pieces[i + 1];
|
||||
if (end > next.offset) {
|
||||
throw "Segment overflow";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onFileLoaded: function(file) {
|
||||
this.verifyFile(file);
|
||||
this.notifyFileLoaded(file);
|
||||
++this._fileIndex;
|
||||
if (this._fileIndex == this._files.length) {
|
||||
this.onArchiveLoaded();
|
||||
} else {
|
||||
this.downloadContent();
|
||||
}
|
||||
},
|
||||
|
||||
onArchiveLoaded: function() {
|
||||
this.isCompleted = true;
|
||||
this.notifyArchiveLoaded();
|
||||
}
|
||||
};
|
||||
|
||||
/* ********************************************************************* */
|
||||
/* Default splash and progress visualisation */
|
||||
/* ********************************************************************* */
|
||||
|
||||
var Progress = {
|
||||
progress_id: "defold-progress",
|
||||
bar_id: "defold-progress-bar",
|
||||
|
||||
listeners: [],
|
||||
|
||||
addListener: function(callback) {
|
||||
if (typeof callback !== 'function') throw "Invalid callback registration";
|
||||
this.listeners.push(callback);
|
||||
},
|
||||
|
||||
notifyListeners: function(percentage) {
|
||||
for (i=0; i<this.listeners.length; ++i) {
|
||||
this.listeners[i](percentage);
|
||||
}
|
||||
},
|
||||
|
||||
addProgress : function (canvas) {
|
||||
/* Insert default progress bar below canvas */
|
||||
canvas.insertAdjacentHTML('afterend', '<div id="' + Progress.progress_id + '" class="canvas-app-progress"><div id="' + Progress.bar_id + '" class="canvas-app-progress-bar" style="width: 0%;"></div></div>');
|
||||
Progress.bar = document.getElementById(Progress.bar_id);
|
||||
Progress.progress = document.getElementById(Progress.progress_id);
|
||||
},
|
||||
|
||||
updateProgress: function(percentage) {
|
||||
if (Progress.bar) {
|
||||
Progress.bar.style.width = percentage + "%";
|
||||
}
|
||||
Progress.notifyListeners(percentage);
|
||||
},
|
||||
|
||||
calculateProgress: function (from, to, current, total) {
|
||||
this.updateProgress(from + (current / total) * (to - from));
|
||||
},
|
||||
|
||||
removeProgress: function () {
|
||||
if (Progress.progress.parentElement !== null) {
|
||||
Progress.progress.parentElement.removeChild(Progress.progress);
|
||||
|
||||
// Remove any background/splash image that was set in runApp().
|
||||
// Workaround for Safari bug DEF-3061.
|
||||
Module.canvas.style.background = "";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/* ********************************************************************* */
|
||||
/* Module is Emscripten namespace */
|
||||
/* ********************************************************************* */
|
||||
|
||||
var Module = {
|
||||
noInitialRun: true,
|
||||
|
||||
_filesToPreload: [],
|
||||
_archiveLoaded: false,
|
||||
_preLoadDone: false,
|
||||
_waitingForArchive: false,
|
||||
|
||||
// Persistent storage
|
||||
persistentStorage: true,
|
||||
_syncInProgress: false,
|
||||
_syncNeeded: false,
|
||||
_syncInitial: false,
|
||||
_syncMaxTries: 3,
|
||||
_syncTries: 0,
|
||||
|
||||
arguments: [],
|
||||
|
||||
print: function(text) { console.log(text); },
|
||||
printErr: function(text) { console.error(text); },
|
||||
|
||||
setStatus: function(text) { console.log(text); },
|
||||
|
||||
isWASMSupported: (function() {
|
||||
try {
|
||||
if (typeof WebAssembly === "object" && typeof WebAssembly.instantiate === "function") {
|
||||
const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
|
||||
if (module instanceof WebAssembly.Module)
|
||||
return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
return false;
|
||||
})(),
|
||||
|
||||
prepareErrorObject: function (err, url, line, column, errObj) {
|
||||
line = typeof line == "undefined" ? 0 : line;
|
||||
column = typeof column == "undefined" ? 0 : column;
|
||||
url = typeof url == "undefined" ? "" : url;
|
||||
var errorLine = url + ":" + line + ":" + column;
|
||||
|
||||
var error = errObj || (typeof window.event != "undefined" ? window.event.error : "" ) || err || "Undefined Error";
|
||||
var message = "";
|
||||
var stack = "";
|
||||
var backtrace = "";
|
||||
|
||||
if (typeof error == "object" && typeof error.stack != "undefined" && typeof error.message != "undefined") {
|
||||
stack = String(error.stack);
|
||||
message = String(error.message);
|
||||
} else {
|
||||
stack = String(error).split("\n");
|
||||
message = stack.shift();
|
||||
stack = stack.join("\n");
|
||||
}
|
||||
stack = stack || errorLine;
|
||||
|
||||
var callLine = /at (\S+:\d*$)/.exec(message);
|
||||
if (callLine) {
|
||||
message = message.replace(/(at \S+:\d*$)/, "");
|
||||
stack = callLine[1] + "\n" + stack;
|
||||
}
|
||||
|
||||
message = message.replace(/(abort\(.+\)) at .+/, "$1");
|
||||
stack = stack.replace(/\?{1}\S+(:\d+:\d+)/g, "$1");
|
||||
stack = stack.replace(/ *at (\S+)$/gm, "@$1");
|
||||
stack = stack.replace(/ *at (\S+)(?: \[as \S+\])? +\((.+)\)/g, "$1@$2");
|
||||
stack = stack.replace(/^((?:Object|Array)\.)/gm, "");
|
||||
stack = stack.split("\n");
|
||||
|
||||
return { stack:stack, message:message };
|
||||
},
|
||||
|
||||
hasWebGLSupport: function() {
|
||||
var webgl_support = false;
|
||||
try {
|
||||
var canvas = document.createElement("canvas");
|
||||
var gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
|
||||
if (gl && gl instanceof WebGLRenderingContext) {
|
||||
webgl_support = true;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("An error occurred while detecting WebGL support: " + error);
|
||||
webgl_support = false;
|
||||
}
|
||||
|
||||
return webgl_support;
|
||||
},
|
||||
|
||||
setupCanvas: function(appCanvasId) {
|
||||
appCanvasId = (typeof appCanvasId === 'undefined') ? 'canvas' : appCanvasId;
|
||||
Module.canvas = document.getElementById(appCanvasId);
|
||||
return Module.canvas;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Module.runApp - Starts the application given a canvas element id
|
||||
*
|
||||
* 'extra_params' is an optional object that can have the following fields:
|
||||
*
|
||||
* 'archive_location_filter':
|
||||
* Filter function that will run for each archive path.
|
||||
*
|
||||
* 'unsupported_webgl_callback':
|
||||
* Function that is called if WebGL is not supported.
|
||||
*
|
||||
* 'engine_arguments':
|
||||
* List of arguments (strings) that will be passed to the engine.
|
||||
*
|
||||
* 'persistent_storage':
|
||||
* Boolean toggling the usage of persistent storage.
|
||||
*
|
||||
* 'custom_heap_size':
|
||||
* Number of bytes specifying the memory heap size.
|
||||
*
|
||||
* 'disable_context_menu':
|
||||
* Disables the right-click context menu on the canvas element if true.
|
||||
*
|
||||
* 'retry_time':
|
||||
* Pause before retry file loading after error.
|
||||
*
|
||||
* 'retry_count':
|
||||
* How many attempts we do when trying to download a file.
|
||||
*
|
||||
* 'can_not_download_file_callback':
|
||||
* Function that is called if you can't download file after 'retry_count' attempts.
|
||||
**/
|
||||
runApp: function(appCanvasId, extra_params) {
|
||||
Module.setupCanvas(appCanvasId);
|
||||
|
||||
var params = {
|
||||
archive_location_filter: function(path) { return 'split' + path; },
|
||||
unsupported_webgl_callback: undefined,
|
||||
engine_arguments: [],
|
||||
persistent_storage: true,
|
||||
custom_heap_size: undefined,
|
||||
disable_context_menu: true,
|
||||
retry_time: 1,
|
||||
retry_count: 10,
|
||||
can_not_download_file_callback: undefined,
|
||||
};
|
||||
|
||||
for (var k in extra_params) {
|
||||
if (extra_params.hasOwnProperty(k)) {
|
||||
params[k] = extra_params[k];
|
||||
}
|
||||
}
|
||||
|
||||
Module.arguments = params["engine_arguments"];
|
||||
Module.persistentStorage = params["persistent_storage"];
|
||||
|
||||
var fullScreenContainer = params["full_screen_container"];
|
||||
if (typeof fullScreenContainer === "string") {
|
||||
fullScreenContainer = document.querySelector(fullScreenContainer);
|
||||
}
|
||||
Module.fullScreenContainer = fullScreenContainer || Module.canvas;
|
||||
|
||||
if (Module.hasWebGLSupport()) {
|
||||
Module.canvas.focus();
|
||||
|
||||
// Add context menu hide-handler if requested
|
||||
if (params["disable_context_menu"])
|
||||
{
|
||||
Module.canvas.oncontextmenu = function(e) {
|
||||
e.preventDefault();
|
||||
};
|
||||
}
|
||||
|
||||
FileLoader.options.retryCount = params["retry_count"];
|
||||
FileLoader.options.retryInterval = params["retry_time"] * 1000;
|
||||
if (typeof params["can_not_download_file_callback"] === "function") {
|
||||
GameArchiveLoader.addFileDownloadErrorListener(params["can_not_download_file_callback"]);
|
||||
}
|
||||
// Load and assemble archive
|
||||
GameArchiveLoader.addFileLoadedListener(Module.onArchiveFileLoaded);
|
||||
GameArchiveLoader.addArchiveLoadedListener(Module.onArchiveLoaded);
|
||||
GameArchiveLoader.setFileLocationFilter(params["archive_location_filter"]);
|
||||
GameArchiveLoader.loadArchiveDescription('/archive_files.json');
|
||||
} else {
|
||||
Progress.updateProgress(100, "Unable to start game, WebGL not supported");
|
||||
Module.setStatus = function(text) {
|
||||
if (text) Module.printErr('[missing WebGL] ' + text);
|
||||
};
|
||||
|
||||
if (typeof params["unsupported_webgl_callback"] === "function") {
|
||||
params["unsupported_webgl_callback"]();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onArchiveFileLoaded: function(file) {
|
||||
Module._filesToPreload.push({path: file.name, data: file.data});
|
||||
},
|
||||
|
||||
onArchiveLoaded: function() {
|
||||
GameArchiveLoader.cleanUp();
|
||||
Module._archiveLoaded = true;
|
||||
Progress.updateProgress(100, "Starting...");
|
||||
|
||||
if (Module._waitingForArchive) {
|
||||
Module._preloadAndCallMain();
|
||||
}
|
||||
},
|
||||
|
||||
toggleFullscreen: function(element) {
|
||||
if (GLFW.isFullscreen) {
|
||||
GLFW.cancelFullScreen();
|
||||
} else {
|
||||
GLFW.requestFullScreen(element);
|
||||
}
|
||||
},
|
||||
|
||||
preSync: function(done) {
|
||||
// Initial persistent sync before main is called
|
||||
FS.syncfs(true, function(err) {
|
||||
if(err) {
|
||||
Module._syncTries += 1;
|
||||
console.error("FS syncfs error: " + err);
|
||||
if (Module._syncMaxTries > Module._syncTries) {
|
||||
Module.preSync(done);
|
||||
} else {
|
||||
Module._syncInitial = true;
|
||||
done();
|
||||
}
|
||||
} else {
|
||||
Module._syncInitial = true;
|
||||
if (done !== undefined) {
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
preloadAll: function() {
|
||||
if (Module._preLoadDone) {
|
||||
return;
|
||||
}
|
||||
Module._preLoadDone = true;
|
||||
for (var i = 0; i < Module._filesToPreload.length; ++i) {
|
||||
var item = Module._filesToPreload[i];
|
||||
FS.createPreloadedFile("", item.path, item.data, true, true);
|
||||
}
|
||||
},
|
||||
|
||||
// Tries to do a MEM->IDB sync
|
||||
// It will flag that another one is needed if there is already one sync running.
|
||||
persistentSync: function() {
|
||||
|
||||
// Need to wait for the initial sync to finish since it
|
||||
// will call close on all its file streams which will trigger
|
||||
// new persistentSync for each.
|
||||
if (Module._syncInitial) {
|
||||
if (Module._syncInProgress) {
|
||||
Module._syncNeeded = true;
|
||||
} else {
|
||||
Module._startSyncFS();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
preInit: [function() {
|
||||
/* Mount filesystem on preinit */
|
||||
var dir = DMSYS.GetUserPersistentDataRoot();
|
||||
FS.mkdir(dir);
|
||||
|
||||
// If IndexedDB is supported we mount the persistent data root as IDBFS,
|
||||
// then try to do a IDB->MEM sync before we start the engine to get
|
||||
// previously saved data before boot.
|
||||
window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
|
||||
if (Module.persistentStorage && window.indexedDB) {
|
||||
FS.mount(IDBFS, {}, dir);
|
||||
|
||||
// Patch FS.close so it will try to sync MEM->IDB
|
||||
var _close = FS.close; FS.close = function(stream) { var r = _close(stream); Module.persistentSync(); return r; }
|
||||
|
||||
// Sync IDB->MEM before calling main()
|
||||
Module.preSync(function() {
|
||||
Module._preloadAndCallMain();
|
||||
});
|
||||
} else {
|
||||
Module._preloadAndCallMain();
|
||||
}
|
||||
}],
|
||||
|
||||
preRun: [function() {
|
||||
/* If archive is loaded, preload all its files */
|
||||
if(Module._archiveLoaded) {
|
||||
Module.preloadAll();
|
||||
}
|
||||
}],
|
||||
|
||||
postRun: [function() {
|
||||
if(Module._archiveLoaded) {
|
||||
Progress.removeProgress();
|
||||
}
|
||||
}],
|
||||
|
||||
_preloadAndCallMain: function() {
|
||||
// If the archive isn't loaded,
|
||||
// we will have to wait with calling main.
|
||||
if (!Module._archiveLoaded) {
|
||||
Module._waitingForArchive = true;
|
||||
} else {
|
||||
Module.preloadAll();
|
||||
Progress.removeProgress();
|
||||
if (Module.callMain === undefined) {
|
||||
Module.noInitialRun = false;
|
||||
} else {
|
||||
Module.callMain(Module.arguments);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Wrap IDBFS syncfs call with logic to avoid multiple syncs
|
||||
// running at the same time.
|
||||
_startSyncFS: function() {
|
||||
Module._syncInProgress = true;
|
||||
|
||||
if (Module._syncMaxTries > Module._syncTries) {
|
||||
FS.syncfs(false, function(err) {
|
||||
Module._syncInProgress = false;
|
||||
|
||||
if (err) {
|
||||
console.error("Module._startSyncFS error: " + err);
|
||||
Module._syncTries += 1;
|
||||
}
|
||||
|
||||
if (Module._syncNeeded) {
|
||||
Module._syncNeeded = false;
|
||||
Module._startSyncFS();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
window.onerror = function(err, url, line, column, errObj) {
|
||||
if (typeof Module.ccall !== 'undefined') {
|
||||
var errorObject = Module.prepareErrorObject(err, url, line, column, errObj);
|
||||
Module.ccall('JSWriteDump', 'null', ['string'], [JSON.stringify(errorObject.stack)]);
|
||||
}
|
||||
Module.setStatus('Exception thrown, see JavaScript console');
|
||||
Module.setStatus = function(text) {
|
||||
if (text) Module.printErr('[post-exception status] ' + text);
|
||||
};
|
||||
};
|
BIN
docs/druid/druid.wasm
Normal file
BIN
docs/druid/druid.wasm
Normal file
Binary file not shown.
87
docs/druid/druid_asmjs.js
Normal file
87
docs/druid/druid_asmjs.js
Normal file
File diff suppressed because one or more lines are too long
BIN
docs/druid/druid_logo.png
Normal file
BIN
docs/druid/druid_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
1
docs/druid/druid_wasm.js
Normal file
1
docs/druid/druid_wasm.js
Normal file
File diff suppressed because one or more lines are too long
218
docs/druid/index.html
Normal file
218
docs/druid/index.html
Normal file
@ -0,0 +1,218 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, minimal-ui, shrink-to-fit=no">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
||||
|
||||
<title>druid 0.8.564</title>
|
||||
<style type='text/css'>
|
||||
/* Disable user selection to avoid strange bug in Chrome on Windows:
|
||||
* Selecting a text outside the canvas, then clicking+draging would
|
||||
* drag the selected text but block mouse down/up events to the engine.
|
||||
*/
|
||||
body {
|
||||
|
||||
position: fixed; /* Prevent overscroll */
|
||||
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.canvas-app-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.canvas-app-container:-webkit-full-screen {
|
||||
/* Auto width and height in Safari/Chrome fullscreen. */
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#canvas {
|
||||
outline: none;
|
||||
border: 0;
|
||||
width: 100%;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
#canvas-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
canvas:focus, canvas:active {
|
||||
outline: none;
|
||||
border: 0;
|
||||
ie-dummy: expression(this.hideFocus=true);
|
||||
-moz-outline-style: none;
|
||||
}
|
||||
|
||||
div {
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.canvas-app-progress {
|
||||
position: absolute;
|
||||
background-color: #d1dbeb;
|
||||
height: 6px;
|
||||
margin-top: -6px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.canvas-app-progress-bar {
|
||||
font-size: 12px;
|
||||
height: 6px;
|
||||
color: rgb(255, 255, 255);
|
||||
background-color: #1a72eb;
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
}
|
||||
.link, .button {
|
||||
font-family: sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-stretch: normal;
|
||||
line-height: normal;
|
||||
letter-spacing: 0px;
|
||||
padding-top: 12px;
|
||||
}
|
||||
|
||||
.buttons-background {
|
||||
background-color: #ffffff;
|
||||
width: 100%;
|
||||
height: 42px;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.canvas-app-container {
|
||||
background: rgba(250,252,255,1);
|
||||
background: -moz-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
|
||||
background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(250,252,255,1)), color-stop(50%, rgba(250,252,255,1)), color-stop(50%, rgba(245,249,255,1)), color-stop(100%, rgba(245,249,255,1)));
|
||||
background: -webkit-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
|
||||
background: -o-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
|
||||
background: -ms-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
|
||||
background: linear-gradient(135deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fafcff', endColorstr='#f5f9ff', GradientType=1 );
|
||||
}
|
||||
|
||||
.canvas-app-canvas {
|
||||
background-repeat:no-repeat;
|
||||
background-position: center center;
|
||||
background-image: url("druid_logo.png");
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app-container" class="canvas-app-container">
|
||||
<div id="canvas-container" class="canvas-app-canvas-container">
|
||||
<canvas id="canvas" class="canvas-app-canvas" tabindex="1" width="600" height="900"></canvas>
|
||||
</div>
|
||||
<div class="buttons-background">
|
||||
</div>
|
||||
</div>
|
||||
<!-- -->
|
||||
<script id='engine-loader' type='text/javascript' src="dmloader.js"></script>
|
||||
<!-- -->
|
||||
<script id='engine-setup' type='text/javascript'>
|
||||
var extra_params = {
|
||||
archive_location_filter: function( path ) {
|
||||
return ("archive" + path + "");
|
||||
},
|
||||
engine_arguments: ["--verify-graphics-calls=false",],
|
||||
custom_heap_size: 67108864,
|
||||
full_screen_container: "#canvas-container",
|
||||
disable_context_menu: true
|
||||
}
|
||||
|
||||
Module['INITIAL_MEMORY'] = extra_params.custom_heap_size;
|
||||
|
||||
Module['onRuntimeInitialized'] = function() {
|
||||
Module.runApp("canvas", extra_params);
|
||||
};
|
||||
|
||||
Module["locateFile"] = function(path, scriptDirectory)
|
||||
{
|
||||
// dmengine*.wasm is hardcoded in the built JS loader for WASM,
|
||||
// we need to replace it here with the correct project name.
|
||||
if (path == "dmengine.wasm" || path == "dmengine_release.wasm" || path == "dmengine_headless.wasm") {
|
||||
path = "druid.wasm";
|
||||
}
|
||||
return scriptDirectory + path;
|
||||
};
|
||||
|
||||
var is_iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
||||
var buttonHeight = 0;
|
||||
var prevInnerWidth = -1;
|
||||
var prevInnerHeight = -1;
|
||||
function resize_game_canvas() {
|
||||
// Hack for iOS when exit from Fullscreen mode
|
||||
if (is_iOS) {
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
|
||||
var app_container = document.getElementById('app-container');
|
||||
var game_canvas = document.getElementById('canvas');
|
||||
var innerWidth = window.innerWidth;
|
||||
var innerHeight = window.innerHeight - buttonHeight;
|
||||
if (prevInnerWidth == innerWidth && prevInnerHeight == innerHeight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
prevInnerWidth = innerWidth;
|
||||
prevInnerHeight = innerHeight;
|
||||
var width = 600;
|
||||
var height = 900;
|
||||
var targetRatio = width / height;
|
||||
var actualRatio = innerWidth / innerHeight;
|
||||
|
||||
|
||||
|
||||
//Fit
|
||||
if (actualRatio > targetRatio) {
|
||||
width = innerHeight * targetRatio;
|
||||
height = innerHeight;
|
||||
app_container.style.marginLeft = ((innerWidth - width) / 2) + "px";
|
||||
app_container.style.marginTop = "0px";
|
||||
}
|
||||
else {
|
||||
width = innerWidth;
|
||||
height = innerWidth / targetRatio;
|
||||
app_container.style.marginLeft = "0px";
|
||||
app_container.style.marginTop = ((innerHeight - height) / 2) + "px";
|
||||
}
|
||||
|
||||
|
||||
app_container.style.width = width + "px";
|
||||
app_container.style.height = height + buttonHeight + "px";
|
||||
game_canvas.width = width;
|
||||
game_canvas.height = height;
|
||||
}
|
||||
resize_game_canvas();
|
||||
window.addEventListener('resize', resize_game_canvas, false);
|
||||
window.addEventListener('orientationchange', resize_game_canvas, false);
|
||||
window.addEventListener('focus', resize_game_canvas, false);
|
||||
</script>
|
||||
|
||||
<script id='engine-start' type='text/javascript'>
|
||||
EngineLoader.load("canvas", "druid");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
Before Width: | Height: | Size: 492 KiB |
333
docs/index.html
333
docs/index.html
@ -1,161 +1,186 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, minimal-ui, shrink-to-fit=no">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
||||
|
||||
<title>Druid 1.1.0</title>
|
||||
<style type='text/css'>
|
||||
/* Disable user selection to avoid strange bug in Chrome on Windows:
|
||||
* Selecting a text outside the canvas, then clicking+draging would
|
||||
* drag the selected text but block mouse down/up events to the engine.
|
||||
*/
|
||||
body {
|
||||
|
||||
position: fixed; /* Prevent overscroll */
|
||||
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.canvas-app-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.canvas-app-container:-webkit-full-screen {
|
||||
/* Auto width and height in Safari/Chrome fullscreen. */
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#canvas {
|
||||
outline: none;
|
||||
border: 0;
|
||||
width: 100%;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
#canvas-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
canvas:focus, canvas:active {
|
||||
outline: none;
|
||||
border: 0;
|
||||
ie-dummy: expression(this.hideFocus=true);
|
||||
-moz-outline-style: none;
|
||||
}
|
||||
|
||||
body, div {
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.canvas-app-progress {
|
||||
position: absolute;
|
||||
background-color: #394046;
|
||||
height: 6px;
|
||||
margin-top: -6px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.canvas-app-progress-bar {
|
||||
font-size: 12px;
|
||||
height: 6px;
|
||||
color: rgb(255, 255, 255);
|
||||
background-color: #1a72eb;
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
transition: transform 1s ease;
|
||||
transform-origin: left;
|
||||
transform: scaleX(1.0);
|
||||
}
|
||||
.link, .button {
|
||||
font-family: sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-stretch: normal;
|
||||
line-height: normal;
|
||||
letter-spacing: 0px;
|
||||
padding-top: 12px;
|
||||
}
|
||||
|
||||
.buttons-background {
|
||||
background-color: #1e2226;
|
||||
width: 100%;
|
||||
height: 42px;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #1e2226;
|
||||
}
|
||||
|
||||
.canvas-app-container {
|
||||
background: rgba(36,41,46,1);
|
||||
background: -moz-linear-gradient(-45deg, rgba(36,41,46,1) 0%, rgba(36,41,46,1) 49%, rgba(38,43,49,1) 50%, rgba(38,43,49,1) 100%);
|
||||
background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(36,41,46,1)), color-stop(49%, rgba(36,41,46,1)), color-stop(50%, rgba(38,43,49,1)), color-stop(100%, rgba(38,43,49,1)));
|
||||
background: -webkit-linear-gradient(-45deg, rgba(36,41,46,1) 0%, rgba(36,41,46,1) 49%, rgba(38,43,49,1) 50%, rgba(38,43,49,1) 100%);
|
||||
background: -o-linear-gradient(-45deg, rgba(36,41,46,1) 0%, rgba(36,41,46,1) 49%, rgba(38,43,49,1) 50%, rgba(38,43,49,1) 100%);
|
||||
background: -ms-linear-gradient(-45deg, rgba(36,41,46,1) 0%, rgba(36,41,46,1) 49%, rgba(38,43,49,1) 50%, rgba(38,43,49,1) 100%);
|
||||
background: linear-gradient(135deg, rgba(36,41,46,1) 0%, rgba(36,41,46,1) 49%, rgba(38,43,49,1) 50%, rgba(38,43,49,1) 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#24292e', endColorstr='#262b31', GradientType=1 );
|
||||
}
|
||||
|
||||
.canvas-app-canvas {
|
||||
background-repeat:no-repeat;
|
||||
background-position: center center;
|
||||
background-image: url("druid_logo.png");
|
||||
}
|
||||
</style>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="app-container" class="canvas-app-container">
|
||||
<div id="running-from-file-warning" style="display: none; margin: 3em;">
|
||||
<h1>Running from local file ⚠️</h1>
|
||||
<p>It seems like you have opened this file by double-clicking on it. In order to test your build in a browser <b>you need to load this file from a web server</b>. You can either upload this file and the rest of the files from a Defold HTML5 bundle to a web hosting service OR host them using a local web server on your home network.</p>
|
||||
<p><a href="https://defold.com/manuals/html5/#testing-html5-build" target="_blank">Learn more about running a local web server in the Defold HTML5 manual</a>.</p>
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="modules/Button.html">Button</a></li>
|
||||
<li><a href="modules/Drag.html">Drag</a></li>
|
||||
<li><a href="modules/Hover.html">Hover</a></li>
|
||||
<li><a href="modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="modules/Text.html">Text</a></li>
|
||||
<li><a href="modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="modules/druid.html">druid</a></li>
|
||||
<li><a href="modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="modules/DataList.html">DataList</a></li>
|
||||
<li><a href="modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="modules/Input.html">Input</a></li>
|
||||
<li><a href="modules/LangText.html">LangText</a></li>
|
||||
<li><a href="modules/Progress.html">Progress</a></li>
|
||||
<li><a href="modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="modules/Slider.html">Slider</a></li>
|
||||
<li><a href="modules/Timer.html">Timer</a></li>
|
||||
<li><a href="modules/Helper.html">Helper</a></li>
|
||||
<li><a href="modules/DruidInstance.html">DruidInstance</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div id="webgl-not-supported" style="display: none; margin: 3em;">
|
||||
<h1>WebGL not supported ⚠️</h1>
|
||||
<p>WebGL is not supported by your browser - visit <a href="https://get.webgl.org/">https://get.webgl.org/</a> to learn more.</p>
|
||||
</div>
|
||||
<div id="canvas-container" class="canvas-app-canvas-container">
|
||||
<canvas id="canvas" class="canvas-app-canvas" tabindex="1" width="1920" height="1080"></canvas>
|
||||
</div>
|
||||
<div class="buttons-background">
|
||||
</div>
|
||||
</div>
|
||||
<!-- -->
|
||||
<script id='engine-loader' type='text/javascript' src="dmloader.js"></script>
|
||||
<script id='engine-setup' type='text/javascript'>
|
||||
// From here you can configure game startup parameters via the CUSTOM_PARAMETERS object,
|
||||
// override ProgressView to create your own loader. See dmloader.js for more details.
|
||||
</script>
|
||||
<script id='engine-start' type='text/javascript'>
|
||||
var runningFromFileWarning = document.getElementById("running-from-file-warning");
|
||||
if (window.location.href.startsWith("file://")) {
|
||||
runningFromFileWarning.style.display = "block";
|
||||
}
|
||||
else {
|
||||
EngineLoader.load("canvas", "Druid");
|
||||
runningFromFileWarning.parentNode.removeChild(runningFromFileWarning);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="content">
|
||||
|
||||
|
||||
<h2>Documentation for Druid Library</h2>
|
||||
|
||||
<h2>Modules</h2>
|
||||
<table class="module_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/BackHandler.html">BackHandler</a></td>
|
||||
<td class="summary">Component to handle back key (android, backspace)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/Blocker.html">Blocker</a></td>
|
||||
<td class="summary">Component to block input on specify zone by node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/Button.html">Button</a></td>
|
||||
<td class="summary">Component to handle basic GUI button</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/Drag.html">Drag</a></td>
|
||||
<td class="summary">Component to handle drag action on node.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/Hover.html">Hover</a></td>
|
||||
<td class="summary">Component to handle hover node interaction</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/Scroll.html">Scroll</a></td>
|
||||
<td class="summary">Component to handle scroll content.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/StaticGrid.html">StaticGrid</a></td>
|
||||
<td class="summary">Component to handle placing components by row and columns.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/Swipe.html">Swipe</a></td>
|
||||
<td class="summary">Component to handle swipe gestures on node.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/Text.html">Text</a></td>
|
||||
<td class="summary">Component to handle all GUI texts.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/BaseComponent.html">BaseComponent</a></td>
|
||||
<td class="summary">Basic class for all Druid components.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/PinKnob.html">PinKnob</a></td>
|
||||
<td class="summary">Druid pin knob custom component.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/RichInput.html">RichInput</a></td>
|
||||
<td class="summary">Druid Rich Input custom component.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/druid.html">druid</a></td>
|
||||
<td class="summary">Druid UI Library.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/DruidEvent.html">DruidEvent</a></td>
|
||||
<td class="summary">Druid lua event library</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/Checkbox.html">Checkbox</a></td>
|
||||
<td class="summary">Druid checkbox component</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/CheckboxGroup.html">CheckboxGroup</a></td>
|
||||
<td class="summary">Checkbox group module</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/DataList.html">DataList</a></td>
|
||||
<td class="summary">Component to manage data for huge dataset in scroll.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/DynamicGrid.html">DynamicGrid</a></td>
|
||||
<td class="summary">Component to handle placing components in row</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/Input.html">Input</a></td>
|
||||
<td class="summary">Druid input text component.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/LangText.html">LangText</a></td>
|
||||
<td class="summary">Component to handle all GUI texts
|
||||
Good working with localization system</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/Progress.html">Progress</a></td>
|
||||
<td class="summary">Basic progress bar component.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/RadioGroup.html">RadioGroup</a></td>
|
||||
<td class="summary">Radio group module</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/Slider.html">Slider</a></td>
|
||||
<td class="summary">Druid slider component</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/Timer.html">Timer</a></td>
|
||||
<td class="summary">Component to handle GUI timers.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/Helper.html">Helper</a></td>
|
||||
<td class="summary">Druid helper module for gui layouts</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/DruidInstance.html">DruidInstance</a></td>
|
||||
<td class="summary">Instance of Druid.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
||||
|
311
docs/ldoc_fixed.css
Normal file
311
docs/ldoc_fixed.css
Normal file
@ -0,0 +1,311 @@
|
||||
/* 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: 700px;
|
||||
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; }
|
||||
|
223
docs/modules/BackHandler.html
Normal file
223
docs/modules/BackHandler.html
Normal file
@ -0,0 +1,223 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><strong>BackHandler</strong></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>BackHandler</code></h1>
|
||||
<p>Component to handle back key (android, backspace)</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, callback[, params])</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_input">on_input(self, action_id, action)</a></td>
|
||||
<td class="summary">Input handler for component</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_back">on_back</a></td>
|
||||
<td class="summary">On back handler callback(self, params)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#params">params</a></td>
|
||||
<td class="summary">Params to back callback</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, callback[, params])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BackHandler</span></span>
|
||||
<a href="../modules/BackHandler.html#">BackHandler</a>
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">callback</span></span>
|
||||
On back button
|
||||
</li>
|
||||
<li><span class="parameter">params</span>
|
||||
<span class="types"><span class="type">any</span></span>
|
||||
Callback argument
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_input"></a>
|
||||
<strong>on_input(self, action_id, action)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Input handler for component
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BackHandler</span></span>
|
||||
<a href="../modules/BackHandler.html#">BackHandler</a>
|
||||
</li>
|
||||
<li><span class="parameter">action_id</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
on_input action id
|
||||
</li>
|
||||
<li><span class="parameter">action</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
on_input action
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "on_back"></a>
|
||||
<strong>on_back</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On back handler callback(self, params)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_back</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "params"></a>
|
||||
<strong>params</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Params to back callback
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">params</span>
|
||||
<span class="types"><span class="type">any</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
714
docs/modules/BaseComponent.html
Normal file
714
docs/modules/BaseComponent.html
Normal file
@ -0,0 +1,714 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><strong>BaseComponent</strong></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>BaseComponent</code></h1>
|
||||
<p>Basic class for all Druid components.</p>
|
||||
<p>
|
||||
To create you component, use `component.create`</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_childrens">get_childrens(self)</a></td>
|
||||
<td class="summary">Return all children components, recursive (protected)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_context">get_context(self)</a></td>
|
||||
<td class="summary">Get current component context (protected)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_druid">get_druid(self)</a></td>
|
||||
<td class="summary">Return druid with context of calling component (protected).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_input_priority">get_input_priority(self)</a></td>
|
||||
<td class="summary">Return component input priority</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_name">get_name(self)</a></td>
|
||||
<td class="summary">Return component name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_node">get_node(self, node_or_name)</a></td>
|
||||
<td class="summary">Get node for component by name.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_parent_component">get_parent_component(self)</a></td>
|
||||
<td class="summary">Return the parent for current component (protected)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_parent_name">get_parent_name(self)</a></td>
|
||||
<td class="summary">Return parent component name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_template">get_template(self)</a></td>
|
||||
<td class="summary">Get current component template name (protected)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_uid">get_uid(self)</a></td>
|
||||
<td class="summary">Return component uid (protected).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#log_message">log_message(self, message, context)</a></td>
|
||||
<td class="summary">Print log information if debug mode is enabled (protected)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#reset_input_priority">reset_input_priority(self)</a></td>
|
||||
<td class="summary">Reset component input priority to default value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_debug">set_debug(self, is_debug)</a></td>
|
||||
<td class="summary">Set debug logs for component enabled or disabled</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_input_enabled">set_input_enabled(self, state)</a></td>
|
||||
<td class="summary">Set component input state.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_input_priority">set_input_priority(self, value)</a></td>
|
||||
<td class="summary">Set component input priority</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_nodes">set_nodes(self, nodes)</a></td>
|
||||
<td class="summary">Set current component nodes (protected)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_style">set_style(self, druid_style)</a></td>
|
||||
<td class="summary">Set current component style table (protected).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_template">set_template(self, template)</a></td>
|
||||
<td class="summary">Set current component template name (protected)
|
||||
It will check parent template name to build full template name</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#ON_INPUT">ON_INPUT</a></td>
|
||||
<td class="summary">Component Interests</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "get_childrens"></a>
|
||||
<strong>get_childrens(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return all children components, recursive (protected)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Array of childrens if the Druid component instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_context"></a>
|
||||
<strong>get_context(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Get current component context (protected)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
BaseComponent context
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_druid"></a>
|
||||
<strong>get_druid(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return druid with context of calling component (protected).
|
||||
Use it to create component inside of other components.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Druid</span></span>
|
||||
Druid instance with component context
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_input_priority"></a>
|
||||
<strong>get_input_priority(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return component input priority
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The component input priority
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_name"></a>
|
||||
<strong>get_name(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return component name
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
The component name
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_node"></a>
|
||||
<strong>get_node(self, node_or_name)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Get node for component by name.
|
||||
If component has nodes, node_or_name should be string
|
||||
It auto pick node by template name or from nodes by clone_tree
|
||||
if they was setup via component:set_nodes, component:set_template.
|
||||
If node is not found, the exception will fired
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
<li><span class="parameter">node_or_name</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">node</span></span>
|
||||
Node name or node itself
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
Gui node
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_parent_component"></a>
|
||||
<strong>get_parent_component(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return the parent for current component (protected)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">BaseComponent</span> or <span class="type">nil</span></span>
|
||||
The druid component instance or nil
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_parent_name"></a>
|
||||
<strong>get_parent_name(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return parent component name
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
|
||||
The parent component name if exist or bil
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_template"></a>
|
||||
<strong>get_template(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Get current component template name (protected)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Component full template name
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_uid"></a>
|
||||
<strong>get_uid(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return component uid (protected).
|
||||
UID generated in component creation order
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The component uid
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "log_message"></a>
|
||||
<strong>log_message(self, message, context)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Print log information if debug mode is enabled (protected)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
<li><span class="parameter">message</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">context</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "reset_input_priority"></a>
|
||||
<strong>reset_input_priority(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Reset component input priority to default value
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The component input priority
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_debug"></a>
|
||||
<strong>set_debug(self, is_debug)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set debug logs for component enabled or disabled
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
<li><span class="parameter">is_debug</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_input_enabled"></a>
|
||||
<strong>set_input_enabled(self, state)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set component input state. By default it enabled
|
||||
You can disable any input of component by this function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
<li><span class="parameter">state</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
The component input state
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
BaseComponent itself
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_input_priority"></a>
|
||||
<strong>set_input_priority(self, value)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set component input priority
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
<li><span class="parameter">value</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The new input priority value
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The component input priority
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_nodes"></a>
|
||||
<strong>set_nodes(self, nodes)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set current component nodes (protected)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
<li><span class="parameter">nodes</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
BaseComponent nodes table
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_style"></a>
|
||||
<strong>set_style(self, druid_style)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set current component style table (protected).
|
||||
Invoke `on_style_change` on component, if exist. BaseComponent should handle
|
||||
their style changing and store all style params
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
<li><span class="parameter">druid_style</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Druid style module
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_template"></a>
|
||||
<strong>set_template(self, template)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set current component template name (protected)
|
||||
It will check parent template name to build full template name
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</li>
|
||||
<li><span class="parameter">template</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
BaseComponent template name
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">BaseComponent</span></span>
|
||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "ON_INPUT"></a>
|
||||
<strong>ON_INPUT</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component Interests
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
221
docs/modules/Blocker.html
Normal file
221
docs/modules/Blocker.html
Normal file
@ -0,0 +1,221 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><strong>Blocker</strong></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>Blocker</code></h1>
|
||||
<p>Component to block input on specify zone by node</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, node)</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#is_enabled">is_enabled(self)</a></td>
|
||||
<td class="summary">Return blocked enabled state</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_enabled">set_enabled(self, state)</a></td>
|
||||
<td class="summary">Set enabled blocker component state</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#node">node</a></td>
|
||||
<td class="summary">Trigger node</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, node)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Blocker</span></span>
|
||||
<a href="../modules/Blocker.html#">Blocker</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Blocker.html#node">node</a></span>
|
||||
Gui node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "is_enabled"></a>
|
||||
<strong>is_enabled(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return blocked enabled state
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Blocker</span></span>
|
||||
<a href="../modules/Blocker.html#">Blocker</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
True, if blocker is enabled
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_enabled"></a>
|
||||
<strong>set_enabled(self, state)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set enabled blocker component state
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Blocker</span></span>
|
||||
<a href="../modules/Blocker.html#">Blocker</a>
|
||||
</li>
|
||||
<li><span class="parameter">state</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Enabled state
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "node"></a>
|
||||
<strong>node</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Trigger node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Blocker.html#node">node</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
788
docs/modules/Button.html
Normal file
788
docs/modules/Button.html
Normal file
@ -0,0 +1,788 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><strong>Button</strong></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>Button</code></h1>
|
||||
<p>Component to handle basic GUI button</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_key_trigger">get_key_trigger(self)</a></td>
|
||||
<td class="summary">Get key-code to trigger this button</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, node, callback[, params[, anim_node]])</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#is_enabled">is_enabled(self)</a></td>
|
||||
<td class="summary">Return button enabled state</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_check_function">set_check_function(self[, check_function[, failure_callback]])</a></td>
|
||||
<td class="summary">Set function for additional check for button click availability</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(self, zone)</a></td>
|
||||
<td class="summary">Strict button click area.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_enabled">set_enabled(self, state)</a></td>
|
||||
<td class="summary">Set enabled button component state</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_key_trigger">set_key_trigger(self, key)</a></td>
|
||||
<td class="summary">Set key-code to trigger this button</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#style">style</a></td>
|
||||
<td class="summary">Component style params.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#anim_node">anim_node</a></td>
|
||||
<td class="summary">Animation node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#click_zone">click_zone</a></td>
|
||||
<td class="summary">Restriction zone</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#hash">hash</a></td>
|
||||
<td class="summary">The hash of trigger node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#hover">hover</a></td>
|
||||
<td class="summary">Druid hover logic component</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#node">node</a></td>
|
||||
<td class="summary">Trigger node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_click">on_click</a></td>
|
||||
<td class="summary">On release button callback(self, params, button_instance)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_click_outside">on_click_outside</a></td>
|
||||
<td class="summary">On click outside of button(self, params, button_instance)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_double_click">on_double_click</a></td>
|
||||
<td class="summary">On double tap button callback(self, params, button_instance, click_amount)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_hold_callback">on_hold_callback</a></td>
|
||||
<td class="summary">On button hold before long_click callback(self, params, button_instance, time)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_long_click">on_long_click</a></td>
|
||||
<td class="summary">On long tap button callback(self, params, button_instance, time)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_repeated_click">on_repeated_click</a></td>
|
||||
<td class="summary">On repeated action button callback(self, params, button_instance, click_amount)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#params">params</a></td>
|
||||
<td class="summary">Params to click callbacks</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#pos">pos</a></td>
|
||||
<td class="summary">Initial pos of anim_node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#start_pos">start_pos</a></td>
|
||||
<td class="summary">Initial pos of anim_node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#start_scale">start_scale</a></td>
|
||||
<td class="summary">Initial scale of anim_node</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "get_key_trigger"></a>
|
||||
<strong>get_key_trigger(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Get key-code to trigger this button
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Button</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><a class="type" href="../modules/Button.html#hash">hash</a></span>
|
||||
The action_id of the key
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, node, callback[, params[, anim_node]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Button</span></span>
|
||||
<a href="../modules/Button.html#">Button</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Button.html#node">node</a></span>
|
||||
Gui node
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Button callback
|
||||
</li>
|
||||
<li><span class="parameter">params</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Button callback params
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">anim_node</span>
|
||||
<span class="types"><a class="type" href="../modules/Button.html#node">node</a></span>
|
||||
Button anim node (node, if not provided)
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "is_enabled"></a>
|
||||
<strong>is_enabled(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return button enabled state
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Button</span></span>
|
||||
<a href="../modules/Button.html#">Button</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
True, if button is enabled
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_check_function"></a>
|
||||
<strong>set_check_function(self[, check_function[, failure_callback]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set function for additional check for button click availability
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Button</span></span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">check_function</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Should return true or false. If true - button can be pressed.
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">failure_callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Function what will be called on button click, if check function return false
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Button</span></span>
|
||||
Current button instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_click_zone"></a>
|
||||
<strong>set_click_zone(self, zone)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Strict button click area. Useful for
|
||||
no click events outside stencil node
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Button</span></span>
|
||||
<a href="../modules/Button.html#">Button</a>
|
||||
</li>
|
||||
<li><span class="parameter">zone</span>
|
||||
<span class="types"><a class="type" href="../modules/Button.html#node">node</a></span>
|
||||
Gui node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Button</span></span>
|
||||
Current button instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_enabled"></a>
|
||||
<strong>set_enabled(self, state)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set enabled button component state
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Button</span></span>
|
||||
<a href="../modules/Button.html#">Button</a>
|
||||
</li>
|
||||
<li><span class="parameter">state</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Enabled state
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Button</span></span>
|
||||
Current button instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_key_trigger"></a>
|
||||
<strong>set_key_trigger(self, key)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set key-code to trigger this button
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Button</span></span>
|
||||
<a href="../modules/Button.html#">Button</a>
|
||||
</li>
|
||||
<li><span class="parameter">key</span>
|
||||
<span class="types"><a class="type" href="../modules/Button.html#hash">hash</a></span>
|
||||
The action_id of the key
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Button</span></span>
|
||||
Current button instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "style"></a>
|
||||
<strong>style</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component style params.
|
||||
You can override this component styles params in druid styles table
|
||||
or create your own style
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">LONGTAP_TIME</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Minimum time to trigger on_hold_callback
|
||||
(<em>default</em> 0.4)
|
||||
</li>
|
||||
<li><span class="parameter">AUTOHOLD_TRIGGER</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Maximum hold time to trigger button release while holding
|
||||
(<em>default</em> 0.8)
|
||||
</li>
|
||||
<li><span class="parameter">DOUBLETAP_TIME</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Time between double taps
|
||||
(<em>default</em> 0.4)
|
||||
</li>
|
||||
<li><span class="parameter">on_click</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
(self, node)
|
||||
</li>
|
||||
<li><span class="parameter">on_click_disabled</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
(self, node)
|
||||
</li>
|
||||
<li><span class="parameter">on_hover</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
(self, node, hover_state)
|
||||
</li>
|
||||
<li><span class="parameter">on_mouse_hover</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
(self, node, hover_state)
|
||||
</li>
|
||||
<li><span class="parameter">on_set_enabled</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
(self, node, enabled_state)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "anim_node"></a>
|
||||
<strong>anim_node</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Animation node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">anim_node</span>
|
||||
<span class="types"><a class="type" href="../modules/Button.html#node">node</a></span>
|
||||
|
||||
(<em>default</em> node)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "click_zone"></a>
|
||||
<strong>click_zone</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Restriction zone
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">click_zone</span>
|
||||
<span class="types"><a class="type" href="../modules/Button.html#node">node</a></span>
|
||||
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "hash"></a>
|
||||
<strong>hash</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The hash of trigger node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">hash</span>
|
||||
<span class="types"><a class="type" href="../modules/Button.html#node">node_id</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "hover"></a>
|
||||
<strong>hover</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Druid hover logic component
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">hover</span>
|
||||
<span class="types"><span class="type">Hover</span></span>
|
||||
<a href="../modules/Hover.html#">Hover</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "node"></a>
|
||||
<strong>node</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Trigger node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Button.html#node">node</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_click"></a>
|
||||
<strong>on_click</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On release button callback(self, params, button_instance)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_click</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_click_outside"></a>
|
||||
<strong>on_click_outside</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On click outside of button(self, params, button_instance)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_click_outside</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_double_click"></a>
|
||||
<strong>on_double_click</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On double tap button callback(self, params, button_instance, click_amount)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_double_click</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_hold_callback"></a>
|
||||
<strong>on_hold_callback</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On button hold before long_click callback(self, params, button_instance, time)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_hold_callback</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_long_click"></a>
|
||||
<strong>on_long_click</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On long tap button callback(self, params, button_instance, time)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_long_click</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_repeated_click"></a>
|
||||
<strong>on_repeated_click</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On repeated action button callback(self, params, button_instance, click_amount)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_repeated_click</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "params"></a>
|
||||
<strong>params</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Params to click callbacks
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">params</span>
|
||||
<span class="types"><span class="type">any</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "pos"></a>
|
||||
<strong>pos</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initial pos of anim_node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">pos</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "start_pos"></a>
|
||||
<strong>start_pos</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initial pos of anim_node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">start_pos</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "start_scale"></a>
|
||||
<strong>start_scale</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initial scale of anim_node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">start_scale</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
351
docs/modules/Checkbox.html
Normal file
351
docs/modules/Checkbox.html
Normal file
@ -0,0 +1,351 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><strong>Checkbox</strong></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>Checkbox</code></h1>
|
||||
<p>Druid checkbox component</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_state">get_state(self)</a></td>
|
||||
<td class="summary">Return checkbox state</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, node, callback[, click_node=node[, initial_state=false]])</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_state">set_state(self, state, is_silent, is_instant)</a></td>
|
||||
<td class="summary">Set checkbox state</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#style">style</a></td>
|
||||
<td class="summary">Component style params.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#button">button</a></td>
|
||||
<td class="summary">Button component from click_node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#click_node">click_node</a></td>
|
||||
<td class="summary">Button trigger node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#node">node</a></td>
|
||||
<td class="summary">Visual node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_change_state">on_change_state</a></td>
|
||||
<td class="summary">On change state callback(self, state)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "get_state"></a>
|
||||
<strong>get_state(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return checkbox state
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Checkbox</span></span>
|
||||
<a href="../modules/Checkbox.html#">Checkbox</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Checkbox state
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, node, callback[, click_node=node[, initial_state=false]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Checkbox</span></span>
|
||||
<a href="../modules/Checkbox.html#">Checkbox</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Checkbox.html#node">node</a></span>
|
||||
Gui node
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Checkbox callback
|
||||
</li>
|
||||
<li><span class="parameter">click_node</span>
|
||||
<span class="types"><a class="type" href="../modules/Checkbox.html#node">node</a></span>
|
||||
Trigger node, by default equals to node
|
||||
(<em>default</em> node)
|
||||
</li>
|
||||
<li><span class="parameter">initial_state</span>
|
||||
<span class="types"><span class="type">boolean</span></span>
|
||||
The initial state of checkbox, default - false
|
||||
(<em>default</em> false)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_state"></a>
|
||||
<strong>set_state(self, state, is_silent, is_instant)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set checkbox state
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Checkbox</span></span>
|
||||
<a href="../modules/Checkbox.html#">Checkbox</a>
|
||||
</li>
|
||||
<li><span class="parameter">state</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Checkbox state
|
||||
</li>
|
||||
<li><span class="parameter">is_silent</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Don't trigger on_change_state if true
|
||||
</li>
|
||||
<li><span class="parameter">is_instant</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
If instant checkbox change
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "style"></a>
|
||||
<strong>style</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component style params.
|
||||
You can override this component styles params in druid styles table
|
||||
or create your own style
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">on_change_state</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
(self, node, state)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "button"></a>
|
||||
<strong>button</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Button component from click_node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">button</span>
|
||||
<span class="types"><span class="type">Button</span></span>
|
||||
<a href="../modules/Button.html#">Button</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "click_node"></a>
|
||||
<strong>click_node</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Button trigger node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">click_node</span>
|
||||
<span class="types"><a class="type" href="../modules/Checkbox.html#node">node</a></span>
|
||||
|
||||
(<em>default</em> node)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "node"></a>
|
||||
<strong>node</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Visual node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Checkbox.html#node">node</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_change_state"></a>
|
||||
<strong>on_change_state</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On change state callback(self, state)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_change_state</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
258
docs/modules/CheckboxGroup.html
Normal file
258
docs/modules/CheckboxGroup.html
Normal file
@ -0,0 +1,258 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><strong>CheckboxGroup</strong></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>CheckboxGroup</code></h1>
|
||||
<p>Checkbox group module</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_state">get_state(self)</a></td>
|
||||
<td class="summary">Return checkbox group state</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, nodes, callback[, click_nodes=node])</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_state">set_state(self, indexes, is_instant)</a></td>
|
||||
<td class="summary">Set checkbox group state</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#checkboxes">checkboxes</a></td>
|
||||
<td class="summary">Array of checkbox components</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_checkbox_click">on_checkbox_click</a></td>
|
||||
<td class="summary">On any checkbox click callback(self, index)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "get_state"></a>
|
||||
<strong>get_state(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return checkbox group state
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">CheckboxGroup</span></span>
|
||||
<a href="../modules/CheckboxGroup.html#">CheckboxGroup</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool[]</span></span>
|
||||
Array if checkboxes state
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, nodes, callback[, click_nodes=node])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">CheckboxGroup</span></span>
|
||||
<a href="../modules/CheckboxGroup.html#">CheckboxGroup</a>
|
||||
</li>
|
||||
<li><span class="parameter">nodes</span>
|
||||
<span class="types"><span class="type">node[]</span></span>
|
||||
Array of gui node
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Checkbox callback
|
||||
</li>
|
||||
<li><span class="parameter">click_nodes</span>
|
||||
<span class="types"><span class="type">node[]</span></span>
|
||||
Array of trigger nodes, by default equals to nodes
|
||||
(<em>default</em> node)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_state"></a>
|
||||
<strong>set_state(self, indexes, is_instant)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set checkbox group state
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">CheckboxGroup</span></span>
|
||||
<a href="../modules/CheckboxGroup.html#">CheckboxGroup</a>
|
||||
</li>
|
||||
<li><span class="parameter">indexes</span>
|
||||
<span class="types"><span class="type">bool[]</span></span>
|
||||
Array of checkbox state
|
||||
</li>
|
||||
<li><span class="parameter">is_instant</span>
|
||||
<span class="types"><span class="type">boolean</span></span>
|
||||
If instant state change
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "checkboxes"></a>
|
||||
<strong>checkboxes</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Array of checkbox components
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">checkboxes</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
<a href="../modules/Checkbox.html#">Checkbox</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_checkbox_click"></a>
|
||||
<strong>on_checkbox_click</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On any checkbox click callback(self, index)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_checkbox_click</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
508
docs/modules/DataList.html
Normal file
508
docs/modules/DataList.html
Normal file
@ -0,0 +1,508 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><strong>DataList</strong></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>DataList</code></h1>
|
||||
<p>Component to manage data for huge dataset in scroll.</p>
|
||||
<p>
|
||||
It requires Druid Scroll and Druid Grid (Static or Dynamic) components</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#clear">clear(self)</a></td>
|
||||
<td class="summary">Clear the DataList and refresh visuals</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_first_index">get_first_index(self)</a></td>
|
||||
<td class="summary">Return first index from data.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_index">get_index(self, data)</a></td>
|
||||
<td class="summary">Return index for data value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_last_index">get_last_index(self)</a></td>
|
||||
<td class="summary">Return last index from data</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_length">get_length(self)</a></td>
|
||||
<td class="summary">Return amount of data</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, scroll, grid, create_function)</a></td>
|
||||
<td class="summary">Data list constructor</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_remove">on_remove(self)</a></td>
|
||||
<td class="summary">Druid System on_remove function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#scroll_to_index">scroll_to_index(self, index)</a></td>
|
||||
<td class="summary">Instant scroll to element with passed index</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_data">set_data(self, data)</a></td>
|
||||
<td class="summary">Set new data set for DataList component</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#grid">grid</a></td>
|
||||
<td class="summary">The Druid Grid component</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#last_index">last_index</a></td>
|
||||
<td class="summary">The current visual last data index</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_scroll_progress_change">on_scroll_progress_change</a></td>
|
||||
<td class="summary">Event triggered when scroll progress is changed; event(self, progress_value)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#scroll">scroll</a></td>
|
||||
<td class="summary">The Druid scroll component</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#scroll_progress">scroll_progress</a></td>
|
||||
<td class="summary">The current progress of scroll posititon</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#top_index">top_index</a></td>
|
||||
<td class="summary">The current visual top data index</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "clear"></a>
|
||||
<strong>clear(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Clear the DataList and refresh visuals
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DataList</span></span>
|
||||
<a href="../modules/DataList.html#">DataList</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_first_index"></a>
|
||||
<strong>get_first_index(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return first index from data. It not always equals to 1
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DataList</span></span>
|
||||
<a href="../modules/DataList.html#">DataList</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_index"></a>
|
||||
<strong>get_index(self, data)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return index for data value
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DataList</span></span>
|
||||
<a href="../modules/DataList.html#">DataList</a>
|
||||
</li>
|
||||
<li><span class="parameter">data</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_last_index"></a>
|
||||
<strong>get_last_index(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return last index from data
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DataList</span></span>
|
||||
<a href="../modules/DataList.html#">DataList</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_length"></a>
|
||||
<strong>get_length(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return amount of data
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DataList</span></span>
|
||||
<a href="../modules/DataList.html#">DataList</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, scroll, grid, create_function)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Data list constructor
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DataList</span></span>
|
||||
<a href="../modules/DataList.html#">DataList</a>
|
||||
</li>
|
||||
<li><span class="parameter">scroll</span>
|
||||
<span class="types"><span class="type">Scroll</span></span>
|
||||
The <a href="../modules/Scroll.html#">Scroll</a> instance for Data List component
|
||||
</li>
|
||||
<li><span class="parameter">grid</span>
|
||||
<span class="types"><span class="type">StaticGrid</span> or <span class="type">DynamicGrid</span></span>
|
||||
The <a href="../modules/StaticGrid.html#">StaticGrid</a> or <a href="../modules/DynamicGrid.html#">DynamicGrid</a> instance for Data List component
|
||||
</li>
|
||||
<li><span class="parameter">create_function</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
The create function callback(self, data, index, data_list). Function should return (node, [component])
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_remove"></a>
|
||||
<strong>on_remove(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Druid System on_remove function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DataList</span></span>
|
||||
<a href="../modules/DataList.html#">DataList</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "scroll_to_index"></a>
|
||||
<strong>scroll_to_index(self, index)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Instant scroll to element with passed index
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DataList</span></span>
|
||||
<a href="../modules/DataList.html#">DataList</a>
|
||||
</li>
|
||||
<li><span class="parameter">index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_data"></a>
|
||||
<strong>set_data(self, data)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set new data set for DataList component
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DataList</span></span>
|
||||
<a href="../modules/DataList.html#">DataList</a>
|
||||
</li>
|
||||
<li><span class="parameter">data</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
The new data array
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">druid.data_list</span></span>
|
||||
Current DataList instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "grid"></a>
|
||||
<strong>grid</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The Druid Grid component
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">grid</span>
|
||||
<span class="types"><span class="type">StaticGrid</span> or <span class="type">DynamicGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>, <a href="../modules/DynamicGrid.html#">DynamicGrid</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "last_index"></a>
|
||||
<strong>last_index</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The current visual last data index
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">last_index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_scroll_progress_change"></a>
|
||||
<strong>on_scroll_progress_change</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Event triggered when scroll progress is changed; event(self, progress_value)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_scroll_progress_change</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "scroll"></a>
|
||||
<strong>scroll</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The Druid scroll component
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">scroll</span>
|
||||
<span class="types"><span class="type">Scroll</span></span>
|
||||
<a href="../modules/Scroll.html#">Scroll</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "scroll_progress"></a>
|
||||
<strong>scroll_progress</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The current progress of scroll posititon
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">scroll_progress</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "top_index"></a>
|
||||
<strong>top_index</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The current visual top data index
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">top_index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
498
docs/modules/Drag.html
Normal file
498
docs/modules/Drag.html
Normal file
@ -0,0 +1,498 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><strong>Drag</strong></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>Drag</code></h1>
|
||||
<p>Component to handle drag action on node.</p>
|
||||
<p>
|
||||
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</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, node, on_drag_callback)</a></td>
|
||||
<td class="summary">Drag component constructor</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(self, node)</a></td>
|
||||
<td class="summary">Strict drag click area.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#style">style</a></td>
|
||||
<td class="summary">Component style params.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#can_x">can_x</a></td>
|
||||
<td class="summary">Is drag component process vertical dragging.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#can_y">can_y</a></td>
|
||||
<td class="summary">Is drag component process horizontal.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#is_drag">is_drag</a></td>
|
||||
<td class="summary">Is component now dragging</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#is_touch">is_touch</a></td>
|
||||
<td class="summary">Is component now touching</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_drag">on_drag</a></td>
|
||||
<td class="summary">on drag progress callback(self, dx, dy)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_drag_end">on_drag_end</a></td>
|
||||
<td class="summary">Event on drag end callback(self)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_drag_start">on_drag_start</a></td>
|
||||
<td class="summary">Event on drag start callback(self)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_touch_end">on_touch_end</a></td>
|
||||
<td class="summary">Event on touch end callback(self)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_touch_start">on_touch_start</a></td>
|
||||
<td class="summary">Event on touch start callback(self)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#touch_start_pos">touch_start_pos</a></td>
|
||||
<td class="summary">Touch start position</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#x">x</a></td>
|
||||
<td class="summary">Current touch x position</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#y">y</a></td>
|
||||
<td class="summary">Current touch y position</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, node, on_drag_callback)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Drag component constructor
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Drag</span></span>
|
||||
<a href="../modules/Drag.html#">Drag</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
GUI node to detect dragging
|
||||
</li>
|
||||
<li><span class="parameter">on_drag_callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Callback for on_drag_event(self, dx, dy)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_click_zone"></a>
|
||||
<strong>set_click_zone(self, node)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Strict drag click area. Useful for
|
||||
restrict events outside stencil node
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Drag</span></span>
|
||||
<a href="../modules/Drag.html#">Drag</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
Gui node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "style"></a>
|
||||
<strong>style</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component style params.
|
||||
You can override this component styles params in druid styles table
|
||||
or create your own style
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">DRAG_DEADZONE</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Distance in pixels to start dragging
|
||||
(<em>default</em> 10)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "can_x"></a>
|
||||
<strong>can_x</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Is drag component process vertical dragging. Default - true
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">can_x</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "can_y"></a>
|
||||
<strong>can_y</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Is drag component process horizontal. Default - true
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">can_y</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "is_drag"></a>
|
||||
<strong>is_drag</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Is component now dragging
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">is_drag</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "is_touch"></a>
|
||||
<strong>is_touch</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Is component now touching
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">is_touch</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_drag"></a>
|
||||
<strong>on_drag</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
on drag progress callback(self, dx, dy)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_drag</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
Event <a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_drag_end"></a>
|
||||
<strong>on_drag_end</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Event on drag end callback(self)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_drag_end</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_drag_start"></a>
|
||||
<strong>on_drag_start</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Event on drag start callback(self)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_drag_start</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_touch_end"></a>
|
||||
<strong>on_touch_end</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Event on touch end callback(self)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_touch_end</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_touch_start"></a>
|
||||
<strong>on_touch_start</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Event on touch start callback(self)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_touch_start</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "touch_start_pos"></a>
|
||||
<strong>touch_start_pos</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Touch start position
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">touch_start_pos</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "x"></a>
|
||||
<strong>x</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Current touch x position
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">x</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "y"></a>
|
||||
<strong>y</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Current touch y position
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">y</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
280
docs/modules/DruidEvent.html
Normal file
280
docs/modules/DruidEvent.html
Normal file
@ -0,0 +1,280 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><strong>DruidEvent</strong></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>DruidEvent</code></h1>
|
||||
<p>Druid lua event library</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#clear">clear(self)</a></td>
|
||||
<td class="summary">Clear the all event handlers</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initialize">initialize(self, initial_callback)</a></td>
|
||||
<td class="summary">Event constructur</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#is_exist">is_exist(self)</a></td>
|
||||
<td class="summary">Return true, if event have at lease one handler</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#subscribe">subscribe(self, callback, context)</a></td>
|
||||
<td class="summary">Subscribe callback on event</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#trigger">trigger(self, ...)</a></td>
|
||||
<td class="summary">Trigger the event and call all subscribed callbacks</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#unsubscribe">unsubscribe(self, callback, context)</a></td>
|
||||
<td class="summary">Unsubscribe callback on event</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "clear"></a>
|
||||
<strong>clear(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Clear the all event handlers
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "initialize"></a>
|
||||
<strong>initialize(self, initial_callback)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Event constructur
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
<li><span class="parameter">initial_callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Subscribe the callback on new event, if callback exist
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "is_exist"></a>
|
||||
<strong>is_exist(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return true, if event have at lease one handler
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
True if event have handlers
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "subscribe"></a>
|
||||
<strong>subscribe(self, callback, context)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Subscribe callback on event
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Callback itself
|
||||
</li>
|
||||
<li><span class="parameter">context</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Additional context as first param to callback call
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "trigger"></a>
|
||||
<strong>trigger(self, ...)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Trigger the event and call all subscribed callbacks
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
<li><span class="parameter">...</span>
|
||||
<span class="types"><span class="type">any</span></span>
|
||||
All event params
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "unsubscribe"></a>
|
||||
<strong>unsubscribe(self, callback, context)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Unsubscribe callback on event
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Callback itself
|
||||
</li>
|
||||
<li><span class="parameter">context</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Additional context as first param to callback call
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
1309
docs/modules/DruidInstance.html
Normal file
1309
docs/modules/DruidInstance.html
Normal file
File diff suppressed because it is too large
Load Diff
795
docs/modules/DynamicGrid.html
Normal file
795
docs/modules/DynamicGrid.html
Normal file
@ -0,0 +1,795 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><strong>DynamicGrid</strong></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>DynamicGrid</code></h1>
|
||||
<p>Component to handle placing components in row</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#_get_side_vector">_get_side_vector(self, side, is_forward)</a></td>
|
||||
<td class="summary">Return side vector to correct node shifting</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#add">add(self, node[, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]]])</a></td>
|
||||
<td class="summary">Add new node to the grid</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#clear">clear(self)</a></td>
|
||||
<td class="summary">Clear grid nodes array.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_all_pos">get_all_pos(self)</a></td>
|
||||
<td class="summary">Return array of all node positions</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_borders">get_borders(self)</a></td>
|
||||
<td class="summary">Return grid content borders</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_index_by_node">get_index_by_node(self, node)</a></td>
|
||||
<td class="summary">Return grid index by node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_offset">get_offset(self)</a></td>
|
||||
<td class="summary">Return DynamicGrid offset, where DynamicGrid content starts.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_pos">get_pos(self, index, node[, origin_index])</a></td>
|
||||
<td class="summary">Return pos for grid node index</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_size">get_size(self, border)</a></td>
|
||||
<td class="summary">Return grid content size</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, parent)</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#remove">remove(self, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]])</a></td>
|
||||
<td class="summary">Remove the item from the grid.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_position_function">set_position_function(self, callback)</a></td>
|
||||
<td class="summary">Change set position function for grid nodes.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#border">border</a></td>
|
||||
<td class="summary">The size of item content</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#first_index">first_index</a></td>
|
||||
<td class="summary">The first index of node in grid</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#last_index">last_index</a></td>
|
||||
<td class="summary">The last index of node in grid</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#node_size">node_size</a></td>
|
||||
<td class="summary">Item size</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#nodes">nodes</a></td>
|
||||
<td class="summary">List of all grid elements.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_add_item">on_add_item</a></td>
|
||||
<td class="summary">On item add callback(self, node, index)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_change_items">on_change_items</a></td>
|
||||
<td class="summary">On item add or remove callback(self, index)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_clear">on_clear</a></td>
|
||||
<td class="summary">On grid clear callback(self)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_remove_item">on_remove_item</a></td>
|
||||
<td class="summary">On item remove callback(self, index)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_update_positions">on_update_positions</a></td>
|
||||
<td class="summary">On update item positions callback(self)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#parent">parent</a></td>
|
||||
<td class="summary">Parent gui node</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "_get_side_vector"></a>
|
||||
<strong>_get_side_vector(self, side, is_forward)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return side vector to correct node shifting
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">side</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">is_forward</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "add"></a>
|
||||
<strong>add(self, node[, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Add new node to the grid
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DynamicGrid</span></span>
|
||||
<a href="../modules/DynamicGrid.html#">DynamicGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
Gui node
|
||||
</li>
|
||||
<li><span class="parameter">index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The node position. By default add as last node
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">shift_policy</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
How shift nodes, if required. See const.SHIFT
|
||||
(<em>default</em> SHIFT.RIGHT)
|
||||
</li>
|
||||
<li><span class="parameter">is_instant</span>
|
||||
<span class="types"><span class="type">boolean</span></span>
|
||||
If true, update node positions instantly
|
||||
(<em>default</em> false)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "clear"></a>
|
||||
<strong>clear(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
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
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DynamicGrid</span></span>
|
||||
<a href="../modules/DynamicGrid.html#">DynamicGrid</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">druid.dynamic_grid</span></span>
|
||||
Current grid instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_all_pos"></a>
|
||||
<strong>get_all_pos(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return array of all node positions
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DynamicGrid</span></span>
|
||||
<a href="../modules/DynamicGrid.html#">DynamicGrid</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">vector3[]</span></span>
|
||||
All grid node positions
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_borders"></a>
|
||||
<strong>get_borders(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return grid content borders
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DynamicGrid</span></span>
|
||||
<a href="../modules/DynamicGrid.html#">DynamicGrid</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
The grid content borders
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_index_by_node"></a>
|
||||
<strong>get_index_by_node(self, node)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return grid index by node
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DynamicGrid</span></span>
|
||||
<a href="../modules/DynamicGrid.html#">DynamicGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
The gui node in the grid
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The node index
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_offset"></a>
|
||||
<strong>get_offset(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return DynamicGrid offset, where DynamicGrid content starts.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DynamicGrid</span></span>
|
||||
<a href="../modules/DynamicGrid.html#">DynamicGrid</a> The DynamicGrid instance
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
The DynamicGrid offset
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_pos"></a>
|
||||
<strong>get_pos(self, index, node[, origin_index])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return pos for grid node index
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DynamicGrid</span></span>
|
||||
<a href="../modules/DynamicGrid.html#">DynamicGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The grid element index
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
The node to be placed
|
||||
</li>
|
||||
<li><span class="parameter">origin_index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Index of nearby node
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
Node position
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_size"></a>
|
||||
<strong>get_size(self, border)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return grid content size
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DynamicGrid</span></span>
|
||||
<a href="../modules/DynamicGrid.html#">DynamicGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">border</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
The grid content size
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, parent)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DynamicGrid</span></span>
|
||||
<a href="../modules/DynamicGrid.html#">DynamicGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">parent</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
The gui node parent, where items will be placed
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "remove"></a>
|
||||
<strong>remove(self, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Remove the item from the grid. Note that gui node will be not deleted
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DynamicGrid</span></span>
|
||||
<a href="../modules/DynamicGrid.html#">DynamicGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The grid node index to remove
|
||||
</li>
|
||||
<li><span class="parameter">shift_policy</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
How shift nodes, if required. See const.SHIFT
|
||||
(<em>default</em> SHIFT.RIGHT)
|
||||
</li>
|
||||
<li><span class="parameter">is_instant</span>
|
||||
<span class="types"><span class="type">boolean</span></span>
|
||||
If true, update node positions instantly
|
||||
(<em>default</em> false)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
The deleted gui node from grid
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_position_function"></a>
|
||||
<strong>set_position_function(self, callback)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Change set position function for grid nodes. It will call on
|
||||
update poses on grid elements. Default: gui.set_position
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">DynamicGrid</span></span>
|
||||
<a href="../modules/DynamicGrid.html#">DynamicGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Function on node set position
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">druid.dynamic_grid</span></span>
|
||||
Current grid instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "border"></a>
|
||||
<strong>border</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The size of item content
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">border</span>
|
||||
<span class="types"><span class="type">vector4</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "first_index"></a>
|
||||
<strong>first_index</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The first index of node in grid
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">first_index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "last_index"></a>
|
||||
<strong>last_index</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The last index of node in grid
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">last_index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "node_size"></a>
|
||||
<strong>node_size</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Item size
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">node_size</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "nodes"></a>
|
||||
<strong>nodes</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
List of all grid elements. Contains from node, pos, size, pivot
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">nodes</span>
|
||||
<span class="types"><span class="type">node[]</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_add_item"></a>
|
||||
<strong>on_add_item</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On item add callback(self, node, index)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_add_item</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_change_items"></a>
|
||||
<strong>on_change_items</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On item add or remove callback(self, index)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_change_items</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_clear"></a>
|
||||
<strong>on_clear</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On grid clear callback(self)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_clear</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_remove_item"></a>
|
||||
<strong>on_remove_item</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On item remove callback(self, index)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_remove_item</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_update_positions"></a>
|
||||
<strong>on_update_positions</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On update item positions callback(self)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_update_positions</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "parent"></a>
|
||||
<strong>parent</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Parent gui node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">parent</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
427
docs/modules/Helper.html
Normal file
427
docs/modules/Helper.html
Normal file
@ -0,0 +1,427 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><strong>Helper</strong></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>Helper</code></h1>
|
||||
<p>Druid helper module for gui layouts</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#helper.centrate_icon_with_text">helper.centrate_icon_with_text([icon_node[, text_node[, margin=0]]])</a></td>
|
||||
<td class="summary">Center two nodes.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#helper.centrate_nodes">helper.centrate_nodes([margin=0[, ...]])</a></td>
|
||||
<td class="summary">Center several nodes nodes.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#helper.centrate_text_with_icon">helper.centrate_text_with_icon([text_node][, icon_node], margin)</a></td>
|
||||
<td class="summary">Center two nodes.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#helper.deprecated">helper.deprecated(message)</a></td>
|
||||
<td class="summary">Show deprecated message.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#helper.get_border">helper.get_border(node, offset)</a></td>
|
||||
<td class="summary">Distance from node position to his borders</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#helper.get_closest_stencil_node">helper.get_closest_stencil_node(node)</a></td>
|
||||
<td class="summary">Return closest non inverted clipping parent node for node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#helper.get_pivot_offset">helper.get_pivot_offset(pivot)</a></td>
|
||||
<td class="summary">Get node offset for given gui pivot</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#helper.is_enabled">helper.is_enabled(node)</a></td>
|
||||
<td class="summary">Check if node is enabled in gui hierarchy.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#helper.is_mobile">helper.is_mobile()</a></td>
|
||||
<td class="summary">Check if device is mobile (Android or iOS)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#helper.is_web">helper.is_web()</a></td>
|
||||
<td class="summary">Check if device is HTML5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#table_to_string">table_to_string(t)</a></td>
|
||||
<td class="summary">Transform table to oneline string</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "helper.centrate_icon_with_text"></a>
|
||||
<strong>helper.centrate_icon_with_text([icon_node[, text_node[, margin=0]]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Center two nodes.
|
||||
Nodes will be center around 0 x position
|
||||
icon_node will be first (at left side)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">icon_node</span>
|
||||
<span class="types"><span class="type">box</span></span>
|
||||
Gui box node
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">text_node</span>
|
||||
<span class="types"><span class="type">text</span></span>
|
||||
Gui text node
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">margin</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Offset between nodes
|
||||
(<em>default</em> 0)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "helper.centrate_nodes"></a>
|
||||
<strong>helper.centrate_nodes([margin=0[, ...]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Center several nodes nodes.
|
||||
Nodes will be center around 0 x position
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">margin</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Offset between nodes
|
||||
(<em>default</em> 0)
|
||||
</li>
|
||||
<li><span class="parameter">...</span>
|
||||
<span class="types"><span class="type">Node</span></span>
|
||||
Any count of gui Node
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "helper.centrate_text_with_icon"></a>
|
||||
<strong>helper.centrate_text_with_icon([text_node][, icon_node], margin)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Center two nodes.
|
||||
Nodes will be center around 0 x position
|
||||
text_node will be first (at left side)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">text_node</span>
|
||||
<span class="types"><span class="type">text</span></span>
|
||||
Gui text node
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">icon_node</span>
|
||||
<span class="types"><span class="type">box</span></span>
|
||||
Gui box node
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">margin</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Offset between nodes
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "helper.deprecated"></a>
|
||||
<strong>helper.deprecated(message)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Show deprecated message. Once time per message
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">message</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
The deprecated message
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "helper.get_border"></a>
|
||||
<strong>helper.get_border(node, offset)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Distance from node position to his borders
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
The gui node to check
|
||||
</li>
|
||||
<li><span class="parameter">offset</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
The offset to add to result
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
vector4 Vector with distance to node border: (left, top, right, down)
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "helper.get_closest_stencil_node"></a>
|
||||
<strong>helper.get_closest_stencil_node(node)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return closest non inverted clipping parent node for node
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
Gui node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">node</span> or <span class="type">nil</span></span>
|
||||
The clipping node
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "helper.get_pivot_offset"></a>
|
||||
<strong>helper.get_pivot_offset(pivot)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Get node offset for given gui pivot
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">pivot</span>
|
||||
<span class="types"><span class="type">gui.pivot</span></span>
|
||||
The node pivot
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
Vector offset with [-1..1] values
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "helper.is_enabled"></a>
|
||||
<strong>helper.is_enabled(node)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Check if node is enabled in gui hierarchy.
|
||||
Return false, if node or any his parent is disabled
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
Gui node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Is enabled in hierarchy
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "helper.is_mobile"></a>
|
||||
<strong>helper.is_mobile()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Check if device is mobile (Android or iOS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "helper.is_web"></a>
|
||||
<strong>helper.is_web()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Check if device is HTML5
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "table_to_string"></a>
|
||||
<strong>table_to_string(t)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Transform table to oneline string
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">t</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
339
docs/modules/Hover.html
Normal file
339
docs/modules/Hover.html
Normal file
@ -0,0 +1,339 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><strong>Hover</strong></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>Hover</code></h1>
|
||||
<p>Component to handle hover node interaction</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, node, on_hover_callback)</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#is_enabled">is_enabled(self)</a></td>
|
||||
<td class="summary">Return current hover enabled state</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(self, zone)</a></td>
|
||||
<td class="summary">Strict hover click area.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_enabled">set_enabled(self, state)</a></td>
|
||||
<td class="summary">Set enable state of hover component.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_hover">set_hover(self, state)</a></td>
|
||||
<td class="summary">Set hover state</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_mouse_hover">set_mouse_hover(self, state)</a></td>
|
||||
<td class="summary">Set mouse hover state</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_hover">on_hover</a></td>
|
||||
<td class="summary">On hover callback(self, state)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_mouse_hover">on_mouse_hover</a></td>
|
||||
<td class="summary">On mouse hover callback(self, state)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, node, on_hover_callback)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Hover</span></span>
|
||||
<a href="../modules/Hover.html#">Hover</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
Gui node
|
||||
</li>
|
||||
<li><span class="parameter">on_hover_callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Hover callback
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "is_enabled"></a>
|
||||
<strong>is_enabled(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return current hover enabled state
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Hover</span></span>
|
||||
<a href="../modules/Hover.html#">Hover</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
The hover enabled state
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_click_zone"></a>
|
||||
<strong>set_click_zone(self, zone)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Strict hover click area. Useful for
|
||||
no click events outside stencil node
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Hover</span></span>
|
||||
<a href="../modules/Hover.html#">Hover</a>
|
||||
</li>
|
||||
<li><span class="parameter">zone</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
Gui node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_enabled"></a>
|
||||
<strong>set_enabled(self, state)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set enable state of hover component.
|
||||
If hover is not enabled, it will not generate
|
||||
any hover events
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Hover</span></span>
|
||||
<a href="../modules/Hover.html#">Hover</a>
|
||||
</li>
|
||||
<li><span class="parameter">state</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
The hover enabled state
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_hover"></a>
|
||||
<strong>set_hover(self, state)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set hover state
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Hover</span></span>
|
||||
<a href="../modules/Hover.html#">Hover</a>
|
||||
</li>
|
||||
<li><span class="parameter">state</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
The hover state
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_mouse_hover"></a>
|
||||
<strong>set_mouse_hover(self, state)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set mouse hover state
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Hover</span></span>
|
||||
<a href="../modules/Hover.html#">Hover</a>
|
||||
</li>
|
||||
<li><span class="parameter">state</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
The mouse hover state
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "on_hover"></a>
|
||||
<strong>on_hover</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On hover callback(self, state)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_hover</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_mouse_hover"></a>
|
||||
<strong>on_mouse_hover</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On mouse hover callback(self, state)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_mouse_hover</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
735
docs/modules/Input.html
Normal file
735
docs/modules/Input.html
Normal file
@ -0,0 +1,735 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><strong>Input</strong></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>Input</code></h1>
|
||||
<p>Druid input text component.</p>
|
||||
<p>
|
||||
Carry on user text input</p>
|
||||
<h3>Info:</h3>
|
||||
<ul>
|
||||
<li><strong>Author</strong>: Part of code from Britzl gooey input component</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_text">get_text(self)</a></td>
|
||||
<td class="summary">Return current input field text</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, click_node, text_node[, keyboard_type])</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#reset_changes">reset_changes(self)</a></td>
|
||||
<td class="summary">Reset current input selection and return previous value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#select">select(self)</a></td>
|
||||
<td class="summary">Select input field.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_allowed_characters">set_allowed_characters(self, characters)</a></td>
|
||||
<td class="summary">Set allowed charaters for input field.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_max_length">set_max_length(self, max_length)</a></td>
|
||||
<td class="summary">Set maximum length for input field.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_text">set_text(self, input_text)</a></td>
|
||||
<td class="summary">Set text for input field</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#unselect">unselect(self)</a></td>
|
||||
<td class="summary">Remove selection from input.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#style">style</a></td>
|
||||
<td class="summary">Component style params.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#allowerd_characters">allowerd_characters</a></td>
|
||||
<td class="summary">Pattern matching for user input</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#button">button</a></td>
|
||||
<td class="summary">Button component</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#is_empty">is_empty</a></td>
|
||||
<td class="summary">Is current input is empty now</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#is_selected">is_selected</a></td>
|
||||
<td class="summary">Is current input selected now</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#keyboard_type">keyboard_type</a></td>
|
||||
<td class="summary">Gui keyboard type for input field</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#max_length">max_length</a></td>
|
||||
<td class="summary">Max length for input text</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_input_empty">on_input_empty</a></td>
|
||||
<td class="summary">On input field text change to empty string callback(self, input_text)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_input_full">on_input_full</a></td>
|
||||
<td class="summary">On input field text change to max length string callback(self, input_text)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_input_select">on_input_select</a></td>
|
||||
<td class="summary">On input field select callback(self, button_node)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_input_text">on_input_text</a></td>
|
||||
<td class="summary">On input field text change callback(self, input_text)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_input_unselect">on_input_unselect</a></td>
|
||||
<td class="summary">On input field unselect callback(self, input_text)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_input_wrong">on_input_wrong</a></td>
|
||||
<td class="summary">On trying user input with not allowed character callback(self, params, button_instance)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#text">text</a></td>
|
||||
<td class="summary">Text component</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "get_text"></a>
|
||||
<strong>get_text(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return current input field text
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Input</span></span>
|
||||
<a href="../modules/Input.html#">Input</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
The current input field text
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, click_node, text_node[, keyboard_type])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Input</span></span>
|
||||
<a href="../modules/Input.html#">Input</a>
|
||||
</li>
|
||||
<li><span class="parameter">click_node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
Button node to enabled input component
|
||||
</li>
|
||||
<li><span class="parameter">text_node</span>
|
||||
<span class="types"><span class="type">node</span> or <span class="type">Text</span></span>
|
||||
Text node what will be changed on user input. You can pass text component instead of text node name <a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
<li><span class="parameter">keyboard_type</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Gui keyboard type for input field
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "reset_changes"></a>
|
||||
<strong>reset_changes(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Reset current input selection and return previous value
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Input</span></span>
|
||||
<a href="../modules/Input.html#">Input</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "select"></a>
|
||||
<strong>select(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Select input field. It will show the keyboard and trigger on_select events
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Input</span></span>
|
||||
<a href="../modules/Input.html#">Input</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_allowed_characters"></a>
|
||||
<strong>set_allowed_characters(self, characters)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set allowed charaters for input field.
|
||||
See: https://defold.com/ref/stable/string/
|
||||
ex: [%a%d] for alpha and numeric
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Input</span></span>
|
||||
<a href="../modules/Input.html#">Input</a>
|
||||
</li>
|
||||
<li><span class="parameter">characters</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Regulax exp. for validate user input
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">druid.input</span></span>
|
||||
Current input instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_max_length"></a>
|
||||
<strong>set_max_length(self, max_length)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set maximum length for input field.
|
||||
Pass nil to make input field unliminted (by default)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Input</span></span>
|
||||
<a href="../modules/Input.html#">Input</a>
|
||||
</li>
|
||||
<li><span class="parameter">max_length</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Maximum length for input text field
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">druid.input</span></span>
|
||||
Current input instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_text"></a>
|
||||
<strong>set_text(self, input_text)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set text for input field
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Input</span></span>
|
||||
<a href="../modules/Input.html#">Input</a>
|
||||
</li>
|
||||
<li><span class="parameter">input_text</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
The string to apply for input field
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "unselect"></a>
|
||||
<strong>unselect(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Remove selection from input. It will hide the keyboard and trigger on_unselect events
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Input</span></span>
|
||||
<a href="../modules/Input.html#">Input</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "style"></a>
|
||||
<strong>style</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component style params.
|
||||
You can override this component styles params in druid styles table
|
||||
or create your own style
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">IS_LONGTAP_ERASE</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Is long tap will erase current input data
|
||||
(<em>default</em> false)
|
||||
</li>
|
||||
<li><span class="parameter">MASK_DEFAULT_CHAR</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Default character mask for password input
|
||||
(<em>default</em> *)
|
||||
</li>
|
||||
<li><span class="parameter">IS_UNSELECT_ON_RESELECT</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
If true, call unselect on select selected input
|
||||
(<em>default</em> false)
|
||||
</li>
|
||||
<li><span class="parameter">on_select</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
(self, button_node) Callback on input field selecting
|
||||
</li>
|
||||
<li><span class="parameter">on_unselect</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
(self, button_node) Callback on input field unselecting
|
||||
</li>
|
||||
<li><span class="parameter">on_input_wrong</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
(self, button_node) Callback on wrong user input
|
||||
</li>
|
||||
<li><span class="parameter">button_style</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Custom button style for input node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "allowerd_characters"></a>
|
||||
<strong>allowerd_characters</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Pattern matching for user input
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">allowerd_characters</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "button"></a>
|
||||
<strong>button</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Button component
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">button</span>
|
||||
<span class="types"><span class="type">Button</span></span>
|
||||
<a href="../modules/Button.html#">Button</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "is_empty"></a>
|
||||
<strong>is_empty</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Is current input is empty now
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">is_empty</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "is_selected"></a>
|
||||
<strong>is_selected</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Is current input selected now
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">is_selected</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "keyboard_type"></a>
|
||||
<strong>keyboard_type</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Gui keyboard type for input field
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">keyboard_type</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "max_length"></a>
|
||||
<strong>max_length</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Max length for input text
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">max_length</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_input_empty"></a>
|
||||
<strong>on_input_empty</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On input field text change to empty string callback(self, input_text)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_input_empty</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_input_full"></a>
|
||||
<strong>on_input_full</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On input field text change to max length string callback(self, input_text)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_input_full</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_input_select"></a>
|
||||
<strong>on_input_select</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On input field select callback(self, button_node)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_input_select</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_input_text"></a>
|
||||
<strong>on_input_text</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On input field text change callback(self, input_text)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_input_text</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_input_unselect"></a>
|
||||
<strong>on_input_unselect</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On input field unselect callback(self, input_text)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_input_unselect</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_input_wrong"></a>
|
||||
<strong>on_input_wrong</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On trying user input with not allowed character callback(self, params, button_instance)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_input_wrong</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "text"></a>
|
||||
<strong>text</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Text component
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">text</span>
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
365
docs/modules/LangText.html
Normal file
365
docs/modules/LangText.html
Normal file
@ -0,0 +1,365 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><strong>LangText</strong></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>LangText</code></h1>
|
||||
<p>Component to handle all GUI texts
|
||||
Good working with localization system</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#format">format(self[, a[, b[, c[, d[, e[, f[, g]]]]]]])</a></td>
|
||||
<td class="summary">Format string with new text params on localized text</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, node, locale_id, no_adjust)</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_to">set_to(self, text)</a></td>
|
||||
<td class="summary">Setup raw text to lang_text component</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#translate">translate(self, locale_id[, a[, b[, c[, d[, e[, f[, g]]]]]]])</a></td>
|
||||
<td class="summary">Translate the text by locale_id</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_change">on_change</a></td>
|
||||
<td class="summary">On change text callback</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#text">text</a></td>
|
||||
<td class="summary">The text component</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "format"></a>
|
||||
<strong>format(self[, a[, b[, c[, d[, e[, f[, g]]]]]]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Format string with new text params on localized text
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">LangText</span></span>
|
||||
<a href="../modules/LangText.html#">LangText</a>
|
||||
</li>
|
||||
<li><span class="parameter">a</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">b</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">c</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">d</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">e</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">f</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">g</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">LangText</span></span>
|
||||
Current instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, node, locale_id, no_adjust)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">LangText</span></span>
|
||||
<a href="../modules/LangText.html#">LangText</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
The text node
|
||||
</li>
|
||||
<li><span class="parameter">locale_id</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Default locale id or text from node as default
|
||||
</li>
|
||||
<li><span class="parameter">no_adjust</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
If true, will not correct text size
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_to"></a>
|
||||
<strong>set_to(self, text)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Setup raw text to lang_text component
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">LangText</span></span>
|
||||
<a href="../modules/LangText.html#">LangText</a>
|
||||
</li>
|
||||
<li><span class="parameter">text</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Text for text node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">LangText</span></span>
|
||||
Current instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "translate"></a>
|
||||
<strong>translate(self, locale_id[, a[, b[, c[, d[, e[, f[, g]]]]]]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Translate the text by locale_id
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">LangText</span></span>
|
||||
<a href="../modules/LangText.html#">LangText</a>
|
||||
</li>
|
||||
<li><span class="parameter">locale_id</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Locale id
|
||||
</li>
|
||||
<li><span class="parameter">a</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">b</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">c</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">d</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">e</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">f</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">g</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Optional param to string.format
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">LangText</span></span>
|
||||
Current instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "on_change"></a>
|
||||
<strong>on_change</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On change text callback
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_change</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "text"></a>
|
||||
<strong>text</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The text component
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">text</span>
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
297
docs/modules/PinKnob.html
Normal file
297
docs/modules/PinKnob.html
Normal file
@ -0,0 +1,297 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><strong>PinKnob</strong></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>PinKnob</code></h1>
|
||||
<p>Druid pin knob custom component.</p>
|
||||
<p>
|
||||
It's simple rotating input element</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, callback, template, nodes)</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_angle">set_angle(self, cur_value, min, max)</a></td>
|
||||
<td class="summary">Set current and min/max angles for component</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_friction">set_friction(self[, value=1])</a></td>
|
||||
<td class="summary">Set current and min/max angles for component</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#druid">druid</a></td>
|
||||
<td class="summary">The component druid instance</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#is_drag">is_drag</a></td>
|
||||
<td class="summary">Is currently under user control</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#node">node</a></td>
|
||||
<td class="summary">The pin node</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, callback, template, nodes)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">PinKnob</span></span>
|
||||
<a href="../modules/PinKnob.html#">PinKnob</a>
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Callback(self, value) on value changed
|
||||
</li>
|
||||
<li><span class="parameter">template</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
The template string name
|
||||
</li>
|
||||
<li><span class="parameter">nodes</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Nodes table from gui.clone_tree
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_angle"></a>
|
||||
<strong>set_angle(self, cur_value, min, max)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set current and min/max angles for component
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">PinKnob</span></span>
|
||||
<a href="../modules/PinKnob.html#">PinKnob</a>
|
||||
</li>
|
||||
<li><span class="parameter">cur_value</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The new value for pin knob
|
||||
</li>
|
||||
<li><span class="parameter">min</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The minimum value for pin knob
|
||||
</li>
|
||||
<li><span class="parameter">max</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The maximum value for pin knob
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">PinKnob</span></span>
|
||||
<a href="../modules/PinKnob.html#">PinKnob</a>
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_friction"></a>
|
||||
<strong>set_friction(self[, value=1])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set current and min/max angles for component
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">PinKnob</span></span>
|
||||
<a href="../modules/PinKnob.html#">PinKnob</a>
|
||||
</li>
|
||||
<li><span class="parameter">value</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The spin speed multiplier
|
||||
(<em>default</em> 1)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">PinKnob</span></span>
|
||||
<a href="../modules/PinKnob.html#">PinKnob</a>
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "druid"></a>
|
||||
<strong>druid</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The component druid instance
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">druid</span>
|
||||
<span class="types"><span class="type">DruidInstance</span></span>
|
||||
<a href="../modules/DruidInstance.html#">DruidInstance</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "is_drag"></a>
|
||||
<strong>is_drag</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Is currently under user control
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">is_drag</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "node"></a>
|
||||
<strong>node</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The pin node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/PinKnob.html#node">node</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
531
docs/modules/Progress.html
Normal file
531
docs/modules/Progress.html
Normal file
@ -0,0 +1,531 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><strong>Progress</strong></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>Progress</code></h1>
|
||||
<p>Basic progress bar component.</p>
|
||||
<p>
|
||||
For correct progress bar init it should be in max size from gui</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#empty">empty(self)</a></td>
|
||||
<td class="summary">Empty a progress bar</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#fill">fill(self)</a></td>
|
||||
<td class="summary">Fill a progress bar and stop progress animation</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get">get(self)</a></td>
|
||||
<td class="summary">Return current progress bar value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, node, key[, init_value=1])</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_steps">set_steps(self, steps, callback)</a></td>
|
||||
<td class="summary">Set points on progress bar to fire the callback</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_to">set_to(self, to)</a></td>
|
||||
<td class="summary">Instant fill progress bar to value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#to">to(self, to[, callback])</a></td>
|
||||
<td class="summary">Start animation of a progress bar</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#style">style</a></td>
|
||||
<td class="summary">Component style params.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#key">key</a></td>
|
||||
<td class="summary">The progress bar direction</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#max_size">max_size</a></td>
|
||||
<td class="summary">Maximum size of progress bar</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#node">node</a></td>
|
||||
<td class="summary">Progress bar fill node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_change">on_change</a></td>
|
||||
<td class="summary">On progress bar change callback(self, new_value)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#scale">scale</a></td>
|
||||
<td class="summary">Current progress bar scale</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#size">size</a></td>
|
||||
<td class="summary">Current progress bar size</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#slice">slice</a></td>
|
||||
<td class="summary">Progress bar slice9 settings</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "empty"></a>
|
||||
<strong>empty(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Empty a progress bar
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Progress</span></span>
|
||||
<a href="../modules/Progress.html#">Progress</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "fill"></a>
|
||||
<strong>fill(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Fill a progress bar and stop progress animation
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Progress</span></span>
|
||||
<a href="../modules/Progress.html#">Progress</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get"></a>
|
||||
<strong>get(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return current progress bar value
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Progress</span></span>
|
||||
<a href="../modules/Progress.html#">Progress</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, node, key[, init_value=1])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Progress</span></span>
|
||||
<a href="../modules/Progress.html#">Progress</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <a class="type" href="../modules/Progress.html#node">node</a></span>
|
||||
Progress bar fill node or node name
|
||||
</li>
|
||||
<li><span class="parameter">key</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Progress bar direction: const.SIDE.X or const.SIDE.Y
|
||||
</li>
|
||||
<li><span class="parameter">init_value</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Initial value of progress bar
|
||||
(<em>default</em> 1)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_steps"></a>
|
||||
<strong>set_steps(self, steps, callback)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set points on progress bar to fire the callback
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Progress</span></span>
|
||||
<a href="../modules/Progress.html#">Progress</a>
|
||||
</li>
|
||||
<li><span class="parameter">steps</span>
|
||||
<span class="types"><span class="type">number[]</span></span>
|
||||
Array of progress bar values
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Callback on intersect step value
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<ul>
|
||||
<pre class="example">progress:set_steps({<span class="number">0</span>, <span class="number">0.3</span>, <span class="number">0.6</span>, <span class="number">1</span>}, <span class="keyword">function</span>(self, step) <span class="keyword">end</span>)</pre>
|
||||
</ul>
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_to"></a>
|
||||
<strong>set_to(self, to)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Instant fill progress bar to value
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Progress</span></span>
|
||||
<a href="../modules/Progress.html#">Progress</a>
|
||||
</li>
|
||||
<li><span class="parameter">to</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Progress bar value, from 0 to 1
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "to"></a>
|
||||
<strong>to(self, to[, callback])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Start animation of a progress bar
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Progress</span></span>
|
||||
<a href="../modules/Progress.html#">Progress</a>
|
||||
</li>
|
||||
<li><span class="parameter">to</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
value between 0..1
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Callback on animation ends
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "style"></a>
|
||||
<strong>style</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component style params.
|
||||
You can override this component styles params in druid styles table
|
||||
or create your own style
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">SPEED</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Progress bas fill rate. More -> faster
|
||||
(<em>default</em> 5)
|
||||
</li>
|
||||
<li><span class="parameter">MIN_DELTA</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Minimum step to fill progress bar
|
||||
(<em>default</em> 0.005)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "key"></a>
|
||||
<strong>key</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The progress bar direction
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">key</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "max_size"></a>
|
||||
<strong>max_size</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Maximum size of progress bar
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">max_size</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "node"></a>
|
||||
<strong>node</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Progress bar fill node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Progress.html#node">node</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_change"></a>
|
||||
<strong>on_change</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On progress bar change callback(self, new_value)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_change</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "scale"></a>
|
||||
<strong>scale</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Current progress bar scale
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">scale</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "size"></a>
|
||||
<strong>size</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Current progress bar size
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">size</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "slice"></a>
|
||||
<strong>slice</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Progress bar slice9 settings
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">slice</span>
|
||||
<span class="types"><span class="type">vector4</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
258
docs/modules/RadioGroup.html
Normal file
258
docs/modules/RadioGroup.html
Normal file
@ -0,0 +1,258 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><strong>RadioGroup</strong></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>RadioGroup</code></h1>
|
||||
<p>Radio group module</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_state">get_state(self)</a></td>
|
||||
<td class="summary">Return radio group state</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, nodes, callback[, click_nodes=node])</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_state">set_state(self, index, is_instant)</a></td>
|
||||
<td class="summary">Set radio group state</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#checkboxes">checkboxes</a></td>
|
||||
<td class="summary">Array of checkbox components</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_radio_click">on_radio_click</a></td>
|
||||
<td class="summary">On any checkbox click</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "get_state"></a>
|
||||
<strong>get_state(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return radio group state
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">RadioGroup</span></span>
|
||||
<a href="../modules/RadioGroup.html#">RadioGroup</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Index in radio group
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, nodes, callback[, click_nodes=node])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">RadioGroup</span></span>
|
||||
<a href="../modules/RadioGroup.html#">RadioGroup</a>
|
||||
</li>
|
||||
<li><span class="parameter">nodes</span>
|
||||
<span class="types"><span class="type">node[]</span></span>
|
||||
Array of gui node
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Radio callback
|
||||
</li>
|
||||
<li><span class="parameter">click_nodes</span>
|
||||
<span class="types"><span class="type">node[]</span></span>
|
||||
Array of trigger nodes, by default equals to nodes
|
||||
(<em>default</em> node)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_state"></a>
|
||||
<strong>set_state(self, index, is_instant)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set radio group state
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">RadioGroup</span></span>
|
||||
<a href="../modules/RadioGroup.html#">RadioGroup</a>
|
||||
</li>
|
||||
<li><span class="parameter">index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Index in radio group
|
||||
</li>
|
||||
<li><span class="parameter">is_instant</span>
|
||||
<span class="types"><span class="type">boolean</span></span>
|
||||
If is instant state change
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "checkboxes"></a>
|
||||
<strong>checkboxes</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Array of checkbox components
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">checkboxes</span>
|
||||
<span class="types"><span class="type">Checkbox[]</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_radio_click"></a>
|
||||
<strong>on_radio_click</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On any checkbox click
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_radio_click</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
267
docs/modules/RichInput.html
Normal file
267
docs/modules/RichInput.html
Normal file
@ -0,0 +1,267 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><strong>RichInput</strong></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>RichInput</code></h1>
|
||||
<p>Druid Rich Input custom component.</p>
|
||||
<p>
|
||||
It's wrapper on Input component with cursor and placeholder text</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, template, nodes)</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_placeholder">set_placeholder(self, placeholder_text)</a></td>
|
||||
<td class="summary">Set placeholder text</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#cursor">cursor</a></td>
|
||||
<td class="summary">On input field text change to empty string callback(self, input_text)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#druid">druid</a></td>
|
||||
<td class="summary">The component druid instance</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#input">input</a></td>
|
||||
<td class="summary">On input field text change callback(self, input_text)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#placeholder">placeholder</a></td>
|
||||
<td class="summary">On input field text change to max length string callback(self, input_text)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, template, nodes)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">RichInput</span></span>
|
||||
<a href="../modules/RichInput.html#">RichInput</a>
|
||||
</li>
|
||||
<li><span class="parameter">template</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
The template string name
|
||||
</li>
|
||||
<li><span class="parameter">nodes</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Nodes table from gui.clone_tree
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_placeholder"></a>
|
||||
<strong>set_placeholder(self, placeholder_text)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set placeholder text
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">RichInput</span></span>
|
||||
<a href="../modules/RichInput.html#">RichInput</a>
|
||||
</li>
|
||||
<li><span class="parameter">placeholder_text</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
The placeholder text
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "cursor"></a>
|
||||
<strong>cursor</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On input field text change to empty string callback(self, input_text)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">cursor</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "druid"></a>
|
||||
<strong>druid</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The component druid instance
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">druid</span>
|
||||
<span class="types"><span class="type">DruidInstance</span></span>
|
||||
<a href="../modules/DruidInstance.html#">DruidInstance</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "input"></a>
|
||||
<strong>input</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On input field text change callback(self, input_text)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">input</span>
|
||||
<span class="types"><span class="type">Input</span></span>
|
||||
<a href="../modules/Input.html#">Input</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "placeholder"></a>
|
||||
<strong>placeholder</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On input field text change to max length string callback(self, input_text)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">placeholder</span>
|
||||
<span class="types"><span class="type">druid.text</span></span>
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
1103
docs/modules/Scroll.html
Normal file
1103
docs/modules/Scroll.html
Normal file
File diff suppressed because it is too large
Load Diff
474
docs/modules/Slider.html
Normal file
474
docs/modules/Slider.html
Normal file
@ -0,0 +1,474 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><strong>Slider</strong></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>Slider</code></h1>
|
||||
<p>Druid slider component</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, node, end_pos[, callback])</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set">set(self, value[, is_silent])</a></td>
|
||||
<td class="summary">Set value for slider</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_input_node">set_input_node(self, input_node)</a></td>
|
||||
<td class="summary">Set input zone for slider.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_steps">set_steps(self, steps)</a></td>
|
||||
<td class="summary">Set slider steps.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#dist">dist</a></td>
|
||||
<td class="summary">Length between start and end position</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#end_pos">end_pos</a></td>
|
||||
<td class="summary">End pin node position</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#is_drag">is_drag</a></td>
|
||||
<td class="summary">Current drag state</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#node">node</a></td>
|
||||
<td class="summary">Slider pin node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_change_value">on_change_value</a></td>
|
||||
<td class="summary">On change value callback(self, value)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#pos">pos</a></td>
|
||||
<td class="summary">Current pin node position</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#start_pos">start_pos</a></td>
|
||||
<td class="summary">Start pin node position</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#target_pos">target_pos</a></td>
|
||||
<td class="summary">Targer pin node position</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#value">value</a></td>
|
||||
<td class="summary">Current slider value</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, node, end_pos[, callback])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Slider</span></span>
|
||||
<a href="../modules/Slider.html#">Slider</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Slider.html#node">node</a></span>
|
||||
Gui pin node
|
||||
</li>
|
||||
<li><span class="parameter">end_pos</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
The end position of slider
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
On slider change callback
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set"></a>
|
||||
<strong>set(self, value[, is_silent])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set value for slider
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Slider</span></span>
|
||||
<a href="../modules/Slider.html#">Slider</a>
|
||||
</li>
|
||||
<li><span class="parameter">value</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Value from 0 to 1
|
||||
</li>
|
||||
<li><span class="parameter">is_silent</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Don't trigger event if true
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_input_node"></a>
|
||||
<strong>set_input_node(self, input_node)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
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+
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Slider</span></span>
|
||||
<a href="../modules/Slider.html#">Slider</a>
|
||||
</li>
|
||||
<li><span class="parameter">input_node</span>
|
||||
<span class="types"><span class="type">Node</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Slider</span></span>
|
||||
<a href="../modules/Slider.html#">Slider</a>
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_steps"></a>
|
||||
<strong>set_steps(self, steps)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set slider steps. Pin node will
|
||||
apply closest step position
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Slider</span></span>
|
||||
<a href="../modules/Slider.html#">Slider</a>
|
||||
</li>
|
||||
<li><span class="parameter">steps</span>
|
||||
<span class="types"><span class="type">number[]</span></span>
|
||||
Array of steps
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Slider</span></span>
|
||||
<a href="../modules/Slider.html#">Slider</a>
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<ul>
|
||||
<pre class="example">slider:set_steps({<span class="number">0</span>, <span class="number">0.2</span>, <span class="number">0.6</span>, <span class="number">1</span>})</pre>
|
||||
</ul>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "dist"></a>
|
||||
<strong>dist</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Length between start and end position
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">dist</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "end_pos"></a>
|
||||
<strong>end_pos</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
End pin node position
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">end_pos</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "is_drag"></a>
|
||||
<strong>is_drag</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Current drag state
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">is_drag</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "node"></a>
|
||||
<strong>node</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Slider pin node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Slider.html#node">node</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_change_value"></a>
|
||||
<strong>on_change_value</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On change value callback(self, value)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_change_value</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "pos"></a>
|
||||
<strong>pos</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Current pin node position
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">pos</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "start_pos"></a>
|
||||
<strong>start_pos</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Start pin node position
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">start_pos</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "target_pos"></a>
|
||||
<strong>target_pos</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Targer pin node position
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">target_pos</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "value"></a>
|
||||
<strong>value</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Current slider value
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">value</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
926
docs/modules/StaticGrid.html
Normal file
926
docs/modules/StaticGrid.html
Normal file
@ -0,0 +1,926 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><strong>StaticGrid</strong></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>StaticGrid</code></h1>
|
||||
<p>Component to handle placing components by row and columns.</p>
|
||||
<p>
|
||||
Grid can anchor your elements, get content size and other</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#add">add(self, item[, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]]])</a></td>
|
||||
<td class="summary">Add new item to the grid</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#clear">clear(self)</a></td>
|
||||
<td class="summary">Clear grid nodes array.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_all_pos">get_all_pos(self)</a></td>
|
||||
<td class="summary">Return array of all node positions</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_borders">get_borders(self)</a></td>
|
||||
<td class="summary">Return grid content borders</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_index">get_index(self, pos)</a></td>
|
||||
<td class="summary">Return index for grid pos</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_index_by_node">get_index_by_node(self, node)</a></td>
|
||||
<td class="summary">Return grid index by node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_offset">get_offset(self)</a></td>
|
||||
<td class="summary">Return StaticGrid offset, where StaticGrid content starts.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_pos">get_pos(self, index)</a></td>
|
||||
<td class="summary">Return pos for grid node index</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_size">get_size(self)</a></td>
|
||||
<td class="summary">Return grid content size</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, parent, element[, in_row=1])</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#remove">remove(self, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]])</a></td>
|
||||
<td class="summary">Remove the item from the grid.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_anchor">set_anchor(self, anchor)</a></td>
|
||||
<td class="summary">Set grid anchor.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_in_row">set_in_row(self, in_row)</a></td>
|
||||
<td class="summary">Set new in_row elements for grid</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_position_function">set_position_function(self, callback)</a></td>
|
||||
<td class="summary">Change set position function for grid nodes.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#style">style</a></td>
|
||||
<td class="summary">Component style params.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#anchor">anchor</a></td>
|
||||
<td class="summary">Item anchor</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#border">border</a></td>
|
||||
<td class="summary">The size of item content</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#first_index">first_index</a></td>
|
||||
<td class="summary">The first index of node in grid</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#last_index">last_index</a></td>
|
||||
<td class="summary">The last index of node in grid</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#node_size">node_size</a></td>
|
||||
<td class="summary">Item size</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#nodes">nodes</a></td>
|
||||
<td class="summary">List of all grid nodes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_add_item">on_add_item</a></td>
|
||||
<td class="summary">On item add callback(self, node, index)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_change_items">on_change_items</a></td>
|
||||
<td class="summary">On item add, remove or change in_row callback(self, index|nil)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_clear">on_clear</a></td>
|
||||
<td class="summary">On grid clear callback(self)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_remove_item">on_remove_item</a></td>
|
||||
<td class="summary">On item remove callback(self, index)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_update_positions">on_update_positions</a></td>
|
||||
<td class="summary">On update item positions callback(self)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#parent">parent</a></td>
|
||||
<td class="summary">Parent gui node</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "add"></a>
|
||||
<strong>add(self, item[, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Add new item to the grid
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">item</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
Gui node
|
||||
</li>
|
||||
<li><span class="parameter">index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The item position. By default add as last item
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">shift_policy</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
How shift nodes, if required. See const.SHIFT
|
||||
(<em>default</em> SHIFT.RIGHT)
|
||||
</li>
|
||||
<li><span class="parameter">is_instant</span>
|
||||
<span class="types"><span class="type">boolean</span></span>
|
||||
If true, update node positions instantly
|
||||
(<em>default</em> false)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "clear"></a>
|
||||
<strong>clear(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
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
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">druid.static_grid</span></span>
|
||||
Current grid instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_all_pos"></a>
|
||||
<strong>get_all_pos(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return array of all node positions
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">vector3[]</span></span>
|
||||
All grid node positions
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_borders"></a>
|
||||
<strong>get_borders(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return grid content borders
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
The grid content borders
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_index"></a>
|
||||
<strong>get_index(self, pos)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return index for grid pos
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">pos</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
The node position in the grid
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The node index
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_index_by_node"></a>
|
||||
<strong>get_index_by_node(self, node)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return grid index by node
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
The gui node in the grid
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The node index
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_offset"></a>
|
||||
<strong>get_offset(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return StaticGrid offset, where StaticGrid content starts.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a> The StaticGrid instance
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
The StaticGrid offset
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_pos"></a>
|
||||
<strong>get_pos(self, index)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return pos for grid node index
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The grid element index
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
Node position
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_size"></a>
|
||||
<strong>get_size(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return grid content size
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
The grid content size
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, parent, element[, in_row=1])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">parent</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
The gui node parent, where items will be placed
|
||||
</li>
|
||||
<li><span class="parameter">element</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
Element prefab. Need to get it size
|
||||
</li>
|
||||
<li><span class="parameter">in_row</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
How many nodes in row can be placed
|
||||
(<em>default</em> 1)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "remove"></a>
|
||||
<strong>remove(self, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Remove the item from the grid. Note that gui node will be not deleted
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The grid node index to remove
|
||||
</li>
|
||||
<li><span class="parameter">shift_policy</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
How shift nodes, if required. See const.SHIFT
|
||||
(<em>default</em> SHIFT.RIGHT)
|
||||
</li>
|
||||
<li><span class="parameter">is_instant</span>
|
||||
<span class="types"><span class="type">boolean</span></span>
|
||||
If true, update node positions instantly
|
||||
(<em>default</em> false)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Node</span></span>
|
||||
The deleted gui node from grid
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_anchor"></a>
|
||||
<strong>set_anchor(self, anchor)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set grid anchor. Default anchor is equal to anchor of grid parent node
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">anchor</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
Anchor
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_in_row"></a>
|
||||
<strong>set_in_row(self, in_row)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set new in_row elements for grid
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">in_row</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The new in_row value
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">druid.static_grid</span></span>
|
||||
Current grid instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_position_function"></a>
|
||||
<strong>set_position_function(self, callback)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Change set position function for grid nodes. It will call on
|
||||
update poses on grid elements. Default: gui.set_position
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">StaticGrid</span></span>
|
||||
<a href="../modules/StaticGrid.html#">StaticGrid</a>
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Function on node set position
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">druid.static_grid</span></span>
|
||||
Current grid instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "style"></a>
|
||||
<strong>style</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component style params.
|
||||
You can override this component styles params in druid styles table
|
||||
or create your own style
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">IS_DYNAMIC_NODE_POSES</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
If true, always center grid content as grid pivot sets
|
||||
(<em>default</em> false)
|
||||
</li>
|
||||
<li><span class="parameter">IS_ALIGN_LAST_ROW</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
If true, always align last row of the grid as grid pivot sets
|
||||
(<em>default</em> false)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "anchor"></a>
|
||||
<strong>anchor</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Item anchor
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">anchor</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "border"></a>
|
||||
<strong>border</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The size of item content
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">border</span>
|
||||
<span class="types"><span class="type">vector4</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "first_index"></a>
|
||||
<strong>first_index</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The first index of node in grid
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">first_index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "last_index"></a>
|
||||
<strong>last_index</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The last index of node in grid
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">last_index</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "node_size"></a>
|
||||
<strong>node_size</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Item size
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">node_size</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "nodes"></a>
|
||||
<strong>nodes</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
List of all grid nodes
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">nodes</span>
|
||||
<span class="types"><span class="type">node[]</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_add_item"></a>
|
||||
<strong>on_add_item</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On item add callback(self, node, index)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_add_item</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_change_items"></a>
|
||||
<strong>on_change_items</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On item add, remove or change in_row callback(self, index|nil)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_change_items</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_clear"></a>
|
||||
<strong>on_clear</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On grid clear callback(self)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_clear</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_remove_item"></a>
|
||||
<strong>on_remove_item</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On item remove callback(self, index)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_remove_item</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_update_positions"></a>
|
||||
<strong>on_update_positions</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On update item positions callback(self)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_update_positions</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "parent"></a>
|
||||
<strong>parent</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Parent gui node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">parent</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
292
docs/modules/Swipe.html
Normal file
292
docs/modules/Swipe.html
Normal file
@ -0,0 +1,292 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><strong>Swipe</strong></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>Swipe</code></h1>
|
||||
<p>Component to handle swipe gestures on node.</p>
|
||||
<p>
|
||||
Swipe will be triggered, if swipe was started and
|
||||
ended on one node</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, node, on_swipe_callback)</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(self, zone)</a></td>
|
||||
<td class="summary">Strict swipe click area.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#style">style</a></td>
|
||||
<td class="summary">Component style params.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#click_zone">click_zone</a></td>
|
||||
<td class="summary">Restriction zone</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#node">node</a></td>
|
||||
<td class="summary">Swipe node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_swipe">on_swipe</a></td>
|
||||
<td class="summary">Trigger on swipe event(self, swipe_side, dist, delta_time)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, node, on_swipe_callback)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Swipe</span></span>
|
||||
<a href="../modules/Swipe.html#">Swipe</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Swipe.html#node">node</a></span>
|
||||
Gui node
|
||||
</li>
|
||||
<li><span class="parameter">on_swipe_callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Swipe callback for on_swipe_end event
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_click_zone"></a>
|
||||
<strong>set_click_zone(self, zone)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Strict swipe click area. Useful for
|
||||
restrict events outside stencil node
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Swipe</span></span>
|
||||
<a href="../modules/Swipe.html#">Swipe</a>
|
||||
</li>
|
||||
<li><span class="parameter">zone</span>
|
||||
<span class="types"><a class="type" href="../modules/Swipe.html#node">node</a></span>
|
||||
Gui node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "style"></a>
|
||||
<strong>style</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component style params.
|
||||
You can override this component styles params in druid styles table
|
||||
or create your own style
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">SWIPE_TIME</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Maximum time for swipe trigger
|
||||
(<em>default</em> 0.4)
|
||||
</li>
|
||||
<li><span class="parameter">SWIPE_THRESHOLD</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Minimum distance for swipe trigger
|
||||
(<em>default</em> 50)
|
||||
</li>
|
||||
<li><span class="parameter">SWIPE_TRIGGER_ON_MOVE</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
If true, trigger on swipe moving, not only release action
|
||||
(<em>default</em> false)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "click_zone"></a>
|
||||
<strong>click_zone</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Restriction zone
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">click_zone</span>
|
||||
<span class="types"><a class="type" href="../modules/Swipe.html#node">node</a></span>
|
||||
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "node"></a>
|
||||
<strong>node</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Swipe node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Swipe.html#node">node</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_swipe"></a>
|
||||
<strong>on_swipe</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Trigger on swipe event(self, swipe_side, dist, delta_time)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_swipe</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
) <a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
832
docs/modules/Text.html
Normal file
832
docs/modules/Text.html
Normal file
@ -0,0 +1,832 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><strong>Text</strong></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>Text</code></h1>
|
||||
<p>Component to handle all GUI texts.</p>
|
||||
<p>
|
||||
Druid text can adjust itself for text node size
|
||||
Text will never will be outside of his text size (even multiline)</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_text_adjust">get_text_adjust(self, adjust_type)</a></td>
|
||||
<td class="summary">Return current text adjust type</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_text_size">get_text_size(self[, text])</a></td>
|
||||
<td class="summary">Calculate text width with font with respect to trailing space</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, node[, value[, adjust_type=0]])</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#is_multiline">is_multiline(self)</a></td>
|
||||
<td class="summary">Return true, if text with line break</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_alpha">set_alpha(self, alpha)</a></td>
|
||||
<td class="summary">Set alpha</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_color">set_color(self, color)</a></td>
|
||||
<td class="summary">Set color</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_minimal_scale">set_minimal_scale(self, minimal_scale)</a></td>
|
||||
<td class="summary">Set minimal scale for DOWNSCALE_LIMITED or SCALE_THEN_SCROLL adjust types</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_pivot">set_pivot(self, pivot)</a></td>
|
||||
<td class="summary">Set text pivot.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_scale">set_scale(self, scale)</a></td>
|
||||
<td class="summary">Set scale</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_text_adjust">set_text_adjust(self[, adjust_type[, minimal_scale]])</a></td>
|
||||
<td class="summary">Set text adjust, refresh the current text visuals, if needed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_to">set_to(self, set_to)</a></td>
|
||||
<td class="summary">Set text to text field</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#style">style</a></td>
|
||||
<td class="summary">Component style params.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#adjust_type">adjust_type</a></td>
|
||||
<td class="summary">Current text size adjust settings</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#color">color</a></td>
|
||||
<td class="summary">Current text color</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#node">node</a></td>
|
||||
<td class="summary">Text node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#node_id">node_id</a></td>
|
||||
<td class="summary">The node id of text node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_set_pivot">on_set_pivot</a></td>
|
||||
<td class="summary">On change pivot callback(self, pivot)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_set_text">on_set_text</a></td>
|
||||
<td class="summary">On set text callback(self, text)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_update_text_scale">on_update_text_scale</a></td>
|
||||
<td class="summary">On adjust text size callback(self, new_scale)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#pos">pos</a></td>
|
||||
<td class="summary">Current text position</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#scale">scale</a></td>
|
||||
<td class="summary">Current text node scale</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#start_scale">start_scale</a></td>
|
||||
<td class="summary">Initial text node scale</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#start_size">start_size</a></td>
|
||||
<td class="summary">Initial text node size</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#text_area">text_area</a></td>
|
||||
<td class="summary">Current text node available are</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "get_text_adjust"></a>
|
||||
<strong>get_text_adjust(self, adjust_type)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return current text adjust type
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">adjust_type</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
The current text adjust type
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_text_size"></a>
|
||||
<strong>get_text_size(self[, text])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Calculate text width with font with respect to trailing space
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
<li><span class="parameter">text</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
<li>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Width</li>
|
||||
<li>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Height</li>
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, node[, value[, adjust_type=0]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Text.html#node">node</a></span>
|
||||
Gui text node
|
||||
</li>
|
||||
<li><span class="parameter">value</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Initial text. Default value is node text from GUI scene.
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">adjust_type</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference
|
||||
(<em>default</em> 0)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "is_multiline"></a>
|
||||
<strong>is_multiline(self)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return true, if text with line break
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Is text node with line break
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_alpha"></a>
|
||||
<strong>set_alpha(self, alpha)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set alpha
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
<li><span class="parameter">alpha</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Alpha for node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
Current text instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_color"></a>
|
||||
<strong>set_color(self, color)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set color
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
<li><span class="parameter">color</span>
|
||||
<span class="types"><span class="type">vector4</span></span>
|
||||
Color for node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
Current text instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_minimal_scale"></a>
|
||||
<strong>set_minimal_scale(self, minimal_scale)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set minimal scale for DOWNSCALE_LIMITED or SCALE_THEN_SCROLL adjust types
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
<li><span class="parameter">minimal_scale</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
If pass nil - not use minimal scale
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
Current text instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_pivot"></a>
|
||||
<strong>set_pivot(self, pivot)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set text pivot. Text will re-anchor inside text area
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
<li><span class="parameter">pivot</span>
|
||||
<span class="types"><span class="type">gui.pivot</span></span>
|
||||
Gui pivot constant
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
Current text instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_scale"></a>
|
||||
<strong>set_scale(self, scale)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set scale
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
<li><span class="parameter">scale</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
Scale for node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
Current text instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_text_adjust"></a>
|
||||
<strong>set_text_adjust(self[, adjust_type[, minimal_scale]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set text adjust, refresh the current text visuals, if needed
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
<li><span class="parameter">adjust_type</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
See const.TEXT_ADJUST. If pass nil - use current adjust type
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">minimal_scale</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
If pass nil - not use minimal scale
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
Current text instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_to"></a>
|
||||
<strong>set_to(self, set_to)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set text to text field
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
<li><span class="parameter">set_to</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Text for node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">Text</span></span>
|
||||
Current text instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "style"></a>
|
||||
<strong>style</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component style params.
|
||||
You can override this component styles params in druid styles table
|
||||
or create your own style
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">TRIM_POSTFIX</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
The postfix for TRIM adjust type
|
||||
(<em>default</em> ...)
|
||||
</li>
|
||||
<li><span class="parameter">DEFAULT_ADJUST</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
The default adjust type for any text component
|
||||
(<em>default</em> DOWNSCALE)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "adjust_type"></a>
|
||||
<strong>adjust_type</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Current text size adjust settings
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">adjust_type</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "color"></a>
|
||||
<strong>color</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Current text color
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">color</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "node"></a>
|
||||
<strong>node</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Text node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Text.html#node">node</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "node_id"></a>
|
||||
<strong>node_id</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
The node id of text node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">node_id</span>
|
||||
<span class="types"><span class="type">hash</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_set_pivot"></a>
|
||||
<strong>on_set_pivot</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On change pivot callback(self, pivot)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_set_pivot</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_set_text"></a>
|
||||
<strong>on_set_text</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On set text callback(self, text)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_set_text</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_update_text_scale"></a>
|
||||
<strong>on_update_text_scale</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On adjust text size callback(self, new_scale)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_update_text_scale</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "pos"></a>
|
||||
<strong>pos</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Current text position
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">pos</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "scale"></a>
|
||||
<strong>scale</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Current text node scale
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">scale</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "start_scale"></a>
|
||||
<strong>start_scale</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initial text node scale
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">start_scale</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "start_size"></a>
|
||||
<strong>start_size</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initial text node size
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">start_size</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "text_area"></a>
|
||||
<strong>text_area</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Current text node available are
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">text_area</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
412
docs/modules/Timer.html
Normal file
412
docs/modules/Timer.html
Normal file
@ -0,0 +1,412 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><strong>Timer</strong></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>Timer</code></h1>
|
||||
<p>Component to handle GUI timers.</p>
|
||||
<p>
|
||||
Timer updating by game delta time. If game is not focused -
|
||||
timer will be not updated.</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#init">init(self, node, seconds_from[, seconds_to=0[, callback]])</a></td>
|
||||
<td class="summary">Component init function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_interval">set_interval(self, from, to)</a></td>
|
||||
<td class="summary">Set time interval</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_state">set_state(self, is_on)</a></td>
|
||||
<td class="summary">Called when update</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_to">set_to(self, set_to)</a></td>
|
||||
<td class="summary">Set text to text field</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#from">from</a></td>
|
||||
<td class="summary">Initial timer value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#node">node</a></td>
|
||||
<td class="summary">Trigger node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_set_enabled">on_set_enabled</a></td>
|
||||
<td class="summary">On timer change enabled state callback(self, is_enabled)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_tick">on_tick</a></td>
|
||||
<td class="summary">On timer tick.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_timer_end">on_timer_end</a></td>
|
||||
<td class="summary">On timer end callback</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#target">target</a></td>
|
||||
<td class="summary">Target timer value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#value">value</a></td>
|
||||
<td class="summary">Current timer value</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "init"></a>
|
||||
<strong>init(self, node, seconds_from[, seconds_to=0[, callback]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Component init function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Timer</span></span>
|
||||
<a href="../modules/Timer.html#">Timer</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Timer.html#node">node</a></span>
|
||||
Gui text node
|
||||
</li>
|
||||
<li><span class="parameter">seconds_from</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Start timer value in seconds
|
||||
</li>
|
||||
<li><span class="parameter">seconds_to</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
End timer value in seconds
|
||||
(<em>default</em> 0)
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Function on timer end
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_interval"></a>
|
||||
<strong>set_interval(self, from, to)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set time interval
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Timer</span></span>
|
||||
<a href="../modules/Timer.html#">Timer</a>
|
||||
</li>
|
||||
<li><span class="parameter">from</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Start time in seconds
|
||||
</li>
|
||||
<li><span class="parameter">to</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Target time in seconds
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_state"></a>
|
||||
<strong>set_state(self, is_on)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Called when update
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Timer</span></span>
|
||||
<a href="../modules/Timer.html#">Timer</a>
|
||||
</li>
|
||||
<li><span class="parameter">is_on</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Timer enable state
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_to"></a>
|
||||
<strong>set_to(self, set_to)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set text to text field
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
<span class="types"><span class="type">Timer</span></span>
|
||||
<a href="../modules/Timer.html#">Timer</a>
|
||||
</li>
|
||||
<li><span class="parameter">set_to</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Value in seconds
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "from"></a>
|
||||
<strong>from</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initial timer value
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">from</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "node"></a>
|
||||
<strong>node</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Trigger node
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><a class="type" href="../modules/Timer.html#node">node</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_set_enabled"></a>
|
||||
<strong>on_set_enabled</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On timer change enabled state callback(self, is_enabled)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_set_enabled</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_tick"></a>
|
||||
<strong>on_tick</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On timer tick. Fire every second callback(self, value)
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_tick</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_timer_end"></a>
|
||||
<strong>on_timer_end</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
On timer end callback
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">on_timer_end</span>
|
||||
<span class="types"><span class="type">DruidEvent</span></span>
|
||||
(self, Timer) <a href="../modules/DruidEvent.html#">DruidEvent</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "target"></a>
|
||||
<strong>target</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Target timer value
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">target</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "value"></a>
|
||||
<strong>value</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Current timer value
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">value</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
394
docs/modules/druid.helper.html
Normal file
394
docs/modules/druid.helper.html
Normal file
@ -0,0 +1,394 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/druid.html">druid</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><strong>druid.helper</strong></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>druid.helper</code></h1>
|
||||
<p>Text node or icon node can be nil</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#centrate_text_with_icon">centrate_text_with_icon([text_node][, icon_node], margin)</a></td>
|
||||
<td class="summary">Center two nodes.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#centrate_icon_with_text">centrate_icon_with_text([icon_node[, text_node[, margin=0]]])</a></td>
|
||||
<td class="summary">Center two nodes.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#centrate_nodes">centrate_nodes([margin=0[, ...]])</a></td>
|
||||
<td class="summary">Center several nodes nodes.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#is_enabled">is_enabled(node)</a></td>
|
||||
<td class="summary">Check if node is enabled in gui hierarchy.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_closest_stencil_node">get_closest_stencil_node(node)</a></td>
|
||||
<td class="summary">Return closest non inverted clipping parent node for node</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_pivot_offset">get_pivot_offset(pivot)</a></td>
|
||||
<td class="summary">Get node offset for given gui pivot</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#helper..is_mobile">helper..is_mobile()</a></td>
|
||||
<td class="summary">Check if device is mobile (Android or iOS)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#is_web">is_web()</a></td>
|
||||
<td class="summary">Check if device is HTML5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_border">get_border(node, offset)</a></td>
|
||||
<td class="summary">Distance from node position to his borders</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#deprecated">deprecated(message)</a></td>
|
||||
<td class="summary">Show deprecated message.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "centrate_text_with_icon"></a>
|
||||
<strong>centrate_text_with_icon([text_node][, icon_node], margin)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Center two nodes.
|
||||
Nodes will be center around 0 x position
|
||||
text_node will be first (at left side)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">text_node</span>
|
||||
<span class="types"><span class="type">text</span></span>
|
||||
Gui text node
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">icon_node</span>
|
||||
<span class="types"><span class="type">box</span></span>
|
||||
Gui box node
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">margin</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Offset between nodes
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "centrate_icon_with_text"></a>
|
||||
<strong>centrate_icon_with_text([icon_node[, text_node[, margin=0]]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Center two nodes.
|
||||
Nodes will be center around 0 x position
|
||||
icon_node will be first (at left side)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">icon_node</span>
|
||||
<span class="types"><span class="type">box</span></span>
|
||||
Gui box node
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">text_node</span>
|
||||
<span class="types"><span class="type">text</span></span>
|
||||
Gui text node
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
<li><span class="parameter">margin</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Offset between nodes
|
||||
(<em>default</em> 0)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "centrate_nodes"></a>
|
||||
<strong>centrate_nodes([margin=0[, ...]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Center several nodes nodes.
|
||||
Nodes will be center around 0 x position
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">margin</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Offset between nodes
|
||||
(<em>default</em> 0)
|
||||
</li>
|
||||
<li><span class="parameter">...</span>
|
||||
<span class="types"><span class="type">Node</span></span>
|
||||
Any count of gui Node
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "is_enabled"></a>
|
||||
<strong>is_enabled(node)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Check if node is enabled in gui hierarchy.
|
||||
Return false, if node or any his parent is disabled
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
Gui node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Is enabled in hierarchy
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_closest_stencil_node"></a>
|
||||
<strong>get_closest_stencil_node(node)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return closest non inverted clipping parent node for node
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
Gui node
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">node</span> or <span class="type">nil</span></span>
|
||||
The clipping node
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_pivot_offset"></a>
|
||||
<strong>get_pivot_offset(pivot)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Get node offset for given gui pivot
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">pivot</span>
|
||||
<span class="types"><span class="type">gui.pivot</span></span>
|
||||
The node pivot
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
Vector offset with [-1..1] values
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "helper..is_mobile"></a>
|
||||
<strong>helper..is_mobile()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Check if device is mobile (Android or iOS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "is_web"></a>
|
||||
<strong>is_web()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Check if device is HTML5
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_border"></a>
|
||||
<strong>get_border(node, offset)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Distance from node position to his borders
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
The gui node to check
|
||||
</li>
|
||||
<li><span class="parameter">offset</span>
|
||||
<span class="types"><span class="type">vector3</span></span>
|
||||
The offset to add to result
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
vector4 Vector with distance to node border: (left, top, right, down)
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "deprecated"></a>
|
||||
<strong>deprecated(message)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Show deprecated message. Once time per message
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">message</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
The deprecated message
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-02-12 17:16:44 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
305
docs/modules/druid.html
Normal file
305
docs/modules/druid.html
Normal file
@ -0,0 +1,305 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Defold Druid UI Library</title>
|
||||
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Druid</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
||||
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
||||
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
||||
<li><a href="../modules/Button.html">Button</a></li>
|
||||
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
||||
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
||||
<li><a href="../modules/DataList.html">DataList</a></li>
|
||||
<li><a href="../modules/Drag.html">Drag</a></li>
|
||||
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
||||
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
||||
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
||||
<li><a href="../modules/Helper.html">Helper</a></li>
|
||||
<li><a href="../modules/Hover.html">Hover</a></li>
|
||||
<li><a href="../modules/Input.html">Input</a></li>
|
||||
<li><a href="../modules/LangText.html">LangText</a></li>
|
||||
<li><a href="../modules/PinKnob.html">PinKnob</a></li>
|
||||
<li><a href="../modules/Progress.html">Progress</a></li>
|
||||
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
||||
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
||||
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
||||
<li><a href="../modules/Slider.html">Slider</a></li>
|
||||
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
||||
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
||||
<li><a href="../modules/Text.html">Text</a></li>
|
||||
<li><a href="../modules/Timer.html">Timer</a></li>
|
||||
<li><strong>druid</strong></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>druid</code></h1>
|
||||
<p>Druid UI Library.</p>
|
||||
<p>
|
||||
Powerful Defold component based UI library. Use standart
|
||||
components or make your own game-specific components to
|
||||
make amazing GUI in your games.
|
||||
<p> Contains the several basic components and examples
|
||||
to how to do your custom complex components to
|
||||
separate UI game logic to small files
|
||||
<p> require("druid.druid")
|
||||
function init(self)
|
||||
self.druid = druid.new(self)
|
||||
end
|
||||
</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#new">new(context[, style])</a></td>
|
||||
<td class="summary">Create Druid instance.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_language_change">on_language_change()</a></td>
|
||||
<td class="summary">Callback on global language change event.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_window_callback">on_window_callback(event)</a></td>
|
||||
<td class="summary">Callback on global window event.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#register">register(name, module)</a></td>
|
||||
<td class="summary">Register external druid component.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_default_style">set_default_style(style)</a></td>
|
||||
<td class="summary">Set new default style.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_sound_function">set_sound_function(callback)</a></td>
|
||||
<td class="summary">Set sound function.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#set_text_function">set_text_function(callback)</a></td>
|
||||
<td class="summary">Set text function
|
||||
Druid locale component will call this function
|
||||
to get translated text.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "new"></a>
|
||||
<strong>new(context[, style])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Create Druid instance.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">context</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Druid context. Usually it is self of script
|
||||
</li>
|
||||
<li><span class="parameter">style</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Druid style module
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">druid_instance</span></span>
|
||||
Druid instance
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_language_change"></a>
|
||||
<strong>on_language_change()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Callback on global language change event.
|
||||
Use to update all lang texts
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "on_window_callback"></a>
|
||||
<strong>on_window_callback(event)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Callback on global window event.
|
||||
Used to trigger on_focus_lost and on_focus_gain
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">event</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
Event param from window listener
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "register"></a>
|
||||
<strong>register(name, module)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Register external druid component.
|
||||
After register you can create the component with
|
||||
druid_instance:new_{name}. For example `druid:new_button(...)`
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">name</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
||||
module name
|
||||
</li>
|
||||
<li><span class="parameter">module</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
lua table with component
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_default_style"></a>
|
||||
<strong>set_default_style(style)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set new default style.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">style</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Druid style module
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_sound_function"></a>
|
||||
<strong>set_sound_function(callback)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set sound function.
|
||||
Component will call this function to
|
||||
play sound by sound_id
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Sound play callback
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "set_text_function"></a>
|
||||
<strong>set_text_function(callback)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set text function
|
||||
Druid locale component will call this function
|
||||
to get translated text. After set_text_funtion
|
||||
all existing locale component will be updated
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">callback</span>
|
||||
<span class="types"><span class="type">function</span></span>
|
||||
Get localized text function
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
||||
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user