GetMaterial

Category: Landscape / Material
Since engine version: 4.9.1.0 GWE

Description

Determines the material type at the specified position in the landscape. Returns a material index which can be used for comparison e.g. with Material. For sky areas the function returns -1.

Syntax

int GetMaterial (int iX, int iY);

Parameters

iX:
X coordinate at which to check the material. Offset in local calls.
iY:
Y coordinate at which to check the material. Offset in local calls.

Remark

This functions only processes static materials - moving material pixels such as rain or snow are not evaluated.

Example

if(GetMaterial(0, +200) == Material("Oil")) Message("Ich bin reich!", this());
Part of a clonk script: if 200 pixels below the calling object oil is found a message is displayed.
See also: GBackLiquid, GBackSolid, InsertMaterial, Material
Sven2, August 2002