egui/examples
Francis Chua 069d7a634d
Add layer transforms, interaction in layer (#3906)
⚠️ Removes `Context::translate_layer`, replacing it with a sticky
`set_transform_layer`

Adds the capability to scale layers.
Allows interaction with scaled and transformed widgets inside
transformed layers.

I've also added a demo of how to have zooming and panning in a window
(see the video below).

This probably closes #1811. Having a panning and zooming container would
just be creating a new
`Area` with a new id, and applying zooming and panning with
`ctx.transform_layer`.

I've run the github workflow scripts in my repository, so hopefully the
formatting and `cargo cranky` is satisfied.

I'm not sure if all call sites where transforms would be relevant have
been handled. This might also be missing are transforming clipping
rects, but I'm not sure where / how to accomplish that. In the demo, the
clipping rect is transformed to match, which seems to work.


https://github.com/emilk/egui/assets/70821802/77e7e743-cdfe-402f-86e3-7744b3ee7b0f

---------

Co-authored-by: tweoss <fchua@puffer5.stanford.edu>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-02-17 11:02:56 +01:00
..
confirm_exit Put all egui crates as workspace crates (#3976) 2024-02-05 12:59:49 +01:00
custom_3d_glow Put all egui crates as workspace crates (#3976) 2024-02-05 12:59:49 +01:00
custom_font Put all egui crates as workspace crates (#3976) 2024-02-05 12:59:49 +01:00
custom_font_style Put all egui crates as workspace crates (#3976) 2024-02-05 12:59:49 +01:00
custom_plot_manipulation Update example screenshots 2024-02-05 13:01:10 +01:00
custom_window_frame Update example screenshots 2024-02-05 13:01:10 +01:00
file_dialog Update `ehttp` to 0.5 (#4055) 2024-02-16 10:57:54 +01:00
hello_world Revert test code in hello_world example 2024-02-10 18:09:41 +01:00
hello_world_par Put all egui crates as workspace crates (#3976) 2024-02-05 12:59:49 +01:00
hello_world_simple Update example screenshots 2024-02-05 13:01:10 +01:00
images Update example screenshots 2024-02-05 13:01:10 +01:00
keyboard_events Put all egui crates as workspace crates (#3976) 2024-02-05 12:59:49 +01:00
multiple_viewports Put all egui crates as workspace crates (#3976) 2024-02-05 12:59:49 +01:00
puffin_profiler Update example screenshots 2024-02-05 13:01:10 +01:00
save_plot Update `ehttp` to 0.5 (#4055) 2024-02-16 10:57:54 +01:00
screenshot Put all egui crates as workspace crates (#3976) 2024-02-05 12:59:49 +01:00
serial_windows Put all egui crates as workspace crates (#3976) 2024-02-05 12:59:49 +01:00
test_inline_glow_paint Update example screenshots 2024-02-05 13:01:10 +01:00
test_viewports Add layer transforms, interaction in layer (#3906) 2024-02-17 11:02:56 +01:00
user_attention Put all egui crates as workspace crates (#3976) 2024-02-05 12:59:49 +01:00
README.md examples/README.md: explain that the examples are for master 2023-02-08 20:34:43 +01:00
run_all.sh Fix up some examples (#3614) 2023-11-23 12:58:44 +01:00

README.md

egui and eframe examples

All the examples in this folder uses eframe to set up a window for egui. Some examples are specific to eframe, but many are applicable to any egui integration.

There are a lot more examples at https://www.egui.rs, and it has links to the source code of each example.

Also check out the official docs at https://docs.rs/egui and https://docs.rs/eframe.

Note that all the examples on master are for the latest master version of egui.

If you want to look for examples for a specific version of egui, go to that tag, e.g. https://github.com/emilk/egui/tree/latest/examples.