egui_overlay
egui_overlay copied to clipboard
How to use eframe storage?
In eframe we are able to use storage: https://docs.rs/eframe/0.26.2/eframe/index.html#:~:text=app%20state%20using-,cc.storage,-(requires%20the%20%22persistence
How to do it when using egui_overlay?
you just serialize egui memory struct from the context using ctx.memory(|mem| serialize(mem)) and save it to a file. And then load it when starting your app, deserialize it (or create default) and assign it to context using ctx.memory_mut()
https://github.com/emilk/egui/blob/master/crates/eframe/src/native/epi_integration.rs#L348 shows you how eframe does it.