Difference between revisions of "B2.DebugDraw:setFlags"

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

Latest revision as of 18: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 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)





LiquidFun