show

Category:Turtle

show()

Category: Turtle

Makes the turtle visible at its current location.

Sometimes seeing the turtle icon is helpful when it is drawing something, other times you might want to hide the turtle so it does not obscure the picture.

Examples


// Show the turtle and move it up from the turtle starting postion at the center of the screen.
show();
moveForward();

Example: Peek-a-Boo Use buttons to hide and show the turtle.

// Use buttons to hide and show the turtle.
button("hide-turtle", "hide");
button("show-turtle", "show");
onEvent("hide-turtle", "click", function() {
  hide();
});
onEvent("show-turtle", "click", function() {
  show();
});

Syntax

show();

Parameters

show() does not take any parameters.

Returns

No return value. Alters the display only.

Tips

  • hide() is often used with show().
  • The turtle's ability to draw is not effected by the show() or hide() commands, which only control if the turtle icon is displayed or not.

Found a bug in the documentation? Let us know at documentation@code.org

Found a bug in the documentation? Let us know at documentation@code.org