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

2014/1/13

Set paint order of objects of same class

arjans arjans

2014/1/13

#
Hello, I'm making a game and in that game I've around 60 objects of the same class. Now I've to order them by an action. If a crane is taking up a container that container must be the highest in the z-index. The container is moving over the other ones. If I move the container now the container moves under other containers. Can anybody help me fixing that problem?
danpost danpost

2014/1/13

#
There is a cheat that currently can be used to produce the behavior you wish. When a container is first 'grabbed' by the crane, use this
1
getWorld().addObject(container, container.getX(), container.getY());
If that does not work, save the coordinates of its location in fields, remove the container from the world, then add it back in at the same location.
You need to login to post a reply.