Can anything block touchscreen buttons in Godot?

  • Thread starter Darkmisc
  • Start date
  • Tags
    godot
  • #1
Darkmisc
220
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
  • #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

FAQ: Can anything block touchscreen buttons in Godot?

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.

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.

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.

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.

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.

Back
Top