App Lab Documentation

show

Category:Turtle

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

Basic Example

// 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();

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 support@code.org.