[−][src]Crate egui
Egui core library
To get started with Egui, you can use one of the available backends
such as egui_web
or egui_glium
.
To write your own backend for Egui you need to do this:
let mut egui_ctx = egui::Context::new(); // game loop: loop { let raw_input: egui::RawInput = my_backend.gather_input(); let mut ui = egui_ctx.begin_frame(raw_input); my_app.ui(&mut ui); // add windows and widgets to `ui` here let (output, paint_jobs) = egui_ctx.end_frame(); my_backend.paint(paint_jobs); my_backend.set_cursor_icon(output.cursor_icon); // Also see `egui::Output` for more }
Re-exports
pub use align::Align; |
pub use containers::*; |
pub use math::*; |
pub use paint::color; |
pub use paint::PaintCmd; |
pub use paint::PaintJobs; |
pub use paint::Rgba; |
pub use paint::Srgba; |
pub use paint::Stroke; |
pub use paint::TextStyle; |
pub use paint::TextureId; |
pub use widgets::*; |
Modules
align | |
app | Traits and helper for writing Egui apps. |
containers | Containers are pieces of the UI which wraps other pieces of UI. Examples: |
demos | Demo-code for showing how Egui is used. |
math | Vectors, positions, rectangles etc. |
menu | Menu bar functionality (very basic so far). |
paint | Graphics module. |
widgets | Widgets are pieces of GUI such as labels, buttons, sliders etc. |
Macros
label | Shortcut for creating a |
Structs
Context | Contains the input, style and output of all GUI commands.
|
DemoApp | Demonstrates how to make an app using Egui. |
GraphicLayers | |
History | This struct tracks recent values of some time series. |
Id | Egui tracks widgets frame-to-frame using |
InputState | What egui maintains |
Layer | An identifier for a paint layer.
Also acts as an identifier for |
Layout | The layout of a |
Memory | The data that Egui persists between frames. |
MouseInput | What egui maintains |
Output | What Egui emits each frame. The backend should use this. |
PaintCmdIdx | A unique identifier of a specific |
PaintList | Each |
Painter | Helper to paint shapes and text to a specific region on a specific layer. |
RawInput | What the backend provides to Egui at the start of each frame. |
Response | The result of adding a widget to an |
Sense | What sort of interaction is a widget sensitive to? |
Style | Specifies the look and feel of a |
Texture | An 8-bit texture containing font data. |
Ui | Represents a region of the screen with a type of layout (horizontal or vertical). |
Enums
CursorIcon | |
Direction |
|
Event | An input event. Only covers events used by Egui. |
Key | Keyboard key name. Only covers keys used by Egui. |
Order | Different layer categories |