Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if a tween is active #14

Open
theRealProHacker opened this issue Jan 12, 2021 · 1 comment
Open

Check if a tween is active #14

theRealProHacker opened this issue Jan 12, 2021 · 1 comment

Comments

@theRealProHacker
Copy link

Is there a possibility to check whether a tween is active or not? Do I have to do it with :oncomplete ? Or can I manually check it if I store the tween as a variable like this:

myTween=flux.to(self, 4, {x=300})
...
if myTween:isActive() then
...
end
@Krunklehorn
Copy link

I'm not a contributor at all, but examining the source code we can see flux:to() wraps flux:add() which assigns the object and it's tween to a table in the flux instance, as well as the flux instance itself. These are later removed during flux:remove() which is called automatically by tween:stop().

I haven't tested this myself yet, but with this in mind, flux[obj][tween] == true should be sufficient to check if a tween exists (i.e. is a valid handle) and is actively being controlled by this instance of flux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants