1 |
function draw_sprite_part_parallax(arg0, arg1, arg2, arg3, arg4) |
2 |
{ |
3 |
var _mysprite = arg0; |
4 |
var _mywidth = sprite_get_width(arg0); |
5 |
var _myheight = sprite_get_height(arg0); |
6 |
var _xoffset = arg2 % _mywidth; |
7 |
var _yoffset = arg3 % _myheight; |
8 |
if (_xoffset < 0) |
9 |
_xoffset += _mywidth; |
10 |
if (_yoffset < 0) |
11 |
_yoffset += _myheight; |
12 |
if (_xoffset == 0 && _yoffset == 0) |
13 |
{ |
14 |
draw_sprite_ext(arg0, arg1, x, y, 2, 2, 0, image_blend, arg4); |
15 |
} |
16 |
else |
17 |
{ |
18 |
draw_sprite_part_ext(arg0, arg1, 0, 0, _mywidth - _xoffset, _myheight - _yoffset, x + (_xoffset * 2), y + (_yoffset * 2), 2, 2, image_blend, arg4); |
19 |
draw_sprite_part_ext(arg0, arg1, _mywidth - _xoffset, _myheight - _yoffset, _xoffset, _yoffset, x, y, 2, 2, image_blend, arg4); |
20 |
draw_sprite_part_ext(arg0, arg1, 0, _myheight - _yoffset, _mywidth - _xoffset, _yoffset, x + (_xoffset * 2), y, 2, 2, image_blend, arg4); |
21 |
draw_sprite_part_ext(arg0, arg1, _mywidth - _xoffset, 0, _xoffset, _myheight - _yoffset, x, y + (_yoffset * 2), 2, 2, image_blend, arg4); |
22 |
} |
23 |
} |