14 releases (5 breaking)

0.8.0 Feb 22, 2024
0.6.4 Jan 2, 2024
0.6.1 Dec 25, 2023
0.5.2 Nov 10, 2023
0.3.0 Sep 13, 2022

#498 in Graphics APIs

Download history 10/week @ 2023-12-22 21/week @ 2023-12-29 3/week @ 2024-01-05 13/week @ 2024-01-19 2/week @ 2024-01-26 101/week @ 2024-02-16 117/week @ 2024-02-23 22/week @ 2024-03-01 50/week @ 2024-03-08 25/week @ 2024-03-15 3/week @ 2024-03-22 54/week @ 2024-03-29 16/week @ 2024-04-05

124 downloads per month
Used in 2 crates (via egui_render_three_d)

MIT license

43KB
834 lines

Egui Overlay

In this context, Overlay simply means a gui application where

  1. It has a transparent window surface
  2. It can toggle the borders/decorations like title bar.
  3. can let the input like mouse clicks to passthrough its window surface.

Here, we will let input passthrough when egui doesn't need input.

The egui_overlay crate just combines the functionality from egui_window_glfw_passthrough for windowing functionality. For rendering, we use egui_render_three_d, as three-d will allow you to draw a bunch of things easily. But, as apple doesn't support opengl, we use egui_render_wgpu on macos.

For advanced usecases, i recommend directly using egui_window_glfw_passthrough crate directly with either wgpu or three-d or glow backend crates. As you can see in lib.rs, its barely 150 lines of code to set up. It will allow you more control over event loop, as well as drawing.

Look at the basic example for a rough idea of how to use this crate for normal usecase. Look at the triangle example (only for linux/windows users, as i use three-d), to see how you can draw custom stuff too.

use cargo run -p basic to run the example.

https://github.com/coderedart/egui_overlay/assets/24411704/9f7bab7b-26ec-47d1-b51e-74006dfa7b0d

Platforms

  1. Windows
  2. Linux (both X11 and Wayland). But support might vary between different window managers.
  3. Mac

Bugs

  1. On Mac, when passthrough is enabled, the window titlebar can only be clicked in the bottom half. The top half becomes passthrough too for some reason.

Dependencies

~7–16MB
~186K SLoC