Need Help for a beginner

Need Help for a beginner
0.0 0


Trying to start cocos2dx i want to add a sprite

bool HelloWorld::init()
if ( CCLayerColor::initWithColor( ccc4(255,255,255,255) ) )
CCSize winSize = CCDirector::sharedDirector()>getWinSize;
CCSprite *player = CCSprite::create );
>setPosition( ccp(player~~>getContentSize.width/2.0f, 100) );
return true;

i’m heading a break at player->setPosition( ccp(player->getContentSize().width/2.0f, 100) ); Please can anyone help mee


Make sure that “Player.png” is in cocos Resource folder. If it is in a subdirectory, you should provide it with a full path to the file so “subdir1/subdir2/Player.png”