Skip to main content

Crate armas_icon

Crate armas_icon 

Source
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 runtime feature
  • Rendering with dynamic colors and sizes

§Architecture

§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
IconData
Pre-tessellated icon data
OwnedIconData
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.