Live data from Hacker News

Egui – An immediate mode GUI written in Rust

egui.rs

21–30 of 143 posts

Re: Egui – An immediate mode GUI written in Rust

#21
post #9

Earlier quoted context omitted.

It's being worked on. Merry Christmas! https://github.com/emilk/egui/issues/3378

Text shaping is anything but easy. Harfbuzz is probably the state of the art open source solution - https://github.com/harfbuzz/harfbuzz Used in in Android, Chrome, ChromeOS, Firefox, GNOME, GTK+, KDE, Qt, LibreOffice, OpenJDK, XeTeX, PlayStation, Microsoft Edge, Adobe Photoshop, Illustrator, InDesign, Godot Engine, Unreal Engine, ...

For egui, it will be rustybuzz, which is used directly by cosmic-text

https://github.com/harfbuzz/rustybuzz

https://github.com/pop-os/cosmic-text

Re: Egui – An immediate mode GUI written in Rust

#23

Demo pages like this are fun, and technically impressive when compiled to a browser environment. But I suffer from a lack of imagination so these widget demos don't really help me envision what an egui-powered app can do or might look like. Does anyone have any examples of fun things that use egui?

It's really good for scrappy prototypes, e.g. here's a water simulation demo I was using to learn Rust [1]. See the "view" menu for more windows.

The code for that is all contained in a single file [2], and IMO it's pretty small for what it does. It was really easy to add/change things while developing, a new button is just a single new line.

[1] https://andreivasiliu.github.io/cybersub/

[2] https://github.com/andreivasiliu/cybersub/blob/master/src/ui...

Re: Egui – An immediate mode GUI written in Rust

#24
post #15

A common problem of immediate mode GUI is how to make the parent component's size dynamically determined by child component's content (2-phase dynamic layout). Does Egui solve this issue?

You can instruct egui to discard a frame. That way you can perform this two phase layout across two frames without showing an unfinished UI.

This mechanism can get you there most of the time.

Re: Egui – An immediate mode GUI written in Rust

#25

Demo pages like this are fun, and technically impressive when compiled to a browser environment. But I suffer from a lack of imagination so these widget demos don't really help me envision what an egui-powered app can do or might look like. Does anyone have any examples of fun things that use egui?

Photo editors, CADs etc.

I mean... pretty much anything you have on desktop but in your browser.

Re: Egui – An immediate mode GUI written in Rust

#26
post #15

A common problem of immediate mode GUI is how to make the parent component's size dynamically determined by child component's content (2-phase dynamic layout). Does Egui solve this issue?

You can instruct egui to discard a frame. That way you can perform this two phase layout across two frames without showing an unfinished UI. This mechanism can get you there most of the time.

Take the Code Example demo initially opened: drag age up to 120, then press the Increment button, and watch the label “Arthur is 120” briefly blip to “Arthur is 121” (while the DragValue still shows 120!) before being dragged back down to 120 presumably by rerendering and egui::DragValue::new(age).range(0..=120) clamping it.

That’s… eww. It probably doesn’t often cause real problems—though it surely could, as it’s allowing temporary rendering with out-of-bounds values that a developer might have expected to be clamped—but it’s still very eww, the idea that mutating data leads to parts of a frame being rendered with different data.

Re: Egui – An immediate mode GUI written in Rust

#27

Am I the only one that has a problem with all non dom/html renderers that I can't copy the text on mobile? The same with flutter etc, it's such a regression in my eyes but nobody prioritizes it.

There are websites that disable copying, so I assume some would consider this a feature. :/

Re: Egui – An immediate mode GUI written in Rust

#28

Earlier quoted context omitted.

You can instruct egui to discard a frame. That way you can perform this two phase layout across two frames without showing an unfinished UI. This mechanism can get you there most of the time.

Take the Code Example demo initially opened: drag age up to 120, then press the Increment button, and watch the label “Arthur is 120” briefly blip to “Arthur is 121” (while the DragValue still shows 120!) before being dragged back down to 120 presumably by rerendering and egui::DragValue::new(age).range(0..=120) clamping it. That’s… eww. It probably doesn’t often cause real problems—though it surely could, as it’s al…

I’m currently on mobile, where I couldn’t reproduce this.

I agree, that shouldn’t happen and it might be a bug, because the input is handled after drawing the initial frame and should be clamped before starting to draw the next frame. Drag events are tricky though, because they come with a frame delay by default (you have to recognize the drag).

Does this reproduce reliably on desktop? If so then I can create an issue for this.

Re: Egui – An immediate mode GUI written in Rust

#30

Demo pages like this are fun, and technically impressive when compiled to a browser environment. But I suffer from a lack of imagination so these widget demos don't really help me envision what an egui-powered app can do or might look like. Does anyone have any examples of fun things that use egui?

The Bevy Engine in Rust has an integration (https://docs.rs/bevy_egui/latest/bevy_egui/) that supports egui, for use in making UIs in games written against the Bevy Engine. Here's a webapp example of a 2d drawing showcase that uses egui as a UI provider: https://vladbat00.github.io/bevy_egui_web_showcase/index.htm...
Post reply on HN