随笔分类 -  cocos2d-x-动画

摘要:之前做了四年的kjava游戏 当时已经有了一定的动画思路GAMELOFT 模式 module->sprite->frame->mechmodel->action->animation->actor切片 精灵 帧 动作 动画 而在cocos2d中 精灵实际就是角色对象 可以播放动画frame -> animation -> spriteframe -> spritesprite-> sprite 在cocos2d中切片精灵帧的概念比较模糊 统一理解为帧更好 放弃module->sprite的概念 故意也是为了快速开发。毕竟当时是为 阅读全文
posted @ 2012-03-06 17:33 aflylove 阅读(640) 评论(0) 推荐(0)
摘要:CCAnimation用于演示动画在CCSprite上 动画有自己的名称 比如兔子跳 兔子跑包含若干个CCSpriteFrameACCAnimationobject is used to perform animations on theCCSpriteobjects.TheCCAnimationobject containsCCSpriteFrameobjects, and a possible delay between the frames. You can animate aCCAnimationobject by using theCCAnimateaction. Example:[ 阅读全文
posted @ 2012-03-06 17:22 aflylove 阅读(746) 评论(0) 推荐(0)
摘要:CCSpriteFrameCacheSingleton that handles the loading of the sprite frames.最大的特点是通过pszPlist 文件生成多个Sprite FramesCCMutableDictionary< std::string,CCObject* > *pobDictionary字典数据 "metadata""frames"textureFileName 和pobTexture 得到CCTexture2D最常用的是addSpriteFramesWithFile(const char * 阅读全文
posted @ 2012-03-06 17:16 aflylove 阅读(704) 评论(0) 推荐(0)
摘要:CCSpriteFrame精灵帧CCTexture2D将被用于CCSprite默认的构造方法通过 图片纹理+纹理上的矩形来创建或通过 图片纹理+纹理上的矩形+是否旋转+偏移坐标+真实size这里简单讲下是否旋转 为了节省图片空间 图片将会被旋转90度偏移坐标+真实size 为了节省图片空间 原始图片周围透明区域将被trimPublic Member FunctionsconstCCRect&getRectInPixels(void)voidsetRectInPixels(constCCRect&rectInPixels)boolisRotated(void)voidsetRot 阅读全文
posted @ 2012-03-06 16:59 aflylove 阅读(1917) 评论(0) 推荐(0)
摘要:CCTexture2Dclass.This class allows to easily create OpenGL 2D textures from images, text or raw data. The createdCCTexture2Dobject will always have power-of-two dimensions. Depending on how you create theCCTexture2Dobject, the actual image area of the texture might be smaller than the texture dimens 阅读全文
posted @ 2012-03-06 16:37 aflylove 阅读(2431) 评论(0) 推荐(0)
摘要:CCSpriteBatchNode 原来是CCSpritSheetACCSpriteBatchNodecan reference one and only one texture (one image file, one texture atlas).CCSpriteBatchNode只包含一个图片或纹理对象它的对象通过texture2d 或fileImage 生成。你可以理解为它是把一堆零散的图片整合到一张大图中的图片它的绘制效率要高于你把这个图内的零散元素单个绘制Public Member Functions~CCSpriteBatchNode()CCTextureAtlas*getTex 阅读全文
posted @ 2012-03-06 16:16 aflylove 阅读(1695) 评论(0) 推荐(0)
摘要:用做自己学习和经验分享struct transformValues_拥有如下几个参数CCPoint pos; // position x and y 位置 CCPoint scale; // scale x and y 放大缩小 float rotation; 旋转 CCPoint skew; // skew x and y 倾斜 CCPoint ap; // anchor point in pixels 锚点 bool visible; 是否可见Public Member Functionsv... 阅读全文
posted @ 2012-03-06 15:36 aflylove 阅读(2900) 评论(0) 推荐(0)