I believe there is a trransparency error when using getImage, can anyone else confirm this? I have logged it on the issues list, with the sample code if anyone can test it:
http://code.google.com/p/agk/issues/detail?id=288
The issue is, if you have an opaque image and a transparent image overlaying it, getImage ignores the opacity and
gets a transparent image. If one of the images is totally opaque, it is impossible for the composite image to be transparent!
Below, the sphere on the left is the composite image and should not
be transparent...
the code...
setVirtualResolution(640,480)
imgTrans = loadimage("default\ball0.png")
imgMain = loadimage("default\ball1.png")
spr2 = createsprite(imgTrans)
spr1 = createsprite(imgMain)
setSpriteDepth(spr2,5)
render()
img1 = getImage(0,0,256,256)
saveImage(img1, "Image_with_trans.png")
sleep(1000)
deleteSprite(imgTrans)
render()
img2 = getImage(0,0,256,256)
saveImage(img2, "Image_without_trans.png")
sleep(1000)
`** Show the transparency problem onscreen
setSpritePositionbyOffset(imgMain, 320,240)
spriteTrans = createSprite(img1)
spriteNoTrans = createSprite(img2)
setSpriteDepth(spriteTrans, 5)
setSpriteDepth(spriteNoTrans, 5)
setSpritePositionbyOffset(spriteTrans, 320-128, 240)
setSpritePositionbyOffset(spriteNoTrans, 320+128, 240)
do
sync()
loop
exit