B2.World:setDebugDraw: Difference between revisions
From GiderosMobile
added see also |
m Text replacement - "</source>" to "</syntaxhighlight>" |
||
| (One intermediate revision by the same user not shown) | |||
| Line 5: | Line 5: | ||
=== Description === | === Description === | ||
Registers a b2.DebugDraw instance for debug drawing. | Registers a b2.DebugDraw instance for debug drawing. | ||
< | <syntaxhighlight lang="lua"> | ||
b2.World:setDebugDraw() | b2.World:setDebugDraw() | ||
</ | </syntaxhighlight> | ||
=== Example === | === Example === | ||
< | <syntaxhighlight 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) | 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) | ||
</ | </syntaxhighlight> | ||
=== See also === | === See also === | ||
Latest revision as of 13: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