Merge pull request #5449 from andyque/fixbug3829

closed #3829: change namespace gui to ui
This commit is contained in:
James Chen 2014-02-25 10:56:37 +08:00
commit 1753a90c68
78 changed files with 307 additions and 307 deletions

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
#include "gui/UIHelper.h"
using namespace cocos2d;
using namespace gui;
using namespace ui;
namespace cocostudio {

View File

@ -149,7 +149,7 @@ bool ComRender::serialize(void* r)
}
else if(strcmp(className, "GUIComponent") == 0)
{
cocos2d::gui::Widget* widget = GUIReader::getInstance()->widgetFromJsonFile(filePath.c_str());
cocos2d::ui::Widget* widget = GUIReader::getInstance()->widgetFromJsonFile(filePath.c_str());
_render = widget;
}
else

View File

@ -27,7 +27,7 @@ THE SOFTWARE.
#include <fstream>
#include <iostream>
using namespace cocos2d::gui;
using namespace cocos2d::ui;
using namespace cocos2d;
@ -208,7 +208,7 @@ Widget* WidgetPropertiesReader0250::widgetFromJsonDictionary(const rapidjson::Va
const rapidjson::Value& uiOptions = DICTOOL->getSubDictionary_json(data, "options");
if (classname && strcmp(classname, "Button") == 0)
{
widget = cocos2d::gui::Button::create();
widget = cocos2d::ui::Button::create();
setPropsForButtonFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "CheckBox") == 0)
@ -218,40 +218,40 @@ Widget* WidgetPropertiesReader0250::widgetFromJsonDictionary(const rapidjson::Va
}
else if (classname && strcmp(classname, "Label") == 0)
{
widget = cocos2d::gui::Text::create();
widget = cocos2d::ui::Text::create();
setPropsForLabelFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "LabelAtlas") == 0)
{
widget = cocos2d::gui::TextAtlas::create();
widget = cocos2d::ui::TextAtlas::create();
setPropsForLabelAtlasFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "LoadingBar") == 0)
{
widget = cocos2d::gui::LoadingBar::create();
widget = cocos2d::ui::LoadingBar::create();
setPropsForLoadingBarFromJsonDictionary(widget, uiOptions);
}else if (classname && strcmp(classname, "ScrollView") == 0){
widget = cocos2d::gui::ScrollView::create();
widget = cocos2d::ui::ScrollView::create();
setPropsForScrollViewFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "TextArea") == 0)
{
widget = cocos2d::gui::Text::create();
widget = cocos2d::ui::Text::create();
setPropsForLabelFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "TextButton") == 0)
{
widget = cocos2d::gui::Button::create();
widget = cocos2d::ui::Button::create();
setPropsForButtonFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "TextField") == 0)
{
widget = cocos2d::gui::TextField::create();
widget = cocos2d::ui::TextField::create();
setPropsForTextFieldFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "ImageView") == 0)
{
widget = cocos2d::gui::ImageView::create();
widget = cocos2d::ui::ImageView::create();
setPropsForImageViewFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "Panel") == 0)
@ -261,17 +261,17 @@ Widget* WidgetPropertiesReader0250::widgetFromJsonDictionary(const rapidjson::Va
}
else if (classname && strcmp(classname, "Slider") == 0)
{
widget = cocos2d::gui::Slider::create();
widget = cocos2d::ui::Slider::create();
setPropsForSliderFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "LabelBMFont") == 0)
{
widget = cocos2d::gui::TextBMFont::create();
widget = cocos2d::ui::TextBMFont::create();
setPropsForLabelBMFontFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "DragPanel") == 0)
{
widget = cocos2d::gui::ScrollView::create();
widget = cocos2d::ui::ScrollView::create();
setPropsForScrollViewFromJsonDictionary(widget, uiOptions);
}
@ -362,7 +362,7 @@ void WidgetPropertiesReader0250::setColorPropsForWidgetFromJsonDictionary(Widget
void WidgetPropertiesReader0250::setPropsForButtonFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::Button* button = static_cast<Button*>(widget);
cocos2d::ui::Button* button = static_cast<Button*>(widget);
bool scale9Enable = DICTOOL->getBooleanValue_json(options, "scale9Enable");
button->setScale9Enabled(scale9Enable);
@ -481,7 +481,7 @@ void WidgetPropertiesReader0250::setPropsForCheckBoxFromJsonDictionary(Widget*wi
void WidgetPropertiesReader0250::setPropsForImageViewFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::ImageView* imageView = static_cast<ImageView*>(widget);
cocos2d::ui::ImageView* imageView = static_cast<ImageView*>(widget);
const char* imageFileName = DICTOOL->getStringValue_json(options, "fileName");
bool scale9EnableExist = DICTOOL->checkObjectExist_json(options, "scale9Enable");
bool scale9Enable = false;
@ -543,7 +543,7 @@ void WidgetPropertiesReader0250::setPropsForImageViewFromJsonDictionary(Widget*w
void WidgetPropertiesReader0250::setPropsForLabelFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::Text* label = static_cast<cocos2d::gui::Text*>(widget);
cocos2d::ui::Text* label = static_cast<cocos2d::ui::Text*>(widget);
bool touchScaleChangeAble = DICTOOL->getBooleanValue_json(options, "touchScaleEnable");
label->setTouchScaleChangeEnabled(touchScaleChangeAble);
const char* text = DICTOOL->getStringValue_json(options, "text");
@ -581,7 +581,7 @@ void WidgetPropertiesReader0250::setPropsForLabelFromJsonDictionary(Widget*widge
void WidgetPropertiesReader0250::setPropsForLabelAtlasFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::TextAtlas* labelAtlas = static_cast<cocos2d::gui::TextAtlas*>(widget);
cocos2d::ui::TextAtlas* labelAtlas = static_cast<cocos2d::ui::TextAtlas*>(widget);
bool sv = DICTOOL->checkObjectExist_json(options, "stringValue");
bool cmf = DICTOOL->checkObjectExist_json(options, "charMapFile");
bool iw = DICTOOL->checkObjectExist_json(options, "itemWidth");
@ -604,8 +604,8 @@ void WidgetPropertiesReader0250::setPropsForLayoutFromJsonDictionary(Widget*widg
{
setPropsForWidgetFromJsonDictionary(widget, options);
Layout* containerWidget = static_cast<Layout*>(widget);
if (!dynamic_cast<cocos2d::gui::ScrollView*>(containerWidget)
&& !dynamic_cast<cocos2d::gui::ListView*>(containerWidget))
if (!dynamic_cast<cocos2d::ui::ScrollView*>(containerWidget)
&& !dynamic_cast<cocos2d::ui::ListView*>(containerWidget))
{
containerWidget->setClippingEnabled(DICTOOL->getBooleanValue_json(options, "clipAble"));
}
@ -674,7 +674,7 @@ void WidgetPropertiesReader0250::setPropsForLayoutFromJsonDictionary(Widget*widg
void WidgetPropertiesReader0250::setPropsForScrollViewFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForLayoutFromJsonDictionary(widget, options);
cocos2d::gui::ScrollView* scrollView = static_cast<cocos2d::gui::ScrollView*>(widget);
cocos2d::ui::ScrollView* scrollView = static_cast<cocos2d::ui::ScrollView*>(widget);
float innerWidth = DICTOOL->getFloatValue_json(options, "innerWidth");
float innerHeight = DICTOOL->getFloatValue_json(options, "innerHeight");
scrollView->setInnerContainerSize(Size(innerWidth, innerHeight));
@ -687,7 +687,7 @@ void WidgetPropertiesReader0250::setPropsForScrollViewFromJsonDictionary(Widget*
void WidgetPropertiesReader0250::setPropsForSliderFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::Slider* slider = static_cast<cocos2d::gui::Slider*>(widget);
cocos2d::ui::Slider* slider = static_cast<cocos2d::ui::Slider*>(widget);
bool barTextureScale9Enable = DICTOOL->getBooleanValue_json(options, "barTextureScale9Enable");
slider->setScale9Enabled(barTextureScale9Enable);
@ -764,7 +764,7 @@ void WidgetPropertiesReader0250::setPropsForSliderFromJsonDictionary(Widget*widg
void WidgetPropertiesReader0250::setPropsForTextFieldFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::TextField* textField = static_cast<cocos2d::gui::TextField*>(widget);
cocos2d::ui::TextField* textField = static_cast<cocos2d::ui::TextField*>(widget);
bool ph = DICTOOL->checkObjectExist_json(options, "placeHolder");
if (ph)
{
@ -814,7 +814,7 @@ void WidgetPropertiesReader0250::setPropsForTextFieldFromJsonDictionary(Widget*w
void WidgetPropertiesReader0250::setPropsForLoadingBarFromJsonDictionary(Widget *widget, const rapidjson::Value&options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::LoadingBar* loadingBar = static_cast<cocos2d::gui::LoadingBar*>(widget);
cocos2d::ui::LoadingBar* loadingBar = static_cast<cocos2d::ui::LoadingBar*>(widget);
bool useMergedTexture = DICTOOL->getBooleanValue_json(options, "useMergedTexture");
std::string tp_b = m_strFilePath;
const char*imageFileName = DICTOOL->getStringValue_json(options, "texture");
@ -837,7 +837,7 @@ void WidgetPropertiesReader0250::setPropsForLabelBMFontFromJsonDictionary(Widget
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::TextBMFont* labelBMFont = static_cast<cocos2d::gui::TextBMFont*>(widget);
cocos2d::ui::TextBMFont* labelBMFont = static_cast<cocos2d::ui::TextBMFont*>(widget);
std::string tp_c = m_strFilePath;
const char* cmf_tp = nullptr;
@ -907,7 +907,7 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va
const rapidjson::Value& uiOptions = DICTOOL->getSubDictionary_json(data, "options");
if (classname && strcmp(classname, "Button") == 0)
{
widget = cocos2d::gui::Button::create();
widget = cocos2d::ui::Button::create();
setPropsForButtonFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "CheckBox") == 0)
@ -917,40 +917,40 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va
}
else if (classname && strcmp(classname, "Label") == 0)
{
widget = cocos2d::gui::Text::create();
widget = cocos2d::ui::Text::create();
setPropsForLabelFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "LabelAtlas") == 0)
{
widget = cocos2d::gui::TextAtlas::create();
widget = cocos2d::ui::TextAtlas::create();
setPropsForLabelAtlasFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "LoadingBar") == 0)
{
widget = cocos2d::gui::LoadingBar::create();
widget = cocos2d::ui::LoadingBar::create();
setPropsForLoadingBarFromJsonDictionary(widget, uiOptions);
}else if (classname && strcmp(classname, "ScrollView") == 0){
widget = cocos2d::gui::ScrollView::create();
widget = cocos2d::ui::ScrollView::create();
setPropsForScrollViewFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "TextArea") == 0)
{
widget = cocos2d::gui::Text::create();
widget = cocos2d::ui::Text::create();
setPropsForLabelFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "TextButton") == 0)
{
widget = cocos2d::gui::Button::create();
widget = cocos2d::ui::Button::create();
setPropsForButtonFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "TextField") == 0)
{
widget = cocos2d::gui::TextField::create();
widget = cocos2d::ui::TextField::create();
setPropsForTextFieldFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "ImageView") == 0)
{
widget = cocos2d::gui::ImageView::create();
widget = cocos2d::ui::ImageView::create();
setPropsForImageViewFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "Panel") == 0)
@ -960,27 +960,27 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va
}
else if (classname && strcmp(classname, "Slider") == 0)
{
widget = cocos2d::gui::Slider::create();
widget = cocos2d::ui::Slider::create();
setPropsForSliderFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "LabelBMFont") == 0)
{
widget = cocos2d::gui::TextBMFont::create();
widget = cocos2d::ui::TextBMFont::create();
setPropsForLabelBMFontFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "DragPanel") == 0)
{
widget = cocos2d::gui::ScrollView::create();
widget = cocos2d::ui::ScrollView::create();
setPropsForScrollViewFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "ListView") == 0)
{
widget = cocos2d::gui::ListView::create();
widget = cocos2d::ui::ListView::create();
setPropsForListViewFromJsonDictionary(widget, uiOptions);
}
else if (classname && strcmp(classname, "PageView") == 0)
{
widget = cocos2d::gui::PageView::create();
widget = cocos2d::ui::PageView::create();
setPropsForPageViewFromJsonDictionary(widget, uiOptions);
}
@ -1136,7 +1136,7 @@ void WidgetPropertiesReader0300::setColorPropsForWidgetFromJsonDictionary(Widget
void WidgetPropertiesReader0300::setPropsForButtonFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::Button* button = static_cast<cocos2d::gui::Button*>(widget);
cocos2d::ui::Button* button = static_cast<cocos2d::ui::Button*>(widget);
bool scale9Enable = DICTOOL->getBooleanValue_json(options, "scale9Enable");
button->setScale9Enabled(scale9Enable);
@ -1253,7 +1253,7 @@ void WidgetPropertiesReader0300::setPropsForButtonFromJsonDictionary(Widget*widg
void WidgetPropertiesReader0300::setPropsForCheckBoxFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
CheckBox* checkBox = static_cast<cocos2d::gui::CheckBox*>(widget);
CheckBox* checkBox = static_cast<cocos2d::ui::CheckBox*>(widget);
const rapidjson::Value& backGroundDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxData");
int backGroundType = DICTOOL->getIntValue_json(backGroundDic, "resourceType");
@ -1372,7 +1372,7 @@ void WidgetPropertiesReader0300::setPropsForImageViewFromJsonDictionary(Widget*w
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::ImageView* imageView = static_cast<cocos2d::gui::ImageView*>(widget);
cocos2d::ui::ImageView* imageView = static_cast<cocos2d::ui::ImageView*>(widget);
const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, "fileNameData");
int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType");
@ -1434,7 +1434,7 @@ void WidgetPropertiesReader0300::setPropsForImageViewFromJsonDictionary(Widget*w
void WidgetPropertiesReader0300::setPropsForLabelFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::Text* label = static_cast<cocos2d::gui::Text*>(widget);
cocos2d::ui::Text* label = static_cast<cocos2d::ui::Text*>(widget);
bool touchScaleChangeAble = DICTOOL->getBooleanValue_json(options, "touchScaleEnable");
label->setTouchScaleChangeEnabled(touchScaleChangeAble);
const char* text = DICTOOL->getStringValue_json(options, "text");
@ -1472,7 +1472,7 @@ void WidgetPropertiesReader0300::setPropsForLabelFromJsonDictionary(Widget*widge
void WidgetPropertiesReader0300::setPropsForLabelAtlasFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::TextAtlas* labelAtlas = static_cast<cocos2d::gui::TextAtlas*>(widget);
cocos2d::ui::TextAtlas* labelAtlas = static_cast<cocos2d::ui::TextAtlas*>(widget);
bool sv = DICTOOL->checkObjectExist_json(options, "stringValue");
bool cmf = DICTOOL->checkObjectExist_json(options, "charMapFile");
bool iw = DICTOOL->checkObjectExist_json(options, "itemWidth");
@ -1505,9 +1505,9 @@ void WidgetPropertiesReader0300::setPropsForLabelAtlasFromJsonDictionary(Widget*
void WidgetPropertiesReader0300::setPropsForLayoutFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
Layout* panel = static_cast<cocos2d::gui::Layout*>(widget);
if (!dynamic_cast<cocos2d::gui::ScrollView*>(widget)
&& !dynamic_cast<cocos2d::gui::ListView*>(widget))
Layout* panel = static_cast<cocos2d::ui::Layout*>(widget);
if (!dynamic_cast<cocos2d::ui::ScrollView*>(widget)
&& !dynamic_cast<cocos2d::ui::ListView*>(widget))
{
panel->setClippingEnabled(DICTOOL->getBooleanValue_json(options, "clipAble"));
}
@ -1575,7 +1575,7 @@ void WidgetPropertiesReader0300::setPropsForLayoutFromJsonDictionary(Widget*widg
void WidgetPropertiesReader0300::setPropsForScrollViewFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForLayoutFromJsonDictionary(widget, options);
cocos2d::gui::ScrollView* scrollView = static_cast<cocos2d::gui::ScrollView*>(widget);
cocos2d::ui::ScrollView* scrollView = static_cast<cocos2d::ui::ScrollView*>(widget);
float innerWidth = DICTOOL->getFloatValue_json(options, "innerWidth");
float innerHeight = DICTOOL->getFloatValue_json(options, "innerHeight");
scrollView->setInnerContainerSize(Size(innerWidth, innerHeight));
@ -1588,7 +1588,7 @@ void WidgetPropertiesReader0300::setPropsForScrollViewFromJsonDictionary(Widget*
void WidgetPropertiesReader0300::setPropsForSliderFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::Slider* slider = static_cast<cocos2d::gui::Slider*>(widget);
cocos2d::ui::Slider* slider = static_cast<cocos2d::ui::Slider*>(widget);
bool barTextureScale9Enable = DICTOOL->getBooleanValue_json(options, "barTextureScale9Enable");
slider->setScale9Enabled(barTextureScale9Enable);
@ -1744,7 +1744,7 @@ void WidgetPropertiesReader0300::setPropsForSliderFromJsonDictionary(Widget*widg
void WidgetPropertiesReader0300::setPropsForTextFieldFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::TextField* textField = static_cast<cocos2d::gui::TextField*>(widget);
cocos2d::ui::TextField* textField = static_cast<cocos2d::ui::TextField*>(widget);
bool ph = DICTOOL->checkObjectExist_json(options, "placeHolder");
if (ph)
{
@ -1794,7 +1794,7 @@ void WidgetPropertiesReader0300::setPropsForTextFieldFromJsonDictionary(Widget*w
void WidgetPropertiesReader0300::setPropsForLoadingBarFromJsonDictionary(Widget *widget, const rapidjson::Value&options)
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::LoadingBar* loadingBar = static_cast<cocos2d::gui::LoadingBar*>(widget);
cocos2d::ui::LoadingBar* loadingBar = static_cast<cocos2d::ui::LoadingBar*>(widget);
const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, "textureData");
int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType");
@ -1822,7 +1822,7 @@ void WidgetPropertiesReader0300::setPropsForLoadingBarFromJsonDictionary(Widget
break;
}
/* gui mark add load bar scale9 parse */
/* ui mark add load bar scale9 parse */
bool scale9Enable = DICTOOL->getBooleanValue_json(options, "scale9Enable");
loadingBar->setScale9Enabled(scale9Enable);
@ -1850,7 +1850,7 @@ void WidgetPropertiesReader0300::setPropsForLabelBMFontFromJsonDictionary(Widget
{
setPropsForWidgetFromJsonDictionary(widget, options);
cocos2d::gui::TextBMFont* labelBMFont = static_cast<cocos2d::gui::TextBMFont*>(widget);
cocos2d::ui::TextBMFont* labelBMFont = static_cast<cocos2d::ui::TextBMFont*>(widget);
const rapidjson::Value& cmftDic = DICTOOL->getSubDictionary_json(options, "fileNameData");
int cmfType = DICTOOL->getIntValue_json(cmftDic, "resourceType");

View File

@ -41,7 +41,7 @@ public:
static GUIReader* getInstance();
static void destroyInstance();
cocos2d::gui::Widget* widgetFromJsonFile(const char* fileName);
cocos2d::ui::Widget* widgetFromJsonFile(const char* fileName);
int getVersionInteger(const char* str);
/**
* @js NA
@ -64,8 +64,8 @@ protected:
class WidgetPropertiesReader : public cocos2d::Ref
{
public:
virtual cocos2d::gui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName)=0;
virtual cocos2d::gui::Widget* widgetFromJsonDictionary(const rapidjson::Value& data) = 0;
virtual cocos2d::ui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName)=0;
virtual cocos2d::ui::Widget* widgetFromJsonDictionary(const rapidjson::Value& data) = 0;
protected:
std::string m_strFilePath;
};
@ -79,23 +79,23 @@ public:
WidgetPropertiesReader0250(){};
virtual ~WidgetPropertiesReader0250(){};
virtual cocos2d::gui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName);
virtual cocos2d::gui::Widget* widgetFromJsonDictionary(const rapidjson::Value& dic);
virtual void setPropsForWidgetFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual cocos2d::ui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName);
virtual cocos2d::ui::Widget* widgetFromJsonDictionary(const rapidjson::Value& dic);
virtual void setPropsForWidgetFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setColorPropsForWidgetFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForButtonFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForCheckBoxFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForImageViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLabelFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLabelAtlasFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLabelBMFontFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLoadingBarFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForSliderFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForTextFieldFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setColorPropsForWidgetFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForButtonFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForCheckBoxFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForImageViewFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLabelFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLabelAtlasFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLabelBMFontFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLoadingBarFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForSliderFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForTextFieldFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLayoutFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForScrollViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLayoutFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForScrollViewFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
};
class WidgetPropertiesReader0300 : public WidgetPropertiesReader
@ -106,25 +106,25 @@ public:
WidgetPropertiesReader0300(){};
virtual ~WidgetPropertiesReader0300(){};
virtual cocos2d::gui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName);
virtual cocos2d::gui::Widget* widgetFromJsonDictionary(const rapidjson::Value& dic);
virtual void setPropsForWidgetFromJsonDictionary(cocos2d::gui::Widget*,const rapidjson::Value& options);
virtual cocos2d::ui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName);
virtual cocos2d::ui::Widget* widgetFromJsonDictionary(const rapidjson::Value& dic);
virtual void setPropsForWidgetFromJsonDictionary(cocos2d::ui::Widget*,const rapidjson::Value& options);
virtual void setColorPropsForWidgetFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForButtonFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForCheckBoxFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForImageViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLabelFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLabelAtlasFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLabelBMFontFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLoadingBarFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForSliderFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForTextFieldFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setColorPropsForWidgetFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForButtonFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForCheckBoxFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForImageViewFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLabelFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLabelAtlasFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLabelBMFontFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLoadingBarFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForSliderFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForTextFieldFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForLayoutFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForPageViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForScrollViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForListViewFromJsonDictionary(cocos2d::gui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsForLayoutFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForPageViewFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForScrollViewFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
virtual void setPropsForListViewFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
};

View File

@ -28,7 +28,7 @@ THE SOFTWARE.
#include "ObjectFactory.h"
using namespace cocos2d;
using namespace gui;
using namespace ui;
namespace cocostudio {

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
const char* CocosGUIVersion()
{

View File

@ -43,7 +43,7 @@ THE SOFTWARE.
#include "gui/UIHelper.h"
NS_CC_BEGIN
namespace gui {
namespace ui {
const char* CocosGUIVersion();

View File

@ -27,7 +27,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
static const int NORMAL_RENDERER_Z = (-2);
static const int PRESSED_RENDERER_Z = (-2);

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui{
namespace ui{
/**
* @js NA

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
static const int BACKGROUNDBOX_RENDERER_Z = (-1);
static const int BACKGROUNDSELECTEDBOX_RENDERER_Z = (-1);

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
typedef enum
{

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
Widget* Helper::seekWidgetByTag(Widget* root, int tag)
{

View File

@ -27,7 +27,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
/**
* @js NA

View File

@ -27,7 +27,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
#define STATIC_CAST_CCSPRITE static_cast<Sprite*>(_imageRenderer)

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
/**
* @js NA

View File

@ -36,7 +36,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
static const int BACKGROUNDIMAGE_Z = (-1);
static const int BCAKGROUNDCOLORRENDERER_Z = (-2);

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
typedef enum
{

View File

@ -25,7 +25,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
Margin::Margin(void) : left(0), top(0), right(0), bottom(0)

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
/**
* @js NA
* @lua NA

View File

@ -27,7 +27,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
LayoutParameter* LayoutParameter::create()

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
typedef enum
{

View File

@ -28,7 +28,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
ListView::ListView():
_model(nullptr),

View File

@ -30,7 +30,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui{
namespace ui{
typedef enum
{

View File

@ -27,7 +27,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
static const int BAR_RENDERER_Z = (-1);

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
typedef enum
{

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
PageView::PageView():
_curPageIdx(0),

View File

@ -30,7 +30,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
typedef enum
{

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
class UIScrollInterface
{

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
static const float AUTOSCROLLMAXSPEED = 1000.0f;

View File

@ -30,7 +30,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
enum SCROLLVIEW_DIR
{

View File

@ -27,7 +27,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
static const int BASEBAR_RENDERER_Z = (-2);
static const int PROGRESSBAR_RENDERER_Z = (-2);

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
typedef enum
{

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
static const int LABEL_RENDERER_Z = (-1);

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
/**
* @js NA

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
static const int LABELATLAS_RENDERER_Z = (-1);

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
/**
* @js NA

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
static const int LABELBMFONT_RENDERER_Z = (-1);

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
/**
* @js NA

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
UICCTextField::UICCTextField()
: _maxLengthEnabled(false)

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
/**
* @js NA

View File

@ -28,7 +28,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
Widget::Widget():
_enabled(true),

View File

@ -31,7 +31,7 @@ THE SOFTWARE.
NS_CC_BEGIN
namespace gui {
namespace ui {
typedef enum
{

View File

@ -1,5 +1,5 @@
//
// jsb_cocos2dx_gui_manual.h
// jsb_cocos2dx_ui_manual.h
//
// Created by LinWenhai on 17/11/13.
//
@ -10,7 +10,7 @@
#include "gui/CocosGUI.h"
using namespace cocos2d;
using namespace cocos2d::gui;
using namespace cocos2d::ui;
class JSStudioEventListenerWrapper: public JSCallbackWrapper {
public:
@ -82,7 +82,7 @@ static bool js_cocos2dx_UIWidget_addTouchEventListener(JSContext *cx, uint32_t a
{
JSObject *obj = JS_THIS_OBJECT(cx, vp);
js_proxy_t *proxy = jsb_get_js_proxy(obj);
gui::Widget* cobj = (gui::Widget *)(proxy ? proxy->ptr : NULL);
ui::Widget* cobj = (ui::Widget *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
if (argc == 2) {
@ -107,7 +107,7 @@ static bool js_cocos2dx_UICheckBox_addEventListener(JSContext *cx, uint32_t argc
{
JSObject *obj = JS_THIS_OBJECT(cx, vp);
js_proxy_t *proxy = jsb_get_js_proxy(obj);
gui::CheckBox* cobj = (gui::CheckBox *)(proxy ? proxy->ptr : NULL);
ui::CheckBox* cobj = (ui::CheckBox *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
if (argc == 2) {
@ -132,7 +132,7 @@ static bool js_cocos2dx_UISlider_addEventListener(JSContext *cx, uint32_t argc,
{
JSObject *obj = JS_THIS_OBJECT(cx, vp);
js_proxy_t *proxy = jsb_get_js_proxy(obj);
gui::Slider* cobj = (gui::Slider *)(proxy ? proxy->ptr : NULL);
ui::Slider* cobj = (ui::Slider *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
if (argc == 2) {
@ -157,7 +157,7 @@ static bool js_cocos2dx_UITextField_addEventListener(JSContext *cx, uint32_t arg
{
JSObject *obj = JS_THIS_OBJECT(cx, vp);
js_proxy_t *proxy = jsb_get_js_proxy(obj);
gui::TextField* cobj = (gui::TextField *)(proxy ? proxy->ptr : NULL);
ui::TextField* cobj = (ui::TextField *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
if (argc == 2) {
@ -182,7 +182,7 @@ static bool js_cocos2dx_UIPageView_addEventListener(JSContext *cx, uint32_t argc
{
JSObject *obj = JS_THIS_OBJECT(cx, vp);
js_proxy_t *proxy = jsb_get_js_proxy(obj);
gui::PageView* cobj = (gui::PageView *)(proxy ? proxy->ptr : NULL);
ui::PageView* cobj = (ui::PageView *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
if (argc == 2) {
@ -207,7 +207,7 @@ static bool js_cocos2dx_UIListView_addEventListener(JSContext *cx, uint32_t argc
{
JSObject *obj = JS_THIS_OBJECT(cx, vp);
js_proxy_t *proxy = jsb_get_js_proxy(obj);
gui::ListView* cobj = (gui::ListView *)(proxy ? proxy->ptr : NULL);
ui::ListView* cobj = (ui::ListView *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
if (argc == 2) {
@ -232,7 +232,7 @@ static bool js_cocos2dx_LayoutParameter_setMargin(JSContext *cx, uint32_t argc,
{
JSObject *obj = JS_THIS_OBJECT(cx, vp);
js_proxy_t *proxy = jsb_get_js_proxy(obj);
gui::LayoutParameter* cobj = (gui::LayoutParameter *)(proxy ? proxy->ptr : NULL);
ui::LayoutParameter* cobj = (ui::LayoutParameter *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
if (argc == 1) {
@ -255,7 +255,7 @@ static bool js_cocos2dx_LayoutParameter_setMargin(JSContext *cx, uint32_t argc,
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
cobj->setMargin(gui::Margin(left,top,right,bottom));
cobj->setMargin(ui::Margin(left,top,right,bottom));
return true;
}
JS_ReportError(cx, "Invalid number of arguments");
@ -266,13 +266,13 @@ static bool js_cocos2dx_LayoutParameter_getMargin(JSContext *cx, uint32_t argc,
{
JSObject *obj = JS_THIS_OBJECT(cx, vp);
js_proxy_t *proxy = jsb_get_js_proxy(obj);
gui::LayoutParameter* cobj = (gui::LayoutParameter *)(proxy ? proxy->ptr : NULL);
ui::LayoutParameter* cobj = (ui::LayoutParameter *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
if (argc == 0) {
JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);
if (!tmp) return false;
gui::Margin margin = cobj->getMargin();
ui::Margin margin = cobj->getMargin();
bool ok = JS_DefineProperty(cx, tmp, "left", DOUBLE_TO_JSVAL(margin.left), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&
JS_DefineProperty(cx, tmp, "top", DOUBLE_TO_JSVAL(margin.top), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&
JS_DefineProperty(cx, tmp, "right", DOUBLE_TO_JSVAL(margin.right), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&
@ -291,29 +291,29 @@ static bool js_cocos2dx_LayoutParameter_getMargin(JSContext *cx, uint32_t argc,
return false;
}
extern JSObject* jsb_cocos2d_gui_Widget_prototype;
extern JSObject* jsb_cocos2d_gui_CheckBox_prototype;
extern JSObject* jsb_cocos2d_gui_Slider_prototype;
extern JSObject* jsb_cocos2d_gui_TextField_prototype;
extern JSObject* jsb_cocos2d_gui_LayoutParameter_prototype;
extern JSObject* jsb_cocos2d_gui_PageView_prototype;
extern JSObject* jsb_cocos2d_gui_ListView_prototype;
extern JSObject* jsb_cocos2d_ui_Widget_prototype;
extern JSObject* jsb_cocos2d_ui_CheckBox_prototype;
extern JSObject* jsb_cocos2d_ui_Slider_prototype;
extern JSObject* jsb_cocos2d_ui_TextField_prototype;
extern JSObject* jsb_cocos2d_ui_LayoutParameter_prototype;
extern JSObject* jsb_cocos2d_ui_PageView_prototype;
extern JSObject* jsb_cocos2d_ui_ListView_prototype;
void register_all_cocos2dx_gui_manual(JSContext* cx, JSObject* global)
void register_all_cocos2dx_ui_manual(JSContext* cx, JSObject* global)
{
JS_DefineFunction(cx, jsb_cocos2d_gui_Widget_prototype, "addTouchEventListener", js_cocos2dx_UIWidget_addTouchEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_ui_Widget_prototype, "addTouchEventListener", js_cocos2dx_UIWidget_addTouchEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_gui_CheckBox_prototype, "addEventListenerCheckBox", js_cocos2dx_UICheckBox_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_ui_CheckBox_prototype, "addEventListenerCheckBox", js_cocos2dx_UICheckBox_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_gui_Slider_prototype, "addEventListenerSlider", js_cocos2dx_UISlider_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_ui_Slider_prototype, "addEventListenerSlider", js_cocos2dx_UISlider_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_gui_TextField_prototype, "addEventListenerTextField", js_cocos2dx_UITextField_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_ui_TextField_prototype, "addEventListenerTextField", js_cocos2dx_UITextField_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_gui_PageView_prototype, "addEventListenerPageView", js_cocos2dx_UIPageView_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_ui_PageView_prototype, "addEventListenerPageView", js_cocos2dx_UIPageView_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_gui_ListView_prototype, "addEventListenerListView", js_cocos2dx_UIListView_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_ui_ListView_prototype, "addEventListenerListView", js_cocos2dx_UIListView_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_gui_LayoutParameter_prototype, "setMargin", js_cocos2dx_LayoutParameter_setMargin, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_ui_LayoutParameter_prototype, "setMargin", js_cocos2dx_LayoutParameter_setMargin, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_gui_LayoutParameter_prototype, "getMargin", js_cocos2dx_LayoutParameter_getMargin, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
JS_DefineFunction(cx, jsb_cocos2d_ui_LayoutParameter_prototype, "getMargin", js_cocos2dx_LayoutParameter_getMargin, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
}

View File

@ -11,6 +11,6 @@
#include "jsapi.h"
#include "jsfriendapi.h"
void register_all_cocos2dx_gui_manual(JSContext* cx, JSObject* global);
void register_all_cocos2dx_ui_manual(JSContext* cx, JSObject* global);
#endif /* defined(__jsb_cocos2dx_gui_manual__) */

View File

@ -163,7 +163,7 @@ bool LuaStack::init(void)
register_all_cocos2dx_extension_manual(_state);
register_all_cocos2dx_manual_deprecated(_state);
register_all_cocos2dx_coco_studio_manual(_state);
register_all_cocos2dx_gui_manual(_state);
register_all_cocos2dx_ui_manual(_state);
register_all_cocos2dx_spine(_state);
register_all_cocos2dx_spine_manual(_state);
register_glnode_manual(_state);

View File

@ -30,7 +30,7 @@
#include "CocosGUI.h"
#include "CCLuaEngine.h"
using namespace gui;
using namespace ui;
class LuaCocoStudioEventListener:public Ref
{
@ -630,7 +630,7 @@ static void extendLayoutParameter(lua_State* L)
lua_pop(L, 1);
}
int register_all_cocos2dx_gui_manual(lua_State* L)
int register_all_cocos2dx_ui_manual(lua_State* L)
{
if (nullptr == L)
return 0;

View File

@ -34,7 +34,7 @@ extern "C" {
#include "CCRef.h"
TOLUA_API int register_all_cocos2dx_gui_manual(lua_State* L);
TOLUA_API int register_all_cocos2dx_ui_manual(lua_State* L);
struct LuaStudioEventListenerData
{

View File

@ -82,7 +82,7 @@ typedef enum
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
<br>
The step parameter tells the gui or application that the parameter has a certain granularity.<br>
The step parameter tells the ui or application that the parameter has a certain granularity.<br>
For example in the example of cutoff frequency with a range from 100.0 to 22050.0 you might only want the selection to be in 10hz increments. For this you would simply use 10.0 as the step value.<br>
For a boolean, you can use min = 0.0, max = 1.0, step = 1.0. This way the only possible values are 0.0 and 1.0.<br>
Some applications may detect min = 0.0, max = 1.0, step = 1.0 and replace a graphical slider bar with a checkbox instead.<br>

View File

@ -82,7 +82,7 @@ typedef enum
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
<br>
The step parameter tells the gui or application that the parameter has a certain granularity.<br>
The step parameter tells the ui or application that the parameter has a certain granularity.<br>
For example in the example of cutoff frequency with a range from 100.0 to 22050.0 you might only want the selection to be in 10hz increments. For this you would simply use 10.0 as the step value.<br>
For a boolean, you can use min = 0.0, max = 1.0, step = 1.0. This way the only possible values are 0.0 and 1.0.<br>
Some applications may detect min = 0.0, max = 1.0, step = 1.0 and replace a graphical slider bar with a checkbox instead.<br>

View File

@ -32,7 +32,7 @@
using namespace cocos2d;
using namespace cocos2d::extension;
using namespace gui;
using namespace ui;
class CocosGUITestMainLayer : public Layer
{

View File

@ -21,7 +21,7 @@ bool UIButtonTest::init()
Size widgetSize = _widget->getSize();
// Add a label in which the button events will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -30,7 +30,7 @@ bool UIButtonTest::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Button");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -56,19 +56,19 @@ void UIButtonTest::touchEvent(Ref *pSender, TouchEventType type)
{
switch (type)
{
case gui::TOUCH_EVENT_BEGAN:
case ui::TOUCH_EVENT_BEGAN:
_displayValueLabel->setText(String::createWithFormat("Touch Down")->getCString());
break;
case gui::TOUCH_EVENT_MOVED:
case ui::TOUCH_EVENT_MOVED:
_displayValueLabel->setText(String::createWithFormat("Touch Move")->getCString());
break;
case gui::TOUCH_EVENT_ENDED:
case ui::TOUCH_EVENT_ENDED:
_displayValueLabel->setText(String::createWithFormat("Touch Up")->getCString());
break;
case gui::TOUCH_EVENT_CANCELED:
case ui::TOUCH_EVENT_CANCELED:
_displayValueLabel->setText(String::createWithFormat("Touch Cancelled")->getCString());
break;
@ -97,7 +97,7 @@ bool UIButtonTest_Scale9::init()
Size widgetSize = _widget->getSize();
// Add a label in which the button events will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -106,7 +106,7 @@ bool UIButtonTest_Scale9::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Button scale9 render");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -134,19 +134,19 @@ void UIButtonTest_Scale9::touchEvent(Ref *pSender, TouchEventType type)
{
switch (type)
{
case gui::TOUCH_EVENT_BEGAN:
case ui::TOUCH_EVENT_BEGAN:
_displayValueLabel->setText(String::createWithFormat("Touch Down")->getCString());
break;
case gui::TOUCH_EVENT_MOVED:
case ui::TOUCH_EVENT_MOVED:
_displayValueLabel->setText(String::createWithFormat("Touch Move")->getCString());
break;
case gui::TOUCH_EVENT_ENDED:
case ui::TOUCH_EVENT_ENDED:
_displayValueLabel->setText(String::createWithFormat("Touch Up")->getCString());
break;
case gui::TOUCH_EVENT_CANCELED:
case ui::TOUCH_EVENT_CANCELED:
_displayValueLabel->setText(String::createWithFormat("Touch Cancelled")->getCString());
break;
@ -172,7 +172,7 @@ bool UIButtonTest_PressedAction::init()
Size widgetSize = _widget->getSize();
// Add a label in which the button events will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -181,7 +181,7 @@ bool UIButtonTest_PressedAction::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Button Pressed Action");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -208,19 +208,19 @@ void UIButtonTest_PressedAction::touchEvent(Ref *pSender, TouchEventType type)
{
switch (type)
{
case gui::TOUCH_EVENT_BEGAN:
case ui::TOUCH_EVENT_BEGAN:
_displayValueLabel->setText(String::createWithFormat("Touch Down")->getCString());
break;
case gui::TOUCH_EVENT_MOVED:
case ui::TOUCH_EVENT_MOVED:
_displayValueLabel->setText(String::createWithFormat("Touch Move")->getCString());
break;
case gui::TOUCH_EVENT_ENDED:
case ui::TOUCH_EVENT_ENDED:
_displayValueLabel->setText(String::createWithFormat("Touch Up")->getCString());
break;
case gui::TOUCH_EVENT_CANCELED:
case ui::TOUCH_EVENT_CANCELED:
_displayValueLabel->setText(String::createWithFormat("Touch Cancelled")->getCString());
break;
@ -247,7 +247,7 @@ bool UIButtonTest_Title::init()
Size widgetSize = _widget->getSize();
// Add a label in which the text button events will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -256,7 +256,7 @@ bool UIButtonTest_Title::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Button with title");
alert->setFontName("Marker Felt");
alert->setFontSize(30);

View File

@ -37,7 +37,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UIButtonTest)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
class UIButtonTest_Scale9 : public UIScene
@ -50,7 +50,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UIButtonTest_Scale9)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
class UIButtonTest_PressedAction : public UIScene
@ -63,7 +63,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UIButtonTest_PressedAction)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
class UIButtonTest_Title : public UIScene
@ -76,7 +76,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UIButtonTest_Title)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
#endif /* defined(__TestCpp__UIButtonTest__) */

View File

@ -21,7 +21,7 @@ bool UICheckBoxTest::init()
Size widgetSize = _widget->getSize();;
// Add a label in which the checkbox events will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -30,7 +30,7 @@ bool UICheckBoxTest::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("CheckBox");
alert->setFontName("Marker Felt");
alert->setFontSize(30);

View File

@ -37,7 +37,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UICheckBoxTest)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
#endif /* defined(__TestCpp__UICheckBoxTest__) */

View File

@ -11,7 +11,7 @@ bool UIImageViewTest::init()
{
Size widgetSize = _widget->getSize();
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("ImageView");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -72,7 +72,7 @@ bool UIImageViewTest_Scale9::init()
{
Size widgetSize = _widget->getSize();
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("ImageView scale9 render");
alert->setFontName("Marker Felt");
alert->setFontSize(26);

View File

@ -12,7 +12,7 @@ bool UILabelAtlasTest::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("LabelAtlas");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -21,7 +21,7 @@ bool UILabelAtlasTest::init()
_uiLayer->addChild(alert);
// Create the label atlas
gui::TextAtlas* labelAtlas = gui::TextAtlas::create();
ui::TextAtlas* labelAtlas = ui::TextAtlas::create();
labelAtlas->setProperty("1234567890", "cocosgui/labelatlas.png", 17, 22, "0");
labelAtlas->setPosition(Point((widgetSize.width) / 2, widgetSize.height / 2.0f));
_uiLayer->addChild(labelAtlas);

View File

@ -11,7 +11,7 @@ bool UILabelBMFontTest::init()
{
Size widgetSize = _widget->getSize();
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("LabelBMFont");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -20,7 +20,7 @@ bool UILabelBMFontTest::init()
_uiLayer->addChild(alert);
// Create the LabelBMFont
gui::TextBMFont* labelBMFont = gui::TextBMFont::create();
ui::TextBMFont* labelBMFont = ui::TextBMFont::create();
labelBMFont->setFntFile("cocosgui/bitmapFontTest2.fnt");
labelBMFont->setText("BMFont");
labelBMFont->setPosition(Point(widgetSize.width / 2, widgetSize.height / 2.0f + labelBMFont->getSize().height / 8.0f));

View File

@ -11,7 +11,7 @@ bool UILabelTest::init()
{
Size widgetSize = _widget->getSize();
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Label");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -20,7 +20,7 @@ bool UILabelTest::init()
_uiLayer->addChild(alert);
// Create the label
gui::Text* label = gui::Text::create();
ui::Text* label = ui::Text::create();
label->setText("Label");
label->setFontName("AmericanTypewriter");
label->setFontSize(30);
@ -40,7 +40,7 @@ bool UILabelTest_LineWrap::init()
{
Size widgetSize = _widget->getSize();
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Label line wrap");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -49,7 +49,7 @@ bool UILabelTest_LineWrap::init()
_uiLayer->addChild(alert);
// Create the line wrap
gui::Text* label = gui::Text::create();
ui::Text* label = ui::Text::create();
label->setTextAreaSize(Size(280, 150));
label->setTextHorizontalAlignment(TextHAlignment::CENTER);
label->setText("Label can line wrap");
@ -72,7 +72,7 @@ bool UILabelTest_Effect::init()
{
Size widgetSize = _widget->getSize();
gui::Label* alert = gui::Label::create();
ui::Label* alert = ui::Label::create();
alert->setText("Label Effect");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -82,7 +82,7 @@ bool UILabelTest_Effect::init()
// create the shadow only label
gui::Label* shadow_label = gui::Label::create();
ui::Label* shadow_label = ui::Label::create();
Color3B tintColorRed = { 255, 0, 0 };
Size shadowOffset(12.0f, 12.0f);
@ -105,7 +105,7 @@ bool UILabelTest_Effect::init()
// create the stroke only label
gui::Label* stroke_label = gui::Label::create();
ui::Label* stroke_label = ui::Label::create();
Color3B tintColorYellow = { 255, 255, 0 };
Color3B strokeColor = { 0, 10, 255 };
@ -128,7 +128,7 @@ bool UILabelTest_Effect::init()
// create the label stroke and shadow
gui::Label* strokeAndShadow_label = gui::Label::create();
ui::Label* strokeAndShadow_label = ui::Label::create();
Color3B tintColorBlue = { 0, 0, 255 };
Color3B strokeShadowColor = { 255, 0, 0 };
@ -170,7 +170,7 @@ bool UILabelTest_TTF::init()
{
Size widgetSize = _widget->getSize();
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Label set TTF font");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -179,7 +179,7 @@ bool UILabelTest_TTF::init()
_uiLayer->addChild(alert);
// Create the label
gui::Text* label = gui::Text::create();
ui::Text* label = ui::Text::create();
label->setText("Label");
label->setFontName("fonts/A Damn Mess.ttf");
label->setFontSize(30);

View File

@ -20,7 +20,7 @@ bool UILayoutTest::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Layout");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -86,7 +86,7 @@ bool UILayoutTest_Color::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Layout color render");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -153,7 +153,7 @@ bool UILayoutTest_Gradient::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Layout gradient render");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -220,7 +220,7 @@ bool UILayoutTest_BackGroundImage::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Layout background image");
alert->setFontName("Marker Felt");
alert->setFontSize(20);
@ -287,7 +287,7 @@ bool UILayoutTest_BackGroundImage_Scale9::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Layout background image scale9");
alert->setFontName("Marker Felt");
alert->setFontSize(20);
@ -354,7 +354,7 @@ bool UILayoutTest_Layout_Linear_Vertical::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Layout Linear Vertical");
alert->setFontName("Marker Felt");
alert->setFontSize(20);
@ -439,7 +439,7 @@ bool UILayoutTest_Layout_Linear_Horizontal::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Layout Linear Horizontal");
alert->setFontName("Marker Felt");
alert->setFontSize(20);
@ -524,7 +524,7 @@ bool UILayoutTest_Layout_Relative_Align_Parent::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Layout Relative Align Parent");
alert->setFontName("Marker Felt");
alert->setFontSize(20);
@ -673,7 +673,7 @@ bool UILayoutTest_Layout_Relative_Location::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Layout Relative Location");
alert->setFontName("Marker Felt");
alert->setFontSize(20);
@ -778,7 +778,7 @@ bool UILayoutTest_Layout_Grid::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Label* alert = gui::Label::create();
ui::Label* alert = ui::Label::create();
alert->setText("Layout Grid");
alert->setFontName("Marker Felt");
alert->setFontSize(20);

View File

@ -27,7 +27,7 @@ bool UIListViewTest_Vertical::init()
{
Size widgetSize = _widget->getSize();
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("Move by vertical direction");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -36,7 +36,7 @@ bool UIListViewTest_Vertical::init()
_uiLayer->addChild(_displayValueLabel);
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("ListView vertical");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -200,7 +200,7 @@ bool UIListViewTest_Horizontal::init()
{
Size widgetSize = _widget->getSize();
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("Move by horizontal direction");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -209,7 +209,7 @@ bool UIListViewTest_Horizontal::init()
_uiLayer->addChild(_displayValueLabel);
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("ListView horizontal");
alert->setFontName("Marker Felt");
alert->setFontSize(30);

View File

@ -37,7 +37,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UIListViewTest_Vertical)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
std::vector<std::string> _array;
};
@ -52,7 +52,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UIListViewTest_Horizontal)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
std::vector<std::string> _array;
};

View File

@ -25,7 +25,7 @@ bool UILoadingBarTest_Left::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("LoadingBar left");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -107,7 +107,7 @@ bool UILoadingBarTest_Right::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text *alert = gui::Text::create();
ui::Text *alert = ui::Text::create();
alert->setText("LoadingBar right");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -190,7 +190,7 @@ bool UILoadingBarTest_Left_Scale9::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("LoadingBar left scale9 render");
alert->setFontName("Marker Felt");
alert->setFontSize(20);
@ -275,7 +275,7 @@ bool UILoadingBarTest_Right_Scale9::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text *alert = gui::Text::create();
ui::Text *alert = ui::Text::create();
alert->setText("LoadingBar right scale9 render");
alert->setFontName("Marker Felt");
alert->setFontSize(20);

View File

@ -21,7 +21,7 @@ bool UIPageViewTest::init()
Size widgetSize = _widget->getSize();
// Add a label in which the dragpanel events will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("Move by horizontal direction");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -30,7 +30,7 @@ bool UIPageViewTest::init()
_uiLayer->addChild(_displayValueLabel);
// Add the black background
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("PageView");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -65,7 +65,7 @@ bool UIPageViewTest::init()
imageView->setPosition(Point(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f));
layout->addChild(imageView);
gui::Text* label = gui::Text::create();
ui::Text* label = ui::Text::create();
label->setText(CCString::createWithFormat("page %d", (i + 1))->getCString());
label->setFontName("Marker Felt");
label->setFontSize(30);

View File

@ -38,7 +38,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UIPageViewTest)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
#endif /* defined(__TestCpp__UIPageViewTest__) */

View File

@ -6,7 +6,7 @@
#include "editor-support/cocostudio/CCSGUIReader.h"
#include "CocosGUIScene.h"
using namespace gui;
using namespace ui;
UIScene::UIScene()
: _sceneTitle(nullptr)
@ -37,9 +37,9 @@ bool UIScene::init()
Layout* root = static_cast<Layout*>(_uiLayer->getChildByTag(81));
_sceneTitle = dynamic_cast<gui::Text*>(root->getChildByName("UItest"));
_sceneTitle = dynamic_cast<ui::Text*>(root->getChildByName("UItest"));
gui::Text* back_label = dynamic_cast<gui::Text*>(root->getChildByName("back"));
ui::Text* back_label = dynamic_cast<ui::Text*>(root->getChildByName("back"));
back_label->addTouchEventListener(this, toucheventselector(UIScene::toCocosGUITestScene));
Button* left_button = dynamic_cast<Button*>(root->getChildByName("left_Button"));

View File

@ -31,7 +31,7 @@
USING_NS_CC;
USING_NS_CC_EXT;
using namespace gui;
using namespace ui;
#define UI_SCENE_CREATE_FUNC(UIScene) \
public: \
@ -65,7 +65,7 @@ public:
virtual void nextCallback(Ref* sender, TouchEventType type);
/** Title label of the scene. */
CC_SYNTHESIZE_READONLY(gui::Text*, _sceneTitle, SceneTitle)
CC_SYNTHESIZE_READONLY(Text*, _sceneTitle, SceneTitle)
UI_SCENE_CREATE_FUNC(UIScene);

View File

@ -21,7 +21,7 @@ bool UIScrollViewTest_Vertical::init()
Size widgetSize = _widget->getSize();
// Add a label in which the scrollview alert will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("Move by vertical direction");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -30,7 +30,7 @@ bool UIScrollViewTest_Vertical::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("ScrollView vertical");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -43,7 +43,7 @@ bool UIScrollViewTest_Vertical::init()
Layout* background = dynamic_cast<Layout*>(root->getChildByName("background_Panel"));
// Create the scrollview by vertical
gui::ScrollView* scrollView = gui::ScrollView::create();
ui::ScrollView* scrollView = ui::ScrollView::create();
scrollView->setTouchEnabled(true);
scrollView->setSize(Size(280.0f, 150.0f));
Size backgroundSize = background->getContentSize();
@ -109,7 +109,7 @@ bool UIScrollViewTest_Horizontal::init()
Size widgetSize = _widget->getSize();
// Add a label in which the scrollview alert will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("Move by horizontal direction");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -117,7 +117,7 @@ bool UIScrollViewTest_Horizontal::init()
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5f));
_uiLayer->addChild(_displayValueLabel);
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("ScrollView horizontal");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -130,7 +130,7 @@ bool UIScrollViewTest_Horizontal::init()
Layout* background = dynamic_cast<Layout*>(root->getChildByName("background_Panel"));
// Create the scrollview by horizontal
gui::ScrollView* scrollView = gui::ScrollView::create();
ui::ScrollView* scrollView = ui::ScrollView::create();
scrollView->setBounceEnabled(true);
scrollView->setDirection(SCROLLVIEW_DIR_HORIZONTAL);
scrollView->setTouchEnabled(true);
@ -203,7 +203,7 @@ bool UIScrollViewTest_Both::init()
Size widgetSize = _widget->getSize();;
// Add a label in which the dragpanel events will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("Move by any direction");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -212,7 +212,7 @@ bool UIScrollViewTest_Both::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("ScrollView both");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -225,7 +225,7 @@ bool UIScrollViewTest_Both::init()
Layout* background = static_cast<Layout*>(root->getChildByName("background_Panel"));
// Create the dragpanel
gui::ScrollView* scrollView = gui::ScrollView::create();
ui::ScrollView* scrollView = ui::ScrollView::create();
scrollView->setDirection(SCROLLVIEW_DIR_BOTH);
scrollView->setTouchEnabled(true);
scrollView->setBounceEnabled(true);
@ -272,7 +272,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection::init()
Size widgetSize = _widget->getSize();
// Add a label in which the dragpanel events will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
// _displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -281,7 +281,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("ScrollView scroll to percent both directrion");
alert->setFontName("Marker Felt");
alert->setFontSize(20);
@ -293,7 +293,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection::init()
Layout* background = static_cast<Layout*>(root->getChildByName("background_Panel"));
gui::ScrollView* sc = gui::ScrollView::create();
ui::ScrollView* sc = ui::ScrollView::create();
sc->setBackGroundColor(Color3B::GREEN);
sc->setBackGroundColorType(LAYOUT_COLOR_SOLID);
sc->setDirection(SCROLLVIEW_DIR_BOTH);
@ -334,7 +334,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init()
Size widgetSize = _widget->getSize();
// Add a label in which the dragpanel events will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
// _displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -343,7 +343,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("ScrollView scroll to percent both directrion bounce");
alert->setFontName("Marker Felt");
alert->setFontSize(20);
@ -355,7 +355,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init()
Layout* background = dynamic_cast<Layout*>(root->getChildByName("background_Panel"));
gui::ScrollView* sc = gui::ScrollView::create();
ui::ScrollView* sc = ui::ScrollView::create();
sc->setBackGroundColor(Color3B::GREEN);
sc->setBackGroundColorType(LAYOUT_COLOR_SOLID);
sc->setBounceEnabled(true);

View File

@ -36,7 +36,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UIScrollViewTest_Vertical)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
class UIScrollViewTest_Horizontal : public UIScene
@ -48,7 +48,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UIScrollViewTest_Horizontal)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
class UIScrollViewTest_Both : public UIScene
@ -60,7 +60,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UIScrollViewTest_Both)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
class UIScrollViewTest_ScrollToPercentBothDirection : public UIScene
@ -72,7 +72,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UIScrollViewTest_ScrollToPercentBothDirection)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
class UIScrollViewTest_ScrollToPercentBothDirection_Bounce : public UIScene
@ -84,7 +84,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UIScrollViewTest_ScrollToPercentBothDirection_Bounce)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
#endif /* defined(__TestCpp__UIScrollViewTest__) */

View File

@ -22,7 +22,7 @@ bool UISliderTest::init()
Size widgetSize = _widget->getSize();
// Add a label in which the slider alert will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("Move the slider thumb");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -31,7 +31,7 @@ bool UISliderTest::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Slider");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -97,7 +97,7 @@ bool UISliderTest_Scale9::init()
Size widgetSize = _widget->getSize();
// Add a label in which the slider alert will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("Move the slider thumb");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -106,7 +106,7 @@ bool UISliderTest_Scale9::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text *alert = gui::Text::create();
ui::Text *alert = ui::Text::create();
alert->setText("Slider scale9 render");
alert->setFontName("Marker Felt");
alert->setFontSize(30);

View File

@ -37,7 +37,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UISliderTest)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
class UISliderTest_Scale9 : public UIScene
@ -50,7 +50,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UISliderTest_Scale9)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
#endif /* defined(__TestCpp__UISliderTest__) */

View File

@ -20,7 +20,7 @@ bool UITextFieldTest::init()
Size widgetSize = _widget->getSize();
// Add a label in which the textfield events will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -29,7 +29,7 @@ bool UITextFieldTest::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("TextField");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -106,7 +106,7 @@ bool UITextFieldTest_MaxLength::init()
Size screenSize = CCDirector::getInstance()->getWinSize();
// Add a label in which the textfield events will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -115,7 +115,7 @@ bool UITextFieldTest_MaxLength::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text *alert = gui::Text::create();
ui::Text *alert = ui::Text::create();
alert->setText("TextField max length");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
@ -200,7 +200,7 @@ bool UITextFieldTest_Password::init()
Size screenSize = CCDirector::getInstance()->getWinSize();
// Add a label in which the textfield events will be displayed
_displayValueLabel = gui::Text::create();
_displayValueLabel = ui::Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontSize(32);
@ -209,7 +209,7 @@ bool UITextFieldTest_Password::init()
_uiLayer->addChild(_displayValueLabel);
// Add the alert
gui::Text *alert = gui::Text::create();
ui::Text *alert = ui::Text::create();
alert->setText("TextField password");
alert->setFontName("Marker Felt");
alert->setFontSize(30);

View File

@ -37,7 +37,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UITextFieldTest)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
class UITextFieldTest_MaxLength : public UIScene
@ -50,7 +50,7 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UITextFieldTest_MaxLength)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
class UITextFieldTest_Password : public UIScene
@ -63,6 +63,6 @@ public:
protected:
UI_SCENE_CREATE_FUNC(UITextFieldTest_Password)
gui::Text* _displayValueLabel;
ui::Text* _displayValueLabel;
};
#endif /* defined(__TestCpp__UITextFieldTest__) */

View File

@ -21,7 +21,7 @@ bool UIWidgetAddNodeTest::init()
Size widgetSize = _widget->getSize();
// Add the alert
gui::Text* alert = gui::Text::create();
ui::Text* alert = ui::Text::create();
alert->setText("Widget Add Node");
alert->setFontName("Marker Felt");
alert->setFontSize(30);

View File

@ -9,7 +9,7 @@
using namespace cocos2d;
using namespace cocostudio;
using namespace gui;
using namespace ui;
Layer *Next();
Layer *Back();
@ -397,7 +397,7 @@ cocos2d::Node* UIComponentTest::createGameScene()
_node = node;
ComRender *render = static_cast<ComRender*>(_node->getChildByTag(10025)->getComponent("GUIComponent"));
Widget* widget = static_cast<cocos2d::gui::Widget*>(render->getNode());
Widget* widget = static_cast<cocos2d::ui::Widget*>(render->getNode());
Button* button = static_cast<Button*>(widget->getChildByName("Button_156"));
button->addTouchEventListener(this, toucheventselector(UIComponentTest::touchEvent));

View File

@ -100,7 +100,7 @@ public:
virtual void onEnter();
virtual void onExit();
cocos2d::Node* createGameScene();
void touchEvent(cocos2d::Ref *pSender, cocos2d::gui::TouchEventType type);
void touchEvent(cocos2d::Ref *pSender, cocos2d::ui::TouchEventType type);
private:
cocos2d::Node* _node;
};

View File

@ -103,8 +103,8 @@ bool AppDelegate::applicationDidFinishLaunching()
sc->addRegisterCallback(register_all_cocos2dx_builder);
sc->addRegisterCallback(register_CCBuilderReader);
sc->addRegisterCallback(register_all_cocos2dx_gui);
sc->addRegisterCallback(register_all_cocos2dx_gui_manual);
sc->addRegisterCallback(register_all_cocos2dx_ui);
sc->addRegisterCallback(register_all_cocos2dx_ui_manual);
sc->addRegisterCallback(register_all_cocos2dx_studio);
sc->addRegisterCallback(register_all_cocos2dx_studio_manual);

View File

@ -1,14 +1,14 @@
[cocos2dx_gui]
# the prefix to be added to the generated functions. You might or might not use this in your own
# templates
prefix = cocos2dx_gui
prefix = cocos2dx_ui
# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)
# all classes will be embedded in that namespace
target_namespace = ccui
# the native namespace in which this module locates, this parameter is used for avoid conflict of the same class name in different modules, as "cocos2d::Label" <-> "cocos2d::gui::Label".
cpp_namespace = cocos2d::gui
# the native namespace in which this module locates, this parameter is used for avoid conflict of the same class name in different modules, as "cocos2d::Label" <-> "cocos2d::ui::Label".
cpp_namespace = cocos2d::ui
android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include
android_flags = -D_SIZE_T_DEFINED_

View File

@ -7,8 +7,8 @@ prefix = cocos2dx_gui
# all classes will be embedded in that namespace
target_namespace = ccui
# the native namespace in which this module locates, this parameter is used for avoid conflict of the same class name in different modules, as "cocos2d::Label" <-> "cocos2d::gui::Label".
cpp_namespace = cocos2d::gui
# the native namespace in which this module locates, this parameter is used for avoid conflict of the same class name in different modules, as "cocos2d::Label" <-> "cocos2d::ui::Label".
cpp_namespace = cocos2d::ui
android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include
android_flags = -D_SIZE_T_DEFINED_