Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ** usage:
- ** draw_ring(x, y, radius, thickness, quality)
- **
- ** given:
- ** x,y center point of the ring
- ** radius distance from the center to the outermost point of the ring
- ** thickness thickness of the ring outline
- ** quality granularity of the drawing, ie number of vertices. default 32. try low numbers like 3-8 to make outlined n-gons.
- **
- **
- ** GMLscripts.com
- */
- {
- var xx=argument0,yy=argument1,rad=argument2,thick=argument3,qual=32;
- if argument4>0{qual = argument4;}
- draw_primitive_begin(pr_trianglestrip);
- var i;
- for(i=0;i<=qual;i+=1)
- {
- draw_vertex(xx+lengthdir_x(rad,i*360/qual),yy+lengthdir_y(rad,i*360/qual));
- draw_vertex(xx+lengthdir_x(rad-thick,(i)*360/qual),yy+lengthdir_y(rad-thick,(i)*360/qual));
- }
- draw_primitive_end();
- }
RAW Paste Data