Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Crimson Wizard on Fri 04/12/2009 00:44:48

Title: AGS transparent colour
Post by: Crimson Wizard on Fri 04/12/2009 00:44:48
What is AGS transparent colour?

When I import sprites there's an option for transparency "leave as-is". When it is selected, a hint appear saying that pixels matching AGS transparent colour will be made transparent.

I tried classic magenta (0xFF00FF) but it did not work.
Title: Re: AGS transparent colour
Post by: Ryan Timothy B on Fri 04/12/2009 01:45:18
R: 255
G: 0
B: 255

(It's pink/magenta/whatever lol. Like the background of a GUI if you have 0 as the background color)
Title: Re: AGS transparent colour
Post by: Calin Leafshade on Fri 04/12/2009 01:48:26
its slightly odd in 32-bit games

255,0,255 doesnt work when using drawpixel so it may be the same for import (you have to use COLOR_TRANSPARENT in the script)
Title: Re: AGS transparent colour
Post by: Crimson Wizard on Fri 04/12/2009 15:08:38
Quote from: Ryan Timothy on Fri 04/12/2009 01:45:18
R: 255
G: 0
B: 255

(It's pink/magenta/whatever lol. Like the background of a GUI if you have 0 as the background color)
But that is exactly what I tried!

Problem is I had a bunch of sprites I wanted to import as tiles (all in once). But they had transparent pixels in different places so I could not use "left-top pixel" or similar option. So I used "leave as-is". I painted transparent pixels as magenta (0xFF00FF or 255-0-255) on my image, then imported it, and it did not work, AGS just copied magenta as magenta and not made it transparent colour (yeah, I tried it in game and it was so).

Project uses 16-bit colour setting btw.
Title: Re: AGS transparent colour
Post by: Ryan Timothy B on Fri 04/12/2009 18:06:39
Perhaps when you saved the image it altered the colors? Have you reopened the image file to see if it's still 255,0,255?
Title: Re: AGS transparent colour
Post by: Crimson Wizard on Fri 04/12/2009 18:37:32
Quote from: Ryan Timothy on Fri 04/12/2009 18:06:39
Perhaps when you saved the image it altered the colors? Have you reopened the image file to see if it's still 255,0,255?

Yes ofcourse. And actually I used "import new sprite from clipboard" option. Can this cause some issue?
Title: Re: AGS transparent colour
Post by: frogking on Mon 07/12/2009 08:53:47
Sounds like what you are trying to do *should* work. Did you try importing the sprite from file instead of clipboard to see if this changes things? Also, when you say "all in once", do you mean "Tiled sprite import"? If yes, does disabling this box change the behavior of transparency?
Title: Re: AGS transparent colour
Post by: Crimson Wizard on Mon 07/12/2009 15:12:36
Heh.
This happen only when importing from clipboard and only when image was copied to clipboard from Paint.NET. MS Paint does not cause this.
Title: Re: AGS transparent colour
Post by: Khris on Mon 07/12/2009 23:03:48
I have noticed that I have to flatten the layers before using the clipboard to put sprites into AGS. The transparent parts of a layer don't work like one might expect.
Title: Re: AGS transparent colour
Post by: Crimson Wizard on Thu 20/05/2010 17:36:33
Sorry for bumping this, but I am getting terribly irritated by the problem...

I am using AGS 3.2.0 now. I have a png image with a region in the center, which meant to be transparent, so I can't use top-left/etc transparent pixel selection.

I filled aforementioned region magenta (255-0-255) and selected "Leave as-is" transparency option, when importing image.

And after importing, AGS made BLACK colour transparent instead.
NOTE: I was importing from file, not from clipboard.

What do I miss here? Should I now use black as transparent on my image?
Is there any topic covering this in the manual?
Title: Re: AGS transparent colour
Post by: Dataflashsabot on Thu 20/05/2010 17:54:17
Your best option would be to just make a 1-pixel magneta border on all 4 sides.
Title: Re: AGS transparent colour
Post by: Khris on Thu 20/05/2010 18:10:23
Exactly, you can crop the sprite in AGS afterwards. You don't need to put it on all four sides btw, one is enough.
Could you upload one of the images you've tried for us to take a look at?
Title: Re: AGS transparent colour
Post by: Crimson Wizard on Thu 20/05/2010 18:43:11
Hmm, that trick with cropping magenta border works...

I don't know if uploading something is worth it, but okay:
http://img132.imageshack.us/img132/269/guidraft4problem.png
Title: Re: AGS transparent colour
Post by: Ryan Timothy B on Thu 20/05/2010 18:51:48
Hmm.  It seems it's doing it because you're Indexing the image to 256 color with black as the first color.
Title: Re: AGS transparent colour
Post by: Crimson Wizard on Thu 20/05/2010 22:06:22
That seems to be correct. Thanks.