Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_tile_layer_shift

(view raw script w/o annotations or w/e)
1
function tile_layer_shift(argument0, argument1, argument2) //gml_Script_tile_layer_shift
2
{
3
    var __depth = argument0
4
    var __x = argument1
5
    var __y = argument2
6
    var __layers = layer_get_all()
7
    var __numlayers = array_length_1d(__layers)
8
    for (var __i = 0; __i < __numlayers; __i++)
9
    {
10
        if (layer_get_depth(__layers[__i]) != __depth)
11
        {
12
        }
13
        else
14
        {
15
            var __els = layer_get_all_elements(__layers[__i])
16
            var __numels = array_length_1d(__els)
17
            for (var __j = 0; __j < __numels; __j++)
18
            {
19
                var __eltype = layer_get_element_type(__els[__j])
20
                if (__eltype == 7)
21
                {
22
                    layer_tile_x(__els[__j], (layer_tile_get_x(__els[__j]) + __x))
23
                    layer_tile_y(__els[__j], (layer_tile_get_y(__els[__j]) + __y))
24
                }
25
            }
26
        }
27
    }
28
}