From cb6fd3038a68f3bb59e26d4329dc8c43646450cc Mon Sep 17 00:00:00 2001 From: Insality Date: Sun, 23 Feb 2020 13:00:59 +0300 Subject: [PATCH] Add examples to component docs --- alpha_todo.txt | 3 ++- config.ld | 6 +++++- druid/base/button.lua | 11 +++++++++++ druid/druid.lua | 5 +++++ druid/event.lua | 2 ++ 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/alpha_todo.txt b/alpha_todo.txt index aae9b80..552c412 100644 --- a/alpha_todo.txt +++ b/alpha_todo.txt @@ -8,7 +8,7 @@ Simple to-do for Druid Alpha 0.2.0 + better name for locale component? lang? lang_text? + better name for slider component? Slider is ok + Druid store assets - separate repository with rich components (progress_rich migrate) -- refactor on_swipe. To on_scroll? Add input priority ++ refactor on_swipe. To on_scroll? Add input priority - separate custom data and predefined fields in components? - add init/remove stuff for every style in component. How to set custom sprites for button states? - unify component api (get/set/to and other general stuff) @@ -24,6 +24,7 @@ Simple to-do for Druid Alpha 0.2.0 - compare with gooey - add docs for all components - add docs folder for every component with gifs? Solutions +- remove component autoremove all children component -- Low diff --git a/config.ld b/config.ld index 43d3a05..b9a95cd 100644 --- a/config.ld +++ b/config.ld @@ -2,6 +2,10 @@ project='Druid' title='Defold Druid UI Library' description='Documentation for Druid Library' file={"./druid"} +package='druid' +sort=true dir='./docs' -style='!pale' +style='!fixed' +format='discount' +use_markdown_titles=true no_space_before_args=true \ No newline at end of file diff --git a/druid/base/button.lua b/druid/base/button.lua index 618663f..22f55b2 100644 --- a/druid/base/button.lua +++ b/druid/base/button.lua @@ -1,6 +1,17 @@ --- Component to handle basic GUI button -- @module druid.button +--- Component events +-- @tfield druid_event on_click +-- @tfield druid_event on_hold_click +-- @tfield druid_event on_long_click +-- @tfield druid_event on_double_click +-- @table events + +--- Component fields +-- @tfield node Main node +-- @table fields + local Event = require("druid.event") local const = require("druid.const") local helper = require("druid.helper") diff --git a/druid/druid.lua b/druid/druid.lua index 0003720..0716805 100644 --- a/druid/druid.lua +++ b/druid/druid.lua @@ -7,6 +7,11 @@ -- to how to do your custom complex components to -- separate UI game logic to small files -- +-- require("druid.druid") +-- function init(self) +-- self.druid = druid.new(self) +-- end +-- -- @module druid local const = require("druid.const") diff --git a/druid/event.lua b/druid/event.lua index f84ac00..baccb8e 100644 --- a/druid/event.lua +++ b/druid/event.lua @@ -1,7 +1,9 @@ --- Lua event small library +-- @module druid_event local class = require("druid.system.middleclass") +-- @class DruidEvent local M = class("druid.event")