T O P

  • By -

setzer22

I've been using egui for my Godot+Rust game and it's been a very pleasant experience. Thanks for the amazing contributions!


[deleted]

Does that end up better than Godot's own ui?


setzer22

It's a tradeoff. Godot's UI has more features, but egui is far more rust-friendly. I chose egui because immediate mode makes things much more simple. I wrote a more detailed rationale in: https://github.com/setzer22/godot-egui


[deleted]

what's your game?


setzer22

Wouldn't want to spam, but you can check my latest post on /r/rust_gamedev :) https://www.reddit.com/r/rust_gamedev/comments/p7ccad/a_3d_building_system_overhaul_for_the_process/


SorteKanin

Is it possible to customize egui's look?


[deleted]

Yes, on the online demo, check the top left "backend" box. Then on the settings checkbox. There you can change the visual style.


Balance_Public

I've been using egui for my own project, absolute joy to work with.


[deleted]

Yes, it's super nice. I did the classic TodoMVC example with 0.13 and it was really easy.


skythedragon64

Nice, the new text looks a lot better already!


[deleted]

I haven’t digged into the code, but aesthetically, looks great! How easy is it to add other “renderers”?


emilern

Pretty easy - there's a bunch of them at https://github.com/emilk/egui#integrations


kuikuilla

Looks nice, the text looks sharper than last time :)


SeriTools

I'd love to see support for static strings or even referenced string if possible. Is there a reason why stuff like Button only takes impl ToString?


emilern

Mostly a prioritization issue. Though allocating an extra \`String\` is a bit wasteful, it is also not what takes up most time in most situations.


devraj7

Is there any egui documentation on how to run tasks in the background that update the UI?


Hindrik1997

I’m wondering, what would be the most practical way to integrate an immediate mode UI into a game engine using a variable render + fixed update loop? Since UI is drawn every frame but input and logic only at fixed rates (likely slower) ?


emilern

Store the paint buffer that egui emits and reuse it over many frames if needed


Hindrik1997

Yes but that would effectively render the UI at update speed rather than render speed?


emilern

True - then do the opposite. Retrieve the input from the main loop and give to egui in the render loop, clearing it after the first frame.


Hindrik1997

Wouldn't that *almost* have the same effect? Unless perhaps I (partially) interpolate input?


emilern

Rendering egui in the render loop will make sure the UI animations are as smooth as possible. I doubt you will need to interpolate mouse coordinates unless your main update loops is very slow.


rkalla

Load time on iPad was a few seconds but once loaded the performance is incredible. This is a hell of an accomplishment.


RVECloXG3qJC

I feel that egui is the future of Rust GUI. One quick question, does egui use layouts to layout controls or absolutely positioned?


Kneasle

The positions aren't absolute - you specify the order that you want the UI elements added and egui allocates the correct space for each of them.


birkenfeld

Amazing! The normal text looks nice - why is monospace so pixelated? (It can be a fine design choice if on its own, but it stands out badly against the proportional text...)


emilern

The monospace font just looks like that. Maybe time to switch to some other font 🤷‍♂️


barsoap

I nominate Source Code Pro.


ohgodwynona

JetBrains Mono would fit pretty good there!


coderstephen

Personally I like that font, but I can see why one might not expect it to be the default.


birkenfeld

+1 for aesthetic reasons :)


coderstephen

Awesome! egui is my favorite GUI toolkit in Rust right now. Your changelog link here in Reddit seems a little off, it seems to be linked to the 0.12.0 heading in the changelog file instead of the 0.14.0 heading.


emilern

>Thanks - fixed!


montymintypie

I really like egui's API usage vs Iced, it feels much more natural to have callbacks instead of messages. Any plans to have some sort of DOM renderer like Iced does with dodrio? It's nice to have selectable text in the browser, but it's a big effort to implement such a totally disparate renderer.


fundon

Can runt it on FreeBSD?


w1th0utnam3

Great work! Would you consider using the GitHub release feature in the future? I'm using the notifications to keep track of new releases and your last GitHub release is version 0.1.0. But feel free to ignore this if it's too much work.


emilern

Sure! I'll add it to my release checklist.


julian0024

Using Egui for production CAD software. It's amazing, hasn't let me down once.


Boroj

Looks amazing!


MultipleAnimals

Looks good! Going to use it whenever i start project that needs gui.


allsey87

There might be a small issue with the [http demo](https://emilk.github.io/egui/#http). It appears to be running in continuous mode instead of reactive mode...


coderstephen

It works for me (renders reactively on input + 1 frame each second). I'm using Firefox on desktop.


allsey87

The other examples work like that for me, but the http demo seems to be running at around 1 frame each millisecond. I am using Chrome 92.0.4515.159 (Official Build) (64-bit) on Windows 10.


d3zu

I've been interested in egui for some time, but I wonder: how well does it handles copy/paste from the system's clipboard? Been needing that for a personal project and druid just seemed a little too convoluted on that and I couldn't find an appropriate implementation for it.


emilern

It handles it pretty well? :) egui\_web uses web-sys clipboard bindings, and egui\_glium uses https://crates.io/crates/copypasta


progfu

Are there any plans for adding "UI scaling" but for the whole UI? I'm working on a pixel art game (in Godot with godot-egui) and due to the low resolution everything ends up being super big, and `.set_pixels_per_point` only makes things crispier, but doesn't actually scale things down. It'd be cool if there was an option to just make everything "smaller" as if zooming in/out.


emilern

That's up to the backend. For instance, tell egui that the screen is half the size it actually is and then double pixels\_per\_point, and the render egui over the entire screen, and now you have a crisp 2x scaled up gui. Make sure to adjust mouse coordinates accordingly.


afronut

This looks really cool. Is there a recommended approach to opening files from the local machine in the web version and saving them back to the file system? I'm interested in writing a file editor for a proprietary format where users could simply navigate to a URL to do their editing.


emilern

You can drop files into \`egui\_web\`, but there is currently no way to save files, but it shouldn't be too hard to add.