Skip to content

Conversation

maxsoulard
Copy link

Simulates joystick click by calculating if the virtual stick position is
within the canvas circle.
basic example also updated to test the center position.

Simulates joystick click by calculating if the virtual stick position is
within the canvas circle.
basic example also updated to test the center position.
@jeromeetienne
Copy link
Owner

what about using current callbacks instead ? like here

It is more flexible and let the user chooses the behavior it want for the click

@maxsoulard
Copy link
Author

I am not sure to fully understand what you are saying.
As you probably saw, the code I wrote allow to determine if the stick is inside or outside the joystick base circle. I am using that in my app to simulate a stick click (as on physical controllers).
Maybe my pull request naming is not well chosen. Or maybe I didn't understand at all what you proposed :)

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

Successfully merging this pull request may close these issues.

2 participants