Difference between revisions of "CBlob::setPosition"

From King Arthur's Gold Wiki
Jump to: navigation, search
(Created page with "<onlyinclude> </onlyinclude> <syntaxhighlight lang="cpp"> void setPosition( Vec2f pos ) </syntaxhighlight> Object method of: CBlob Category:Scripting [[Category...")
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<onlyinclude>
 
<onlyinclude>
+
Sets a new position for the blob.
 
</onlyinclude>
 
</onlyinclude>
+
 
 +
This function will set the new position for the blob.
 +
 
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
 
 
void setPosition( Vec2f pos )
 
void setPosition( Vec2f pos )
 
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
 +
Example from: Base/Rules/CommonScripts/Editor.as
 +
(This will create a block blob to player's mouse cursor position)
 +
<syntaxhighlight lang="cpp">
 +
CBlob @block = CreateBlob( "genericitem", "Entities/Structures/Stone/Block1x1.cfg" );
 +
block.setPosition(getControls().getMouseWorldPos());
 +
</syntaxhighlight>
 +
 
   
 
   
 
Object method of: [[CBlob]]
 
Object method of: [[CBlob]]
 
[[Category:Scripting]]
 
[[Category:Scripting]]
 
[[Category:Object Methods]]
 
[[Category:Object Methods]]

Latest revision as of 01:10, 29 September 2012

Sets a new position for the blob.


This function will set the new position for the blob.

void setPosition( Vec2f pos )


Example from: Base/Rules/CommonScripts/Editor.as (This will create a block blob to player's mouse cursor position)

CBlob @block = CreateBlob( "genericitem", "Entities/Structures/Stone/Block1x1.cfg" );
block.setPosition(getControls().getMouseWorldPos());


Object method of: CBlob