Function stroke_arc

Source
pub fn stroke_arc(
    center: Vec2,
    radius: f32,
    start: f32,
    sweep: f32,
    stroke: Stroke,
)
Expand description

Anti-aliased arc of radius from start sweeping sweep radians (positive is clockwise on screen with Y down). Useful for radial meters and cooldowns. A sweep of a full turn or more draws a closed ring. Emits at most 1,782 vertices.

use std::f32::consts::{FRAC_PI_2, TAU};
use ferravex_render::{Color, vec2, shapes::{self, Cap, Stroke}};
// A 70% cooldown ring starting at 12 o'clock.
shapes::stroke_arc(vec2(40., 40.), 18., -FRAC_PI_2, 0.7 * TAU,
    Stroke::new(5., Color::from_hex(0xf7b553)).cap(Cap::Round));