1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>GetMaterial</title>
<category>Landscape</category>
<subcat>Material</subcat>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>
<param>
<type>int</type>
<name>x</name>
<desc>X coordinate at which to check the material. Offset in local calls.</desc>
</param>
<param>
<type>int</type>
<name>y</name>
<desc>Y coordinate at which to check the material. Offset in local calls.</desc>
</param>
</params>
</syntax>
<desc>Determines the material type at the specified position in the landscape. Returns a material index which can be used for comparison e.g. with <funclink>Material</funclink>. For sky areas the function returns -1.</desc>
<remark>This functions only processes static materials - moving material pixels such as rain or snow are not evaluated.</remark>
<examples>
<example>
<code><funclink>if</funclink>(GetMaterial(0, +200) == <funclink>Material</funclink>("Oil")) <funclink>Message</funclink>("I am rich!");</code>
<text>Part of a clonk script: if 200 pixels below the calling object oil is found a message is displayed.</text>
</example>
</examples>
<related>
<funclink>Material</funclink>
<funclink>GetBackMaterial</funclink>
<funclink>GBackSolid</funclink>
<funclink>GBackLiquid</funclink>
<funclink>InsertMaterial</funclink>
</related>
</func>
<author>Sven2</author><date>2002-08</date>
</funcs>
|