Skip to content
Rust library to build imgui GUIs using a derive macro
Branch: master
Clone or download
germangb Merge pull request #5 from germangb/dependabot/cargo/imgui-0.0.23
Update imgui requirement from 0.0.22 to 0.0.23
Latest commit c8bee9d Apr 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets imgui 0.0.22 Feb 7, 2019
ci ci scripts Feb 2, 2019
example image_button annotation Apr 21, 2019
imgui_derive image_button annotation Apr 21, 2019
src image_button annotation Apr 21, 2019
.gitignore put input text & numeric in the same tag/module Mar 1, 2019
.rustfmt.toml put input text & numeric in the same tag/module Mar 1, 2019
.travis.yml ci scripts Feb 2, 2019
Cargo.toml image_button annotation Apr 21, 2019
LICENSE.md README Jan 28, 2019
README.md image_button annotation Apr 21, 2019

README.md

imgui-ext

Build Status Cargo package docs.rs docs Master docs

A crate to quickly build imgui UIs using annotations and a derive macro.

Features

  • Encode UI directly on the types.
  • Static code generation.
  • 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

You can’t perform that action at this time.