GetClrModulation

Category: Objects / Display
Since engine version: 4.9.5.0 CE (extended in 4.9.6.0 CR)

Description

Determines the color modulation of an object. This is a color value which is multiplied (or added, according to BlitMode) with the object graphics. For more information see SetClrModulation().

Syntax

int GetClrModulation (object pObj, int iOverlayID);

Parameters

pObj:
Object of which to get the color. Can be 0 in local calls.
iOverlayID:
[opt] If specified, the color modulation of the overlay is returned instead. The overlay must be set using SetGraphics first. From CR.

Remark

A return value of 0 means that no color modulation is done. This corresponds to RGBa(255,255,255,0).

Example

global func SetObjAlpha(var byAlpha, pObj)
  {
  var dwClrMod=GetClrModulation(pObj);
  if (!dwClrMod) dwClrMod = byAlpha<<24; else dwClrMod = dwClrMod & 16777215 | byAlpha<<24;
  return(SetClrModulation(dwClrMod, pObj));
  }
Global function: only sets the alpha value of the color modulation of an object.
See also: GetColorDw, RGB, RGBa, SetClrModulation, SetGamma
Sven2, Fabruar 2004