Difference between revisions of "B2.DebugDraw:setFlags"
From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight") |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | ''' | + | <languages /> |
− | === | + | '''Available since:''' Gideros 2011.6<br/> |
− | + | '''Class:''' [[Special:MyLanguage/b2.DebugDraw|b2.DebugDraw]]<br/> | |
− | Sets the debug drawing flags. These flags are available: | + | |
− | < | + | === Description === |
− | + | Sets the debug drawing flags. These flags are available: | |
− | + | <ul> | |
− | + | <li>[[Special:MyLanguage/b2.DebugDraw.SHAPE_BIT|b2.DebugDraw.SHAPE_BIT]]</li> | |
− | + | <li>[[Special:MyLanguage/b2.DebugDraw.JOINT_BIT|b2.DebugDraw.JOINT_BIT]]</li> | |
− | + | <li>[[Special:MyLanguage/b2.DebugDraw.AABB_BIT|b2.DebugDraw.AABB_BIT]]</li> | |
− | + | <li>[[Special:MyLanguage/b2.DebugDraw.PAIR_BIT|b2.DebugDraw.PAIR_BIT]]</li> | |
− | + | <li>[[Special:MyLanguage/b2.DebugDraw.CENTER_OF_MASS_BIT|b2.DebugDraw.CENTER_OF_MASS_BIT]]</li> | |
− | + | </ul> | |
− | [[Special:MyLanguage/b2.DebugDraw.SHAPE_BIT|b2.DebugDraw.SHAPE_BIT]] is set by default. | + | [[Special:MyLanguage/b2.DebugDraw.SHAPE_BIT|b2.DebugDraw.SHAPE_BIT]] is set by default. |
− | + | ||
− | Because Lua doesn | + | Because Lua doesn't support bitwise operations by default, you can use "|" operator to combine flags. |
− | + | <syntaxhighlight lang="lua"> | |
− | < | + | b2.DebugDraw:setFlags(flags) |
− | + | </syntaxhighlight> | |
− | </ | + | |
− | === | + | === Parameters === |
− | '''flags''': (number) | + | '''flags''': (number) debug draw flags <br/> |
− | === | + | |
− | + | === Examples === | |
− | < | + | <syntaxhighlight lang="lua"> |
− | debugDraw:setFlags(b2.DebugDraw.SHAPE_BIT | + | local debugDraw = b2.DebugDraw.new() |
+ | debugDraw:setFlags(b2.DebugDraw.SHAPE_BIT | b2.DebugDraw.JOINT_BIT) | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | {{B2.DebugDraw}} |
Latest revision as of 17:00, 12 July 2023
Available since: Gideros 2011.6
Class: b2.DebugDraw
Description
Sets the debug drawing flags. These flags are available:
- b2.DebugDraw.SHAPE_BIT
- b2.DebugDraw.JOINT_BIT
- b2.DebugDraw.AABB_BIT
- b2.DebugDraw.PAIR_BIT
- b2.DebugDraw.CENTER_OF_MASS_BIT
b2.DebugDraw.SHAPE_BIT is set by default.
Because Lua doesn't support bitwise operations by default, you can use "|" operator to combine flags.
b2.DebugDraw:setFlags(flags)
Parameters
flags: (number) debug draw flags
Examples
local debugDraw = b2.DebugDraw.new()
debugDraw:setFlags(b2.DebugDraw.SHAPE_BIT | b2.DebugDraw.JOINT_BIT)