Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: chapter11studios on Mon 18/04/2005 19:41:48

Title: Re: Tansparent image formats in AGS
Post by: chapter11studios on Mon 18/04/2005 19:41:48
Is AGS limited to GIF for transparent image formats or can it use other formats like PNG?
Title: Re: Tansparent image formats in AGS
Post by: Mozesh on Mon 18/04/2005 20:16:09
Well transparency can be controlled by ags self, when using it for objects or characters.
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:
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.
Title: Re: Tansparent image formats in AGS
Post by: chapter11studios on Mon 18/04/2005 20:36:00
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.
Title: Re: Tansparent image formats in AGS
Post by: DoorKnobHandle on Mon 18/04/2005 20:47:34
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...
Title: Re: Tansparent image formats in AGS
Post by: on Mon 18/04/2005 21:57:14
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.
Title: Re: Re: Tansparent image formats in AGS
Post by: Ishmael on Mon 18/04/2005 22:03:42
Just set the game palette to 32-bit and import your alpha-channeled sprites... It's not that hard, I reckon...
Title: Re: Tansparent image formats in AGS
Post by: DoorKnobHandle on Mon 18/04/2005 22:04:37
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)...
Title: Re: Re: Tansparent image formats in AGS
Post by: Ishmael on Mon 18/04/2005 22:07:32
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...