(Formerly known as SetObjectTransparency, which is now obsolete)
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.
NOTE: Transparency only works in 16-bit and 32-bit colour games.
NOTE: When using the DirectX 5 driver, a large transparent object 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 object[0].Transparency++; is not recommended as it will probably
end too quickly.
In order to fade an object in/out, the best approach is shown in the example below:
Example:
int trans = object[0].Transparency;
while (trans < 100) {
trans++;
object[0].Transparency = trans;
Wait(1);
}
will gradually fade out the object from its current transparency level to being fully
invisible.
See Also: Character.Transparency,
GUI.Transparency
|