al_draw_ribbon(3alleg5)
๐ al_draw_ribbon โ from the Allegro 5 API ๐
okay bestie, sit down, hydrate, because we're about to draw a literal ribbon and it's gonna be gorgeous โจ
๐ธ SYNOPSIS ๐ธ
#include <allegro5/allegro_primitives.h>
void al_draw_ribbon(const float *points, int points_stride, ALLEGRO_COLOR color,
float thickness, int num_segments)
๐ DESCRIPTION ๐
So like, this function draws a ribbon ๐๏ธ based on an array of points you hand it. And when I say it goes through your points, I mean it goes through all of them โ every single one, no skipping, no playing favourites, the ribbon threads through the whole squad ๐ซถ.
Your points buffer needs to be built like a little grid of evenly spaced doublets of floats, and each doublet is one vertex's x and y coordinate. That's it, that's the whole vibe: pairs, in a row, regularly spaced. ๐
๐ฆ Parameters ๐ฆ
pointsโ an array of coordinate pairs (x and y), one pair for each point ๐บ๏ธpoints_strideโ the distance, in bytes, between the starts of successive pairs of coordinates in thepointsbuffer ๐colorโ the color of the spline ๐จthicknessโ the thickness of the spline; pass<= 0to draw a hairline spline ๐ชก (yes, hairline, we love a delicate moment)num_segmentsโ the number of segments ๐ข
๐ SEE ALSO ๐
al_calculate_ribbon(3alleg5)โ the math bestie that does the ribbon maths for you ๐งฎโจ
and that's the whole page, no cap ๐
this was pulled straight out of the Allegro reference manual, under the al_draw_ribbon(3alleg5) page, so if you cite it, cite it proud. go forth and draw ribbons, you absolute icon ๐๐๐ฆ
๐ฆ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 ยท Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 ยท Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 ยท Zlib
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms