visual studio 2012 - Porting old Code to Cocos2d-x rc0 2.1.3 giving error -
i have old code. porting new cocos2d-x rc0 2.1.3 .it giving me errors in following lines:
1. in gamescene.cpp
ccscene *scene = ccscene::node(); gamescene *layer = gamescene::node(); 2. in gamescene.cpp
userpaddle_->runaction(ccmoveto::actionwithduration(0.3 * diffx / gamearea_.size.width, destposition)); 3. in gamescene.cpp
ccpoint location = touch->locationinview(touch->view()); 4. in gamescene.cpp
if (ccrect::ccrectcontainspoint(toucharea_, location)) 5. in gamescene.cpp
if (ccrect::ccrectintersectsrect(ballrect, cc_sprite_rect(paddle))) 6. in appdelegate.cpp
pdirector->setopenglview(&cceglview::sharedopenglview()); 7. in gamescene.h
// implement "static node()" method manually layer_node_func(helloworld);
for full list of cocos2d-x api changes, please refer
http://www.cocos2d-x.org/projects/cocos2d-x/wiki/api_change_list_from_v1x_to_2x
and
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 if still exist.
i forgot openglview one, there one.
Comments
Post a Comment