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

2015/8/26

Bring Objects To The Front

Camyh15 Camyh15

2015/8/26

#
Hello, I'm trying to make pong and I want the ball to be in front of the middle line, but the line is in front of the ball. How can you fix this, is this with code or something else.
danpost danpost

2015/8/26

#
Two ways: (1) add a 'setPaintOrder' line of code in your world constructor; or (2) add the line into the world first (before the ball); this however is due to undocumented behavior
Camyh15 Camyh15

2015/8/27

#
How do you use the setPaintOrder code?
fejfo fejfo

2015/8/27

#
the arguments are classes in the order that the have to be painted :
1
setPaintOrder(Top.class,Middle.class); //unlisted ones will be on the back
Camyh15 Camyh15

2015/8/27

#
Thank you! That's helped a lot!
You need to login to post a reply.