Can anything block touchscreen buttons in Godot?

  • Thread starter Darkmisc
  • Start date
  • Tags
    godot
  • #1
Darkmisc
213
28
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
  • #2
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.
 
  • Like
Likes Darkmisc

Related to Can anything block touchscreen buttons in Godot?

1. Can physical obstacles block touchscreen buttons in Godot?

Yes, physical obstacles such as dirt, water, or even a layer of protective film can block touchscreen buttons in Godot. Make sure to keep the screen clean and free of any obstructions for optimal performance.

2. Can software issues cause touchscreen buttons to be blocked in Godot?

Yes, software issues such as bugs or conflicts with other applications can cause touchscreen buttons to be blocked in Godot. Try restarting the device or updating the software to resolve any potential issues.

3. Can a malfunctioning touchscreen block buttons in Godot?

Yes, a malfunctioning touchscreen can block buttons in Godot. If certain areas of the touchscreen are unresponsive or not registering touch input correctly, it can affect the functionality of the buttons in the game.

4. Can incorrect calibration affect touchscreen buttons in Godot?

Yes, incorrect calibration of the touchscreen can affect the accuracy of touch input and potentially block buttons in Godot. Make sure to calibrate the touchscreen properly in the device settings to ensure optimal performance.

5. Can environmental factors such as temperature affect touchscreen buttons in Godot?

Yes, extreme temperatures can affect the responsiveness of the touchscreen and potentially block buttons in Godot. Avoid exposing the device to very hot or very cold temperatures to prevent any issues with touch input.

Similar threads

  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
1
Views
901
  • Programming and Computer Science
Replies
14
Views
3K
  • Programming and Computer Science
Replies
4
Views
759
  • Programming and Computer Science
Replies
4
Views
2K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
0
Views
856
  • Programming and Computer Science
Replies
9
Views
3K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
4
Views
712
Back
Top