In Gideros studio box2d, bodies(which are basicly the physical object, not the picture that goes with it) always show up as a translucent shape. In my game, i don't want players to be able to see these bodies. I've seen that you can do this in corona, but I haven't seen anything about Gideros. Is there anyone who knows lua and box2d well enough to tell me how to do this? Thanks!
Asked
Active
Viewed 221 times
1
-
sounds like you have physics debug drawing enabled – CodeSmile Sep 28 '14 at 11:08
-
Thanks! I was editing an example that I downloaded, and I didn't see that part of the code. – Henry V Sep 28 '14 at 13:07
1 Answers
1
If it is really debug drawing, then click on top menu Edit, choose Find in files and search for DebugDraw
You should find something like:
local world = b2.World.new(0, 10, true)
local debugDraw = b2.DebugDraw.new()
world:setDebugDraw(debugDraw)
stage:addChild(debugDraw)
Just comment out the line --stage:addChild(debugDraw)
and you are good to go.
Remove setting debug draw completely for production for better performance
You can setup some global variable debug and toggle it to enable/disable debug drawing:
DEBUG = false
and then later in your code
if DEBUG then
local world = b2.World.new(0, 10, true)
local debugDraw = b2.DebugDraw.new()
world:setDebugDraw(debugDraw)
stage:addChild(debugDraw)
end

Artūrs Sosins
- 579
- 5
- 21