al_draw_pieslice(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 <= 0 to draw a hairline pieslice. so zero or below and it goes all delicate and thin on you. ✨
fr fr, delta_theta going negative flipping the direction is not a bug, it's a feature, and thickness <= 0 giving 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