This commit is contained in:
Insality
2025-03-20 09:46:13 +02:00
parent 10556ba31a
commit 330dabda09
8 changed files with 45 additions and 41 deletions

View File

@@ -8,6 +8,11 @@ local event_queue = require("druid.event_queue")
---@field time number
local M = {}
M.PROP_SIZE_X = hash("size.x")
M.PROP_SIZE_Y = hash("size.y")
M.PROP_SCALE_X = hash("scale.x")
M.PROP_SCALE_Y = hash("scale.y")
function M:init(node)
self.node = self:get_node(node)
self.animation = nil
@@ -42,10 +47,10 @@ function M:get_repeat()
if not self.is_inited then
return 1, 1
end
local size_x = gui.get(self.node, helper.PROP_SIZE_X)
local size_y = gui.get(self.node, helper.PROP_SIZE_Y)
local scale_x = gui.get(self.node, helper.PROP_SCALE_X)
local scale_y = gui.get(self.node, helper.PROP_SCALE_Y)
local size_x = gui.get(self.node, M.PROP_SIZE_X)
local size_y = gui.get(self.node, M.PROP_SIZE_Y)
local scale_x = gui.get(self.node, M.PROP_SCALE_X)
local scale_y = gui.get(self.node, M.PROP_SCALE_Y)
local repeat_x = (size_x / self.animation.width) / scale_x
local repeat_y = (size_y / self.animation.height) / scale_y