(Formerly known as SetCharacterTransparency, which is now obsolete)
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.
NOTE: Transparency only works in 16-bit and 32-bit colour games.
NOTE: When using the DirectX 5 driver, a large transparent character can significantly slow
down AGS.
Some rounding is done internally when the transparency is stored -- therefore, if you get
the transparency after setting it, the value you get back might be one out. Therefore, using
a loop with cEgo.Transparency++; is not recommended as it will probably
end too quickly.
In order to fade a character in, the best approach is shown in the example below:
Example:
int trans = cEgo.Transparency;
while (trans < 100) {
trans++;
cEgo.Transparency = trans;
Wait(1);
}
will gradually fade out the character from its current transparency level to being fully
invisible.
See Also: Object.Transparency
|