1 |
var __result; |
2 |
function __background_get_colour_element() //gml_Script___background_get_colour_element |
3 |
{ |
4 |
var __nearestdepth = -15000 |
5 |
var __farthestdepth = 15999 |
6 |
var __depthinc = 100 |
7 |
__result[0] = -1 |
8 |
__result[1] = -1 |
9 |
var __colstring = "Compatibility_Colour" |
10 |
var __layerlist = layer_get_all() |
11 |
var __layerlistlength = array_length_1d(__layerlist) |
12 |
var __layerid = -1 |
13 |
var __isforeground = false |
14 |
var __i = 0 |
15 |
while (__i < __layerlistlength) |
16 |
{ |
17 |
var __layername = layer_get_name(__layerlist[__i]) |
18 |
if (string_pos(__colstring, __layername) > 0) |
19 |
{ |
20 |
__layerid = __layerlist[__i] |
21 |
break |
22 |
} |
23 |
else |
24 |
{ |
25 |
__i++ |
26 |
continue |
27 |
} |
28 |
} |
29 |
if (__layerid != -1) |
30 |
{ |
31 |
var __els = layer_get_all_elements(__layerid) |
32 |
var __elslength = array_length_1d(__els) |
33 |
for (__i = 0; __i < __elslength; __i++) |
34 |
{ |
35 |
if (layer_get_element_type(__els[__i]) == 1) |
36 |
{ |
37 |
__result[0] = __els[__i] |
38 |
__result[1] = __layerid |
39 |
} |
40 |
} |
41 |
} |
42 |
else |
43 |
{ |
44 |
var __newback = __background_set_element(-1, false, false, -1, 0, 0, true, true, 1, 1, true, 0, 0, c_black, 1) |
45 |
__result[0] = __newback[0] |
46 |
__result[1] = __newback[1] |
47 |
} |
48 |
return __result; |
49 |
} |