Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Opacity #6956

Open
togetherwithasteria opened this issue Dec 14, 2022 · 3 comments
Open

UI Opacity #6956

togetherwithasteria opened this issue Dec 14, 2022 · 3 comments
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Feature A new feature, making something new possible

Comments

@togetherwithasteria
Copy link
Contributor

togetherwithasteria commented Dec 14, 2022

What problem does this solve or what need does it fill?

This allows fade-in fade-out transitions for UI bundles, and setting the overall transparency of UI bundles, which I think is useful in many games to unclutter the window when it's not really important (but may be needed) or as a configuration in games for players who wish to unclutter their view and see more what's going on.

What solution would you like?

To be discussed.

What alternative(s) have you considered?

For my own game, I am considering trying to do pop-in pop-out animation with Transform. It allows a more cartoony transition, but for others this might not been what they prefer for their game theme.

It's possible to change the opacity of TextBundles and background colors but that's a major hack and can't be used with ImageBundle

Additional context

https://developer.mozilla.org/en-US/docs/Web/CSS/opacity

@togetherwithasteria togetherwithasteria added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Dec 14, 2022
@alice-i-cecile alice-i-cecile added A-UI Graphical user interfaces, styles, layouts, and widgets and removed S-Needs-Triage This issue needs to be labelled labels Dec 15, 2022
@viridia
Copy link
Contributor

viridia commented Nov 28, 2023

The way I would like to see this done is with buffered rendering. So for example, if you have an animated dialog that needs to transition (fade-in, scale, etc.) it would be rendered to an offscreen render target, and then the render target would be rendered to the main view. This allows you to control the opacity of the entire dialog, instead of making the children individually translucent (which would look bad).

I propose that there be some Component that you attach to a UI node that says "render all of the children of this node onto this offscreen rendertarget", at which point the node itself simply sets that same render target as its background image. You can then either introduce a new Opacity style property, or use the existing behavior where the alpha component of the background color is multiplied with the background image.

@togetherwithasteria
Copy link
Contributor Author

This allows you to control the opacity of the entire dialog, instead of making the children individually translucent (which would look bad).

Yeah. I'm not exactly sure if this is accurate but generally in raster programs, opacity in folders works but occasionally normal mode makes it better?

@UkoeHB
Copy link
Contributor

UkoeHB commented Sep 17, 2024

See #15256 for a proposed solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Feature A new feature, making something new possible
Projects
None yet
Development

No branches or pull requests

4 participants