Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_fx_screenbloom_Draw_0

(view raw script w/o annotations or w/e)
1
siner++;
2
var scale = 0.5 + (global.darkzone * 0.5);
3
if (!surface_exists(mysurface))
4
    mysurface = surface_create(__view_get(e__VW.WView, 0), __view_get(e__VW.HView, 0));
5
surface_set_target(mysurface);
6
if (brightbloom == 1)
7
{
8
    draw_clear_alpha(c_black, 0);
9
    draw_set_blend_mode(bm_add);
10
}
11
if (style == 0)
12
{
13
    draw_set_alpha(0.5);
14
    var b = bloomdist + (sin(siner / period) * amplitude);
15
    draw_surface_ext(application_surface, -b, -b, 0.5, 0.5, 0, c_white, 0.5);
16
    draw_surface_ext(application_surface, b, -b, 0.5, 0.5, 0, c_white, 0.5);
17
    draw_surface_ext(application_surface, -b, b, 0.5, 0.5, 0, c_white, 0.5);
18
    draw_surface_ext(application_surface, b, b, 0.5, 0.5, 0, c_white, 0.5);
19
    draw_set_alpha(bloomstrength);
20
}
21
if (style == 1)
22
{
23
    var b = bloomdist + (sin(siner / period) * amplitude);
24
    draw_set_alpha(0.6);
25
    draw_surface(application_surface, -b * 2, -b * 2);
26
    draw_surface(application_surface, b * 2, -b * 2);
27
    draw_surface(application_surface, -b * 2, b * 2);
28
    draw_surface(application_surface, b * 2, b * 2);
29
    draw_set_alpha(0.5);
30
    draw_surface(application_surface, -b, -b);
31
    draw_surface(application_surface, b, -b);
32
    draw_surface(application_surface, -b, b);
33
    draw_surface(application_surface, b, b);
34
    draw_set_alpha(bloomstrength);
35
}
36
if (style == 2)
37
{
38
    var b = bloomdist + (sin(siner / period) * amplitude);
39
    for (i = 0; i < 4; i++)
40
        draw_surface_ext(application_surface, lengthdir_x(b * 2, (siner * 2) + (90 * i)) + xoff, lengthdir_y(b * 2, (siner * 2) + (90 * i)) + yoff, scale, scale, 0, c_white, 0.6);
41
    for (i = 0; i < 4; i++)
42
        draw_surface_ext(application_surface, lengthdir_x(b, (siner * 2) + (90 * i) + 45) + xoff, lengthdir_y(b, (siner * 2) + (90 * i) + 45) + yoff, scale, scale, 0, c_white, 0.5);
43
}
44
if (style == 3)
45
{
46
    var b = bloomdist + (sin(siner / period) * amplitude);
47
    draw_set_alpha(0.5);
48
    for (i = 0; i < 4; i++)
49
        draw_surface(application_surface, lengthdir_x(b, (siner * 2) + (90 * i) + 45), lengthdir_y(b, (siner * 2) + (90 * i) + 45));
50
    draw_set_alpha(bloomstrength);
51
}
52
surface_reset_target();
53
draw_surface(mysurface, camerax(), cameray());
54
if (brightbloom != 0)
55
    draw_set_blend_mode(bm_normal);
56
57
enum e__VW
58
{
59
    XView,
60
    YView,
61
    WView,
62
    HView,
63
    Angle,
64
    HBorder,
65
    VBorder,
66
    HSpeed,
67
    VSpeed,
68
    Object,
69
    Visible,
70
    XPort,
71
    YPort,
72
    WPort,
73
    HPort,
74
    Camera,
75
    SurfaceID
76
}