Pixel-Composer/scripts/draw_circle_angle/draw_circle_angle.gml
2023-02-19 19:49:20 +07:00

23 lines
No EOL
451 B
Text

function draw_circle_angle(_x, _y, _r, _angSt, _angEd, precision = 32) {
var ox, oy, nx, ny, oa, na;
draw_primitive_begin(pr_trianglelist);
for( var i = 0; i <= precision; i++ ) {
na = lerp(_angSt, _angEd, i / precision);
nx = _x + lengthdir_x(_r, na);
ny = _y + lengthdir_y(_r, na);
if(i) {
draw_vertex(_x, _y);
draw_vertex(ox, oy);
draw_vertex(nx, ny);
}
oa = na;
ox = nx;
oy = ny;
}
draw_primitive_end();
}