world.Transparency

MUSHclient script function (Method) — introduced in version 3.83

Sets the transparency of the main MUSHclient window under Windows XP

Prototype

boolean Transparency(long Key, short Amount);

Data type meanings

Description

Under Windows XP or later operating systems, you can make the MUSHclient window semi-transparent, so that the underlying windows "show through". Under Windows NT/2000/95/98/ME this function does nothing.

Key: specifies the transparency colour key to be used when composing the layered window. All pixels painted by the window in this color will be transparent. This is an RGB code, you can use ColourNameToRGB to convert a name to RGB.

If the key is -1 then there is no colour key.

Amount: the amount of transparency for other colours, in the range 0 to 255. If outside this range the number will be coerced into it.

WARNING

Drawing transparent windows may slow down the program, as the operating system has to render to an off-screen bitmap and copy to the main window. This slow-down may not be obvious on fast PCs.

VBscript example

Transparency -1, 127  ' Make everything 50% transparent
Transparency 0, 255   ' Black is transparent, everything else is full intensity

Lua example

Transparency (-1, 127) -- Make everything 50% transparent
Transparency (0, 255)  -- Black is transparent, everything else is full intensity
Transparency (ColourNameToRGB ("red"), 64)  -- Red is transparent, everything else is 25% transparent

Return value

On success, returns true.
On failure, returns false (eg. under Windows 95).

Related topic

Utilities

See also

FunctionDescription
ColourNameToRGBConverts a named colour to a RGB colour code.