SetClrModulation

Category: Objects / Display
Since engine version: 4.9.1.0 GWE (extended in 4.9.6.0 CR)

Description

Changes the color modulation of an object. This is a color value which is multiplied with the object color. RGB(255,0,0) will only let the red part of the color show. RGBa(255,255,255,128) will make all color half transparent (unless alpha addition is disabled in the graphics options).

Syntax

bool SetClrModulation (int dwClr, object pObj, int iOverlayID);

Parameters

dwClr:
New color which is used for color modulation. If 0, modulation is deactivated. To create a 'black' color, use a value slightly higher than 0 such as RGB(0,0,1).
pObj:
Object the coloration of which you want to change. Can be 0 in local calls.
iOverlayID:
[opt] If specified, sets the color modulation of the graphics overlay instead. The overlay must have been created using SetGraphics first. From CR.

Example

SetClrModulation(RGBa(128,128,255,128), GetCursor());
Colors the selected clonk of the first player slightly blue and makes him half transparent.
See also: GetClrModulation, RGB, RGBa, SetColorDw, SetGamma, SetObjectBlitMode
Sven2, April 2002