mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 10:02:18 +02:00
Add test widget stubs
This commit is contained in:
20
README.md
20
README.md
@@ -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.
|
||||
|
Reference in New Issue
Block a user