mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 10:27:47 +02:00
Update docs
This commit is contained in:
parent
4f8be6ebdb
commit
336694cd1d
@ -185,7 +185,7 @@ end
|
|||||||
You can also use the root node ID or node directly, it will be cloned and used as a template:
|
You can also use the root node ID or node directly, it will be cloned and used as a template:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
self.my_widget = self.druid:new_widget(best_widget_in_the_world, "best_widget_in_the_world", "best_widget_in_the_world/root")
|
self.my_widget = self.druid:new_widget(best_widget_in_the_world, "best_widget_in_the_world", "root")
|
||||||
-- or
|
-- or
|
||||||
self.my_widget = self.druid:new_widget(best_widget_in_the_world, "best_widget_in_the_world", self.prefab)
|
self.my_widget = self.druid:new_widget(best_widget_in_the_world, "best_widget_in_the_world", self.prefab)
|
||||||
```
|
```
|
||||||
|
@ -126,8 +126,8 @@ function init(self)
|
|||||||
-- In case we want to clone it and use several times we can pass the nodes table
|
-- In case we want to clone it and use several times we can pass the nodes table
|
||||||
local array_of_widgets = {}
|
local array_of_widgets = {}
|
||||||
for index = 1, 10 do
|
for index = 1, 10 do
|
||||||
-- For widgets now we can use a root node directly instead of manually cloning the nodes
|
-- For widgets now we can use a root node inside my_widget directly instead of manually cloning the nodes
|
||||||
local widget = self.druid:new_widget(my_widget, "my_widget", "my_widget/root")
|
local widget = self.druid:new_widget(my_widget, "my_widget", "root")
|
||||||
table.insert(array_of_widgets, widget)
|
table.insert(array_of_widgets, widget)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user