mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 10:02:18 +02:00
Update examples
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
local panthera = require("panthera.panthera")
|
||||
local component = require("druid.component")
|
||||
|
||||
local basic_animation_panthera = require("example.examples.panthera.basic_animation.basic_animation_panthera")
|
||||
|
||||
---@class examples.basic_animation: druid.component
|
||||
---@field druid druid.instance
|
||||
local M = component.create("basic_animation")
|
||||
---@class examples.basic_animation: druid.widget
|
||||
---@field animation panthera.instance
|
||||
---@field button druid.button
|
||||
local M = {}
|
||||
|
||||
|
||||
---@param template string
|
||||
---@param nodes table<hash, node>
|
||||
function M:init(template, nodes)
|
||||
self.druid = self:get_druid(template, nodes)
|
||||
|
||||
self.animation = panthera.create_gui(basic_animation_panthera, self:get_template(), nodes)
|
||||
function M:init()
|
||||
self.animation = panthera.create_gui(basic_animation_panthera, self:get_template(), self:get_nodes())
|
||||
|
||||
self.button = self.druid:new_button("button/root", function()
|
||||
panthera.play(self.animation, "on_click", {
|
||||
|
Reference in New Issue
Block a user