Crates.io | egui_memory_editor |
lib.rs | egui_memory_editor |
version | 0.2.10 |
source | src |
created_at | 2021-02-10 17:16:27.695263 |
updated_at | 2024-08-03 11:56:04.205913 |
description | A simple memory editor for the egui library |
homepage | https://github.com/Hirtol/egui_memory_editor |
repository | https://github.com/Hirtol/egui_memory_editor |
max_upload_size | |
id | 353314 |
size | 159,991 |
This is a simple memory editor/viewer utility for the immediate mode UI library egui
Data Preview
section.It's best to look at the example in the examples/
folder, but one can initialise the editor with any struct of their choosing.
For example, a custom memory struct:
let mut memory = Memory::new();
// Create a memory editor with a variety of ranges, need at least one, but can be as many as you want.
let mut mem_editor = MemoryEditor::new()
.with_address_range("All", 0..0xFFFF)
.with_address_range("IO", 0xFF00..0xFF80)
.with_window_title("Hello Editor!");
// In your egui rendering simply include the following.
// The write function is optional, if you don't set it the UI will be in read-only mode.
let mut is_open = true;
mem_editor.window_ui(
ctx,
&mut is_open,
&mut memory,
|mem, address| mem.read_value(address).into(),
|mem, address, val| mem.write_value(address, val),
);
To run the example do the following:
git clone https://github.com/Hirtol/egui_memory_editor
cd egui_memory_editor
cargo run --example simple --release