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

2017/12/28

How do you put a single actor at the top of the world's paintOrder?

CubeGamer6 CubeGamer6

2017/12/28

#

(Yes i have read the World documentation and i know it says you can't choose the paint order of individual objects but i still wanted to know if i wasn't missing anything.)

I am currently making a scenario that has lists that show information and such, and the problem is that, because the
getWorld().setPaintOrder(java.lang.Class... classes)
doesn't allow for individual actors, i am stuck with having some actors always below others. I was thinking that there was some method like
getWorld().paintOnTop(this)
but i couldn't find anything. Basically what i want is like with Windows where you have a multiple windows on top of each other, and you can focus on one specific window just by clicking on it.
danpost danpost

2017/12/28

#
CubeGamer6 wrote...
I was thinking that there was some method like
getWorld().paintOnTop(this)
but i couldn't find anything. what i want is like with Windows where you have a multiple windows on top of each other, and you can focus on one specific window just by clicking on it.
You might, at least for now, get away with using some undocumented behavior where actors of a class are currently painted in the order they were added into the world (where the last one added is painted last -- or on top of the others). So, to have one moved to on top of others, save the world and the location coordinates of where the actor is, then remove and re-add the actor back at that same location. The PIP actors in my PIP Actor Class scenario display this behavior (drag them around and onto each other). Otherwise, you might have to create a special subclass of Actor for either the focused actor or all the others. Without knowing more about what you are trying to do, I cannot say if this would be a feasible option or not.
You need to login to post a reply.