Re: Tansparent image formats in AGS

Started by chapter11studios, Mon 18/04/2005 19:41:48

Previous topic - Next topic

chapter11studios

Is AGS limited to GIF for transparent image formats or can it use other formats like PNG?

Mozesh

Well transparency can be controlled by ags self, when using it for objects or characters.
Code: ags
int Object.Transparency //Gets sets the object's transparency level

If this is set to 100, it means that the object is totally invisible, and lower values represent varying levels of transparency. Set this to 0 to stop the object being transparent.
Or for characters:
Code: ags
int Character.Transparency //Gets sets the character's transparency

This is specified as a percentage, from 0 to 100. 100 means fully transparent (ie. invisible), and 0 is totally opaque (fully visible). Numbers in between represent varying levels of transparency. (from da manual)

But about the png format I don't know I've tried it a few days ago, but it came out normal just like a non transparrtent sprite.

chapter11studios

I probably wasn't clear enough on why I wanted to know this. Basically, I want to know if I could use PNGs or TGAs instead of GIFs for sprites and animated frames -- the reason being that GIF can't hold semi-transparent pixels so the edges look rough/pixelated (a big concern for animation). PNGs and TGAs have that option, however.

DoorKnobHandle

Wait, I hope I'm understanding you correctly, when you're talking about semi-transparent pixels, you mean alpha-transperancy, right?

That is supported in AGS - simply draw a PNG file, that uses alpha-transperancy, save it and import it into AGS. Oh, and make sure your game is set to 32-bit because it will only work in this mode...

Was that what you meant?

NOTE: Changing to 32-bit may result in big filesizes so use with care...

Nightfall

Yes, alpha transparency. Both for sprite animation and side animation (doors opening, birds,... pretty much everything).

We need to have smooth edges but GIF is limited since they offer no anti-aliasing. I know PNGs and TGAs offer that but is there any other way to make it work?

If not, how, err... "big" are we talking about?

Thanks for the help fellas.

Ishmael

Just set the game palette to 32-bit and import your alpha-channeled sprites... It's not that hard, I reckon...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

DoorKnobHandle

This is the only way for semi-transparent (alpha-transperant) sprites as far as I know.

How big your gamefile is going to be can no one tell you, because it depends on various other values... Just try it out for yourself.

Oh, and I once tried to use a 640x480 animated sprite using alpha-transparency covering the whole screen and it slew down the game like... like... like you're trying to ride a bycicle in sand or so (sorry for the crappy comparison)...

Ishmael

Quote from: [ ... ] on Mon 18/04/2005 22:04:37
Oh, and I once tried to use a 640x480 animated sprite using alpha-transparency covering the whole screen and it slew down the game like... like... like you're trying to ride a bycicle in sand or so (sorry for the crappy comparison)...

I think the comparison is quite fit... My old laptop sometimes did that with 16-bit in 640 res :P Like riding a bicycly in sand, indeed...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk