巴索罗米·杰

I hear – and I forget; I see – and I remember; I do – and I understand!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

所有代码运行版本均在Cocos-2dx 2.1.3版本中测试通过


 

  • 报错提示:cannot define a compiler-generated special member function (must be declared in the class first)

  在头文件中添加此方法的声明,C++在使用函数时必须先声明再使用。

  • 如何使用CCLabelTTF显示数字
int Count;
CCString* strScore=CCString::createWithFormat("%d",count);//使用格式转化

CCLabelTTF *labelTargetDestroyed = CCLabelTTF::create("Destroyed:","Artial",12);
		labelTargetDestroyed->setString(strScore->m_sString.c_str());
  • 设置窗口大小、窗口标题
CCEGLView* eglView = CCEGLView::sharedOpenGLView();
eglView->setViewName("PandoRun");  //窗口标题
eglView->setFrameSize(480, 320);   //窗口大小
  •  设置背景图
CCSprite* pSprite = CCSprite::create("back.png");
CC_BREAK_IF(! pSprite);

 // Place the sprite
        pSprite->setAnchorPoint(CCPointZero);
        pSprite->setPosition(CCPointZero);

        // Add the sprite
        this->addChild(pSprite);

 

posted on 2013-11-01 17:18  SeeGo  阅读(263)  评论(0编辑  收藏  举报