A user friendly game engine written in Rust
Maintainers: @bvssvni
List of games made with Piston
You should know how to build "hello world" with Rust, see http://www.rust-lang.org/.
Piston uses FreeType for font rendering. How to install FreeType
Add piston_window to your Cargo.toml, for example:
[dependencies]
piston_window = "0.5.0"
In "src/main.rs", type the following code:
```Rust extern crate piston_window;
use piston_window::*;
fn main() { let window: PistonWindow = WindowSettings::new("Hello Piston!", [640, 480]) .exitonesc(true).into(); for e in window { e.draw_2d(|c, g| { clear([1.0; 4], g); rectangle([1.0, 0.0, 0.0, 1.0], // red [0.0, 0.0, 100.0, 100.0], c.transform, g); }); } } ```
Use cargo run
to start the application. It should clear the screen in white color and draw a red rectangle.
The Piston project is a large collaboration among many developers. There are libraries for 2D, 3D, event programming, AI, image processing etc. By sharing the maintenance, we get more time to build new stuff.
Piston is as much a community project as it is a collection of libraries. Writing and maintaining code is expensive, and by sharing this cost we reach our goals faster. We believe that seeking personal goals and ambitions, while helping each other, results in higher quality.
In addition we do research or plan to in the following areas: