Skip to main content

ui_button

Function ui_button 

Source
pub fn ui_button(
    id: u32,
    x: f32,
    y: f32,
    w: f32,
    h: f32,
    label: &str,
    on_click: impl FnOnce(),
)
Expand description

Render a button at the given position and run on_click when it is clicked. Use ui_button_variant for non-default styling.

Must be called from on_frame() — widgets are only rendered for interactive applications that export a frame loop.