Function row

Source
pub fn row(x: f32, cy: f32, items: &[RowItem<'_>], theme: &KitTheme) -> f32
Expand description

Lay out items left to right from x, vertically centered on cy, with an 8-unit gap between pieces; returns the width. This is the standard icon-first HUD line ([E] gem 3/6 ●●○), shared so games don’t each rebuild it.

use ferravex_render::{Color, icons::Icon, ui::kit::{self, KitTheme, RowItem}};
let theme = KitTheme::default();
let gold = Color::from_hex(0xf7b553);
let items = [RowItem::Key("E"), RowItem::Icon(Icon::Gem, 18., gold),
    RowItem::Text("3", 16., gold), RowItem::Pips(3, 6, gold)];
let w = kit::row(40., 40., &items, &theme);
assert!((w - kit::row_width(&items, &theme)).abs() < 0.5);