mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 10:02:18 +02:00
Other updated
This commit is contained in:
@@ -70,4 +70,25 @@ function M:setup_rich_text()
|
||||
end
|
||||
|
||||
|
||||
---@param properties_panel properties_panel
|
||||
function M:properties_control(properties_panel)
|
||||
local vertical_time = panthera.get_time(self.animation_vertical)
|
||||
|
||||
local vertical_slider = properties_panel:add_slider("ui_animation_vertical", vertical_time, function(value)
|
||||
panthera.set_time(self.animation_vertical, "vertical", value)
|
||||
end)
|
||||
|
||||
local horizontal_time = panthera.get_time(self.animation_horizontal)
|
||||
|
||||
local horizontal_slider = properties_panel:add_slider("ui_animation_horizontal", horizontal_time, function(value)
|
||||
panthera.set_time(self.animation_horizontal, "horizontal", value)
|
||||
end)
|
||||
|
||||
self.on_update:subscribe(function()
|
||||
vertical_slider:set_value(panthera.get_time(self.animation_vertical))
|
||||
horizontal_slider:set_value(panthera.get_time(self.animation_horizontal))
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
@@ -19,25 +19,6 @@ function M.get_examples()
|
||||
root = "animation_blend/root",
|
||||
code_url = "example/examples/panthera/animation_blend/animation_blend.lua",
|
||||
widget_class = require("example.examples.panthera.animation_blend.animation_blend"),
|
||||
properties_control = function(instance, properties_panel)
|
||||
---@cast instance examples.animation_blend
|
||||
local vertical_time = panthera.get_time(instance.animation_vertical)
|
||||
|
||||
local vertical_slider = properties_panel:add_slider("ui_animation_vertical", vertical_time, function(value)
|
||||
panthera.set_time(instance.animation_vertical, "vertical", value)
|
||||
end)
|
||||
|
||||
local horizontal_time = panthera.get_time(instance.animation_horizontal)
|
||||
|
||||
local horizontal_slider = properties_panel:add_slider("ui_animation_horizontal", horizontal_time, function(value)
|
||||
panthera.set_time(instance.animation_horizontal, "horizontal", value)
|
||||
end)
|
||||
|
||||
instance.on_update:subscribe(function()
|
||||
vertical_slider:set_value(panthera.get_time(instance.animation_vertical))
|
||||
horizontal_slider:set_value(panthera.get_time(instance.animation_horizontal))
|
||||
end)
|
||||
end,
|
||||
}
|
||||
}
|
||||
end
|
||||
|
Reference in New Issue
Block a user