Category: Objects
/ Display
Since engine version: 1.0 OC
GetClrModulation
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(int overlay_id);
Parameter
- overlay_id:
- [opt] If specified, the color modulation of the overlay is returned instead. The overlay must be set using SetGraphics first.
Remark
A return value of -1 means that no color modulation is done. This corresponds to RGBa(255,255,255,255).
Example
global func SetObjAlpha(byAlpha, obj) { var dwClrMod = obj->GetClrModulation(); if (!dwClrMod) dwClrMod = byAlpha << 24; else dwClrMod = dwClrMod & RGB(255,255,255) | byAlpha << 24; return(obj->SetClrModulation(dwClrMod)); }
Global function: only sets the alpha value of the color modulation of an object.