Difference between revisions of "B2.World:setDebugDraw"
From GiderosMobile
(2nd example) |
|||
Line 11: | Line 11: | ||
=== <translate>Examples</translate> === | === <translate>Examples</translate> === | ||
− | '''Example''' | + | '''Example with no flags''' |
<source lang="lua"> | <source lang="lua"> | ||
local debugDraw = b2.DebugDraw.new() | local debugDraw = b2.DebugDraw.new() | ||
+ | world:setDebugDraw(debugDraw) | ||
+ | stage:addChild(debugDraw) | ||
+ | </source> | ||
+ | |||
+ | '''Example with flags''' | ||
+ | <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) | stage:addChild(debugDraw) |
Revision as of 00:58, 6 September 2020
Available since: Gideros 2011.6
Class: b2.World
Description
Registers a b2.DebugDraw instance for debug drawing.
b2.World:setDebugDraw()
Examples
Example with no flags
local debugDraw = b2.DebugDraw.new()
world:setDebugDraw(debugDraw)
stage:addChild(debugDraw)
Example with flags
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)