Add support for blend modes to 2D widget bundles
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## What problem does this solve or what need does it fill?
I want to have a button whose icon supports alpha blending, i.e. transparency.
Currently the only way to enable alpha blending is to manipulate the image object's properties. However, when building UIs from bundles, you generally just pass the Image asset handle to the bundle. It's very cumbersome to have to open up the asset and twiddle its properties directly.
## What solution would you like?
There are several possible solutions.
* One approach is to allow specifying the alpha mode in the Asset V2 ".meta" file as part of the loader settings. This would change the blend mode for that image by the loader. This is probably the easiest to implement, but the downside is that it means that all users of the image would be constrained to use the same blend mode.
* The other option is to make it part of the bundle, similar to how other Style properties are handled, either by adding a new field to one of the existing components or by adding a new component. This is more flexible, but probably requires more labor to implement.
## Additional context
Since I'm currently writing a stylesheet system, it would be nice if I could specify the blend mode as a stylesheet property, something like "blend-mode": "AlphaBlend" or something.
Contributor guide
Assessment
This issue has not been assessed yet.