Module pix_engine::gui::widgets::tooltip

source ·
Expand description

Tooltip widget rendering methods.

Provided PixState methods:

Example

fn on_update(&mut self, s: &mut PixState) -> PixResult<()> {
    s.help_marker("Help marker icon w/ tooltip")?;

    s.text("Hover me")?;
    if s.hovered() {
        s.tooltip("Basic tooltip")?;
    }

    s.text("Hover me too!")?;
    if s.hovered() {
        s.advanced_tooltip(
            "Advanced tooltip",
            rect![s.mouse_pos(), 200, 100],
            |s: &mut PixState| {
                s.background(Color::CADET_BLUE);
                s.bullet("Advanced tooltip")?;
                Ok(())
            }
        )?;
    }
    Ok(())
}