mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
remove druid_animate, update docs
This commit is contained in:
@@ -1,16 +1,28 @@
|
||||
local ui_animate = require("druid.helper.druid_animate")
|
||||
|
||||
|
||||
local M = {}
|
||||
|
||||
|
||||
local function scale_to(self, node, to, callback, time, delay, easing)
|
||||
easing = easing or gui.EASING_INSINE
|
||||
time = time or M.SCALE_ANIMATION_TIME
|
||||
delay = delay or 0
|
||||
time = time or 0.25
|
||||
gui.animate(node, gui.PROP_SCALE, to, easing, time, delay,
|
||||
function()
|
||||
if callback then
|
||||
callback(self, node)
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
function M.back_scale_animation(self, node, target_scale)
|
||||
ui_animate.scale_to(self, node, target_scale)
|
||||
scale_to(self, node, target_scale)
|
||||
end
|
||||
|
||||
|
||||
function M.tap_scale_animation(self, node, target_scale)
|
||||
ui_animate.scale_to(self, node, target_scale,
|
||||
scale_to(self, node, target_scale,
|
||||
function()
|
||||
M.back_scale_animation(self, node, self.scale_from)
|
||||
end
|
||||
@@ -19,7 +31,7 @@ end
|
||||
|
||||
|
||||
function M.hover_scale(self, target, time)
|
||||
ui_animate.scale(self, self.anim_node, target, time)
|
||||
gui.animate(self.anim_node, "scale", target, gui.EASING_OUTSINE, time)
|
||||
end
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user