Basic 2d graphics crate

How would you choose between Piston, Cairo and so on if you’d want a good lib to start doing 2d graphics with (i.e. simple games)? I basically need a way to use png files, sound and it would be nice to be able to get help handling keyboard input events. I guess Piston would be my choice? It’s for non-professional uses, experiments and so on. In the end I will (perhaps) try to connect stuff with the web using WebAssembly (I guess I’ll have to rewrite the key-handling then and communicate such events from JS to my app in that case?)

I am a beginner (if my level is of relevance in relation to what crate and so on that may suit me). Game programming is also only a hobby. :slight_smile: Thanks! /C-M

A couple of extra options to consider:

  • ggez is probably the most actively developed 2D game framework in Rust, and is quite beginner friendly. It currently depends on SDL2, so there’s a little environment setup involved, but they’re moving to pure Rust in the next big release.
  • quicksilver is a little earlier in development than ggez, but has the ability to compile to WebAssembly straight out of the box.

I’d personally choose one of those over Piston, but it’d definitely worth trying all three out and seeing which one you like best :slight_smile:

3 Likes

Thanks, 17cupsofcoffee! Will look into that. :slight_smile: