Deltarune (Chapter 3) script viewer

← back to main script listing

gml_GlobalScript_scr_perspective_shadow

(view raw script w/o annotations or w/e)
1
function 
scr_perspective_shadow
scr_perspective_shadow

function
scr_perspective_shadow(arg0, arg1 = 100)
{ var _x2 = camerax() + (camerawidth() / 2); var _y2 = cameray() + (cameraheight() / 2); scr_perspective_shadow_ext(arg0, 0, _x2, _y2, false, 0, arg1); } function scr_perspective_shadow_ext(arg0, arg1, arg2, arg3 = 0, arg4 = false, arg5 = 0, arg6 = 100) { with (arg0) { var _stl =
scr_get_sprite_point(id, 0, 0, false);
var _sbr =
scr_get_sprite_point(id, 1, 1, false);
var _sh = arg3 -
scr_get_sprite_point(id, 0, 0, false).y;
var _topdif = _stl.y - arg3; var _botdif = _sbr.y - arg3; var _tl = scr_perspective_scale_ext(_stl.x, arg3, arg6 + _topdif, arg1, arg2, arg6); var _tr = scr_perspective_scale_ext(_sbr.x, arg3, arg6 + _topdif, arg1, arg2, arg6); var _bl = scr_perspective_scale_ext(_stl.x, arg3, arg6 + _botdif, arg1, arg2, arg6); var _br = scr_perspective_scale_ext(_sbr.x, arg3, arg6 + _botdif, arg1, arg2, arg6); draw_sprite_pos_fixed_col(sprite_index, image_index, _tl.x, _tl.y, _tr.x, _tr.y, _br.x, _br.y, _bl.x, _bl.y, arg5, 1); } } function scr_perspective_shadow_alt(arg0, arg1, arg2, arg3 = 0, arg4 = false, arg5 = 0, arg6 = 100) { with (arg0) { var _bl =
scr_get_sprite_point(id, 0, 1, false);
var _br =
scr_get_sprite_point(id, 1, 1, false);
if (!arg4) arg3 += _bl.y; var _sh = arg3 -
scr_get_sprite_point(id, 0, 0, false).y;
var _sl = scr_perspective_scale_ext(_bl.x, arg3, arg6 - _sh, arg1, arg2, arg6); var _sr = scr_perspective_scale_ext(_br.x, arg3, arg6 - _sh, arg1, arg2, arg6); if (!arg4 && arg3 != _bl.y) { _bl = scr_perspective_scale_ext(_bl.x, arg3, arg6 + (sprite_height - _sh), arg1, arg2); _br = scr_perspective_scale_ext(_br.x, arg3, arg6 + (sprite_height - _sh), arg1, arg2); } draw_sprite_pos_fixed_col(sprite_index, image_index, _sl.x, _sl.y, _sr.x, _sr.y, _br.x, arg3, _bl.x, arg3, arg5, 1); } }
(arg0, arg1 = 100)
2
{
3
    var _x2 = camerax() + (camerawidth() / 2);
4
    var _y2 = cameray() + (cameraheight() / 2);
5
    scr_perspective_shadow_ext(arg0, 0, _x2, _y2, false, 0, arg1);
6
}
7
8
function scr_perspective_shadow_ext(arg0, arg1, arg2, arg3 = 0, arg4 = false, arg5 = 0, arg6 = 100)
9
{
10
    with (arg0)
11
    {
12
        var _stl = 
scr_get_sprite_point
scr_get_sprite_point

function
scr_get_sprite_point(arg0 = -4, arg1 = 0.5, arg2 = 0.5, arg3 = true)
{ var __v2 = new Vector2(0, 0); if (arg0 != -4) { with (arg0) { __v2.x = (x - sprite_xoffset) + (sprite_width * arg1); __v2.y = (y - sprite_yoffset) + (sprite_height * arg2); if (arg3) __v2 = scr_rotatevector_around(__v2, new Vector2(x, y), image_angle); } } return __v2; } function scr_get_sprite_point_x(arg0, arg1 = 0.5, arg2 = true) { return
scr_get_sprite_point(arg0, arg1, 0.5, arg2).x;
} function scr_get_sprite_point_y(arg0, arg1 = 0.5, arg2 = true) { return
scr_get_sprite_point(arg0, 0.5, arg1, arg2).y;
}
(id, 0, 0, false);
13
        var _sbr = 
scr_get_sprite_point
scr_get_sprite_point

function
scr_get_sprite_point(arg0 = -4, arg1 = 0.5, arg2 = 0.5, arg3 = true)
{ var __v2 = new Vector2(0, 0); if (arg0 != -4) { with (arg0) { __v2.x = (x - sprite_xoffset) + (sprite_width * arg1); __v2.y = (y - sprite_yoffset) + (sprite_height * arg2); if (arg3) __v2 = scr_rotatevector_around(__v2, new Vector2(x, y), image_angle); } } return __v2; } function scr_get_sprite_point_x(arg0, arg1 = 0.5, arg2 = true) { return
scr_get_sprite_point(arg0, arg1, 0.5, arg2).x;
} function scr_get_sprite_point_y(arg0, arg1 = 0.5, arg2 = true) { return
scr_get_sprite_point(arg0, 0.5, arg1, arg2).y;
}
(id, 1, 1, false);
14
        var _sh = arg3 - 
scr_get_sprite_point
scr_get_sprite_point

function
scr_get_sprite_point(arg0 = -4, arg1 = 0.5, arg2 = 0.5, arg3 = true)
{ var __v2 = new Vector2(0, 0); if (arg0 != -4) { with (arg0) { __v2.x = (x - sprite_xoffset) + (sprite_width * arg1); __v2.y = (y - sprite_yoffset) + (sprite_height * arg2); if (arg3) __v2 = scr_rotatevector_around(__v2, new Vector2(x, y), image_angle); } } return __v2; } function scr_get_sprite_point_x(arg0, arg1 = 0.5, arg2 = true) { return
scr_get_sprite_point(arg0, arg1, 0.5, arg2).x;
} function scr_get_sprite_point_y(arg0, arg1 = 0.5, arg2 = true) { return
scr_get_sprite_point(arg0, 0.5, arg1, arg2).y;
}
(id, 0, 0, false).y;
15
        var _topdif = _stl.y - arg3;
16
        var _botdif = _sbr.y - arg3;
17
        var _tl = scr_perspective_scale_ext(_stl.x, arg3, arg6 + _topdif, arg1, arg2, arg6);
18
        var _tr = scr_perspective_scale_ext(_sbr.x, arg3, arg6 + _topdif, arg1, arg2, arg6);
19
        var _bl = scr_perspective_scale_ext(_stl.x, arg3, arg6 + _botdif, arg1, arg2, arg6);
20
        var _br = scr_perspective_scale_ext(_sbr.x, arg3, arg6 + _botdif, arg1, arg2, arg6);
21
        draw_sprite_pos_fixed_col(sprite_index, image_index, _tl.x, _tl.y, _tr.x, _tr.y, _br.x, _br.y, _bl.x, _bl.y, arg5, 1);
22
    }
23
}
24
25
function scr_perspective_shadow_alt(arg0, arg1, arg2, arg3 = 0, arg4 = false, arg5 = 0, arg6 = 100)
26
{
27
    with (arg0)
28
    {
29
        var _bl = 
scr_get_sprite_point
scr_get_sprite_point

function
scr_get_sprite_point(arg0 = -4, arg1 = 0.5, arg2 = 0.5, arg3 = true)
{ var __v2 = new Vector2(0, 0); if (arg0 != -4) { with (arg0) { __v2.x = (x - sprite_xoffset) + (sprite_width * arg1); __v2.y = (y - sprite_yoffset) + (sprite_height * arg2); if (arg3) __v2 = scr_rotatevector_around(__v2, new Vector2(x, y), image_angle); } } return __v2; } function scr_get_sprite_point_x(arg0, arg1 = 0.5, arg2 = true) { return
scr_get_sprite_point(arg0, arg1, 0.5, arg2).x;
} function scr_get_sprite_point_y(arg0, arg1 = 0.5, arg2 = true) { return
scr_get_sprite_point(arg0, 0.5, arg1, arg2).y;
}
(id, 0, 1, false);
30
        var _br = 
scr_get_sprite_point
scr_get_sprite_point

function
scr_get_sprite_point(arg0 = -4, arg1 = 0.5, arg2 = 0.5, arg3 = true)
{ var __v2 = new Vector2(0, 0); if (arg0 != -4) { with (arg0) { __v2.x = (x - sprite_xoffset) + (sprite_width * arg1); __v2.y = (y - sprite_yoffset) + (sprite_height * arg2); if (arg3) __v2 = scr_rotatevector_around(__v2, new Vector2(x, y), image_angle); } } return __v2; } function scr_get_sprite_point_x(arg0, arg1 = 0.5, arg2 = true) { return
scr_get_sprite_point(arg0, arg1, 0.5, arg2).x;
} function scr_get_sprite_point_y(arg0, arg1 = 0.5, arg2 = true) { return
scr_get_sprite_point(arg0, 0.5, arg1, arg2).y;
}
(id, 1, 1, false);
31
        if (!arg4)
32
            arg3 += _bl.y;
33
        var _sh = arg3 - 
scr_get_sprite_point
scr_get_sprite_point

function
scr_get_sprite_point(arg0 = -4, arg1 = 0.5, arg2 = 0.5, arg3 = true)
{ var __v2 = new Vector2(0, 0); if (arg0 != -4) { with (arg0) { __v2.x = (x - sprite_xoffset) + (sprite_width * arg1); __v2.y = (y - sprite_yoffset) + (sprite_height * arg2); if (arg3) __v2 = scr_rotatevector_around(__v2, new Vector2(x, y), image_angle); } } return __v2; } function scr_get_sprite_point_x(arg0, arg1 = 0.5, arg2 = true) { return
scr_get_sprite_point(arg0, arg1, 0.5, arg2).x;
} function scr_get_sprite_point_y(arg0, arg1 = 0.5, arg2 = true) { return
scr_get_sprite_point(arg0, 0.5, arg1, arg2).y;
}
(id, 0, 0, false).y;
34
        var _sl = scr_perspective_scale_ext(_bl.x, arg3, arg6 - _sh, arg1, arg2, arg6);
35
        var _sr = scr_perspective_scale_ext(_br.x, arg3, arg6 - _sh, arg1, arg2, arg6);
36
        if (!arg4 && arg3 != _bl.y)
37
        {
38
            _bl = scr_perspective_scale_ext(_bl.x, arg3, arg6 + (sprite_height - _sh), arg1, arg2);
39
            _br = scr_perspective_scale_ext(_br.x, arg3, arg6 + (sprite_height - _sh), arg1, arg2);
40
        }
41
        draw_sprite_pos_fixed_col(sprite_index, image_index, _sl.x, _sl.y, _sr.x, _sr.y, _br.x, arg3, _bl.x, arg3, arg5, 1);
42
    }
43
}