Skip to content

cf_draw_push_outline

Category: draw
GitHub: cute_draw.h


Draws an outline around subsequent shapes.

void cf_draw_push_outline(CF_Color color, float width);
Parameters Description
color The outline color.
width Outline width in world units. Zero (the default) disables it.

Remarks

The outline is a band running width inward from the shape's edge, drawn over the shape like a CSS border over its background: the shape keeps its extent, and a translucent outline blends over the fill beneath it. On a stroked shape the band runs inward from both edges of the stroke. It comes straight out of the signed distance the shape already computes -- no second draw, no extra geometry, and it anti-aliases exactly like the shape does. Works on every SDF shape (circles, boxes, capsules, triangles, polygons, arrows, custom shapes, shape groups) and composes with cf_draw_push_glow. Sprites and text ignore it.

cf_draw_pop_outline
cf_draw_push_glow
cf_draw_push_color