Difference between revisions of "B2.World:setDebugDraw"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 +
'''Class:''' [[Special:MyLanguage/b2.World|b2.World]]<br/>
 +
 
=== Description ===
 
=== Description ===
<translate><br />
+
Registers a b2.DebugDraw instance for debug drawing.
Registers a b2.DebugDraw instance for debug drawing.<br />
+
<syntaxhighlight lang="lua">
<br /></translate>
+
b2.World:setDebugDraw()
<source lang="lua">
+
</syntaxhighlight>
b2.World:setDebugDraw()
+
 
</source>
+
=== Example ===
=== Examples ===
+
<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 + b2.DebugDraw.PAIR_BIT)
 
world:setDebugDraw(debugDraw)
 
world:setDebugDraw(debugDraw)
stage:addChild(debugDraw)</source>
+
stage:addChild(debugDraw)
 +
</syntaxhighlight>
 +
 
 +
=== See also ===
 +
'''[[B2.DebugDraw]]'''
 +
 
 +
{{B2.World}}

Latest revision as of 15:27, 13 July 2023

Available since: Gideros 2011.6
Class: b2.World

Description

Registers a b2.DebugDraw instance for debug drawing.

b2.World:setDebugDraw()

Example

local debugDraw = b2.DebugDraw.new()
debugDraw:setFlags(b2.DebugDraw.SHAPE_BIT + b2.DebugDraw.JOINT_BIT + b2.DebugDraw.PAIR_BIT)
world:setDebugDraw(debugDraw)
stage:addChild(debugDraw)

See also

B2.DebugDraw





LiquidFun