AGS transparent colour

Started by Crimson Wizard, Fri 04/12/2009 00:44:48

Previous topic - Next topic

Crimson Wizard

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.

Ryan Timothy B

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)

Calin Leafshade

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)

Crimson Wizard

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.

Ryan Timothy B

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?

Crimson Wizard

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?

frogking

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?

Crimson Wizard

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.

Khris

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.

Crimson Wizard

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?

Dataflashsabot

Your best option would be to just make a 1-pixel magneta border on all 4 sides.

Khris

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?

Crimson Wizard

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

Ryan Timothy B

Hmm.  It seems it's doing it because you're Indexing the image to 256 color with black as the first color.

Crimson Wizard

That seems to be correct. Thanks.

SMF spam blocked by CleanTalk