Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_border_controller_Draw_77

(view raw script w/o annotations or w/e)
1
var ww = window_get_width();
2
var wh = window_get_height();
3
var sw = surface_get_width(application_surface);
4
var sh = surface_get_height(application_surface);
5
var xx = floor((ww - (sw * global.window_scale)) / 2);
6
var yy = floor((wh - (sh * global.window_scale)) / 2);
7
global.window_xofs = xx;
8
global.window_yofs = yy;
9
if (scr_is_switch_os() && wh == 720)
10
    texture_set_interpolation(true);
11
else
12
    texture_set_interpolation(false);
13
if (global.screen_border_active)
14
{
15
    var border_id = global.screen_border_id;
16
    draw_enable_alphablend(false);
17
    if (border_id == "Dynamic" || border_id == "ダイナミック")
18
    {
19
        
scr_draw_background_ps4
scr_draw_background_ps4

function
scr_draw_background_ps4(arg0, arg1, arg2)
{ var bg = arg0; var xx = arg1; var yy = arg2; if (os_type == os_ps4 || scr_is_switch_os() || os_type == os_ps5) { var scale = window_get_width() / 1920; draw_background_stretched(bg, xx * scale, yy * scale, background_get_width(bg) * scale, background_get_height(bg) * scale); } else { var scale = window_get_width() / 1920; draw_background_stretched(bg, xx * scale, yy * scale, background_get_width(bg) * scale, background_get_height(bg) * scale); } }
(_border_image, 0, 0);
20
        global.disable_border = obj_time.border_alpha != 1;
21
    }
22
    draw_set_alpha(1);
23
    draw_enable_alphablend(true);
24
    if (_border_image != _border_image_temp)
25
    {
26
        draw_set_alpha(_border_image_temp_alpha);
27
        
scr_draw_background_ps4
scr_draw_background_ps4

function
scr_draw_background_ps4(arg0, arg1, arg2)
{ var bg = arg0; var xx = arg1; var yy = arg2; if (os_type == os_ps4 || scr_is_switch_os() || os_type == os_ps5) { var scale = window_get_width() / 1920; draw_background_stretched(bg, xx * scale, yy * scale, background_get_width(bg) * scale, background_get_height(bg) * scale); } else { var scale = window_get_width() / 1920; draw_background_stretched(bg, xx * scale, yy * scale, background_get_width(bg) * scale, background_get_height(bg) * scale); } }
(_border_image_temp, 0, 0);
28
        _border_image_temp_alpha += _border_image_temp_alpha_amount;
29
        if (_border_image_temp_alpha > 1)
30
        {
31
            _border_image_temp_alpha = 0;
32
            _border_image = _border_image_temp;
33
        }
34
        draw_set_alpha(1);
35
    }
36
    if (custom_effect >= 0)
37
    {
38
        if (custom_effect_con == 0)
39
        {
40
            if (custom_effect_alpha < custom_effect_alpha_target)
41
                custom_effect_alpha += custom_effect_fade_speed;
42
        }
43
        if (custom_effect_con == 1)
44
        {
45
            custom_effect_alpha -= custom_effect_fade_speed;
46
            if (custom_effect_alpha <= 0)
47
            {
48
                custom_effect = -1;
49
                custom_effect_con = 0;
50
            }
51
        }
52
        draw_set_alpha(custom_effect_alpha);
53
        draw_set_color(custom_effect_color);
54
        ossafe_fill_rectangle(0, 0, ww - 1, wh - 1);
55
        draw_set_alpha(1);
56
        draw_set_color(c_white);
57
    }
58
    draw_set_alpha(overlay_alpha);
59
    draw_set_color(overlay_color);
60
    ossafe_fill_rectangle(0, 0, ww - 1, wh - 1);
61
    draw_set_alpha(1);
62
    draw_set_color(c_white);
63
    if (border_id == "Simple" || border_id == "シンプル")
64
    {
65
        
scr_draw_background_ps4
scr_draw_background_ps4

function
scr_draw_background_ps4(arg0, arg1, arg2)
{ var bg = arg0; var xx = arg1; var yy = arg2; if (os_type == os_ps4 || scr_is_switch_os() || os_type == os_ps5) { var scale = window_get_width() / 1920; draw_background_stretched(bg, xx * scale, yy * scale, background_get_width(bg) * scale, background_get_height(bg) * scale); } else { var scale = window_get_width() / 1920; draw_background_stretched(bg, xx * scale, yy * scale, background_get_width(bg) * scale, background_get_height(bg) * scale); } }
(border_line_1080, 0, 0);
66
        global.disable_border = obj_time.border_alpha != 1;
67
    }
68
}
69
else
70
{
71
    var room_id = room;
72
    if (instance_exists(obj_savepoint))
73
        global.disable_border = false;
74
    if (room_id == PLACE_CONTACT || room_id == 1528 || room_id == PLACE_MENU || room_id == room_gameover || room_id == PLACE_DOG)
75
        global.disable_border = true;
76
}
77
draw_enable_alphablend(false);
78
draw_surface_ext(application_surface, xx, yy, global.window_scale, global.window_scale, 0, c_white, 1);
79
if (instance_exists(obj_time))
80
{
81
    var is_paused = false;
82
    with (obj_time)
83
        is_paused = paused;
84
    if (is_paused)
85
    {
86
        if (sprite_exists(obj_time.screenshot))
87
            draw_sprite_ext(obj_time.screenshot, 0, xx, yy, global.window_scale, global.window_scale, 0, c_white, 1);
88
    }
89
}
90
draw_enable_alphablend(true);
91
texture_set_interpolation(false);