#include "ui\CocosGUI.h"
#include "cocostudio\CocoStudio.h"ui
using namespace cocos2d::ui;
using namespace cocostudio;this
//读取csb文件spa
auto ui = CSLoader::createNode("MyScene.csb");指针
//获取cocostudio的按钮空间,并给btn指针
Button* btn = (Button*)ui->getChildByName("MtBtn");对象
//获取控件对象
LoadingBar* m_hpBar = (LoadingBar*)UI->getChildByName("hpBar");图片
//获取图片对象get
ImageView* m_xiaoruoImg = (ImageView*)UI->getChildByName("xiaoruoImg");io
//添加单击监听
m_hpBar->addTouchEventListener(this, toucheventselector(HelloWorld::onClick));event