TextureButton Collider Broken

Hi! I’m new to Godot and just got a bug with my TextureButton that I can’t figure out.

Question

I have a TextureButton node that, obviously acts as a button, having a normal texture and a pressed texture. But for some reason, the area where I can click is shifted downward, as shown in the image below. I’ve already tried setting the pivot to 0.5 x and 0.5 y as I have seen many people try, but that hasn’t worked. I’ve also attached an image of the inspector of the button below.

Images

Thanks in advance!

Still having this issue. Welcome to any advice!

What happens if you move the game window at runtime?

Well, the game window is full screen (1920x1080) so I can’t really move it. If it helps, my Control that holds the TextureButton is also 1920x1080. Here is the Control node’s inspector panel.

First, please check if you have a click mask. It overrides the clickable area for the button.

I assume you don’t have a click mask set. So it means the button would use its own default rect.

One way to check its own rect boundary: During runtime, go to the remote scene, click on the button node. It should show the rect of that node in the game.

Check if the rect boundary is different than the shown texture. If that’s the case, we can debug it more detailed.

You are correct in saying I don’t have a click mask. I did check the rect on the button, and it shows the rect being perfectly conformed to the button.

1 Like

I tried to reproduce this issue and could not.
Can you tell me what did you use as a texture; New AtlasTexture, New ImageTexture, other?

Also, you can try to create this button on a blank project to see if something else is interfering with it.

It’s weird. Is it possible to make a small project with the same issue and put it on github? So we can check it in our devices.

@sancho2, I’m not sure what you mean, I’m just using a normal .png texture file. The type is CompressedTexture2D.

Here is the small reproduction of this, that seems to have the same issue when I’ve tested it. GitHub - theTacocat88/DebuggingTextureButton . I’ve changed all the project settings to match the original.

I copied and ran your project and I don’t see the issue.

Btw, there is this recent topic that talks about the same issue it seems. Maybe you can try to see what’s the common divisor between you?

I believe I’ve figured it out. It seems to only happen when I’m in fullscreen (can’t see the top bar of the runtime window), but when I am not in fullscreen the button seems to work perfectly fine. Not sure if this is a problem with Godot or just my monitor. I can’t seem to record the change from when it is in full screen and when it isn’t but the button seems to be clickable in fullscreen where it would be if it wasn’t in fullscreen.

I also checked the other forum post you linked, and it seems to be similar to mine, but I can’t really tell for sure as it doesn’t have much info on the issue.

I tried changing between fullscreen and windowed modes, but still can’t reproduce your issue…

extends Node2D


func _unhandled_input(event: InputEvent) -> void:
	if event.is_action_pressed("ui_accept"):
		get_window().mode = Window.MODE_FULLSCREEN
	if event.is_action_pressed("ui_cancel"):
		get_window().mode = Window.MODE_WINDOWED

It’s weird that you have this issue, but it must be somehow related to something outside of Godot.

I had a similar problem with some prior version of Godot on one of my machines. It started happening “out of the blue”. The whole viewport was drawn vertically “misaligned”, with the offset roughly the height of a window menu bar. It happened even with the editor gui. It aligned itself when a window was repositioned by dragging.

It’s likely a gpu driver issue. Updating the driver fixed it for me. So try updating or tracing back. You can also delete your .godot folder in case some weirdness accumulated there.

1 Like

Thanks so much! This worked for me. Sadly, being in 1920x1080 also causes this issue, so I have to use a smaller resolution while I am in development. Thanks for your help and have a good day.

Edit: Actually just ended up changing setting in Project Settings from windowed to fullscreen.