标签:style blog io color os sp on div log
Scene* HelloWorld::createScene() { // ‘scene‘ is an autorelease object auto scene = Scene::createWithPhysics(); scene->getPhysicsWorld()->setDebugDrawMask(PhysicsWorld::DEBUGDRAW_ALL); // ‘layer‘ is an autorelease object auto layer = HelloWorld::create(); // add layer as a child to scene scene->addChild(layer); // return the scene return scene; }
void HelloWorld::onEnter() { Layer::onEnter(); addEdge(); }
void HelloWorld::addEdge() { Size visibleSize=Director::getInstance()->getVisibleSize(); auto body=PhysicsBody::createEdgeBox(visibleSize); auto node=Node::create(); node->setPhysicsBody(body); node->setPosition(visibleSize.width/2,visibleSize.height/2); addChild(node); }
标签:style blog io color os sp on div log
原文地址:http://www.cnblogs.com/yufenghou/p/4154118.html