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

Calling setState() in the onDirectionChanged property will make the joystick not working... #26

Open
phandrieu opened this issue Jul 8, 2020 · 2 comments

Comments

@phandrieu
Copy link

Hey,
Is there a way to call setState in the onDirecitonChanged callback or is there another way to do it ?
Thanks :)

@metanav
Copy link

metanav commented Aug 11, 2020

I am facing same issue.

@luistrivelatto
Copy link

+1. It seems any call to setState that triggers constructing a new JoystickView widget makes it return to the (0, 0) position. E.g., I set a timer that calls setState every 100 milliseconds. Then it works for those 100 milliseconds, then when the setState call is triggered and the parent widget is rebuilt, the JoystickView gets back to (0, 0).

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

3 participants