rayengine 0.0.2

A small Linux-first Rust game SDK over raylib
Documentation

rayengine

A small Linux-first Rust game SDK over raylib. Games are ordinary Cargo projects with a shared lifecycle for 2D and 3D, action input, fixed updates, fitted cameras, logical UI with optional interaction and explicit asset ownership. Version 0.0.2.

Start with the quickstart, then read game structure and scene switching and state stacks, and optional plugins. The remaining guides explain responsive viewports, timing and input, assets, first-person movement, generated meshes, materials and shaders, spatial queries, background work, interactive UI and input routing, versioned saves, runtime diagnostics, testing and performance, and the agent workflow.

Optional rayengine.toml project descriptions share a CPU-only loader with the CLI. See the project manifest guide for profiles, asset/font declarations, validation and configuration precedence.

rayengine-core contains display-independent components and math; access it through core or depend on it directly for simulations without raylib. prelude contains the normal game imports. raylib remains available for specialized rendering and other lower-level features.

use rayengine::prelude::*;

#[derive(Default)]
struct Hello;

impl Game for Hello {
    fn fixed_update(&mut self, _: &mut Update<'_, '_>) {}
    fn draw(&mut self, frame: &mut Frame<'_, '_>) {
        frame.clear(Color::new(18, 29, 48, 255));
        frame.world_2d(Camera2D::default(), |canvas| {
            canvas.circle(Vec2::ZERO, 40.0, Color::SKYBLUE);
        });
        frame.ui(|ui| ui.text("Hello, rayengine", Vec2::new(24.0, 24.0), 24.0, Color::WHITE));
    }
}

fn main() -> Result<(), Error> {
    App::new(Config::new("Hello")).run(Hello)?;
    Ok(())
}

Custom outline fonts, matching label measurement, per-button font choice, DPI-aware atlases, and explicit nearest-filtered pixel text are described in the font guide. The repository includes a distributable two-font example (--example fonts).

The first release provides basic swept character movement and geometric drawing, not rigid-body dynamics or an advanced 3D rendering pipeline. The interactive input/image/state testing protocol is deferred. The CLI's JSON project diagnostics are available now. Desktop Linux is the supported development target; Windows and macOS are optional and not yet verified by this project's CI.

Basic ambient, directional, and point lighting is opt-in with Shading::Lit. See the lighting guide and run cargo run -p rayengine --example lighting for a generated/imported lit/unlit comparison with adjustable lights.