I have a TextureButton and have created a BMP mask and applied it. However, when the program runs, I can still click the button anywhere on its surface and it will still press. Besides loading the mask, is there something else needed to make the button only click on the mask area?

Seems to work for me. I used a PNG image with no problem. It should be a black and white image (no alpha channel) with the white set to the clickable area and the black to the non-clickable area. After you import, go to the Import tab and make sure the type is set to BitMap (not Texture) and re-import and it may ask you to restart Godot. Then add it to the Mask property on the TextureButton and it should work.

Yes. I have a png that I imported as a BitMap, restarted and added it to the click mask. For some reason it still isn't honoring the mask.

@ondesci Can you upload a minimal reproduction project?

Note, I used the pressed() signal to detect mouse clicks and that worked. You can also use gui_input(). The regular input() is global so won't work.

I have used both _gui_input() and pressed(). I'll create a minimal project (sometimes when I do this I figure out the problem)

I was able to reproduce the problem and figure out where it stems from. I have TextureButton with a TextureRect as a child. To add an extra layer of imaging.

Run the app and start moving the mouse over the dot. Even with a Click Mask applied the TextureButton will not honor it. It will show the hover image when hovering even outside of the Click Mask. If you hide the TextureRect inside, the Click Mask works.

The TextureRect should have no influence over it's parent's Hover signal.

Well this makes sense. The TextureRect is a child of the TextureButton, so then it becomes one object basically. So this is not a bug, but correct and expected behavior. All you need to do is click on the TextureRect, then look on the Inspector on the right and under Mouse > Filter select Ignore. Then the TextureRect will not process mouse input and the TextureButton will only use the mask.

a year later