This site requires JavaScript, please enable it in your browser!
Greenfoot back
Klumb
Klumb wrote ...

2017/7/5

How to create a mask?

Klumb Klumb

2017/7/5

#
hello! I'd like to create a mask, an image that will cover everything but certain actors. I imagined 2 ways of doing it: - set the paint order so that the actors I don't want to be masked are painted last. - draw the mask last but make holes in it where the actors are. the first option is only possible in greenfoot (AFAIK) for all the actors of the same class (not what I want). if you know a way to set the paint order of the actors, I'd like to know it. And for the second option, I don't know how to do it. thanks in advance for you're help.
danpost danpost

2017/7/5

#
I have found that there is an undocumented behavior that the actors are drawn in the order they are placed into the world in. This could change (or even, may already have changed). If this has not changed, you could add the actors into the world starting with the one that is to be behind others and work your way up to that which is to be painted last. If you require the order to change at some point, you will need to remove and, using the new order, re-add all the actors at their current locations.
Klumb Klumb

2017/7/6

#
I can try to use it. add the mask, remove the actors, and add them back where they were.
You need to login to post a reply.