GetMaterialColor

Category: Landscape / Material
Since engine version: 4.9.1.0 GWE

Description

Determines the color of a material.

Syntax

int GetMaterialColor (int iMat, int iNumber, int iChannel);

Parameters

iMat:
Index of the material of which to determine color
iNumber:
Material color index (0-2).
iChannel:
Color channel. 0 = red, 1 = green, 2 = blue

Remark

This value is not synchronization safe!

Example

var bgmat=GetMaterial(GetX(GetCursor(0)), GetY(GetCursor(0))+12));
SetSkyFade(GetMaterialColor(bgmat,0,0),GetMaterialColor(bgmat,0,1),GetMaterialColor(bgmat,0,2),GetMaterialColor(bgmat,1,0),GetMaterialColor(bgmat,1,1),GetMaterialColor(bgmat,1,2));
Sets sky colors according to the material on which the selected clonk of the first player is standing.
See also: Material, SetMaterialColor
Sven2, November 2001