cocos2d-X 节点(UILayer.h)API
来源:互联网 发布:sql删除语句所有数据 编辑:程序博客网 时间:2024/05/16 14:17
本文来自http://blog.csdn.net/runaying ,引用必须注明出处!
cocos2d-X 节点(UILayer.h)API
温馨提醒:为了大家能更好学习,强烈推荐大家看看本人的这篇博客 Cocos2d-X权威指南笔记
获取 UIInputManager,添加/移除 widget,设置 UILayer的可见 性
/////cocos2d-x-3.0alpha0/extensions/CocoStudio/GUI/System// 获取 UIInputManager,添加/移除 widget ,设置 UILayer 的可见 性#ifndef __UILAYER_H__#define __UILAYER_H__#include "cocos2d.h"#include "ExtensionMacros.h"#include "../BaseClasses/UIRootWidget.h"#include "../System/UIInputManager.h"NS_CC_EXT_BEGINclass UILayer : public Layer{ public: /** * Default constructor */ UILayer(); /** * Default destructor */ virtual ~UILayer(); /** * Allocates and initializes a widget. */ static UILayer *create(void); //initializes state of uilayer. //初始化 uilayer 的状态 virtual bool init(); virtual void onEnter(); virtual void onExit(); virtual void onEnterTransitionDidFinish(); virtual bool onTouchBegan(Touch *pTouch, Event *pEvent); virtual void onTouchMoved(Touch *pTouch, Event *pEvent); virtual void onTouchEnded(Touch *pTouch, Event *pEvent); virtual void onTouchCancelled(Touch *pTouch, Event *pEvent); /** * Add a widget to UILayer, for drawing. //为绘制添加一个 eidget 到 UILayer * * @param widget. */ void addWidget(UIWidget* widget); /** * Remove a widget from UILayer. * * @param widget. * * @param cleanup true 所有 children widgets 运行的 所有 action 都将 删除, false otherwise. */ void removeWidget(UIWidget* widget); /** * Sets whether the UILayer is visible 可见 * * 默认值是 true ,默认可见 * * @param visible true if the UILayer is visible, false if the UILayer is hidden. */ virtual void setVisible(bool visible); /** * Finds a widget whose tag is equal tag param from widget tree. //从 widget 树上查找 tag 等于输入参数的 widget * * @param tag. */ UIWidget* getWidgetByTag(int tag); /** * Seek a widget whose name is equal name param from widget tree. //从 widget 树上查找 name 等于输入参数的 widget * * @param name. */ UIWidget* getWidgetByName(const char* name); /** * Gets UIInputManager. * * UIInputManager 管理 UILayer 的触摸. * * @return UIInputManager. */ UIInputManager* getInputManager(); /** * Remove and clean up all of UILayer's widget. //移除并清理所有的 UILayer's widget. */ virtual void clear(); /** * Gets root widget of UILayer. * * @return UIRootWidget, "UIRootWidget" is the root widget of UILayer. */ UIRootWidget* getRootWidget(); protected: UIRootWidget* _rootWidget; UIInputManager* _inputManager;};NS_CC_EXT_END#endif /* defined(__UILAYER_H__) */
- cocos2d-X 节点(UILayer.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
- JMeter主要组件介绍(二)
- PVID
- Log4j学习汇总—–配置详解
- Linux之进程组
- cocos2d-X 节点(UIInputManager.h)API
- cocos2d-X 节点(UILayer.h)API
- 喜欢的音乐
- 32位汇编基础
- linux驱动编译时make -C M= 解释
- redhat中libstd++.so.5找不到
- 乒乓缓冲类的设计(上)
- C# 线程练习1
- 乒乓缓冲类的设计(下)
- 百钱买百鸡——c语言算法实现