Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_factory_03_axis_flashlight_Draw_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
if (active == -1)
4
    return;
5
var darkness_alpha = 0.6
6
if (!surface_exists(lighting_surface))
7
    lighting_surface = surface_create(camera_get_view_width(view_camera[0]), camera_get_view_height(view_camera[0]))
8
if surface_exists(lighting_surface)
9
{
10
    var view_x = camera_get_view_x(view_camera[0])
11
    var view_y = camera_get_view_y(view_camera[0])
12
    surface_set_target(lighting_surface)
13
    draw_set_color(c_black)
14
    draw_set_alpha(darkness_alpha)
15
    draw_rectangle(0, 0, room_width, room_height, false)
16
    draw_set_alpha(1)
17
    if instance_exists(obj_factory_03_furnace_light)
18
    {
19
        with (obj_factory_03_furnace_light)
20
        {
21
            gpu_set_blendmode(bm_subtract)
22
            draw_sprite_ext(sprite_index, -1, (x - view_x), (y - view_y), 1, 1, image_angle, c_white, 1)
23
            gpu_set_blendmode(bm_normal)
24
        }
25
    }
26
    if (active == true)
27
    {
28
        gpu_set_blendmode(bm_subtract)
29
        draw_sprite_ext(spr_factory_03_axis_flashlight_mask, 0, (x - view_x), (y - view_y), 1, 1, image_angle, c_white, 1)
30
        gpu_set_blendmode(bm_normal)
31
    }
32
    surface_reset_target()
33
    draw_surface(lighting_surface, view_x, view_y)
34
}