openclonk/docs/sdk/script/fn/Split2Components.xml

35 lines
1.4 KiB
XML

<?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>Split2Components</title>
<category>Objects</category>
<subcat>Existence</subcat>
<version>5.1 OC</version>
<syntax>
<rtype>bool</rtype>
</syntax>
<desc>Splits an object into its components. The new component objects will be created with random rotation and a low speed in random direction at the position at which the object was located. The original object is removed. If the original object was contained, the new component objects will be created in the original container.</desc>
<remark>See notice for <funclink>RemoveObject</funclink>.</remark>
<examples>
<example>
<code>protected func ControlUse()
{
var target=<funclink>FindObject</funclink>(<funclink>Find_AtPoint</funclink>(0,0),<funclink>Find_Exclude</funclink>(this));
<funclink>if</funclink> (!target) <funclink>return</funclink> false;
target-&gt;Split2Components();
return true;
}</code>
<text>Script for a tool: It splits the first object it finds at it's position on usage.</text>
</example>
</examples>
<related>
<funclink>RemoveObject</funclink>
<funclink>GetComponent</funclink>
</related>
</func>
<author>Sven2</author><date>2002-08</date>
</funcs>