我用cocos2d-x创建一个物理场景出现个问题,就是如果该场景是用cocostudio场景编辑器编写的,通过auto scene = SceneReader::getInstance()->createNodeWithSceneFile( StringUtils::format( “level_%d.json”, level ) );
\n this->addChild( scene );方式在init()函数里家在的,那么我在createScene()函数里auto scene = Scene::createWithPhysics();\n
scene->getPhysicsWorld()->setDebugDrawMask( PhysicsWorld::DEBUGDRAW_ALL);\n
scene->getPhysicsWorld()->setGravity( Vect( 0.0f, 200.0f ) );\n
这样设置物理世界属性后调试项目发现场景内看不到setDebugDrawMask(PhysicsWorld::DEBUGDRAW_ALL)应有的调试效果,也就是一些标志线条看不见,而如果我不是通过cocostudio场景编辑器编写场景,直接自己代码写场景代码就能看到setDebugDrawMask(PhysicsWorld::DEBUGDRAW_ALL)应有的调试效果,第一次碰见这种问题,有经验的高手大神们希望不吝赐教,谢谢了。