Deltarune (Chapter 5) script viewer

← back to main script listing

gml_GlobalScript_scr_getspritepoint

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

function
scr_getspritepoint(arg0, arg1 = 0.5, arg2 = 0.5, arg3 = true)
{ var _obj = arg0; if (!i_ex(_obj)) exit; var _x = arg0.x; var _y = arg0.y; with (_obj) { _x = (x - sprite_xoffset) + round(sprite_width * arg1); _y = (y - sprite_yoffset) + round(sprite_height * arg2); } return new Vector2(_x, _y); }
(arg0, arg1 = 0.5, arg2 = 0.5, arg3 = true)
2
{
3
    var _obj = arg0;
4
    if (!i_ex(_obj))
5
        exit;
6
    var _x = arg0.x;
7
    var _y = arg0.y;
8
    with (_obj)
9
    {
10
        _x = (x - sprite_xoffset) + round(sprite_width * arg1);
11
        _y = (y - sprite_yoffset) + round(sprite_height * arg2);
12
    }
13
    return new Vector2(_x, _y);
14
}