A Rust game library for building 2D games on PC, mobile, and the browser. One codebase targets desktop, HTML5, Android, and iOS.
Overview
Macroquad is a Rust game library aimed at simple cross-platform game development, drawing design ideas from raylib. Developers add it as a normal Cargo dependency and write game code that runs on multiple targets without extra platform-specific defines.
Rendering focuses on efficient 2D drawing with automatic geometry batching. The stack keeps dependencies small and ships an immediate-mode UI library. Deploy workflows include single-command builds for WebAssembly and Android.
Supported run targets include Windows, Linux, and macOS on PC, HTML5 in the browser, and native Android and iOS builds. Async and await in examples support a cross-platform main loop, especially for WASM and Android where a blocking loop is awkward.
Community support covers native, WASM, and mobile build paths.
Key features
- Shared code across listed platforms
- 2D rendering with geometry batching
- Immediate-mode UI included
- WASM and Android deploy commands
- Few Cargo dependencies
- Async-friendly main loop pattern
Use cases
- Rust hobby games
- Browser games via WASM
- Mobile games on Android or iOS
- 2D prototypes on desktop