Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_screen_shatter_effect_Draw_64

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
if (surf_screen_noloop == false)
4
{
5
    surface_set_target(surf_screen_copy)
6
    draw_clear_alpha(c_black, 0)
7
    surface_reset_target()
8
    surface_copy(surf_screen_copy, 0, 0, application_surface)
9
    application_surface_draw_enable(false)
10
    surf_screen_noloop = true
11
}
12
else if (!surface_exists(surf_screen_copy))
13
{
14
    surf_screen_noloop = false
15
    return;
16
}
17
var w_scale = surface_get_width(application_surface) / 320
18
var h_scale = surface_get_height(application_surface) / 240
19
var w_multiplier = 320 / surface_get_width(application_surface)
20
var h_multiplier = 240 / surface_get_height(application_surface)
21
var v = 0
22
var h = 0
23
for (var i = 0; i < total_number; i++)
24
{
25
    if (h > (h_number - 1))
26
    {
27
        h -= h_number
28
        v += 1
29
    }
30
    draw_surface_part_ext(surf_screen_copy, (h * (h_width * w_scale)), (v * (v_height * h_scale)), (h_width * w_scale), (v_height * h_scale), piece_x[i], piece_y[i], w_multiplier, h_multiplier, 16777215, 1)
31
    h += 1
32
}