SimonSmith said:That is a great feature .
Please add this feature to drawsprite.
That is much more versatile..
Drawsprite already works with sprites that use alpha masks. Just load the mask along with the sprite (i.e.,
Code:
loadsprite(path, maskpath)
SimonSmith said:I found loadsprite has 2 parameters: loadsprite(path,maskpath)
And I don't know how to make it work.
I tested the 2nd parameter and gave it a mask file.
But it didn't work properly... :'(
I just tested it and it works, so your mask is probably malformed. Alpha masks in OpenBOR have to be grayscale images following very specific rules:
[quote author=the linked wiki page]
- The mask must have exactly the same width and height as its corresponding sprite.
- The transparent pixels in the sprite must match exactly with the fully transparent (grayscale value 0) pixels in the mask. Any transparent pixels in one image that aren't transparent in the other will cause undefined behavior - anything from the mask not working to a complete engine crash.