|0.4.3||Jun 7, 2018|
|0.4.2||Mar 29, 2018|
|0.4.0||Dec 31, 2017|
|0.3.4||Nov 25, 2017|
|0.1.0||Oct 3, 2016|
#14 in Game engines
608 downloads per month
ggez is a Rust library to create a Good Game Easily.
More specifically, ggez is a lightweight cross-platform game framework for making 2D games with minimum friction. It aims to implement an API based on (a Rustified version of) the LÖVE game framework. This means it contains basic and portable 2D drawing, sound, resource loading and event handling.
ggez is not meant to be everything to everyone, but rather a good base upon which to build. Thus it takes a fairly batteries-included approach without needing a million additions and plugins for everything imaginable, but also does not dictate higher-level functionality such as physics engine or entity component system. Instead the goal is to allow you to use whichever libraries you want to provide these functions, or build your own libraries atop ggez.
- Filesystem abstraction that lets you load resources from folders or zip files
- Hardware-accelerated 2D rendering built on the
- Loading and playing .ogg, .wav and .flac files via the
- TTF font rendering with
rusttype, as well as bitmap fonts.
- Interface for handling keyboard and mouse events easily through callbacks
- Config file for defining engine and game settings
- Easy timing and FPS measurement functions.
- Math integration with nalgebra
- Some more advanced graphics options: shaders, sprite batches and render targets
- Fully supported: Windows, Linux, macOS
- Work in progress: Web/WASM/Emscripten
- Not officially supported yet (but maybe you can help!): Android, iOS
For details, see docs/BuildingForEveryPlatform.md
Check out the projects list!
ggez is requires rustc >= 1.23.0 and distributed on
crates.io. To include it in your project, just add the dependency
line to your
ggez = "0.4"
However you also need to have the SDL2 libraries installed on your system. The best way to do this is documented by the SDL2 crate.
ggez consists of three main parts: A
Context object which
contains all the state required to interface with the computer's
EventHandler trait that the user implements to
register callbacks for events, and various sub-modules such as
audio that provide the functionality to actually
get stuff done. The general pattern is to create a struct holding
your game's data which implements the
Create a new
Context object with default objects from a
Conf object, and then call
Context and an instance of your
EventHandler to run your game's
examples/ directory in the source. Most examples show off
a single feature of ggez, while
astroblasto is a small but
complete Asteroids-like game.
To run the examples, just check out the source and execute
cargo run --example
in the root directory:
cargo run --example astroblasto
If this doesn't work, see the FAQ for solutions to common problems.
ggez is built upon SDL2 for windowing and events,
rodio for sound,
and a 2D drawing engine implemented in
gfx using the OpenGL backend
(which currently defaults to use OpenGL 3.2). It should be
entirely thread-safe outside of the basic event-handling loop, and
portable to Windows, Linux and Mac.
The goal is to eventually have ggez be pure Rust, but we're not there yet.
Sources of information:
- The FAQ has answers to common questions and problems.
- The API docs, a lot of design stuff is explained there.
- Check out the examples.
If you still have problems, feel free to open an issue or say hi in the
#rust-gamedev IRC channel on the
- app_dirs2 2
- gfx 0.17
- gfx_device_gl 0.15
- gfx_glyph ~0.10.2
- gfx_window_sdl 0.8
+gif_codec +jpeg +ico +png_codec +pnm +tga +tiff +webp +bmp +dxt
- log 0.4
- lyon 0.10
- nalgebra 0.14
- rodio 0.7
- rusttype 0.5
- sdl2 0.31
- serde 1.0
- serde_derive 1.0
- smart-default 0.2
- toml 0.4
- zip 0.3