[][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:

This example is not tested
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: Window, ScrollArea, Resize, etc.

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 Label widget.

Structs

Context

Contains the input, style and output of all GUI commands. Ui:s keep an Arc pointer to this. This allows us to create several child Ui:s at once, all working against the same shared Context.

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 Ids.

InputState

What egui maintains

Layer

An identifier for a paint layer. Also acts as an identifier for Area:s.

Layout

The layout of a Ui, e.g. horizontal left-aligned.

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 PaintCmd in a PaintList.

PaintList

Each PaintCmd is paired with a clip rectangle.

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 Ui.

Sense

What sort of interaction is a widget sensitive to?

Style

Specifies the look and feel of a Ui.

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

Layout direction (horizontal or vertical).

Event

An input event. Only covers events used by Egui.

Key

Keyboard key name. Only covers keys used by Egui.

Order

Different layer categories