godotengine / godotengine/godot
TextureButton texture_click_mask has no effect, is unset on project reload
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- 4.2.1.stable
- 4.2.stable
- 4.1.stable
### System information
macOS 12.6.6
### Issue description
Adding textures to a TextureButton with a click mask does not work - there are several things going wrong:
- Adding a freshly (re)imported click mask makes the texture_normal disappear on run, but the mask works as expected
- Reloading the project removes the mask (every time)
- Adding the mask again does not make the button disappear, but it also does not have any effect
All of these are probably related, but they could also be independent. To me, it seems that something is wrong either with the BitMap, TextureButton, or the way that it is applied
### Steps to reproduce
1. TextureButton
2. Add a texture with alpha to normal, duplicate and recolour it slightly, apply to pressed (optionally also to hover)
3. duplicate and import as BitMap, pretty sure from alpha and from black & white have the same issue
4. apply to texture_click_mask
5. run, see if the button is visible and the area is masked
6. reload the project
7. check if the masks are still applied
8. run, check again
### Minimal reproduction project (MRP)
[ClickMaskMinimal.zip](https://github.com/godotengine/godot/files/14030705/ClickMaskMinimal.zip)
note: click masks might not be applied, due to them being unset by on project open
Contributor guide
Research direction
Open ClickMaskMinimal.zip and reproduce the behavior with TextureButton and its texture_click_mask before and after reloading the project. Investigate the reported interaction between TextureButton and BitMap; done means the normal texture remains visible, the mask affects the clickable area, and the mask persists after reload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100