First, I just want to say, this is a phonomenal library. I did however run into one difficulty (which I've resolved) that I thought should perhaps be addressed in the library itself. The source of my trouble seems to be the inability to check if tweens are applied to an object (and how many).
Maybe some code will clarify. I had to write the following function:
Code: Select all
function tweenit(obj, vars)
obj.tc = obj.tc + 1
if obj.tween == nil then
obj.tween = flux.to(obj, 0.2, vars)
:ease("linear"):oncomplete(
function()
obj.tc = obj.tc - 1
if obj.tc == 0 then
obj.tween = nil
end
end)
else
obj.tween = obj.tween:after(obj, 0.2, vars)
:ease("linear"):oncomplete(
function()
obj.tc = obj.tc - 1
if obj.tc == 0 then
obj.tween = nil
end
end)
end
end
I feel like I'm explaining this badly. See the attached love file.
Also, there may be entirely different ways (easier and more sensible ways even) of solving this issue. I just know that none of the more simplistic paths I explored worked.