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.
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.
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.
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.
@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 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 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.
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.