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
newandadd_turtlemethods onDrawingallow 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.tomlfile has changed to includeopt-level = 3for 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
Eventenum 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 Eventand 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.Eventand its related enums are now entirely part of the turtle crate. We no longer re-export parts of thepiston_windowcrate (and in fact do not rely onpiston_windowat all anymore).- The
eventmodule,Event, and all related enums are now unstable and you need to use theunstablefeature in yourCargo.tomlto 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_svgmethod onDrawingreturns aResulttype now - The
set_pen_sizemethod 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
Speedlevels 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_colormethod updates the currently filling shape, even afterbegin_fillhas been called- Previously, you could only set the fill color before
begin_fillwas called
- Previously, you could only set the fill color before
- The
homemethod 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.rshas been updated to bitvec 0.17
drawinganddrawing_mutmethods 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_fillingmethod onTurtlestruct - New simplified
randmodule which provides a simple, stable interface for generating random numbers - New
save_svgmethod onDrawingfor exporting the current drawing to SVG - New geometric art example in
examples/geometric_art.rs - New star example in
examples/star2.rsfor drawing a star with any number of points - New bits example in
examples/bits.rsto visualize binary numbers using turtle and the bitvec crate
- Crate now uses the 2018 edition of Rust
turtle::rand::random_rangenow has an inclusive upper bound
- The
randcrate is no longer re-exported from therandmodule - Methods from
randare no longer re-exported from the crate root- Import from the
randmodule instead
- Import from the
- #92 -
wait_for_clickno 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
Colorrgbrgbahslhslahuesaturationlightnessmixrotate_huelightendarkensaturatedesaturategrayscalecomplementinvert
- LOGO interpreter example in
examples/logo_interpreter.rsnow supports the following additional commands:homesetxsetysetheading/sethshowturtle/sthideturtle/htcleanclearscreen/cspendown/pdpenup/pusetpensize/setwidth/setpw
- New colored spiral example in
examples/colored_spiral.rs
- squares example in
examples/squares.rsnow draws a colorful red/white flower with square petals
1.0.0-rc.1 - 2018-03-10
- New
Pointtype that replaces the previousPoint = [f64; 2]type alias - New fractal tree example in
examples/tree.rs - New example in
examples/draw_turtle.rsof drawing a child's drawing of a turtle
0can 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
Drawingstruct to manage properties of the drawing/window - New
drawinganddrawing_mutmethods on theTurtlestruct to allow you to access the newDrawingstruct - New methods on
Drawingstructcenterset_centerreset_centertitleset_titlesizeset_sizereset_sizemaximize(unstable)unmaximize(unstable)is_maximized(unstable)enter_fullscreenexit_fullscreenis_fullscreen
- New
Sizestruct for use withsizeandset_sizemethods onDrawing with_alphamethod toColorfor creating a new color with a desired alpha value- Added LOGO interpreter example in
examples/logo_interpreter.rswith support for a few basic commands likefd/forward,bk/back,lt/left, andrt/right
- The
background_colorandset_background_colormethods onTurtlehave moved to the newDrawingstruct- Use
turtle.drawing().background_color()instead ofturtle.background_color() - Use
turtle.drawing_mut().set_background_color(...)instead ofturtle.set_background_color(...)
- Use
- The
poll_eventmethod onTurtlehas moved to the newDrawingstruct- Use
turtle.drawing_mut().poll_event()instead ofturtle.poll_event()
- Use
- Renamed fields of
WindowResizedevent towidthandheightinstead ofxandy - Code is now licensed under MPL 2.0 instead of MIT license
- #8 - the
turn_towardsmethod now works correctly and as expected
1.0.0-alpha.7 - 2017-12-4
- New star example in
examples/empty_star.rsthat 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.rstoexamples/maze.rs/main.rsnow 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
Turtlestruct:go_toset_xset_yset_headinghomeresetwait
- New
turtle::rand::random_rangefunction for easily generating a random value within a certain range - New maze solving example in
examples/maze.rs - New snowflake example in
examples/snowflake.rsusing fractals - New squares example in
examples/squares.rsthat creates a flower with square petals
- Instead of re-exporting the
randcrate from the root of the turtle crate, it is now exposed from its own separaterandmodule- 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
Turtlestruct
to_absoluteandto_rotationmethods onSpeedare 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
Colorstruct - Floating point numbers (specifically
f64values) can now be used inset_speed - Added more documentation and tests for methods on the
Turtlestruct
1.0.0-alpha.3 - 2017-10-27
- Added
examples/nestedcubes.rs - Documentation and examples in crate root,
Turtlestruct, andColorstruct
- #5 - Using the line currently being drawn in the fill polygon
1.0.0-alpha.2 - 2017-10-21
- Added
clear()method toTurtlestruct
- Renamed
visible()method on theColorstruct toopaque - Renamed
invisible()method on theColorstruct 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.