0

古いコードがあります。新しい Cocos2d-x rc0 2.1.3 に移植しています。次の行でエラーが発生しています。

1. GameScene.cpp 内

CCScene *scene = CCScene::node();
GameScene *layer = GameScene::node();

2. GameScene.cpp 内

userPaddle_->runAction(CCMoveTo::actionWithDuration(0.3 * diffX / gameArea_.size.width, destPosition));

3. GameScene.cpp 内

CCPoint location = touch->locationInView(touch->view());

4. GameScene.cpp 内

if (CCRect::CCRectContainsPoint(touchArea_, location))

5. GameScene.cpp で

if (CCRect::CCRectIntersectsRect(ballRect, CC_SPRITE_RECT(paddle)))

6. Appdelegate.cpp で

pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView());

7. GameScene.h で

// implement the "static node()" method manually
LAYER_NODE_FUNC(HelloWorld);
4

1 に答える 1

0

cocos2d-x API の変更点の完全なリストについては、次を参照してください。

http://www.cocos2d-x.org/projects/cocos2d-x/wiki/API_Change_List_from_v1x_to_2x

http://www.cocos2d-x.org/projects/cocos2d-x/wiki/About_Static_Constructor_API_changes_in_cocos2d-x_v20

node()->create()

actionWithDuation(a,b)->create(a,b)

CCRect::CCRectContainsPoint(touchArea_, location)->touchArea_.containsPoint(location)

touch->locationInView(touch->view())->touch->getLocation()

CCRect::CCRectIntersectsRect(ballRect, CC_SPRITE_RECT(paddle))- >ballRect.intersectsRect(CC_SPRITE_RECT(paddle))

LAYER_NODE_FUNC->CREATE_FUNCまだ存在する場合。

OpenGLView を忘れましたが、あります。

于 2013-08-01T05:28:11.253 に答える