Have questions about Druid? Ask me! Here is questions you might have
A: ---
A: Any created Druid component can be removed with druid:remove. API reference link.
A: ---
A: SImply: the Druid has a LIFO queue to check input. Last added buttons have more priority than first. Placing your buttons from behind to the front is correct in most cases.
A: Component explanation here. With Blocker you can block input in some zone. It is useful for make unclickable zone in buttons or kind of buttons panel on other big button (ex. close windows on window background click)
A: Any of you can imagine! There is a lot of examples, but in general: custom components allow you place component and some game logic separately from other stuff. It will be reusable, easier for testing and developing.
For example it can be element in scroll with buttons, your custom GUI widget or even component with your game logic. Usually custom components going with templates. You can do several templates for single component module (for different visuals!)
Some examples of custom components you can find here.
A: The node can be placed in gui directly or can be cloned via gui.clone_tree(). Also nodes can be placed as templates, so full node id will be composed from template name and node name (in cloned nodes too).
Druid component self:get_node() trying to search in all of this places. Use self:set_template() and self:set_component_nodes() for correct setup component nodes before any call of self:get_node().
Remember, usually you should pass string name of the node, not gui node itself. It's better and more druid-way.
A: Since Druid checking click node with gui.pick_node, stencil is not prevent this. You can setup additional click zone on your buttons with button:set_click_zone.
The usual Druid way after add button to the scroll do:
-- Scroll view node usually is stencil node
button:set_click_zone(scroll.view_node)
A: Since the dependencies can't be processed by external editors, for use generated EmmyLua annotations you should copy the druid/annotations.lua to your project. For EmmyLua it will be enough. Remember you can restart emmylua server for refresh the changes, if something goes wrong. After the annotations is processed, you should point the type of Druid in requires:
---@type druid
local druid = require("druid.druid")
-- Now the autocomplete is working
A: ---