Set image mask requires that;
The DESTINATION image has a mask when copying the alpha channel, other wise it will not work.
The DESTINATION image mask must also be smaller than the dimensions of the image, other wise it will not work.
//Example by Quarter Circles Sprites (AGK version: 108.24)
//Submitted: 2015-02-17 18:53:45
// set window properties
SetWindowTitle( "image mask" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
mask_squiggle = loadimage("mask_squiggle.png")
nomask_squiggle = loadimage("nomask_squiggle.png")
spade = Loadimage("spade.png")
SetImageMask(nomask_squiggle, spade, 4, 4, 0, 0 )
SetImageMask(mask_squiggle, spade, 4, 4, 0, 0 )
nomask_sprite = CreateSprite(nomask_squiggle)
SetSpritePosition(nomask_sprite, 0, 20)
mask_sprite = CreateSprite(mask_squiggle)
SetSpritePosition(mask_sprite, 0, 320)
SetPrintSize(18)
do
print("Squiggle image has a mask that covers the entire image")
print(""): print(""): print(""): print(""): print(""): print("")
print(""): print(""): print(""): print(""): print(""): print("")
print(""): print(""): print(""): print(""): print(""):
print("Squiggle image has a mask that is smaller than the image size")
sync()
loop