Deltarune (Chapter 3) script viewer

← back to main script listing

gml_GlobalScript_scr_screenspace

(view raw script w/o annotations or w/e)
1
function screenx()
2
{
3
    var __xx = (argument_count == 1) ? argument[0] : x;
4
    return __xx - camerax();
5
}
6
7
function screeny()
8
{
9
    var __yy = (argument_count == 1) ? argument[0] : y;
10
    return __yy - cameray();
11
}
12
13
function screenvec2()
14
{
15
    var __vec = (argument_count == 1) ? argument[0] : new Vector2(x, y);
16
    __vec.x -= camerax();
17
    __vec.y -= cameray();
18
    return __vec;
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
}