al_draw_pieslice(3alleg5)
β¨ al_draw_pieslice β Allegro 5 API β¨
okay bestie, sit down, hydrate, because we're about to draw a pie slice π this is from the allegro5 manual, section 3alleg5, and it's genuinely one of the cutest little primitives in the whole set. no cap.
πΈ SYNOPSIS πΈ
#include <allegro5/allegro_primitives.h>
void al_draw_pieslice(float cx, float cy, float r, float start_theta,
float delta_theta, ALLEGRO_COLOR color, float thickness)
π DESCRIPTION π
So the vibe here? It draws a pieslice β that's an outlined circular sector, meaning the curved wedge shape, just the outline, not filled in. Think of the little slice-of-pie shape and that's literally it. π₯§
Here are the parameters, and yes we're going through every single one because they all matter:
cx,cyβ the center of the pieslice. that's the pointy corner where all the slices would meet, the origin of the whole situation. πrβ the radius of the pieslice. how far out the curve stretches from that center. πcolorβ the color of the pieslice. self-explanatory but like, important. π¨start_thetaβ the initial angle from which the pieslice is drawn, in radians. radians, bestie, not degrees β iykyk. this is where the slice starts sweeping from. πdelta_thetaβ the angular span of the pieslice, in radians. this is how wide the wedge is. and here's the fun part: pass a negative number to switch direction. so if you want it going the other way, you just go negative, iconic behavior honestly. πthicknessβ the thickness of the circle. and listen: pass<= 0to draw a hairline pieslice. so zero or below and it goes all delicate and thin on you. β¨
fr fr,delta_thetagoing negative flipping the direction is not a bug, it's a feature, andthickness <= 0giving you a hairline is also extremely on purpose. π
β SINCE β
- 5.0.6, 5.1.0 β so she's been around for a minute, we love a stable queen. π
π¦ SEE ALSO π¦
al_draw_filled_pieslice(3alleg5)β the filled version, for when you want that slice SOLID and unbothered. the way that outline vs fill pipeline goes... obsessed. π
and that's the whole page, bestie π«Ά courtesy of the Allegro reference manual, all the way back from versions 5.0.6 and 5.1.0. go draw some wedges, you're gonna eat πβ¨π
π¦ 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