flux
flux copied to clipboard
make flux.after a top-level method
Sometimes I want to make chains of tweens, like so
local f = flux.to(...)
f = f:after(...)
f = f:after(...)
this works pretty nice, except for the fact that the callsite for the first tween is different from the other tweens. this can be inconvenient, for example, when doing this in a loop:
local f
for _, obj in ipairs(objects) do
if not f then
f = flux.to(...)
else
f = f:after(...)
end
end
I'm wondering if it's possible to move this logic up, so for example there could be a flux:after() method that, because it's called on the flux object and not a tween object, behaves like flux.to(). that would look like this in a loop:
local f = flux
for _, obj in ipairs(objects) do
f = f:after(...)
end