Expand description
Generic Icon System for egui
Provides a generic SVG-based icon system with:
- Static icon data via
IconData - Runtime SVG parsing via the
runtimefeature - Rendering with dynamic colors and sizes
§Architecture
IconData- Pre-tessellated icon geometry (static references)OwnedIconData- Runtime-parsed icon geometry (owned buffers)Icon- Generic icon widget (works with both)render_icon/render_icon_data- Low-level rendering
§Example
use armas_icon::{Icon, IconData};
use egui::{Color32, Ui};
static MY_ICON: IconData = IconData {
name: "my_icon",
vertices: &[(0.0, 0.0), (24.0, 12.0), (0.0, 24.0)],
indices: &[0, 1, 2],
viewbox_width: 24.0,
viewbox_height: 24.0,
};
fn show_icon(ui: &mut Ui) {
Icon::new(&MY_ICON)
.size(24.0)
.color(Color32::WHITE)
.show(ui);
}Structs§
- Icon
- Generic icon widget
- Icon
Data - Pre-tessellated icon data
- Owned
Icon Data - Icon data that owns its buffers.
Functions§
- render_
icon - Render icon data to an egui painter.
- render_
icon_ data - Render icon geometry to an egui painter.