Update examples

This commit is contained in:
Insality
2025-03-27 00:30:37 +02:00
parent 7640e207a4
commit b053b5044b
15 changed files with 125 additions and 146 deletions

View File

@@ -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", {