After trying Bevy, Iced and egui, I built my own app engine

159 points Available-Many-5354 64 comments

I wanted to build a multiplayer board game in Rust. Server, client, shared crate.

Every UI framework I tried fell short in a different way. Bevy turns simple things into thousands of lines of ECS queries. Iced's code is ..default() and .into() on every line with nesting that reads backwards. egui is great for simple stuff but you're manually calling .add_space() for gaps and allocating rects.

I found macroquad, which felt closest to what I wanted, but it's a rendering library, not an app engine.

So I started building on top of it. First with Clay (a C layout library), then I ported the entire layout engine to pure Rust and designed a new API from scratch.

What is Ply?

Ply is an app engine for building UIs in Rust. Builder pattern, closures for children, one use ply_engine::prelude::* import. It runs on Linux, macOS, Windows, Android, iOS, and the web from one codebase via the plyx CLI.

ui.element().width(grow!()).height(grow!())
    .background_color(0x262220)
    .layout(|l| l.align(CenterX, CenterY).padding(24))
    .children(|ui| {
        ui.text("Hello, Ply!", |t| t.font_size(32).color(0xFFFFFF));
    });

Into<T> everywhere. .background_color() takes hex integers, float tuples, or macroquad colors. .image() takes file paths, embedded bytes, textures, or vector graphics.

What does 1.0 contain?

  • Layout engine: Flexbox-like sizing, padding, gaps, alignment, scrolling, floating elements
  • Text input: Selection, undo/redo, multiline, password mode, all standard keyboard shortcuts
  • Rich text styling: Inline colors, wave, pulse, gradient, typewriter, shadow, per-character animations
  • GLSL shaders on any element, with built-in effects and a SPIR-V build pipeline
  • Accessibility: AccessKit on desktop, JS bridge on web
  • Debug view: Chrome DevTools-style inspector built into the engine
  • HTTP + WebSocket networking that never blocks the UI
  • TinyVG vector graphics with on-demand rasterization
  • Rotation: Visual and shape-level
  • Sound: WAV/OGG playback

Interactive docs

The documentation has live WASM playgrounds. You can change code in the browser and see results instantly. There's also a little interpreter on the home page. I was tired of reading docs that don't let you try things.

Website: https://plyx.iz.rs

Interactive docs: https://plyx.iz.rs/docs/getting-started/

Examples (shader playground, snake...): https://plyx.iz.rs/examples/

GitHub: https://github.com/TheRedDeveloper/ply-engine

Blog post (the full story): https://plyx.iz.rs/blog/introducing-ply/

cargo install plyx
plyx init

Licensed under 0BSD. Use it for anything, no attribution required.

I'd love to hear your thoughts. Do you have a use for this? What's missing?