al_draw_ribbon(3alleg5)

๐Ÿ“ฆ
version 5.2.11.3 ยท 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– 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 the points buffer ๐Ÿ“
  • color โ€” the color of the spline ๐ŸŽจ
  • thickness โ€” the thickness of the spline; pass <= 0 to draw a hairline spline ๐Ÿชก (yes, hairline, we love a delicate moment)
  • num_segments โ€” the number of segments ๐Ÿ”ข

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€


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