Turtle Graphics - Turtle and Window Control
[Index] [<< Previous section: Curved Paths] [Next section: Pen and Background Control >>]
showturtle
st
- Description: shows the turtle on the canvas.
hideturtle
ht
- Description: hides the turtle from the canvas.
clean
- Description: clears the graphics canvas.
clearscreen
cs
- Description: clears the graphics canvas and moves the turtle at the initial position.
- This command is the same as
clear
andhome
together. - This command is the same as
wrap
- Description: (default) tells the turtle to enter wrap mode.
From now on, if the turtle is asked to move past the boundary of the graphics window, it will "wrap around" and reappear at the opposite edge of the window.
- Example: wrap fd 300
- The result is shown bellow:
- Example: wrap fd 300
window
- Description: tells the turtle that can move past the edges of the screen, unbounded.
The visible canvas is considered as just part of an infinite graphics plane; the turtle can be anywhere on the plane.
- Example: window fd 300
- The result is shown bellow:
- If you lose the turtle,
home
will bring it back to the center of the window. - Example: window fd 300
fence
- Description: tells the turtle that it can't move past the edges of the screen.
From now on, if the turtle is asked to move past the boundary of the graphics canvas, it will move as far as it can and then stop at the edge.
- Example: fence fd 300
- The result is shown bellow:
- Example: fence fd 300
[Index] [<< Previous section: Curved Paths] [Next section: Pen and Background Control >>]