Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_room_tile_add_ext

(view raw script w/o annotations or w/e)
1
function room_tile_add_ext(argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7, argument8, argument9, argument10, argument11) //gml_Script_room_tile_add_ext
2
{
3
    var __ind = argument0
4
    var __back = argument1
5
    var __left = argument2
6
    var __top = argument3
7
    var __width = argument4
8
    var __height = argument5
9
    var __x = argument6
10
    var __y = argument7
11
    var __depth = argument8
12
    var __xscale = argument9
13
    var __yscale = argument10
14
    var __alpha = argument11
15
    if (room_exists(__ind) == false)
16
        return -1;
17
    var __currroom = layer_get_target_room()
18
    layer_set_target_room(__ind)
19
    var __layers = layer_get_all()
20
    var __numlayers = array_length_1d(__layers)
21
    var __layertouse = -1
22
    var __i = 0
23
    while (__i < __numlayers)
24
    {
25
        if (layer_get_depth(__layers[__i]) == __depth)
26
        {
27
            __layertouse = __layers[__i]
28
            break
29
        }
30
        else
31
        {
32
            __i++
33
            continue
34
        }
35
    }
36
    if (__layertouse == -1)
37
        __layertouse = layer_create(__depth)
38
    var __tile = layer_tile_create(__layertouse, __x, __y, __back, __left, __top, __width, __height)
39
    layer_tile_xscale(__tile, __xscale)
40
    layer_tile_yscale(__tile, __yscale)
41
    layer_tile_alpha(__tile, __alpha)
42
    layer_set_target_room(__currroom)
43
    return __tile;
44
}