Skip to content

Draw Pie Slice

Mikkel102454 edited this page Oct 6, 2026 · 1 revision

draw_pie_slice

Draw a filled circular sector.

Arguments

All listed arguments are required.

Name Type Meaning
x, y integer Center inside the display
radius integer 1 through 4096 pixels
start_angle integer Starting angle in degrees; normalized modulo 360
sweep_angle integer Clockwise sweep, 1 through 360 degrees
color string Opaque palette color

Example

{
  "cmd": "draw_pie_slice",
  "args": {
    "x": 200,
    "y": 135,
    "radius": 80,
    "start_angle": 270,
    "sweep_angle": 90,
    "color": "red"
  }
}

Behavior

Zero degrees points right, 90 down, 180 left, and 270 up. A 360-degree sweep fills a disk. The sector is clipped to the framebuffer while its center must be inside. Use one command per slice; later slices overwrite overlapping pixels. There are no width or fill arguments.

See Command Reference, Color Palette, and Renderer Notes.

Implementation references

Clone this wiki locally