tilemap_get_global_mask

Description

This function can be used to retrieve the bit mask value for all tilemaps, returning the current mask value or -1 if there is an error or 0 if no mask is specified. For further information on global tilemap bit masks, see the function tilemap_set_global_mask.


Syntax:

tilemap_get_global_mask();


Returns:

Real (0 for no mask, -1 for an error, mask value otherwise)


Example:

var mask = tilemap_get_global_mask(map_id);
var new_mask = tile_mirror | tile_flip | tile_rotate | 255;
if mask != new_mask
   {
   tilemap_set_global_mask(new_mask);
   }

The above code gets the global mask value associated with all tilemaps. If it is not the same as the value defined in the variable "new_mask", then it is set to that value.