Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_tile_add

(view raw script w/o annotations or w/e)
1
function tile_add(argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7) //gml_Script_tile_add
2
{
3
    var __back = argument0
4
    var __left = argument1
5
    var __top = argument2
6
    var __width = argument3
7
    var __height = argument4
8
    var __x = argument5
9
    var __y = argument6
10
    var __depth = argument7
11
    var __layers = layer_get_all()
12
    var __numlayers = array_length_1d(__layers)
13
    var __layertouse = -1
14
    var __i = 0
15
    while (__i < __numlayers)
16
    {
17
        if (layer_get_depth(__layers[__i]) == __depth)
18
        {
19
            __layertouse = __layers[__i]
20
            break
21
        }
22
        else
23
        {
24
            __i++
25
            continue
26
        }
27
    }
28
    if (__layertouse == -1)
29
        __layertouse = layer_create(__depth)
30
    var __tile = layer_tile_create(__layertouse, __x, __y, __back, __left, __top, __width, __height)
31
    return __tile;
32
}