2010-08-22 13:13:17 +00:00
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
< !DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
2009-05-09 13:11:51 +00:00
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs >
<func >
<title > ExtractMaterialAmount</title>
2010-08-22 13:13:17 +00:00
<category > Landscape</category>
2009-05-09 13:11:51 +00:00
<subcat > Material</subcat>
2011-06-30 10:52:55 +00:00
<version > 5.1 OC</version>
2009-05-09 13:11:51 +00:00
<syntax >
<rtype > int</rtype>
<params >
2010-08-22 13:13:17 +00:00
<param >
<type > int</type>
<name > x</name>
<desc > X position at which material is extracted. Offset in local calls.</desc>
</param>
<param >
<type > int</type>
<name > y</name>
<desc > Y position at which material is extracted. Offset in local calls.</desc>
</param>
<param >
<type > int</type>
<name > material_index</name>
<desc > Index of the material to be extracted. Also see <funclink > Material</funclink> .</desc>
</param>
<param >
<type > int</type>
<name > amount</name>
<desc > Maximum amount to be extracted.</desc>
</param>
2015-05-01 16:04:42 +00:00
<param >
<type > bool</type>
<name > distant_x</name>
<desc > If true, material will be extracted at the most distant horizontal position of the top row of the material body, to a maximum of the material's MaxSlide parameter. If used on liquids, this mode ensures that level pools of 1px height can be extracted by extracting from anywhere horizontally.</desc>
<optional />
</param>
2009-05-09 13:11:51 +00:00
</params>
</syntax>
2010-08-22 13:13:17 +00:00
<desc > Extracts a certain amount of material at the specified position. The return value is the amount actually extracted.</desc>
2009-05-09 13:11:51 +00:00
<examples >
<example >
2010-08-22 13:13:17 +00:00
<code > var i=ExtractMaterialAmount(0,0,<funclink > Material</funclink> (" Water" ),10);
<funclink > while</funclink> (i--) <funclink > InsertMaterial</funclink> (<funclink > Material</funclink> (" Water" ),0,-10,<funclink > Random</funclink> (5)-2,-10);</code>
<text > Sucks up to ten pixels of water and squirts them up.</text>
2009-05-09 13:11:51 +00:00
</example>
</examples>
<related >
<funclink > Material</funclink>
<funclink > ExtractLiquid</funclink>
<funclink > InsertMaterial</funclink>
</related>
</func>
2010-08-22 13:13:17 +00:00
<author > Sven2</author> <date > 2001-11</date>
2009-05-09 13:11:51 +00:00
</funcs>