Hi,
I'm new here, and new to ags. I've had a good search for the answer to my question and haven't been able to find an answer, so apologies if this has been asked before.
Basically, I'm trying to import sprites with alpha blending, my game is set to 32bit color depth, but when I import a png, bmp or tga version of the sprite (which was created in flash, although I've since opened it in photoshop to double check that the alpha channel is ok) it gives me no options to use the alpha for transparency. I simply get the standard, pallette index 0, top-left pixel etc, no alpha channel option. So obviously the image looks less than desirable.
To me it seems like the game isn't actually in 32bit mode. I've checked in the GAME, Change color depth, and it says it is set to 32bit mode.
Any help would be greatly appreciated. I'm a huge adventure game fan, and also an animator, so ags is exactly the kind of thing I've been looking for. And if I can get this alpha blending problem solved, I'll be a happy man.
I've linked to an image of the import screen, plus a png and bmp version of the sprite for reference.
Thanks so much for the help
Tim
http://www.mukpuddy.com/mukbucket/agsimport.jpg
http://www.mukpuddy.com/mukbucket/squirrel_idol_side0001.bmp
http://www.mukpuddy.com/mukbucket/squirrel_idol_side0001.png
When you import a png with alpha channel there should come up a window where it says, if you want to use the alpha channel or not. And it seems that your png doesn't have any alpha channel.
Alpha channel means that you have some pixels which are not fully transparent(some are 80% transparent some are 44% transparent...)
The best way is to make the background fully transparent and then draw on it. Save it as an png and import it. it should work.
AFAIK, AGS can only import alpha channel data from PNG images, so the bmp, tga and jpg versions wouldn't work, regardless. (Can those formats even have alpha channels? TGA, maybe, but I don't think JPG or BMP can...)
I tried the PNG version you linked - no option to use the alpha channel in AGS, but acording to PSP it doesn't have one. I resaved it with one in PSP, opened it in AGS, got the option and it worked fine. I think the problem is (at least, this is the problem I had with PSP for a while), the transparency layer you've saved isn't the same as the alpha channel AGS looks for. I don't know enough about the technical side to explain it better than that - the transparency can be there for some programs, but you need to save/export the PNG in a specific way to make AGS acknowledge it. I'm not familiar with PS or Flash, so I couldn't tell you what it was (try looking into the 'Export' settins, though), and that's drifting away from AGS Technical questions, anyway.
I would recommend you dont use a png alpha for a character, use the "top left pixel" or something like that. the problem i had when using alphas was that for instance on a character if you clicked the eyeball inside the sprites limits over the transparent area it would be as if your clicking on the character and not on something behind the character. the ags engine seems to ignore that the alpha is actually transparent. do a test where you have a 200x200 pixel image all transparent except for a 1 pixel dot and anywhere you click inside that 200x200 area even though its supposed to be transparent will act as though your clicking on the dot
Da_Elf, can you replicate that? I've tried a couple of times, and pixel-perfect detection works fine on sprites (Characters or Objects) with alpha channels - provided the 'transparancy' is 100%. Partial transparency (kind of the point of alpha channels, I know) count as clicks on the sprite but I don't think that's a bug, more like the desired behaviour.
Hi everyone,
Thanks heaps for your help, you were absolutely right, neither the png or the bmp had working alpha channels. Photoshop was being a liar.
For future reference you can export animation frames straight from flash to a png sequence (with a working alpha channel) and bring them straight into AGS. This will make things much quicker for my game/test.
Thanks again.
Tim
hmmm. i cant seem to get it to work anymore. guess its not a repeatable thing