Is there anyway to invert colors?

So I am developing a project that mainly uses the colors black and white. My problem is that the UI sometimes overlays on top of the obstacles.
GdevelopFourmPic#1
So is there any way to invert the color to white based on if its overlaying black or anything?

Just an example of what I am looking for.
GdevelopFourmPic#2

Hi, not sure if this is an optimal way to do that but you could try the “Object masking extension”. You would need the UI in black and white, and the white version would become visible when the black obstacles overlap.

Ok, sounds promising. I’ll check it out!

So I have tried using it but it doesn’t work with text and requires a second sprite. Is there a way I could create it using an effect or are there other methods that could work?

Alright, I hope someone chimes in and suggests something better.

I’ve tried looking around for an easy solution. I had no luck. Though, it would be cool if there were an effect available which reverses color on masking. I only tested stuff on safari on my iPad so I didn’t search for a solution thoroughly. But, I bet there is a more advanced way to make it work, just don’t know how.

You will be able to do this using the sprite masking extension, but you will have to duplicate your objects.

Here is how I did it with simulating silhouettes. 2D silhouette visible throw walls - #11 by Silver-Streak

You should be able to do it with text the same way (duplicate objects already in the other color).

Outside of that, you can use a layer effect to reverse the color palette of an object or entire layer, but not parts of an object (without masking).

n/m, I didn’t see that others have already replied.

@Silver-Streak your link is incomplete…

Ignore that - it had too many characters. It should read https://forum.gdevelop.io/t/2d-silhouette-visible-throw-walls/40501/

1 Like