Difference between revisions of "R3d.Fixture:setCollisionCategoryBits"
From GiderosMobile
(Created page with "'''Available since:''' Gideros 2019.10<br/> '''Class:''' R3d.Fixture<br/> === Description === Sets the fixture category bit. <source lang="lua"> r3d.Fixture:setCollisionC...") |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
(One intermediate revision by the same user not shown) | |||
Line 4: | Line 4: | ||
=== Description === | === Description === | ||
Sets the fixture category bit. | Sets the fixture category bit. | ||
− | < | + | <syntaxhighlight lang="lua"> |
r3d.Fixture:setCollisionCategoryBits(bits) | r3d.Fixture:setCollisionCategoryBits(bits) | ||
− | </ | + | </syntaxhighlight> |
=== Parameters === | === Parameters === | ||
Line 12: | Line 12: | ||
=== Example === | === Example === | ||
− | < | + | <syntaxhighlight lang="lua"> |
local fixture = ship.body:createFixture(shape, nil, mass) -- shape, transform, mass | local fixture = ship.body:createFixture(shape, nil, mass) -- shape, transform, mass | ||
fixture:setCollisionCategoryBits(8) | fixture:setCollisionCategoryBits(8) | ||
− | </ | + | </syntaxhighlight> |
{{R3d.Fixture}} | {{R3d.Fixture}} |
Latest revision as of 14:32, 13 July 2023
Available since: Gideros 2019.10
Class: R3d.Fixture
Description
Sets the fixture category bit.
r3d.Fixture:setCollisionCategoryBits(bits)
Parameters
bits: (number) the fixture category bit (power of 2)
Example
local fixture = ship.body:createFixture(shape, nil, mass) -- shape, transform, mass
fixture:setCollisionCategoryBits(8)