GetBackMaterial

Category: Landscape / Material
Since engine version: 7.0 OC

Description

Determines the background 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 background the function returns -1. The background material is the material that a pixel is replaced with when it is digged away or blasted free.

Syntax

int GetBackMaterial(int x, int y);

Parameters

x:
X coordinate at which to check the background material. Offset in local calls.
y:
Y coordinate at which to check the background 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, 0) == Material("Water") && GetBackMaterial(0, 0) == Material("Water")) Message("I am in a neverending stream of water!");
Part of a clonk script: if the clonk is swimming in water that is replaced with water when it flows away, a message is displayed.
See also: GBackLiquid, GBackSolid, GetMaterial, InsertMaterial, Material
Clonk-Karl, 2015-07