Can anything block touchscreen buttons in Godot?

  • Thread starter Thread starter Darkmisc
  • Start date Start date
  • Tags Tags
    godot
AI Thread Summary
The discussion revolves around a user facing an issue with overlapping buttons in a Godot project, specifically wanting to press one button without triggering an underlying touchscreen button. The user cannot use the .hide() function to disable the touchscreen button entirely and is seeking a way to block part of it instead. Suggestions point towards the z-index affecting visual layering but not input event handling, indicating that the order of input events is crucial. The user considers resizing the button or changing the touchscreen button to a regular button as last resorts, emphasizing a preference for maintaining the current aesthetic. The conversation highlights the importance of understanding input event management in Godot to resolve overlapping button issues effectively.
Darkmisc
Messages
222
Reaction score
31
TL;DR Summary
I have a button that overlaps with a touchscreen button. When I press the button, it also presses the touchscreen button underneath. Can I stop this from happening?
Hi everyone

I have a button that overlaps with a touchscreen button. I want to be able to press the button without also pressing the touchscreen button. I can't use the .hide() function on the touchscreen button because I don't want to disable the whole touchscreen button.

Is there something I can use to block half of the touchscreen button (in the same way that you can block a button)?

If all else fails, I'm just going to make the button smaller or convert the touchscreen button to a regular button, but I'd rather not for aesthetic reasons. Thanks

1702447937868.png
 
Technology news on Phys.org
I'm not familiar with Godot, but that seemed to be a z-index problem to me. But looking at Godot's documentation:
https://docs.godotengine.org/en/stable/classes/class_canvasitem.html#class-canvasitem-property-z-index said:
Note: Changing the Z index of a Control only affects the drawing order, not the order in which input events are handled. This can be useful to implement certain UI animations, e.g. a menu where hovered items are scaled and should overlap others.
This seems to indicate that it is the order in which you implement the input events that determines which button event is on top. Again, not an expert with Godot, but it seems to have something to do with InputMap.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top