#gui #imgui #macro

imgui-ext

A crate to build debug UIs on structs using a derive macro (based on the imgui crate)

13 releases

✓ Uses Rust 2018 edition

0.1.8 Apr 3, 2019
0.1.7 Mar 1, 2019
0.1.6 Feb 9, 2019

#83 in GUI

Download history 60/week @ 2019-01-31 51/week @ 2019-02-07 3/week @ 2019-02-14 73/week @ 2019-02-21 77/week @ 2019-02-28 3/week @ 2019-03-07 13/week @ 2019-03-14 122/week @ 2019-03-21 18/week @ 2019-03-28

141 downloads per month

MIT license

50KB
717 lines

imgui-ext

Build Status Cargo package docs.rs docs Master docs

A crate to quickly build imgui UIs using annotations and a custom Derive.

Features

  • Encode UI directly on the types.
  • Static code generation: example.
  • Nested UIs (see the imgui(nested(...)) annotation).
  • Descriptive compiler errors.

Example

use imgui_ext::ImGuiExt;

#[derive(ImGuiExt)]
struct Example {
    #[imgui(slider(min = 0.0, max = 4.0))]
    x: f32,
    #[imgui(input(step = 2))]
    y: i32,
    #[imgui(drag(label = "Drag 2D"))]
    drag_2d: [f32; 2],
    #[imgui(
        checkbox(label = "Turbo mode"),
        display(label = "Is turbo enabled?"),
    )]
    turbo: bool,
}

Result:

See full example

cargo run --package example

Limitations

  • #[derive(ImGuiExt)] is only supported for structs with named fields, at the moment.
  • Limited layout support.

License

MIT

Dependencies

~5MB
~80K SLoC