Deltarune (Chapter 2) script viewer

← back to main script listing

gml_GlobalScript_scr_draw_circle_width_radius

(view raw script w/o annotations or w/e)
1
function 
scr_draw_circle_width_radius
scr_draw_circle_width_radius

function
scr_draw_circle_width_radius(arg0, arg1, arg2, arg3, arg4)
{ var xx = arg0; var yy = arg1; var radius = arg2; var inner_radius = max(arg3, 0); var steps = arg4; draw_primitive_begin(pr_trianglelist); for (i = 0; i < steps; i += 1) { draw_vertex(xx + lengthdir_x(inner_radius, (360 * i) / steps), yy + lengthdir_y(inner_radius, (360 * i) / steps)); draw_vertex(xx + lengthdir_x(radius, (360 * i) / steps), yy + lengthdir_y(radius, (360 * i) / steps)); draw_vertex(xx + lengthdir_x(radius, (360 * (i + 1)) / steps), yy + lengthdir_y(radius, (360 * (i + 1)) / steps)); draw_vertex(xx + lengthdir_x(radius, (360 * (i + 1)) / steps), yy + lengthdir_y(radius, (360 * (i + 1)) / steps)); draw_vertex(xx + lengthdir_x(inner_radius, (360 * (i + 1)) / steps), yy + lengthdir_y(inner_radius, (360 * (i + 1)) / steps)); draw_vertex(xx + lengthdir_x(inner_radius, (360 * i) / steps), yy + lengthdir_y(inner_radius, (360 * i) / steps)); } draw_primitive_end(); }
(arg0, arg1, arg2, arg3, arg4)
2
{
3
    var xx = arg0;
4
    var yy = arg1;
5
    var radius = arg2;
6
    var inner_radius = max(arg3, 0);
7
    var steps = arg4;
8
    draw_primitive_begin(pr_trianglelist);
9
    for (i = 0; i < steps; i += 1)
10
    {
11
        draw_vertex(xx + lengthdir_x(inner_radius, (360 * i) / steps), yy + lengthdir_y(inner_radius, (360 * i) / steps));
12
        draw_vertex(xx + lengthdir_x(radius, (360 * i) / steps), yy + lengthdir_y(radius, (360 * i) / steps));
13
        draw_vertex(xx + lengthdir_x(radius, (360 * (i + 1)) / steps), yy + lengthdir_y(radius, (360 * (i + 1)) / steps));
14
        draw_vertex(xx + lengthdir_x(radius, (360 * (i + 1)) / steps), yy + lengthdir_y(radius, (360 * (i + 1)) / steps));
15
        draw_vertex(xx + lengthdir_x(inner_radius, (360 * (i + 1)) / steps), yy + lengthdir_y(inner_radius, (360 * (i + 1)) / steps));
16
        draw_vertex(xx + lengthdir_x(inner_radius, (360 * i) / steps), yy + lengthdir_y(inner_radius, (360 * i) / steps));
17
    }
18
    draw_primitive_end();
19
}