Update CCScene.cpp

in line 157, here need to create  and add camera, if not ,in the function createWithPhysics, will show black screen.
This commit is contained in:
jimmystar 2014-08-09 17:37:18 +08:00
parent ddde741d86
commit 63c9780c49
1 changed files with 4 additions and 0 deletions

View File

@ -153,6 +153,10 @@ bool Scene::initWithPhysics()
{
Director * director;
CC_BREAK_IF( ! (director = Director::getInstance()) );
// add camera
auto camera = Camera::create();
addChild(camera);
this->setContentSize(director->getWinSize());
CC_BREAK_IF(! (_physicsWorld = PhysicsWorld::construct(*this)));