object_get_mask(obj);
Argument | Description |
---|---|
obj | The index of the object to check |
Returns: real
This function will tell you whether the object you are checking
has a mask index or not, and if it does then it will return the
index of that mask, or -1 if it does not. Please note that this is
not an instance function! You can have an object with no mask while
an instance of that same object can have one and vice-versa, or
they can even have different masks. You can set an individual
instances mask index using the mask_index
instance variable.
if mask_index != object_get_mask(object_index) mask_index = object_get_mask(object_index);
The above example will check the mask index of the instance against the mask of the object_index of the instance. If they are not the same, then it will assign the same mask as the one the object index has to the instance.