Topic was automatically imported from the old Question2Answer platform.
Asked By
ondesic
No matter how hard I try, I can’t load a black and white image to the Click Mask of a TextureButton. I have dragged a PNG but it won’t take it. I have clicked “Load” and I can select the PNG, but when I press Open, the Click Mask stays
Here is an answer to my own question. There is something definitely wrong. You should be able to drag a PNG over to the property and just have it work.
BUT there are 2 work around I have found. One is to use code, the other is:
Select the PNG you want as a Mask.
Find the “Import” tab and select it.
There is a drop down menu under “Import As”
Select “Bitmap”
The settings should be “Black & White”
Now click “Reimport”
You now should be able to drag the PNG file over into the “Click Mask” property.
I hope this gets fixed in the future.
I agree there’s a problem with using TextureButton masks. In Godot 3.1.1 reimporting the mask closes and restarts the entire editor !
I also tried using a black and white jpg image as a mask, but that didn’t work either unless you reimport …
@ondesic : thanks for the workaround ! I wouldn’t have thought about doing that.
siska | 2019-05-28 13:53
“Black & White” works if you have a black background. Alternately, you can use “Alpha” to make your mask off the alpha channel if your background is transparent.
Strangely, you cannot make a new “BitMap” resource and load the image into that. The BitMap resource has no way to load a file.
CharlesMerriam | 2020-10-21 17:58
Thanks so much I was very confused by the texturebutton bitmap thing.