L
Yeah, I wonder if there is a way of getting those information...There's sprite_collision_mask which lets you define the mask, including the type and dimensions, but I'm not aware of any function that actually returns what mask type a sprite has.
enum MaskType {rectangle, rectRot, ellipse, diamond, precise, precisePerFrame}
maskType = MaskType.ellipse;
That would work, but the cohesion of the solution would be a problem. The number of issues would include: changing the mask type in the sprite and forgetting to set in the code; possibly setting the mask type wrong in the code. Besides the fact that every single sprite would need additional work.I dont see why you would need this information, but you could always create a variable for each instance and manually type in the type of collision mask it has, for example:
shouldn't be that messy to implement.Code:enum MaskType {rectangle, rectRot, ellipse, diamond, precise, precisePerFrame} maskType = MaskType.ellipse;
draw_sprite(mask_index, 0, x, y);
Again, the mask_index is just another sprite at the end of the day. A sprite that does not actually represent visually its own collision mask can be assigned as mask_index, leading to some inaccurate results.You could assign each object a sprite as its mask using mask_index, then draw it on top of the object's sprite:
Well, there are many other ways of drawing the mask, but yes i can see how it could be useful as a built-in function for debugging purposes.Code:draw_sprite(mask_index, 0, x, y);
Personally I mostly avoid using sprites as their own masks for the same reason that i like to visually see the actual collision mask without going in the sprite editor each time.
You're right, I forgot to mention that the sprite you use as the mask should look the same as its collision area to avoid confusion.Again, the mask_index is just another sprite at the end of the day. A sprite that does not actually represent visually its own collision mask can be assigned as mask_index, leading to some inaccurate results.