COCos2d-X 节点(CCAtlasNode.h)API
来源:互联网 发布:怎么用手机淘宝做代理 编辑:程序博客网 时间:2024/05/22 08:25
本文来自http://blog.csdn.net/runaying ,引用必须注明出处!
COCos2d-X 节点(CCAtlasNode.h)API
温馨提醒:为了大家能更好学习,强烈推荐大家看看本人的这篇博客 Cocos2d-X权威指南笔记
///cocos2d-x-3.0alpha0/cocos2dx/base_nodes#ifndef __CCATLAS_NODE_H__#define __CCATLAS_NODE_H__#include "CCNode.h"#include "CCProtocols.h"#include "ccTypes.h"NS_CC_BEGIN/** * @addtogroup base_nodes * @{ */class TextureAtlas;/** @brief AtlasNode 是 Node 的子类,实现了 RGBAProtocol 、 TextureProtocol 协议他知道如何 render(呈现)一个 TextureAtlas 对象.如果你要 render(呈现)一个 AtlasNode 的子类 TextureAtlas (or AtlasNode 的子类)从节点的所有功能都有效,再加上以下功能:- opacity and RGB colors //不透明度和RGB颜色*/class CC_DLL AtlasNode : public NodeRGBA, public TextureProtocol{ public:/** 使用 一个 Atlas 文件,每个 item(组成Atlas 的 tile(瓷砖)) 的宽度、高度 要显示的 items 数量 创建一个 AtlasNode */static AtlasNode * create(const char* tile,unsigned int tileWidth, unsigned int tileHeight, unsigned int itemsToRender); /** * @js ctor */ AtlasNode(); /** * @js NA * @lua NA */ virtual ~AtlasNode(); /** 使用 一个 Atlas 文件,每个 item(组成Atlas 的 tile(瓷砖)) 的宽度、高度 要显示的 items 数量 初始化一个 AtlasNode */ bool initWithTileFile(const char* tile, unsigned int tileWidth, unsigned int tileHeight, unsigned int itemsToRender); /** 使用 texture,每个 item(组成Atlas 的 tile(瓷砖)) 的宽度、高度 要显示的 items 数量 初始化一个 AtlasNode */ bool initWithTexture(Texture2D* texture, unsigned int tileWidth, unsigned int tileHeight, unsigned int itemsToRender); /**更新 Atlas(地图集) (indexed vertex array). //索引顶点数组 * 应在子类中重写 */ virtual void updateAtlasValues(); void setTextureAtlas(TextureAtlas* textureAtlas); TextureAtlas* getTextureAtlas() const; void setQuadsToDraw(unsigned int quadsToDraw); unsigned int getQuadsToDraw() const; // Overrides(覆盖) virtual void draw() override; virtual Texture2D* getTexture() const override; virtual void setTexture(Texture2D *texture) override; virtual bool isOpacityModifyRGB() const override; virtual void setOpacityModifyRGB(bool isOpacityModifyRGB) override; virtual const Color3B& getColor(void) const override; virtual void setColor(const Color3B& color) override; virtual void setOpacity(GLubyte opacity) override; /** * @code * 这个功能绑定在 js or lua 时参数将改变 * In js: var setBlendFunc(var src, var dst) * @endcode * @lua NA */ virtual void setBlendFunc(const BlendFunc& blendFunc) override; /** * @js NA * @lua NA */ virtual const BlendFunc& getBlendFunc() const override;private : void calculateMaxItems(); void updateBlendFunc(); void updateOpacityModifyRGB(); friend class Director; void setIgnoreContentScaleFactor(bool bIgnoreContentScaleFactor);protected: //! 每行字符 unsigned int _itemsPerRow; //! 每列的字符 unsigned int _itemsPerColumn; //! 每个字符的宽度 unsigned int _itemWidth; //! 每个字符的高度 unsigned int _itemHeight; Color3B _colorUnmodified; TextureAtlas* _textureAtlas; // 协议变量 bool _isOpacityModifyRGB; BlendFunc _blendFunc; // 绘制的四边形 unsigned int _quadsToDraw; // 颜色均匀 GLint _uniformColor; // 这仅用于显示 LabelAtlas FPS . 所以我希望大家不要修改它的值. bool _ignoreContentScaleFactor;};// end of base_node group/// @}NS_CC_END#endif // __CCATLAS_NODE_H__
- COCos2d-X 节点(CCAtlasNode.h)API
- cocos2d-X 节点(CCNode.h)API
- cocos2d-X 节点(CCLayer.h)API
- cocos2d-X 节点(CCMenu.h)API
- cocos2d-X 节点(CCMenuItem.h)API
- cocos2d-X 节点(CCSprite.h)API
- cocos2d-X 节点(CCTexture2D.h)API
- cocos2d-X 节点(SpriteBatchNode.h.)API
- cocos2d-X 节点(CCSpriteFrame.h..)API
- cocos2d-X 节点(CCAnimationCache.h)API
- cocos2d-X 节点(CCCamera.h.)API
- cocos2d-X 节点(CCAction.h)API
- cocos2d-X 节点(CCActionManager.h)API
- cocos2d-X 节点(CCIMEDelegate.h)API
- cocos2d-X 节点(CCLabelAtlas.h)API
- cocos2d-X 节点(CCLabelBMFont.h)API
- cocos2d-X 节点(CCLabelTTF.h)API
- cocos2d-X 节点(CCTileMapAtlas.h)API
- 专题 -- 换行、
- 【树状数组】HDU_3854_Glorious Array
- 简易递归快排 QuicklySort C++
- 写程序的注意点
- 金蝶外贸进出口行业解决方案(K/3 Cloud、EAS版)
- COCos2d-X 节点(CCAtlasNode.h)API
- 美英房地产估价行业发展模式及经验借鉴
- WMI win32的研究
- python自动安装apk文件
- 全志A13 + Android4.0.3平台的错误
- osmdroid启程
- android 判断网络连接是否可用
- substring JDK1.6和JDK1.7的区别
- GSON使用的学习笔记,进阶篇(一)