tkinter-ish canvas port to Rust
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ThyW 35e47f7670 circle fix 5 months ago
src circle fix 5 months ago
.gitignore finished button, added TODO 7 months ago
Cargo.toml circle fix 5 months ago circle fix 5 months ago circle fix 5 months ago reorganized file structure, did a bunch of documentation 7 months ago
example.png General cleanup, fixed error handling and docs 6 months ago


A an attempt to port Tk's Canvas, written in Rust and SFML, aiming to provide simple and Python-like syntax.


use canrust::canvas::{Canvas, Color}; 

fn main() {
      // Create a canvas:
      // size, name, background color
      let mut canvas = Canvas::new((800, 600), "Canvas", Color::WHITE);
      // create shapes:
      // laser eyes go brrrrr
      canvas.create_circle((1., 1.), 20., Color::BLACK, None, None);
      canvas.create_rectangle((20., 20.), (30., 80.), Color::BLACK, None, None);
      canvas.create_line((18., 20.), (18., 80), 2., Color::RED, None, None);
      canvas.create_line((32., 20.), (32. 80.), 2., Color::RED, None, None);
      // call the mainloop, objects will keep rendering as long as the program is running


  • SFML 2.6
  • CSFML 2.6


Add this line to your Cargo.toml

canrust = "1.3.1"