Add test widget stubs

This commit is contained in:
Insality
2024-11-18 21:48:08 +02:00
parent 56ef92a1b5
commit f3fad8bd92
10 changed files with 1282 additions and 1 deletions

View File

@@ -96,6 +96,8 @@ For all **Druid** instance functions, [see here](https://insality.github.io/drui
### Default GUI Script
Put the following code in your GUI script to start using **Druid**.
```lua
local druid = require("druid.druid")
@@ -116,11 +118,27 @@ function on_message(self, message_id, message, sender)
end
function on_input(self, action_id, action)
self.druid:on_input(action_id, action)
return self.druid:on_input(action_id, action)
end
```
### Default Widget Template
Create a new lua file to create a new widget class. This widget can be created with `self.druid:new_widget(widget_class, [template], [nodes])`
```lua
local M = {}
function M:init()
self.druid = self:get_druid()
self.root = self:get_node("root")
end
return M
```
### API Documentation
**Druid** offers a wide range of components and functions. To facilitate usage, **Druid** provides comprehensive API documentation with examples and annotations.