Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_radialdistort_Draw_73

(view raw script w/o annotations or w/e)
1
var _cx = camerax();
2
var _cy = cameray();
3
if (!surface_exists(surf_distort))
4
    surf_distort = surface_create(640, 480);
5
if (!surface_exists(surf_capture))
6
{
7
    surf_capture = surface_create(640, 480);
8
    surface_set_target(surf_capture);
9
    gpu_set_blendenable(false);
10
    draw_surface(application_surface, 0, 0);
11
    gpu_set_blendenable(true);
12
    surface_reset_target();
13
}
14
surface_set_target(surf_distort);
15
gpu_set_blendenable(false);
16
draw_clear_alpha(c_black, 0);
17
shader_set(shd_distortiondonut);
18
shader_set_uniform_f(u_distort_pos, x - _cx, y - _cy);
19
shader_set_uniform_f(u_time, time_percent * 640);
20
shader_set_uniform_f(u_donut, ring_start, ring_width, ring_strength);
21
draw_surface(surf_capture, 0, 0);
22
shader_reset();
23
gpu_set_blendenable(true);
24
surface_reset_target();
25
draw_set_alpha(alpha);
26
draw_surface(surf_distort, _cx, _cy);
27
draw_set_alpha(1);