2020-06-05 12:20:43 +00:00
[](https://crates.io/crates/egui)
[](https://docs.rs/egui)


2020-05-30 08:22:35 +00:00
# Egui
An immediate mode GUI library written in Rust. Works anywhere you can draw textured triangles.
2018-12-23 18:42:30 +00:00
2019-03-12 07:54:17 +00:00
## Goals:
2020-04-29 19:25:49 +00:00
* Lightweight
* Short, conveniant syntax
* Responsive (60 Hz without breaking a sweat)
* Portable
2019-03-12 21:59:55 +00:00
* Platform independent (the same code works on the web and as a native app)
2018-12-23 18:42:30 +00:00
2019-03-12 07:54:17 +00:00
## How it works:
2019-03-10 20:01:07 +00:00
Loop:
* Gather input: mouse, touches, screen size, ...
2019-03-12 07:54:17 +00:00
* Run application code (Immediate Mode GUI)
2019-03-10 20:01:07 +00:00
* Output is a triangle mesh
2019-03-12 21:59:55 +00:00
* Render with e.g. OpenGL
## Available backends:
2020-05-30 08:22:35 +00:00
Wherever you can render textured triangles you can use Egui.
2019-03-12 21:59:55 +00:00
2020-08-10 17:38:46 +00:00
* WebAssembly (`egui_web`) for making a web app. [Click to run ](https://emilk.github.io/egui/index.html ).
2019-03-12 21:59:55 +00:00
* [Glium ](https://github.com/glium/glium ) for native apps (see example_glium).
2020-05-01 04:16:45 +00:00
* [miniquad ](https://github.com/not-fl3/emigui-miniquad ) [web demo ](https://not-fl3.github.io/miniquad-samples/emigui.html ) [demo source ](https://github.com/not-fl3/good-web-game/blob/master/examples/emigui.rs )
2019-03-12 21:59:55 +00:00
The same application code can thus be compiled to either into a native app or a web app.
2018-12-23 18:42:30 +00:00
2019-03-10 20:01:07 +00:00
## Demos
2020-08-10 17:38:46 +00:00
[Egui feature demo ](https://emilk.github.io/egui/index.html ), (partial) source: https://github.com/emilk/egui/blob/master/egui/src/demos/app.rs
2018-12-23 18:42:30 +00:00
2020-05-30 08:22:35 +00:00
[Hobogo: A small game using Egui ](https://emilk.github.io/hobogo/index.html ), source: https://github.com/emilk/hobogo
2018-12-23 23:15:18 +00:00
2019-03-10 20:01:07 +00:00
## State
2020-05-30 08:22:35 +00:00
Alpha state. It works, but is somewhat incomplete.
2019-03-12 07:54:17 +00:00
Features:
2018-12-23 23:15:18 +00:00
2020-05-02 09:37:12 +00:00
* Labels
2019-03-12 07:54:17 +00:00
* Buttons, checkboxes, radio buttons and sliders
2019-03-10 20:01:07 +00:00
* Horizontal or vertical layout
2019-03-12 07:54:17 +00:00
* Column layout
* Collapsible headers (sections)
2020-05-02 09:37:12 +00:00
* Windows
* Resizable regions
* Vertical scolling
* Simple text input
2019-03-12 07:54:17 +00:00
* Anti-aliased rendering of circles, rounded rectangles and lines.
2020-05-11 15:57:11 +00:00
## Conventions
* All coordinates are screen space coordinates, in locial "points" (which may consist of many physical pixels).
* All colors have premultiplied alpha
2019-01-04 13:14:32 +00:00
2019-03-10 20:01:07 +00:00
## Inspiration
2020-04-19 09:15:35 +00:00
The one and only [Dear ImGui ](https://github.com/ocornut/imgui ) is a great Immediate Mode GUI for C++ which works with many backends. That library revolutionized how I think about GUI code from something I hated to do to something I now like to do.
2019-01-04 13:14:32 +00:00
2020-05-30 08:22:35 +00:00
## Name
The name of the gui library is "Egui", written like that in text and as `egui` in code and pronounced as "e-gooey".
2020-08-10 17:38:46 +00:00
The library was originally called "Emigui", but was renamed to Egui in 2020.
2020-05-30 08:22:35 +00:00
2019-03-10 20:01:07 +00:00
## Credits / Licenses
2019-03-12 07:54:17 +00:00
Fonts:
2019-03-16 12:37:29 +00:00
* Comfortaa: Open Font License, see OFT.txt
2019-03-12 07:54:17 +00:00
* ProggyClean.ttf, Copyright (c) 2004, 2005 Tristan Grimmer. MIT License. http://www.proggyfonts.net/
* Roboto-Regular.ttf: Apache License, Version 2.0