The API Documentation below will help you learn about the various things you can do with this library.
If this is your first time using Rust or using this library, read the Guide on turtle.rs to learn how to start.
Turtle struct documentation contains information about the various
things you can do with the
Turtle instances you create. The
and its submodules contain hundreds of constants that you can use as color values.
As a convenience, you can use the color name listed with each constant in a string instead of the
constant itself. See that module for more information about how to use different colors.
For advanced users, the
Event enum documentation provides information
about how you can create an event loop. This allows you to draw things in response to
certain events like the mouse moving, keys being pressed, and more.
Turtle struct contains a few convenience methods so you can do some common event-related
things without creating the entire event loop. For example, use
wait_for_click() to wait for the user to click
anywhere on the screen before proceeding.
Color types and constants
Event handling (mouse, keyboard, controller, touch screen, etc.)
A turtle with a pen attached to its tail
Represents the supported movement and rotation speeds
An angle value without a unit
Any distance value (positive or negative)
A point in 2D space: [x, y]