Difference between revisions of "Shape:setMask"

(Added example, see also links)
Line 7: Line 7:
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|numbers|...|Numbers from 1-16.}}
+
{{param|number|...|Numbers from 1-16.}}
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.
 +
== Examples ==
 +
=== Only collide with category 6 ===
 +
<source lang="lua">
 +
shape:setMask(1, 2, 3, 4, 5, 7, 8, 9, 10, 12, 13, 14, 15, 16)
 +
</source>
 
== See Also ==
 
== See Also ==
 
* [[parent::Shape]]
 
* [[parent::Shape]]
 +
* [[Shape:getMask]]
 +
* [[Shape:getMaskBits]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Sets which categories this shape should '''NOT''' collide with.
 
{{#set:Description=Sets which categories this shape should '''NOT''' collide with.
 
}}
 
}}

Revision as of 17:20, 18 October 2010

Sets which categories this shape should NOT collide with. With this function, you can exclude certain shape categories from collisions with this shape. The categories passed as parameters will be excluded from collisions - all others included.

Function

Synopsis

Shape:setMask( ... )

Arguments

number ...
Numbers from 1-16.

Returns

Nothing.

Examples

Only collide with category 6

shape:setMask(1, 2, 3, 4, 5, 7, 8, 9, 10, 12, 13, 14, 15, 16)

See Also