cocos2dx教程之CCSprite
来源:互联网 发布:directx编程入门 pdf 编辑:程序博客网 时间:2024/06/06 03:49
boolCCSprite::initWithFile(const char *pszFilename, constCCRect&rect)
{
CCAssert(pszFilename != NULL, "");
CCTexture2D *pTexture =CCTextureCache::sharedTextureCache()->addImage(pszFilename);
if (pTexture)
{returninitWithTexture(pTexture,rect);
}
return false;
}
boolCCSprite::initWithSpriteFrameName(const char *pszSpriteFrameName)
{
CCAssert(pszSpriteFrameName != NULL, "");
CCSpriteFrame *pFrame =
CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(pszSpriteFrameName);
return initWithSpriteFrame(pFrame);
}
CCSprite* pSprite = CCSprite::spriteWithFile("grossini.png");
CC_BREAK_IF(! pSprite);
CCSize size = CCDirector::sharedDirector()->getWinSize();
// Place the sprite on the center of the screen
pSprite->setPosition(ccp(size.width/2, size.height/2));
// Add the sprite to HelloWorld layer as a child layer.
this->addChild(pSprite, 0);
- cocos2dx教程之CCSprite
- cocos2dx进阶学习之CCSprite
- cocos2dX UI控件之CCSprite
- cocos2dx CCSprite操作
- cocos2dx中的精灵CCSprite
- Cocos2dx-CCSprite研究-随心
- cocos2dx教程之CCNode
- cocos2dx教程之CCLayer
- cocos2dx教程之CCLayerColor
- cocos2dx教程之CCLayerGradient
- cocos2dx教程之CCLayerMultiplex
- cocos2dx教程之CCMenu
- cocos2dx教程之CCAction
- cocos2dx教程之CCImage
- cocos2dx教程之CCTexture2D
- cocos2dx教程之CCTextureCache
- [windows+cocos2dx]CCSprite精灵类
- CCSprite(1)(cocos2dx-2.2.5)
- Zero Copy I: User-Mode Perspective
- cocos2dx教程之CCTextureCache
- SCU
- getResource和getRessourceAsStream的区别和含义
- Sumblime Text 3 常用快捷键
- cocos2dx教程之CCSprite
- 基于JavaScript的Base64编码、解码算法
- 我看小米抢购——纯技术分析贴
- AS3 Socket 基础知识
- Http和Socket连接区别
- LESS详解之函数(四)
- FastDFS安装使用实战一(安装篇)
- Resin 以及搭建基于Eclipse的开发环境(转)
- 由一次WCF项目的需求扩展想到的