Lua Box2d Gideros:隐藏身体
问题描述:
在Gideros工作室box2d中,身体(基本上是物理对象,而不是伴随它的图片)总是显示为半透明形状。在我的比赛中,我不希望球员能够看到这些身体。我已经看到你可以在日冕中做到这一点,但我还没有看到任何关于Gideros的事情。有没有人知道lua和box2d能够告诉我如何做到这一点?谢谢!Lua Box2d Gideros:隐藏身体
答
如果真的是调试绘图,然后点击上面菜单编辑,选择文件,查找并搜索DebugDraw
你应该找到类似:
local world = b2.World.new(0, 10, true)
local debugDraw = b2.DebugDraw.new()
world:setDebugDraw(debugDraw)
stage:addChild(debugDraw)
只是注释掉该行--stage:addChild(debugDraw)
和你已准备好出发。 删除设置调试彻底划清生产更好的性能
你可以设置一些全局变量调试和拨动它启用/禁用调试绘图:
DEBUG = false
,然后后面的代码
if DEBUG then
local world = b2.World.new(0, 10, true)
local debugDraw = b2.DebugDraw.new()
world:setDebugDraw(debugDraw)
stage:addChild(debugDraw)
end
听起来像你有物理调试绘图启用 – LearnCocos2D 2014-09-28 11:08:24
谢谢!我正在编辑一个我下载的例子,而且我没有看到代码的那部分。 – 2014-09-28 13:07:32