Skip to content

Instantly share code, notes, and snippets.

@YellowAfterlife
Created November 11, 2015 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YellowAfterlife/97e7d9e237eaef82ac7f to your computer and use it in GitHub Desktop.
Save YellowAfterlife/97e7d9e237eaef82ac7f to your computer and use it in GitHub Desktop.
/// draw_circle_width(x, y, rad1, rad2, segments)
var _x; _x = argument0;
var _y; _y = argument1;
var r1; r1 = argument2;
var r2; r2 = argument3;
var sn; sn = argument4;
//
var i; i = 0;
draw_primitive_begin(pr_trianglestrip);
repeat (sn + 1) {
var d, dx, dy;
d = i / sn * 360;
dx = lengthdir_x(1, d);
dy = lengthdir_y(1, d);
draw_vertex(_x + dx * r1, _y + dy * r1);
draw_vertex(_x + dx * r2, _y + dy * r2);
i += 1;
}
draw_primitive_end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment