1 |
function room_tile_add(argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7, argument8) //gml_Script_room_tile_add |
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 |
if (room_exists(__ind) == false) |
13 |
return -1; |
14 |
var __currroom = layer_get_target_room() |
15 |
layer_set_target_room(__ind) |
16 |
var __layers = layer_get_all() |
17 |
var __numlayers = array_length_1d(__layers) |
18 |
var __layertouse = -1 |
19 |
var __i = 0 |
20 |
while (__i < __numlayers) |
21 |
{ |
22 |
if (layer_get_depth(__layers[__i]) == __depth) |
23 |
{ |
24 |
__layertouse = __layers[__i] |
25 |
break |
26 |
} |
27 |
else |
28 |
{ |
29 |
__i++ |
30 |
continue |
31 |
} |
32 |
} |
33 |
if (__layertouse == -1) |
34 |
__layertouse = layer_create(__depth) |
35 |
var __tile = layer_tile_create(__layertouse, __x, __y, __back, __left, __top, __width, __height) |
36 |
layer_set_target_room(__currroom) |
37 |
return __tile; |
38 |
} |