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

2020/11/18

Paint Order for instance

SwaggyXiao SwaggyXiao

2020/11/18

#
Hi, now i have a class called Human. I want the human to be under the Display.class when the Human's bool variable paintBehind is true, but on it when the bool = false. Is there any way to do that? I know there is a World method called setPaintOrder, but it's setting the whole class. Mine is for instance where Human(paintBehind=true) and Human(paintBehind=false) are exist at the same time, but different paint order?
SwaggyXiao SwaggyXiao

2020/11/18

#
Go to my simulation (Link: https://www.greenfoot.org/scenarios/26802) and click the facility, there will be a display window coming out. I only want the big human to be displayed, but all the small humans are behind, but they all belong to the same class
danpost danpost

2020/11/18

#
There is an undocumented behavior that actors are painted in the order they are added into the world. This would put the most recently actor on top of everything else. So, you can remove and add the one you want on top at any time.
You need to login to post a reply.