Skip to main content

draw_text

Function draw_text 

Source
pub fn draw_text(
    t: &str,
    x: f32,
    y: f32,
    size: f32,
    font: Option<&Font>,
    color: Color,
)
Expand description

Draws text with its top-left corner at (x, y) with the given font, size, and color.

ยงExamples

draw_text("Hello", 10.0, 10.0, 32.0, None, WHITE);           // default font
draw_text("Hello", 10.0, 10.0, 32.0, Some(&font), WHITE);    // loaded font