![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
cocos2d-x源码分析
文章平均质量分 79
最后的牛仔
不断的学习,追求技术上的自由!
展开
-
CCActionGird源码分析
这个文件中是一些网格动作,网格动作的效果还是可以的,但是,网格动作对效率的影响也是十分明显的,之前用网格动作代替怪兽死亡的动画,一两只还好,当有大批怪兽死亡的时候,效率就十分低了。所以,网格动作可能不太适合同时有太多对象执行。代码:/** @class GridAction@brief Base class for Grid actions.@details Grid act原创 2015-08-22 22:18:01 · 427 阅读 · 0 评论 -
CCLabelBMFont解析
CCLabelBMFont代码:/** @brief LabelBMFont is a subclass of SpriteBatchNode.LabelBMFont是SpriteBatchNode的子类Features:- Treats each character like a Sprite. This means that each individual charact原创 2015-09-06 00:14:16 · 607 阅读 · 0 评论 -
CCLabelTTF解析
代码:/** @brief LabelTTF is a subclass of TextureNode that knows how to render text labels *LabelTTF是一个知道如何绘制文本标签纹理节点的子类 * All features from TextureNode are valid in LabelTTF *所有纹理节点的特性在LabelTTF中都是原创 2015-09-06 00:07:07 · 1094 阅读 · 0 评论 -
CCLabel解析
代码:/** * @addtogroup _2d * @{ *//** * @brief Possible GlyphCollection used by Label. * * Specify a collections of characters to be load when Label created. * Consider using DYNAMIC. */enu原创 2015-09-05 23:46:36 · 2375 阅读 · 0 评论 -
CCActionCatmullRom源码解析
这个文件中主要实现了样条曲线动作和插值曲线动作。1.点数组样条曲线和插值曲线都需要传入控制点数组。通过,修改控制点,来控制样条曲线和插值曲线的轨迹。代码:/** An Array that contain control points. * Used by CardinalSplineTo and (By) and CatmullRomTo (and By) acti原创 2015-08-20 22:46:07 · 876 阅读 · 0 评论 -
CCLayer解析
代码:// // Layer///** @class Layer * @brief Layer is a subclass of Node that implements the TouchEventsDelegate protocol.Layer是Node的一个子类实现了TouchEventsDelegate协议All features from Node are valid原创 2015-09-07 00:58:33 · 831 阅读 · 0 评论 -
ActionCamera,OrbitCamera源码解析
CCActionCamera中的两个类:首先看ActionCamera代码:/** *@brief Base class for Camera actions. *@ingroup Actions */ /// 摄像机动作的基类class CC_DLL ActionCamera : public ActionInterval // {public: /**原创 2015-08-19 23:42:32 · 1759 阅读 · 0 评论 -
CCActionEase源码分析
缓冲动作:这些动作的执行的时间间隔是不断变化的,大部分分为三种形式In(先快后慢),Out(先慢后快),InOut(先快后慢再快)源文件中有许多动作的实现,就不一一的分析了,将这类动作进行了一个整体的分类和分析。按着自己的理解分了下类。用的最多的就是最普通的三种形式来,至于后面的,根据各种函数来执行的,其实我是没用到过,可能是研究的不够深入,看官方的Demo的话,也会发现,个别的动原创 2015-08-20 23:42:43 · 366 阅读 · 0 评论 -
Application源码分析
进行分析下cocos的入口,简单的学习下ApplicationProtocol,Application,AppDelegate,GLContextAttrs,GLView这几个类。游戏的入口是从AppDelegate开始的,但是,ApplDelegate继承自Application,Application继承自ApplicationProtocol。他们的关系如下:原创 2015-08-19 22:35:45 · 883 阅读 · 1 评论 -
CCMenu解析
代码:/** @brief A Menu for touch handling.* * Features and Limitation:* - You can add MenuItem objects in runtime using addChild.* - But the only accepted children are MenuItem objects.*/// 处原创 2015-09-07 21:59:10 · 292 阅读 · 0 评论 -
CCMotionStreak解析
代码:/** @class MotionStreak. * @brief Creates a trailing path. */ // 移动纹理class CC_DLL MotionStreak : public Node, public TextureProtocol{public: /** Creates and initializes a motion streak原创 2015-09-07 22:31:01 · 577 阅读 · 0 评论 -
CCMenuItem解析
代码:/** @brief MenuItem base class. * 菜单项目基类 * Subclass MenuItem (or any subclass) to create your custom MenuItem objects. */class CC_DLL MenuItem : public Node{public: /** Creates a Menu原创 2015-09-07 22:20:33 · 409 阅读 · 0 评论 -
CCRenderTexture解析
代码:/****************************************************************************Copyright (c) 2009 Jason BoothCopyright (c) 2010-2012 cocos2d-x.orgCopyright (c) 2013-2014 Chukong Technologie原创 2015-09-17 23:32:30 · 846 阅读 · 0 评论 -
CCScene解析
代码:/****************************************************************************Copyright (c) 2008-2010 Ricardo QuesadaCopyright (c) 2010-2012 cocos2d-x.orgCopyright (c) 2011 Zynga Inc.Copy原创 2015-09-17 23:24:06 · 563 阅读 · 0 评论 -
CCSprite解析
代码:/****************************************************************************Copyright (c) 2008-2010 Ricardo QuesadaCopyright (c) 2010-2012 cocos2d-x.orgCopyright (c) 2011 Zynga Inc.Copy原创 2015-09-17 23:19:14 · 1225 阅读 · 0 评论 -
CCRenderTexture解析
代码:/** * @brief RenderTexture is a generic rendering target. To render things into it, * simply construct a render target, call begin on it, call visit on any cocos * scenes or objects to render原创 2015-09-20 21:32:24 · 530 阅读 · 0 评论 -
CCSpriteFrame解析
代码:/** @class SpriteFrame * @brief A SpriteFrame has: - texture: A Texture2D that will be used by the Sprite - rectangle: A rectangle of the texture精灵帧纹理:精灵使用的2D纹理矩形:纹理的矩形 You can modi原创 2015-09-20 21:33:31 · 1305 阅读 · 0 评论 -
CCNodeGird解析
代码:/** * @brief Base class for Grid Node. *///网格节点的基类class CC_DLL NodeGrid : public Node{public: /** Create a Grid Node. * * @return An autorelease Grid Node. */ // 创建一个网格原创 2015-09-20 21:35:07 · 941 阅读 · 0 评论 -
CCLabelAtlas,CCLabelTextFormatter解析
代码:/** * @class LabelAtlas * @brief LabelAtlas is a subclass of AtlasNode. *LabelAtlas是一个AtlasNode的子类 * It can be as a replacement of Label since it is MUCH faster. * 他可以代替Label,因为他更快 * Label原创 2015-09-05 23:54:38 · 849 阅读 · 0 评论 -
CCNode解析
代码:/** @class Node* @brief Node is the base element of the Scene Graph. Elements of the Scene Graph must be Node objects or subclasses of it. The most common Node objects are: Scene, Layer, Sprite原创 2015-09-10 01:15:53 · 1631 阅读 · 0 评论 -
CCAction源码分析
想通过分析cocos2d-x的源码,加深对cocos的理解,当然,主要是查看cocos的API和对API的一些翻译。Action源码注释:/** * @brief Base class for Action objects. *@biref 动作类的基类,继承自Ref和Clonable,说明这个基类能放在自动回收池中,同时,能够被克隆。 */class CC_DL原创 2015-08-18 23:16:38 · 485 阅读 · 0 评论 -
CCActionGird3D源码解析
这个文件中都是一些3D网格动作。思维导图如下:源码:/** * @addtogroup actions * @{ *//** @brief Waves3D action.@details This action is used for take effect on the target node as 3D waves. You can control原创 2015-08-23 20:42:22 · 385 阅读 · 0 评论 -
CCActionInstant源码解析
瞬时动作,这类动作,都是只执行一次的动作。没有持续时间。源码:/** * @addtogroup actions * @{ *//** @class ActionInstant* @brief Instant actions are immediate actions. They don't have a duration like the IntervalAction原创 2015-08-23 20:50:35 · 459 阅读 · 0 评论 -
CCActionInterval源码解析
所有的间隔动作代码:/** * @addtogroup actions * @{ *//** @class ActionInterval@brief An interval action is an action that takes place within a certain period of time.It has an start time, and a f原创 2015-08-23 22:34:15 · 1008 阅读 · 0 评论 -
CCActionManager和PageTurn3D源码解析
CCActionManager:思维导图:源码:/** @class ActionManager @brief ActionManager is a singleton that manages all the actions. Normally you won't need to use this singleton directly. 99% of the cases原创 2015-08-23 23:02:15 · 1473 阅读 · 0 评论 -
CCActionTiledGrid与CCActionProgressTimer,源码分析
瓦片网格动作和进度动作CCActionProgressTimer:源代码:/** * @addtogroup actions * @{ *//**@brief Progress to percentage.@details This action show the target node from current percentage to the specifi原创 2015-08-24 22:15:47 · 378 阅读 · 0 评论 -
CCAnimation源码解析
帧动画:源码:/** @class AnimationFrame * * A frame of the animation. It contains information like: * - sprite frame name. * - # of delay units. * - offset @since v2.0 */ /// 帧动画class CC_D原创 2015-08-24 23:15:35 · 375 阅读 · 0 评论 -
CCActionTween,CCAnimationCache源码分析
CCActionTween:补间动画/**@brief The delegate class for ActionTween.@details If you want to use ActionTween on a node. You should implement the node follow these steps: 1. The node原创 2015-08-24 23:27:34 · 571 阅读 · 0 评论 -
CCCamera,CCAtlasNode源码解析
源码:/** * Note: * Scene creates a default camera. And the default camera mask of Node is 1, therefore it can be seen by the default camera. * During rendering the scene, it draws the objects seen原创 2015-08-25 22:54:51 · 538 阅读 · 0 评论 -
CCClippingRectangleNode,CCClippingNode源码解析
源码:/** * @addtogroup _2d * @{ *//** ClippingNode is a subclass of Node. * It draws its content (childs) clipped using a stencil. * The stencil is an other Node that will not be drawn. * The原创 2015-08-25 22:50:42 · 1527 阅读 · 0 评论 -
CCComponentContainer,CCComponent解析
CCComponent:源码:enum { kComponentOnEnter, kComponentOnExit, kComponentOnUpdate};/// 组件class CC_DLL Component : public Ref{CC_CONSTRUCTOR_ACCESS: /** * @js ctor */原创 2015-08-26 23:27:30 · 1733 阅读 · 0 评论 -
CCDrawPrimitives,CCDrawNode解析
CCDrawPrimitives:源码:/** @file Drawing OpenGL ES primitives.OpenGL 图元绘制 - drawPoint, drawPoints,画点和点数组 - drawLine/// 画线 - drawRect, drawSolidRect/// 画矩形 - drawPoly, drawSolidPoly/// 画多变性原创 2015-08-26 23:24:20 · 1925 阅读 · 0 评论 -
CCFastTMXLayer解析
代码:/** @brief FastTMXLayer represents the TMX layer. FastTMXLayer代表了TMX层 * It is a subclass of SpriteBatchNode. By default the tiles are rendered using a TextureAtlas. *他是SpriteBatchNode的一个子类,瓦片的原创 2015-08-30 22:39:07 · 1289 阅读 · 0 评论 -
CCFastTMXTiledMap解析
代码:/** @brief FastTMXLayer represents the TMX layer. FastTMXLayer代表了TMX层 * It is a subclass of SpriteBatchNode. By default the tiles are rendered using a TextureAtlas. *他是SpriteBatchNode的一个子类,瓦片的原创 2015-08-30 22:32:32 · 1564 阅读 · 0 评论 -
CCFontAtlasCache,CCFontCharMap,CCFontFNT,CCFontFreeType解析
CCFontAtlasCache:代码:class FontAtlas;// 字体图集缓存class CC_DLL FontAtlasCache{ public:// 得到字体图集 static FontAtlas * getFontAtlasTTF(const TTFConfig & config); static FontAtlas * getFon原创 2015-09-02 00:23:53 · 1452 阅读 · 0 评论 -
CCFontAtlas,CCGrid,CCGLBufferedNode,CCGrabber解析
CCFontAtlas:代码:struct FontLetterDefinition //字体字母定义{ unsigned short letteCharUTF16;//utf-16编码 float U; float V; float width;//宽 float height;//高 float offsetX;//水平偏移量原创 2015-09-02 00:35:23 · 1309 阅读 · 0 评论 -
CCLight解析
代码:enum class LightType// 光线类型{ DIRECTIONAL = 0, POINT = 1, SPOT = 2, AMBIENT = 3,};enum class LightFlag//光线标识{ LIGHT0 = 1, LIGHT1 = 1 << 1, LIGHT2 = 1 << 2, LIG原创 2015-09-07 21:45:40 · 751 阅读 · 0 评论 -
FiniteTimeAction,Follow,Speed源码分析
CCAction文件中剩余类的分析:1.FiniteTimeAction源码:/** @class FiniteTimeAction * @brief * Base class actions that do have a finite time duration. * Possible actions: * - An action with a duratio原创 2015-08-19 00:18:42 · 731 阅读 · 0 评论 -
CCSpriteFrameCache解析
代码:/** @class SpriteFrameCache * @brief Singleton that handles the loading of the sprite frames. It saves in a cache the sprite frames. @since v0.9 @js cc.spriteFrameCache */ // 精灵帧缓存区 // 加载精原创 2015-09-20 21:36:12 · 1552 阅读 · 0 评论