Deltarune (Chapter 5) script viewer

← back to main script listing

gml_GlobalScript_scr_screenspace

(view raw script w/o annotations or w/e)
1
function screenx(arg0 = x)
2
{
3
    return arg0 - camera_get_view_x(view_camera[0]);
4
}
5
6
function screeny(arg0 = y)
7
{
8
    return arg0 - camera_get_view_y(view_camera[0]);
9
}
10
11
function cache_cameraxy()
12
{
13
    if (!v_ex("camera_time") || camera_time != current_time)
14
    {
15
        camera_time = current_time;
16
        camera_x = camerax();
17
        camera_y = cameray();
18
    }
19
}
20
21
function draw_self_screenspace()
22
{
23
    draw_sprite_ext(sprite_index, image_index, screenx(), screeny(), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
24
}
25
26
function draw_self_screenspace_offset(arg0, arg1)
27
{
28
    draw_sprite_ext(sprite_index, image_index, screenx() + arg0, screeny() + arg1, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
29
}
30
31
function draw_self_surfacespace(arg0, arg1)
32
{
33
    draw_sprite_ext(sprite_index, image_index, x - arg0, y - arg1, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
34
}
35
36
function screenx_ext(arg0 = camerax(), arg1 = x)
37
{
38
    return arg1 - arg0;
39
}
40
41
function screeny_ext(arg0 = cameray(), arg1 = y)
42
{
43
    return arg1 - arg0;
44
}