Drawing simple shapes

I need to handle things like fading screen to black or white.
The way I solve this is by importing a portrait ratio’d black (or white) png image, and scale to cover entire screen. Put this into a sprite > into a game object and change the sprite’s alpha.

This feels a bit convoluted and I end up with these big black and white blocks in my collection view covering my gui. Simple enough, I move them out of way and put into the right position at game startup in scripts init function.

At this point I wonder if there’s a way to do this a bit cleaner, just define a width/height of a fully opaque color and draw to screen, and change/animate alpha on the fly?

Should I send messages directly to the renderer maybe? Will that introduce challenges to z-ordering my overlay vs objects already on screen?

You could do that by dynamically created GUI nodes. Set it with full alpha initially and then animate color.

2 Likes

Nice, good idea!