Quicksilver

Github Crates.io Documentation

Quicksilver allows you to create 2D applications targeting Windows, macOS, Linux, and the Web all from the same codebase, using only Rust.

What's included?

A Quick Example

            
// Draw some multi-colored geometry to the screen
extern crate quicksilver;

use quicksilver::{
    State, run,
    geom::{Circle, Rectangle, Transform},
    graphics::{Color, Sprite, Window, WindowBuilder}
};

struct DrawGeometry;

impl State for DrawGeometry {
    fn configure() -> Window {
        WindowBuilder::new().build("Draw Geometry", 800, 600)
    }

    fn new() -> DrawGeometry { DrawGeometry }

    fn draw(&mut self, window: &mut Window) {
        window.clear(Color::black());
        window.draw(&Sprite::rectangle(Rectangle::new(100, 100, 32, 32))
            .with_color(Color::red()));
        window.draw(&Sprite::rectangle(Rectangle::new(400, 300, 32, 32))
            .with_color(Color::blue())
            .with_transform(Transform::rotate(45))
            .with_z(10));
        window.draw(&Sprite::circle(Circle::new(400, 300, 100))
            .with_color(Color::green()));
        window.present();
    }
}

fn main() {
    run::<DrawGeometry>();
}  
            
        

View the examples in your browser

Thanks to the magic of WebAssembly, if your browser supports both WebAssembly and WebGL2, then you can view the examples online with no plugins required.