cocos2d-X 节点(UIHelper.h)API
来源:互联网 发布:sql删除语句所有数据 编辑:程序博客网 时间:2024/05/22 01:48
本文来自http://blog.csdn.net/runaying ,引用必须注明出处!
cocos2d-X 节点(UIHelper.h)API
温馨提醒:为了大家能更好学习,强烈推荐大家看看本人的这篇博客 Cocos2d-X权威指南笔记
使用json 文件加载一个 widget.查找widget
///cocos2d-x-3.0alpha0/extensions/CocoStudio/GUI/System// 使用json 文件加载一个 widget.查找widget#ifndef __UIHELPER_H__#define __UIHELPER_H__#include "UIInputManager.h"#include "../../Json/CSContentJsonDictionary.h"#define CCUIHELPER cocos2d::extension::UIHelper::instance()NS_CC_EXT_BEGINclass UIHelper{public: /** * Default constructor */ UIHelper(); /** * Default destructor */ ~UIHelper(); //initializes state of UIHelper. void init(); /** * 使用json 文件加载一个 widget. * * @return 使用 json 文件创建的 widgete. */ UIWidget* createWidgetFromJsonFile(const char* fileName); //get instance 单例 static UIHelper* instance(); //release instance 单例static void purgeUIHelper(); //add a plist file for loading widget's texture. //添加plist文件用来加载 widget's 的 texture void addSpriteFrame(const char* fileName); //remove a plist file for loading widget's texture. //移除一个用来加载 widget's 的 texture 的 plist 文件 void removeSpriteFrame(const char* fileName); //remove all plist files for loading widget's texture. void removeAllSpriteFrame(); /** 从 root widget 查找一个 tag 等于输入参数 的 widget * * * @param root widget which will be seeked(查找). * * @tag tag value. * * @return finded result. */ UIWidget* seekWidgetByTag(UIWidget* root, int tag); /** * 从 root widget 查找一个 name 等于输入参数 的 widget * * @param root widget which will be seeked(查找). * * @name name value. * * @return finded result. */ UIWidget* seekWidgetByName(UIWidget* root, const char* name); /** * 从 root widget 查找一个 name 等于输入参数 的 widget * * RelativeLayout会调用这个方法来查找 witch 需要的 widget * * @param root widget which will be seeked(查找).. * * @name name value. * * @return finded result. */ UIWidget* seekWidgetByRelativeName(UIWidget* root, const char* name); void setFileDesignWidth(float width); float getFileDesignWidth(); void setFileDesignHeight(float height); float getFileDesignHeight(); /*temp action*/ UIWidget* seekActionWidgetByActionTag(UIWidget* root, int tag);protected: float _fileDesignWidth; float _fileDesignHeight; //texture Array* _textureFiles;};NS_CC_EXT_END#endif /* defined(__CocoGUI__UISystem__) */
- cocos2d-X 节点(UIHelper.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
- oracle序列
- ffmpeg tutorial 创建线程
- js判断大小 文件上传
- (编程基础)c语言递归
- 2007年内蒙古大学考研计算机真题__算法设计
- cocos2d-X 节点(UIHelper.h)API
- 一些激励人的话 ——记东华大学校ACM/ICPC集训队
- JMeter主要组件介绍(二)
- PVID
- Log4j学习汇总—–配置详解
- Linux之进程组
- cocos2d-X 节点(UIInputManager.h)API
- cocos2d-X 节点(UILayer.h)API
- 喜欢的音乐