Function draw_tooltip

Source
pub fn draw_tooltip(
    card: Rect,
    text: &str,
    style: TooltipStyle,
    text_system: &mut TextSystem,
) -> Vec<DrawCmd>
Expand description

Tooltip bubble (place in an overlay layer for correct z-order).

card is caller-resolved geometry; the helper does not measure or resize it. It returns exactly two commands: background, then word-wrapped text. Text y is baseline-positioned at card.y + pad_y + font_px.

ยงExamples

use ailloli_ui_core::Rect;
use ailloli_ui_text::TextSystem;
use ailloli_ui_widgets::overlay::{draw_tooltip, TooltipStyle};
let mut text_system = TextSystem::new();
let commands = draw_tooltip(Rect::new(0.0, 0.0, 120.0, 32.0), "Details", TooltipStyle::default(), &mut text_system);
assert_eq!(commands.len(), 2);