elmarti / react-joystick-component

Tiny, multitouch, component driven joysticks in react
MIT License
87 stars 27 forks source link

Default or init stick position #58

Closed gokhangunduz closed 1 year ago

gokhangunduz commented 1 year ago

Is your feature request related to a problem? Please describe. The object we want to control with the joystick can be in motion when the component is rendered.

Describe the solution you'd like With a props named "initPosition" or "defaultPosition", it is correct to give the position that the joystick should see in the first render.

Describe alternatives you've considered I didn't see any other alternative.

Additional context When the joystick is used in sticky mode, the controlled object moves with a constant acceleration when the joystick control is released. Many parameters, such as the user navigating to another page, may require re-rendering for the joystick. In this case, it is an incorrect display that the joystick is in the 0 position while the object is moving with constant acceleration.

elmarti commented 1 year ago

Hi! Thanks for the Issue - this seems to be a similar problem to this one: https://github.com/elmarti/react-joystick-component/issues/40

I didn't settle on a solution for this, but I think it would look something like this:

The areas where i didn't make a decision are

I'll have a play with the above now

gokhangunduz commented 1 year ago

Hello, thank you very much for your interest. I will be eagerly waiting for the new version :)

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 6.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

elmarti commented 1 year ago

See a demo here: https://elmarti.github.io/react-joystick-component/?path=/story/joystick-examples--position-override-with-second-joystick Enjoy!

gokhangunduz commented 1 year ago

Thanks for everything 👍🏻