I've drawn two objects in Python turtle, when the second object draws on screen, it comes in front of the first object and hides it. I don't want that, I want the first object to come in front. How can I do that?
Asked
Active
Viewed 533 times
2 Answers
0
You could gather your objects into a list and draw them in reverse order:
a = [ ... ] # objects that respond to draw
for i in reversed(a):
i.draw()

quamrana
- 37,849
- 12
- 53
- 71
-
these are actually two images. – Ali Danish Aug 24 '17 at 15:27
-
Perhaps you could update your question with the code you are using. – quamrana Aug 24 '17 at 15:37
0
The rule when it comes to two turtle objects at the same location is: last to arrive is on top
There are (random) exceptions, see my answer to Make One Turtle Object Always Above Another.
these are actually two images.
Assuming your images are turtles, via turtle.register_shape()
(or its alias) and turtle.shape()
, then you may be able to force the rear image/turtle to the front, even if drawn first, by making it do some sort of null motion, eg. turtle.forward(0)
, forcing it to arrive later.

cdlane
- 40,441
- 5
- 32
- 81