hide

Category:Turtle

hide()

Category: Turtle

Makes the turtle invisible 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


// Hide the turtle and move it up from the turtle starting postion at the center of the screen.
hide();
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

hide();

Parameters

hide() does not take any parameters.

Returns

No return value. Alters the display only.

Tips

  • show() is often used with hide.
  • 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