-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Make joystick invisible when not is use #15
Comments
Hello, this feature is related to a feature that I want to add, this one here (#7 ) to be able to externalize behaviors, but I am still thinking about how to do it, on the other hand I will help you temporarily with this, just give me a moment because I have changed system and I have to reconfigure the project |
Just a thought. A quick hack would be to spawn the joystick as a child of a parent node. And have the parent node's |
The So invisible joystick when joystick not used should be possible with no changes to this library/plugin. I may create an example to show how if I get time. |
An example will be brilliant thank you. One thing to consider when using this style of joystick (one that appears wherever you touch instead of staying in a fixed location), is that the joystick area needs to be the whole screen. This means it may need to support window resize events. It also means that the "knob" can be dragged around the whole screen, instead of being limited to a max distance from where it was first clicked. |
I got close, but no cigar. https://github.com/clinuxrulz/virtual_joystick/blob/invisible-joystick-example/examples/invisible.rs The problem is the input's in |
I would probably opt to do something with the color instead of hiding it, previously there was this in the examples |
@SergioRibera that solves one problem. Another problem is |
@clinuxrulz I hadn't noticed that detail, I'll see if I can fix it |
Invisible Joystick:
|
Its working now. No change to library needed. Just needed to make interactive area Val::Percent(100) while invisible (alpha channel 0.0), and change it to its normal size when not invisible (alpha channel 1.0). |
I will close this issue to follow up on the custom behaviors feature (#7 ) |
Is your feature request related to a problem? Please describe.
The joystick takes up space on the screen.
Describe the solution you'd like
If the user is not holding down the mouse button, or is not touching the screen, the joystick should not be visible. The joystick area will appear wherever the user clicks / touches.
Describe alternatives you've considered
Create a custom system that checks for mouse state and modifies the joystick entity. But I do not know how to do this.
Additional context
N/A
The text was updated successfully, but these errors were encountered: