1 | function tile_get_count() //gml_Script_tile_get_count |
2 | { |
3 | var __totaltiles = 0 |
4 | var __layers = layer_get_all() |
5 | var __numlayers = array_length_1d(__layers) |
6 | for (var __i = 0; __i < __numlayers; __i++) |
7 | { |
8 | var __els = layer_get_all_elements(__layers[__i]) |
9 | var __numels = array_length_1d(__els) |
10 | for (var __j = 0; __j < __numels; __j++) |
11 | { |
12 | var __eltype = layer_get_element_type(__els[__j]) |
13 | if (__eltype == 7) |
14 | __totaltiles++ |
15 | } |
16 | } |
17 | return __totaltiles; |
18 | } |