Skip to main content

button

Function button 

Source
pub fn button(
    input: &InputState,
    ui: &mut UiState,
    theme: &UiTheme,
    label: &str,
    rect: Rect,
) -> UiInteraction
Expand description

Draw a button and return whether it was clicked.

ยงExample

if ui::button(ctx, "Start Game", Rect::new(100, 200, 200, 50)) {
    start_game();
}