GetBackMaterial

Kategorie: Landschaft / Material
Ab Engineversion: 7.0 OC

Beschreibung

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);

Parameter

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.

Anmerkung

Die Funktion erfasst nur feste Materialpixel, also beispielsweise keinen herunterrieselnden Schnee. Materialflächen, die nur über den MassMover in Bewegung sind, werden natürlich erfasst.

Beispiel

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.
Siehe auch: GBackLiquid, GBackSolid, GetMaterial, InsertMaterial, Material
Clonk-Karl, 2015-07