Difference between revisions of "B2.World:setDebugDraw"

From GiderosMobile
(2nd example)
(added see also)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Class:''' [[Special:MyLanguage/b2.World|b2.World]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/b2.World|b2.World]]<br/>
 
  
=== <translate>Description</translate> ===
+
=== Description ===
 
Registers a b2.DebugDraw instance for debug drawing.
 
Registers a b2.DebugDraw instance for debug drawing.
 
<source lang="lua">
 
<source lang="lua">
Line 10: Line 9:
 
</source>
 
</source>
  
=== <translate>Examples</translate> ===
+
=== Example ===
'''Example with no flags'''
 
 
<source lang="lua">
 
<source lang="lua">
 
local debugDraw = b2.DebugDraw.new()
 
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)
 
stage:addChild(debugDraw)
 
</source>
 
</source>
  
'''Example with flags'''
+
=== See also ===
<source lang="lua">
+
'''[[B2.DebugDraw]]'''
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)
 
</source>
 
  
 
{{B2.World}}
 
{{B2.World}}

Revision as of 01:05, 6 September 2020

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