All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- New
new
andadd_turtle
methods onDrawing
allow you to create a drawing and a turtle at the center of it- This API will eventually enable us to have support for multiple turtles drawing at the same time
- First few pages of the new guide have been published on https://turtle.rs/guide
- The recommended way to add the turtle crate to your
Cargo.toml
file has changed to includeopt-level = 3
for dependencies only. This is necessary because debug performance of turtle and other crates is not very good. This change increases the initial build time for any application using the turtle crate as a dependency, but should not affect incremental builds after that. See the docs or the guide for more detailed instructions.[profile.dev.package."*"] opt-level = 3
- Closing the window no longer calls
process::exit
. That means that you can create multiple windows which can be closed independently. If you continue to use a turtle after the window has closed, the thread will panic since there is no where to continue drawing the picture. This panic stops the current thread, but is not necessarily an "error". Make sure to useturtle::start()
if you plan to callTurtle::new()
orDrawing::new()
in a separate thread. - The
Event
enum has changed considerably now that we've moved to glutin, but most of the same events are still available with minor changes to existing code Event
and some of its related enums are now marked#[non_exhaustive]
. That means that we will be able to add further variants in the future if needed without it being a breaking change.Event
and its related enums are now entirely part of the turtle crate. We no longer re-export parts of thepiston_window
crate (and in fact do not rely onpiston_window
at all anymore).- The
event
module,Event
, and all related enums are now unstable and you need to use theunstable
feature in yourCargo.toml
to enable them. These may change as we figure out what event handling should look like in the turtle crate. - The pen used by the turtle is now circular and has circular ends at higher pen thicknesses. This matches the behaviour of the Python turtle module and is useful for being able to smoothly draw curves and circles using the turtle crate.
- The
save_svg
method onDrawing
returns aResult
type now - The
set_pen_size
method no doubles the given thickness value- This means that you may have to adjust your program to set the pen thickness to double the value you were setting previously
- The
Speed
levels change the amount of time it takes to draw something linearly- This may change again in the future as we decide how to best use the different speed levels
- The
set_fill_color
method updates the currently filling shape, even afterbegin_fill
has been called- Previously, you could only set the fill color before
begin_fill
was called
- Previously, you could only set the fill color before
- The
home
method is no longer an instantaneous change in the turtle's position- To move the turtle instantly, use
turtle.set_speed("instant")
- To avoid drawing a line while moving back to the origin, use
turtle.pen_up()
- To move the turtle instantly, use
- The bits example in
examples/bits.rs
has been updated to bitvec 0.17
drawing
anddrawing_mut
methods have been removed due to soundness issues that these methods would introduce when multiple turtle support is added. UseDrawing::new()
anddrawing.add_turtle()
instead to get access to the drawing.
- #30 - potentially breaking:
fill polygons now start at the current position when
begin_fill()
is called. We previously had a bug where we would start at the end of the next line afterbegin_fill()
was called.
1.0.0-rc.3 - 2019-12-11
- New
is_filling
method onTurtle
struct - New simplified
rand
module which provides a simple, stable interface for generating random numbers - New
save_svg
method onDrawing
for exporting the current drawing to SVG - New geometric art example in
examples/geometric_art.rs
- New star example in
examples/star2.rs
for drawing a star with any number of points - New bits example in
examples/bits.rs
to visualize binary numbers using turtle and the bitvec crate
- Crate now uses the 2018 edition of Rust
turtle::rand::random_range
now has an inclusive upper bound
- The
rand
crate is no longer re-exported from therand
module - Methods from
rand
are no longer re-exported from the crate root- Import from the
rand
module instead
- Import from the
- #92 -
wait_for_click
no longer results in very high CPU usage (fixed busy waiting)
1.0.0-rc.2 - 2018-08-15
- New website: https://turtle.rs
- New methods on
Color
rgb
rgba
hsl
hsla
hue
saturation
lightness
mix
rotate_hue
lighten
darken
saturate
desaturate
grayscale
complement
invert
- LOGO interpreter example in
examples/logo_interpreter.rs
now supports the following additional commands:home
setx
sety
setheading
/seth
showturtle
/st
hideturtle
/ht
clean
clearscreen
/cs
pendown
/pd
penup
/pu
setpensize
/setwidth
/setpw
- New colored spiral example in
examples/colored_spiral.rs
- squares example in
examples/squares.rs
now draws a colorful red/white flower with square petals
1.0.0-rc.1 - 2018-03-10
- New
Point
type that replaces the previousPoint = [f64; 2]
type alias - New fractal tree example in
examples/tree.rs
- New example in
examples/draw_turtle.rs
of drawing a child's drawing of a turtle
0
can no longer be passed toset_speed
, use"instant"
orSpeed::instant()
instead
- #63 - Disabling srgb to avoid pixel format errors
1.0.0-alpha.8 - 2017-12-22
- New
Drawing
struct to manage properties of the drawing/window - New
drawing
anddrawing_mut
methods on theTurtle
struct to allow you to access the newDrawing
struct - New methods on
Drawing
structcenter
set_center
reset_center
title
set_title
size
set_size
reset_size
maximize
(unstable)unmaximize
(unstable)is_maximized
(unstable)enter_fullscreen
exit_fullscreen
is_fullscreen
- New
Size
struct for use withsize
andset_size
methods onDrawing
with_alpha
method toColor
for creating a new color with a desired alpha value- Added LOGO interpreter example in
examples/logo_interpreter.rs
with support for a few basic commands likefd
/forward
,bk
/back
,lt
/left
, andrt
/right
- The
background_color
andset_background_color
methods onTurtle
have moved to the newDrawing
struct- Use
turtle.drawing().background_color()
instead ofturtle.background_color()
- Use
turtle.drawing_mut().set_background_color(...)
instead ofturtle.set_background_color(...)
- Use
- The
poll_event
method onTurtle
has moved to the newDrawing
struct- Use
turtle.drawing_mut().poll_event()
instead ofturtle.poll_event()
- Use
- Renamed fields of
WindowResized
event towidth
andheight
instead ofx
andy
- Code is now licensed under MPL 2.0 instead of MIT license
- #8 - the
turn_towards
method now works correctly and as expected
1.0.0-alpha.7 - 2017-12-4
- New star example in
examples/empty_star.rs
that draws the outline of a star without needing any lines within it - New dragon curve example in
examples/dragon.rs
- The maze example has moved from
examples/maze.rs
toexamples/maze.rs/main.rs
now that multi-file examples are supported in Rust 1.22
- #27 - the turtle crate now has a two-process architecture which allows it to run on MacOS
1.0.0-alpha.6 - 2017-11-14
- New methods on the
Turtle
struct:go_to
set_x
set_y
set_heading
home
reset
wait
- New
turtle::rand::random_range
function for easily generating a random value within a certain range - New maze solving example in
examples/maze.rs
- New snowflake example in
examples/snowflake.rs
using fractals - New squares example in
examples/squares.rs
that creates a flower with square petals
- Instead of re-exporting the
rand
crate from the root of the turtle crate, it is now exposed from its own separaterand
module- Write
use turtle::rand::{Rand, Rng}
to use the new module
- Write
- Negative angles passed to
right()
andleft()
no longer result in very long animation times (caused by integer overflow)
1.0.0-alpha.5 - 2017-10-29
- Added more documentation and tests for methods on the
Turtle
struct
to_absolute
andto_rotation
methods onSpeed
are private now as they represent unstable implementation details that should not be relied on
1.0.0-alpha.4 - 2017-10-28
- Hexadecimal colors are now supported for use with the
Color
struct - Floating point numbers (specifically
f64
values) can now be used inset_speed
- Added more documentation and tests for methods on the
Turtle
struct
1.0.0-alpha.3 - 2017-10-27
- Added
examples/nestedcubes.rs
- Documentation and examples in crate root,
Turtle
struct, andColor
struct
- #5 - Using the line currently being drawn in the fill polygon
1.0.0-alpha.2 - 2017-10-21
- Added
clear()
method toTurtle
struct
- Renamed
visible()
method on theColor
struct toopaque
- Renamed
invisible()
method on theColor
struct totransparent
1.0.0-alpha.1 - 2017-10-20
- Using absolute URLs so that images in README.md work on crates.io
1.0.0-alpha.0 - 2017-10-20
Initial release of first version of turtle crate.