Skip to content

cf_draw_push_dash

Category: draw
GitHub: cute_draw.h


Pushes a dash pattern for subsequent stroke drawing.

void cf_draw_push_dash(float on_length, float off_length, float phase);
Parameters Description
on_length Length of each dash in world units.
off_length Length of each gap in world units.
phase Offset into the pattern in world units -- animate for marching ants.

Remarks

Applies to lines (cf_draw_line), polylines (dashes flow unbroken through the joints), and circle outlines (cf_draw_circle, dashed along the ring; the pattern wraps at the seam unless on_length + off_length divides the circumference evenly). Each dash gets round caps and the usual anti-aliasing. An on_length of zero (the default) draws solid strokes. Filled shapes ignore the dash stack. This is the 2d analog of cf_draw3d_push_dash.

cf_draw_pop_dash
cf_draw_line
cf_draw_polyline
cf_draw_circle