mirror of https://github.com/axmolengine/axmol.git
Merge pull request #5449 from andyque/fixbug3829
closed #3829: change namespace gui to ui
This commit is contained in:
commit
1753a90c68
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
#include "gui/UIHelper.h"
|
#include "gui/UIHelper.h"
|
||||||
|
|
||||||
using namespace cocos2d;
|
using namespace cocos2d;
|
||||||
using namespace gui;
|
using namespace ui;
|
||||||
|
|
||||||
namespace cocostudio {
|
namespace cocostudio {
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ bool ComRender::serialize(void* r)
|
||||||
}
|
}
|
||||||
else if(strcmp(className, "GUIComponent") == 0)
|
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;
|
_render = widget;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -27,7 +27,7 @@ THE SOFTWARE.
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace cocos2d::gui;
|
using namespace cocos2d::ui;
|
||||||
using namespace cocos2d;
|
using namespace cocos2d;
|
||||||
|
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ Widget* WidgetPropertiesReader0250::widgetFromJsonDictionary(const rapidjson::Va
|
||||||
const rapidjson::Value& uiOptions = DICTOOL->getSubDictionary_json(data, "options");
|
const rapidjson::Value& uiOptions = DICTOOL->getSubDictionary_json(data, "options");
|
||||||
if (classname && strcmp(classname, "Button") == 0)
|
if (classname && strcmp(classname, "Button") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::Button::create();
|
widget = cocos2d::ui::Button::create();
|
||||||
setPropsForButtonFromJsonDictionary(widget, uiOptions);
|
setPropsForButtonFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "CheckBox") == 0)
|
else if (classname && strcmp(classname, "CheckBox") == 0)
|
||||||
|
@ -218,40 +218,40 @@ Widget* WidgetPropertiesReader0250::widgetFromJsonDictionary(const rapidjson::Va
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "Label") == 0)
|
else if (classname && strcmp(classname, "Label") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::Text::create();
|
widget = cocos2d::ui::Text::create();
|
||||||
setPropsForLabelFromJsonDictionary(widget, uiOptions);
|
setPropsForLabelFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "LabelAtlas") == 0)
|
else if (classname && strcmp(classname, "LabelAtlas") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::TextAtlas::create();
|
widget = cocos2d::ui::TextAtlas::create();
|
||||||
setPropsForLabelAtlasFromJsonDictionary(widget, uiOptions);
|
setPropsForLabelAtlasFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "LoadingBar") == 0)
|
else if (classname && strcmp(classname, "LoadingBar") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::LoadingBar::create();
|
widget = cocos2d::ui::LoadingBar::create();
|
||||||
setPropsForLoadingBarFromJsonDictionary(widget, uiOptions);
|
setPropsForLoadingBarFromJsonDictionary(widget, uiOptions);
|
||||||
}else if (classname && strcmp(classname, "ScrollView") == 0){
|
}else if (classname && strcmp(classname, "ScrollView") == 0){
|
||||||
widget = cocos2d::gui::ScrollView::create();
|
widget = cocos2d::ui::ScrollView::create();
|
||||||
setPropsForScrollViewFromJsonDictionary(widget, uiOptions);
|
setPropsForScrollViewFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "TextArea") == 0)
|
else if (classname && strcmp(classname, "TextArea") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::Text::create();
|
widget = cocos2d::ui::Text::create();
|
||||||
setPropsForLabelFromJsonDictionary(widget, uiOptions);
|
setPropsForLabelFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "TextButton") == 0)
|
else if (classname && strcmp(classname, "TextButton") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::Button::create();
|
widget = cocos2d::ui::Button::create();
|
||||||
setPropsForButtonFromJsonDictionary(widget, uiOptions);
|
setPropsForButtonFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "TextField") == 0)
|
else if (classname && strcmp(classname, "TextField") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::TextField::create();
|
widget = cocos2d::ui::TextField::create();
|
||||||
setPropsForTextFieldFromJsonDictionary(widget, uiOptions);
|
setPropsForTextFieldFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "ImageView") == 0)
|
else if (classname && strcmp(classname, "ImageView") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::ImageView::create();
|
widget = cocos2d::ui::ImageView::create();
|
||||||
setPropsForImageViewFromJsonDictionary(widget, uiOptions);
|
setPropsForImageViewFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "Panel") == 0)
|
else if (classname && strcmp(classname, "Panel") == 0)
|
||||||
|
@ -261,17 +261,17 @@ Widget* WidgetPropertiesReader0250::widgetFromJsonDictionary(const rapidjson::Va
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "Slider") == 0)
|
else if (classname && strcmp(classname, "Slider") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::Slider::create();
|
widget = cocos2d::ui::Slider::create();
|
||||||
setPropsForSliderFromJsonDictionary(widget, uiOptions);
|
setPropsForSliderFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "LabelBMFont") == 0)
|
else if (classname && strcmp(classname, "LabelBMFont") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::TextBMFont::create();
|
widget = cocos2d::ui::TextBMFont::create();
|
||||||
setPropsForLabelBMFontFromJsonDictionary(widget, uiOptions);
|
setPropsForLabelBMFontFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "DragPanel") == 0)
|
else if (classname && strcmp(classname, "DragPanel") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::ScrollView::create();
|
widget = cocos2d::ui::ScrollView::create();
|
||||||
setPropsForScrollViewFromJsonDictionary(widget, uiOptions);
|
setPropsForScrollViewFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ void WidgetPropertiesReader0250::setColorPropsForWidgetFromJsonDictionary(Widget
|
||||||
void WidgetPropertiesReader0250::setPropsForButtonFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
void WidgetPropertiesReader0250::setPropsForButtonFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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");
|
bool scale9Enable = DICTOOL->getBooleanValue_json(options, "scale9Enable");
|
||||||
button->setScale9Enabled(scale9Enable);
|
button->setScale9Enabled(scale9Enable);
|
||||||
|
|
||||||
|
@ -481,7 +481,7 @@ void WidgetPropertiesReader0250::setPropsForCheckBoxFromJsonDictionary(Widget*wi
|
||||||
void WidgetPropertiesReader0250::setPropsForImageViewFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
void WidgetPropertiesReader0250::setPropsForImageViewFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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");
|
const char* imageFileName = DICTOOL->getStringValue_json(options, "fileName");
|
||||||
bool scale9EnableExist = DICTOOL->checkObjectExist_json(options, "scale9Enable");
|
bool scale9EnableExist = DICTOOL->checkObjectExist_json(options, "scale9Enable");
|
||||||
bool scale9Enable = false;
|
bool scale9Enable = false;
|
||||||
|
@ -543,7 +543,7 @@ void WidgetPropertiesReader0250::setPropsForImageViewFromJsonDictionary(Widget*w
|
||||||
void WidgetPropertiesReader0250::setPropsForLabelFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
void WidgetPropertiesReader0250::setPropsForLabelFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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");
|
bool touchScaleChangeAble = DICTOOL->getBooleanValue_json(options, "touchScaleEnable");
|
||||||
label->setTouchScaleChangeEnabled(touchScaleChangeAble);
|
label->setTouchScaleChangeEnabled(touchScaleChangeAble);
|
||||||
const char* text = DICTOOL->getStringValue_json(options, "text");
|
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)
|
void WidgetPropertiesReader0250::setPropsForLabelAtlasFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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 sv = DICTOOL->checkObjectExist_json(options, "stringValue");
|
||||||
bool cmf = DICTOOL->checkObjectExist_json(options, "charMapFile");
|
bool cmf = DICTOOL->checkObjectExist_json(options, "charMapFile");
|
||||||
bool iw = DICTOOL->checkObjectExist_json(options, "itemWidth");
|
bool iw = DICTOOL->checkObjectExist_json(options, "itemWidth");
|
||||||
|
@ -604,8 +604,8 @@ void WidgetPropertiesReader0250::setPropsForLayoutFromJsonDictionary(Widget*widg
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, options);
|
setPropsForWidgetFromJsonDictionary(widget, options);
|
||||||
Layout* containerWidget = static_cast<Layout*>(widget);
|
Layout* containerWidget = static_cast<Layout*>(widget);
|
||||||
if (!dynamic_cast<cocos2d::gui::ScrollView*>(containerWidget)
|
if (!dynamic_cast<cocos2d::ui::ScrollView*>(containerWidget)
|
||||||
&& !dynamic_cast<cocos2d::gui::ListView*>(containerWidget))
|
&& !dynamic_cast<cocos2d::ui::ListView*>(containerWidget))
|
||||||
{
|
{
|
||||||
containerWidget->setClippingEnabled(DICTOOL->getBooleanValue_json(options, "clipAble"));
|
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)
|
void WidgetPropertiesReader0250::setPropsForScrollViewFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForLayoutFromJsonDictionary(widget, 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 innerWidth = DICTOOL->getFloatValue_json(options, "innerWidth");
|
||||||
float innerHeight = DICTOOL->getFloatValue_json(options, "innerHeight");
|
float innerHeight = DICTOOL->getFloatValue_json(options, "innerHeight");
|
||||||
scrollView->setInnerContainerSize(Size(innerWidth, innerHeight));
|
scrollView->setInnerContainerSize(Size(innerWidth, innerHeight));
|
||||||
|
@ -687,7 +687,7 @@ void WidgetPropertiesReader0250::setPropsForScrollViewFromJsonDictionary(Widget*
|
||||||
void WidgetPropertiesReader0250::setPropsForSliderFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
void WidgetPropertiesReader0250::setPropsForSliderFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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");
|
bool barTextureScale9Enable = DICTOOL->getBooleanValue_json(options, "barTextureScale9Enable");
|
||||||
slider->setScale9Enabled(barTextureScale9Enable);
|
slider->setScale9Enabled(barTextureScale9Enable);
|
||||||
|
@ -764,7 +764,7 @@ void WidgetPropertiesReader0250::setPropsForSliderFromJsonDictionary(Widget*widg
|
||||||
void WidgetPropertiesReader0250::setPropsForTextFieldFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
void WidgetPropertiesReader0250::setPropsForTextFieldFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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");
|
bool ph = DICTOOL->checkObjectExist_json(options, "placeHolder");
|
||||||
if (ph)
|
if (ph)
|
||||||
{
|
{
|
||||||
|
@ -814,7 +814,7 @@ void WidgetPropertiesReader0250::setPropsForTextFieldFromJsonDictionary(Widget*w
|
||||||
void WidgetPropertiesReader0250::setPropsForLoadingBarFromJsonDictionary(Widget *widget, const rapidjson::Value&options)
|
void WidgetPropertiesReader0250::setPropsForLoadingBarFromJsonDictionary(Widget *widget, const rapidjson::Value&options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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");
|
bool useMergedTexture = DICTOOL->getBooleanValue_json(options, "useMergedTexture");
|
||||||
std::string tp_b = m_strFilePath;
|
std::string tp_b = m_strFilePath;
|
||||||
const char*imageFileName = DICTOOL->getStringValue_json(options, "texture");
|
const char*imageFileName = DICTOOL->getStringValue_json(options, "texture");
|
||||||
|
@ -837,7 +837,7 @@ void WidgetPropertiesReader0250::setPropsForLabelBMFontFromJsonDictionary(Widget
|
||||||
|
|
||||||
setPropsForWidgetFromJsonDictionary(widget, options);
|
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;
|
std::string tp_c = m_strFilePath;
|
||||||
const char* cmf_tp = nullptr;
|
const char* cmf_tp = nullptr;
|
||||||
|
@ -907,7 +907,7 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va
|
||||||
const rapidjson::Value& uiOptions = DICTOOL->getSubDictionary_json(data, "options");
|
const rapidjson::Value& uiOptions = DICTOOL->getSubDictionary_json(data, "options");
|
||||||
if (classname && strcmp(classname, "Button") == 0)
|
if (classname && strcmp(classname, "Button") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::Button::create();
|
widget = cocos2d::ui::Button::create();
|
||||||
setPropsForButtonFromJsonDictionary(widget, uiOptions);
|
setPropsForButtonFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "CheckBox") == 0)
|
else if (classname && strcmp(classname, "CheckBox") == 0)
|
||||||
|
@ -917,40 +917,40 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "Label") == 0)
|
else if (classname && strcmp(classname, "Label") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::Text::create();
|
widget = cocos2d::ui::Text::create();
|
||||||
setPropsForLabelFromJsonDictionary(widget, uiOptions);
|
setPropsForLabelFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "LabelAtlas") == 0)
|
else if (classname && strcmp(classname, "LabelAtlas") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::TextAtlas::create();
|
widget = cocos2d::ui::TextAtlas::create();
|
||||||
setPropsForLabelAtlasFromJsonDictionary(widget, uiOptions);
|
setPropsForLabelAtlasFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "LoadingBar") == 0)
|
else if (classname && strcmp(classname, "LoadingBar") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::LoadingBar::create();
|
widget = cocos2d::ui::LoadingBar::create();
|
||||||
setPropsForLoadingBarFromJsonDictionary(widget, uiOptions);
|
setPropsForLoadingBarFromJsonDictionary(widget, uiOptions);
|
||||||
}else if (classname && strcmp(classname, "ScrollView") == 0){
|
}else if (classname && strcmp(classname, "ScrollView") == 0){
|
||||||
widget = cocos2d::gui::ScrollView::create();
|
widget = cocos2d::ui::ScrollView::create();
|
||||||
setPropsForScrollViewFromJsonDictionary(widget, uiOptions);
|
setPropsForScrollViewFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "TextArea") == 0)
|
else if (classname && strcmp(classname, "TextArea") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::Text::create();
|
widget = cocos2d::ui::Text::create();
|
||||||
setPropsForLabelFromJsonDictionary(widget, uiOptions);
|
setPropsForLabelFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "TextButton") == 0)
|
else if (classname && strcmp(classname, "TextButton") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::Button::create();
|
widget = cocos2d::ui::Button::create();
|
||||||
setPropsForButtonFromJsonDictionary(widget, uiOptions);
|
setPropsForButtonFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "TextField") == 0)
|
else if (classname && strcmp(classname, "TextField") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::TextField::create();
|
widget = cocos2d::ui::TextField::create();
|
||||||
setPropsForTextFieldFromJsonDictionary(widget, uiOptions);
|
setPropsForTextFieldFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "ImageView") == 0)
|
else if (classname && strcmp(classname, "ImageView") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::ImageView::create();
|
widget = cocos2d::ui::ImageView::create();
|
||||||
setPropsForImageViewFromJsonDictionary(widget, uiOptions);
|
setPropsForImageViewFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "Panel") == 0)
|
else if (classname && strcmp(classname, "Panel") == 0)
|
||||||
|
@ -960,27 +960,27 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "Slider") == 0)
|
else if (classname && strcmp(classname, "Slider") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::Slider::create();
|
widget = cocos2d::ui::Slider::create();
|
||||||
setPropsForSliderFromJsonDictionary(widget, uiOptions);
|
setPropsForSliderFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "LabelBMFont") == 0)
|
else if (classname && strcmp(classname, "LabelBMFont") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::TextBMFont::create();
|
widget = cocos2d::ui::TextBMFont::create();
|
||||||
setPropsForLabelBMFontFromJsonDictionary(widget, uiOptions);
|
setPropsForLabelBMFontFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "DragPanel") == 0)
|
else if (classname && strcmp(classname, "DragPanel") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::ScrollView::create();
|
widget = cocos2d::ui::ScrollView::create();
|
||||||
setPropsForScrollViewFromJsonDictionary(widget, uiOptions);
|
setPropsForScrollViewFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "ListView") == 0)
|
else if (classname && strcmp(classname, "ListView") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::ListView::create();
|
widget = cocos2d::ui::ListView::create();
|
||||||
setPropsForListViewFromJsonDictionary(widget, uiOptions);
|
setPropsForListViewFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
else if (classname && strcmp(classname, "PageView") == 0)
|
else if (classname && strcmp(classname, "PageView") == 0)
|
||||||
{
|
{
|
||||||
widget = cocos2d::gui::PageView::create();
|
widget = cocos2d::ui::PageView::create();
|
||||||
setPropsForPageViewFromJsonDictionary(widget, uiOptions);
|
setPropsForPageViewFromJsonDictionary(widget, uiOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1136,7 +1136,7 @@ void WidgetPropertiesReader0300::setColorPropsForWidgetFromJsonDictionary(Widget
|
||||||
void WidgetPropertiesReader0300::setPropsForButtonFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
void WidgetPropertiesReader0300::setPropsForButtonFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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");
|
bool scale9Enable = DICTOOL->getBooleanValue_json(options, "scale9Enable");
|
||||||
button->setScale9Enabled(scale9Enable);
|
button->setScale9Enabled(scale9Enable);
|
||||||
|
|
||||||
|
@ -1253,7 +1253,7 @@ void WidgetPropertiesReader0300::setPropsForButtonFromJsonDictionary(Widget*widg
|
||||||
void WidgetPropertiesReader0300::setPropsForCheckBoxFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
void WidgetPropertiesReader0300::setPropsForCheckBoxFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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");
|
const rapidjson::Value& backGroundDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxData");
|
||||||
int backGroundType = DICTOOL->getIntValue_json(backGroundDic, "resourceType");
|
int backGroundType = DICTOOL->getIntValue_json(backGroundDic, "resourceType");
|
||||||
|
@ -1372,7 +1372,7 @@ void WidgetPropertiesReader0300::setPropsForImageViewFromJsonDictionary(Widget*w
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, options);
|
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");
|
const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, "fileNameData");
|
||||||
int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType");
|
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)
|
void WidgetPropertiesReader0300::setPropsForLabelFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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");
|
bool touchScaleChangeAble = DICTOOL->getBooleanValue_json(options, "touchScaleEnable");
|
||||||
label->setTouchScaleChangeEnabled(touchScaleChangeAble);
|
label->setTouchScaleChangeEnabled(touchScaleChangeAble);
|
||||||
const char* text = DICTOOL->getStringValue_json(options, "text");
|
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)
|
void WidgetPropertiesReader0300::setPropsForLabelAtlasFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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 sv = DICTOOL->checkObjectExist_json(options, "stringValue");
|
||||||
bool cmf = DICTOOL->checkObjectExist_json(options, "charMapFile");
|
bool cmf = DICTOOL->checkObjectExist_json(options, "charMapFile");
|
||||||
bool iw = DICTOOL->checkObjectExist_json(options, "itemWidth");
|
bool iw = DICTOOL->checkObjectExist_json(options, "itemWidth");
|
||||||
|
@ -1505,9 +1505,9 @@ void WidgetPropertiesReader0300::setPropsForLabelAtlasFromJsonDictionary(Widget*
|
||||||
void WidgetPropertiesReader0300::setPropsForLayoutFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
void WidgetPropertiesReader0300::setPropsForLayoutFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, options);
|
setPropsForWidgetFromJsonDictionary(widget, options);
|
||||||
Layout* panel = static_cast<cocos2d::gui::Layout*>(widget);
|
Layout* panel = static_cast<cocos2d::ui::Layout*>(widget);
|
||||||
if (!dynamic_cast<cocos2d::gui::ScrollView*>(widget)
|
if (!dynamic_cast<cocos2d::ui::ScrollView*>(widget)
|
||||||
&& !dynamic_cast<cocos2d::gui::ListView*>(widget))
|
&& !dynamic_cast<cocos2d::ui::ListView*>(widget))
|
||||||
{
|
{
|
||||||
panel->setClippingEnabled(DICTOOL->getBooleanValue_json(options, "clipAble"));
|
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)
|
void WidgetPropertiesReader0300::setPropsForScrollViewFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForLayoutFromJsonDictionary(widget, 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 innerWidth = DICTOOL->getFloatValue_json(options, "innerWidth");
|
||||||
float innerHeight = DICTOOL->getFloatValue_json(options, "innerHeight");
|
float innerHeight = DICTOOL->getFloatValue_json(options, "innerHeight");
|
||||||
scrollView->setInnerContainerSize(Size(innerWidth, innerHeight));
|
scrollView->setInnerContainerSize(Size(innerWidth, innerHeight));
|
||||||
|
@ -1588,7 +1588,7 @@ void WidgetPropertiesReader0300::setPropsForScrollViewFromJsonDictionary(Widget*
|
||||||
void WidgetPropertiesReader0300::setPropsForSliderFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
void WidgetPropertiesReader0300::setPropsForSliderFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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");
|
bool barTextureScale9Enable = DICTOOL->getBooleanValue_json(options, "barTextureScale9Enable");
|
||||||
slider->setScale9Enabled(barTextureScale9Enable);
|
slider->setScale9Enabled(barTextureScale9Enable);
|
||||||
|
@ -1744,7 +1744,7 @@ void WidgetPropertiesReader0300::setPropsForSliderFromJsonDictionary(Widget*widg
|
||||||
void WidgetPropertiesReader0300::setPropsForTextFieldFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
void WidgetPropertiesReader0300::setPropsForTextFieldFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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");
|
bool ph = DICTOOL->checkObjectExist_json(options, "placeHolder");
|
||||||
if (ph)
|
if (ph)
|
||||||
{
|
{
|
||||||
|
@ -1794,7 +1794,7 @@ void WidgetPropertiesReader0300::setPropsForTextFieldFromJsonDictionary(Widget*w
|
||||||
void WidgetPropertiesReader0300::setPropsForLoadingBarFromJsonDictionary(Widget *widget, const rapidjson::Value&options)
|
void WidgetPropertiesReader0300::setPropsForLoadingBarFromJsonDictionary(Widget *widget, const rapidjson::Value&options)
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, 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");
|
const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, "textureData");
|
||||||
int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType");
|
int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType");
|
||||||
|
@ -1822,7 +1822,7 @@ void WidgetPropertiesReader0300::setPropsForLoadingBarFromJsonDictionary(Widget
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* gui mark add load bar scale9 parse */
|
/* ui mark add load bar scale9 parse */
|
||||||
bool scale9Enable = DICTOOL->getBooleanValue_json(options, "scale9Enable");
|
bool scale9Enable = DICTOOL->getBooleanValue_json(options, "scale9Enable");
|
||||||
loadingBar->setScale9Enabled(scale9Enable);
|
loadingBar->setScale9Enabled(scale9Enable);
|
||||||
|
|
||||||
|
@ -1850,7 +1850,7 @@ void WidgetPropertiesReader0300::setPropsForLabelBMFontFromJsonDictionary(Widget
|
||||||
{
|
{
|
||||||
setPropsForWidgetFromJsonDictionary(widget, options);
|
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");
|
const rapidjson::Value& cmftDic = DICTOOL->getSubDictionary_json(options, "fileNameData");
|
||||||
int cmfType = DICTOOL->getIntValue_json(cmftDic, "resourceType");
|
int cmfType = DICTOOL->getIntValue_json(cmftDic, "resourceType");
|
||||||
|
@ -1901,4 +1901,4 @@ void WidgetPropertiesReader0300::setPropsForListViewFromJsonDictionary(Widget* w
|
||||||
listView->setItemsMargin(itemMargin);
|
listView->setItemsMargin(itemMargin);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
static GUIReader* getInstance();
|
static GUIReader* getInstance();
|
||||||
static void destroyInstance();
|
static void destroyInstance();
|
||||||
|
|
||||||
cocos2d::gui::Widget* widgetFromJsonFile(const char* fileName);
|
cocos2d::ui::Widget* widgetFromJsonFile(const char* fileName);
|
||||||
int getVersionInteger(const char* str);
|
int getVersionInteger(const char* str);
|
||||||
/**
|
/**
|
||||||
* @js NA
|
* @js NA
|
||||||
|
@ -64,8 +64,8 @@ protected:
|
||||||
class WidgetPropertiesReader : public cocos2d::Ref
|
class WidgetPropertiesReader : public cocos2d::Ref
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual cocos2d::gui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName)=0;
|
virtual cocos2d::ui::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* widgetFromJsonDictionary(const rapidjson::Value& data) = 0;
|
||||||
protected:
|
protected:
|
||||||
std::string m_strFilePath;
|
std::string m_strFilePath;
|
||||||
};
|
};
|
||||||
|
@ -79,23 +79,23 @@ public:
|
||||||
WidgetPropertiesReader0250(){};
|
WidgetPropertiesReader0250(){};
|
||||||
virtual ~WidgetPropertiesReader0250(){};
|
virtual ~WidgetPropertiesReader0250(){};
|
||||||
|
|
||||||
virtual cocos2d::gui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName);
|
virtual cocos2d::ui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName);
|
||||||
virtual cocos2d::gui::Widget* widgetFromJsonDictionary(const rapidjson::Value& dic);
|
virtual cocos2d::ui::Widget* widgetFromJsonDictionary(const rapidjson::Value& dic);
|
||||||
virtual void setPropsForWidgetFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForWidgetFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
|
|
||||||
virtual void setColorPropsForWidgetFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setColorPropsForWidgetFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForButtonFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForButtonFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForCheckBoxFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForCheckBoxFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForImageViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForImageViewFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForLabelFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForLabelFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForLabelAtlasFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForLabelAtlasFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForLabelBMFontFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForLabelBMFontFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForLoadingBarFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForLoadingBarFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForSliderFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForSliderFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForTextFieldFromJsonDictionary(cocos2d::gui::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 setPropsForLayoutFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForScrollViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForScrollViewFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
};
|
};
|
||||||
|
|
||||||
class WidgetPropertiesReader0300 : public WidgetPropertiesReader
|
class WidgetPropertiesReader0300 : public WidgetPropertiesReader
|
||||||
|
@ -106,25 +106,25 @@ public:
|
||||||
WidgetPropertiesReader0300(){};
|
WidgetPropertiesReader0300(){};
|
||||||
virtual ~WidgetPropertiesReader0300(){};
|
virtual ~WidgetPropertiesReader0300(){};
|
||||||
|
|
||||||
virtual cocos2d::gui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName);
|
virtual cocos2d::ui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName);
|
||||||
virtual cocos2d::gui::Widget* widgetFromJsonDictionary(const rapidjson::Value& dic);
|
virtual cocos2d::ui::Widget* widgetFromJsonDictionary(const rapidjson::Value& dic);
|
||||||
virtual void setPropsForWidgetFromJsonDictionary(cocos2d::gui::Widget*,const rapidjson::Value& options);
|
virtual void setPropsForWidgetFromJsonDictionary(cocos2d::ui::Widget*,const rapidjson::Value& options);
|
||||||
|
|
||||||
virtual void setColorPropsForWidgetFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setColorPropsForWidgetFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForButtonFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForButtonFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForCheckBoxFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForCheckBoxFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForImageViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForImageViewFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForLabelFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForLabelFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForLabelAtlasFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForLabelAtlasFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForLabelBMFontFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForLabelBMFontFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForLoadingBarFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForLoadingBarFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForSliderFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForSliderFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForTextFieldFromJsonDictionary(cocos2d::gui::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 setPropsForLayoutFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForPageViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForPageViewFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForScrollViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);
|
virtual void setPropsForScrollViewFromJsonDictionary(cocos2d::ui::Widget* widget,const rapidjson::Value& options);
|
||||||
virtual void setPropsForListViewFromJsonDictionary(cocos2d::gui::Widget* widget, const rapidjson::Value& options);
|
virtual void setPropsForListViewFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ THE SOFTWARE.
|
||||||
#include "ObjectFactory.h"
|
#include "ObjectFactory.h"
|
||||||
|
|
||||||
using namespace cocos2d;
|
using namespace cocos2d;
|
||||||
using namespace gui;
|
using namespace ui;
|
||||||
|
|
||||||
namespace cocostudio {
|
namespace cocostudio {
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
const char* CocosGUIVersion()
|
const char* CocosGUIVersion()
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,7 @@ THE SOFTWARE.
|
||||||
#include "gui/UIHelper.h"
|
#include "gui/UIHelper.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
const char* CocosGUIVersion();
|
const char* CocosGUIVersion();
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
static const int NORMAL_RENDERER_Z = (-2);
|
static const int NORMAL_RENDERER_Z = (-2);
|
||||||
static const int PRESSED_RENDERER_Z = (-2);
|
static const int PRESSED_RENDERER_Z = (-2);
|
||||||
|
@ -678,4 +678,4 @@ void Button::copySpecialProperties(Widget *widget)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui{
|
namespace ui{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @js NA
|
* @js NA
|
||||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
static const int BACKGROUNDBOX_RENDERER_Z = (-1);
|
static const int BACKGROUNDBOX_RENDERER_Z = (-1);
|
||||||
static const int BACKGROUNDSELECTEDBOX_RENDERER_Z = (-1);
|
static const int BACKGROUNDSELECTEDBOX_RENDERER_Z = (-1);
|
||||||
|
@ -512,4 +512,4 @@ void CheckBox::copySpecialProperties(Widget *widget)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
Widget* Helper::seekWidgetByTag(Widget* root, int tag)
|
Widget* Helper::seekWidgetByTag(Widget* root, int tag)
|
||||||
{
|
{
|
||||||
|
@ -120,4 +120,4 @@ Widget* Helper::seekActionWidgetByActionTag(Widget* root, int tag)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -27,7 +27,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @js NA
|
* @js NA
|
||||||
|
|
|
@ -27,7 +27,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
|
|
||||||
#define STATIC_CAST_CCSPRITE static_cast<Sprite*>(_imageRenderer)
|
#define STATIC_CAST_CCSPRITE static_cast<Sprite*>(_imageRenderer)
|
||||||
|
@ -304,4 +304,4 @@ void ImageView::copySpecialProperties(Widget *widget)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @js NA
|
* @js NA
|
||||||
|
|
|
@ -36,7 +36,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
static const int BACKGROUNDIMAGE_Z = (-1);
|
static const int BACKGROUNDIMAGE_Z = (-1);
|
||||||
static const int BCAKGROUNDCOLORRENDERER_Z = (-2);
|
static const int BCAKGROUNDCOLORRENDERER_Z = (-2);
|
||||||
|
@ -1366,4 +1366,4 @@ void Layout::copySpecialProperties(Widget *widget)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,7 +25,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
|
|
||||||
Margin::Margin(void) : left(0), top(0), right(0), bottom(0)
|
Margin::Margin(void) : left(0), top(0), right(0), bottom(0)
|
||||||
|
@ -61,4 +61,4 @@ bool Margin::equals(const Margin &target) const
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
/**
|
/**
|
||||||
* @js NA
|
* @js NA
|
||||||
* @lua NA
|
* @lua NA
|
||||||
|
|
|
@ -27,7 +27,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
|
|
||||||
LayoutParameter* LayoutParameter::create()
|
LayoutParameter* LayoutParameter::create()
|
||||||
|
@ -123,4 +123,4 @@ const char* RelativeLayoutParameter::getRelativeName() const
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
ListView::ListView():
|
ListView::ListView():
|
||||||
_model(nullptr),
|
_model(nullptr),
|
||||||
|
@ -470,4 +470,4 @@ void ListView::copySpecialProperties(Widget *widget)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -30,7 +30,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui{
|
namespace ui{
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
static const int BAR_RENDERER_Z = (-1);
|
static const int BAR_RENDERER_Z = (-1);
|
||||||
|
|
||||||
|
@ -339,4 +339,4 @@ void LoadingBar::copySpecialProperties(Widget *widget)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
PageView::PageView():
|
PageView::PageView():
|
||||||
_curPageIdx(0),
|
_curPageIdx(0),
|
||||||
|
@ -626,4 +626,4 @@ void PageView::copySpecialProperties(Widget *widget)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -30,7 +30,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
class UIScrollInterface
|
class UIScrollInterface
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
static const float AUTOSCROLLMAXSPEED = 1000.0f;
|
static const float AUTOSCROLLMAXSPEED = 1000.0f;
|
||||||
|
|
||||||
|
@ -1674,4 +1674,4 @@ void ScrollView::copySpecialProperties(Widget *widget)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -30,7 +30,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
enum SCROLLVIEW_DIR
|
enum SCROLLVIEW_DIR
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
static const int BASEBAR_RENDERER_Z = (-2);
|
static const int BASEBAR_RENDERER_Z = (-2);
|
||||||
static const int PROGRESSBAR_RENDERER_Z = (-2);
|
static const int PROGRESSBAR_RENDERER_Z = (-2);
|
||||||
|
@ -546,4 +546,4 @@ void Slider::copySpecialProperties(Widget *widget)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
static const int LABEL_RENDERER_Z = (-1);
|
static const int LABEL_RENDERER_Z = (-1);
|
||||||
|
|
||||||
|
@ -275,4 +275,4 @@ void Text::copySpecialProperties(Widget *widget)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @js NA
|
* @js NA
|
||||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
static const int LABELATLAS_RENDERER_Z = (-1);
|
static const int LABELATLAS_RENDERER_Z = (-1);
|
||||||
|
|
||||||
|
@ -151,4 +151,4 @@ void TextAtlas::copySpecialProperties(Widget *widget)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @js NA
|
* @js NA
|
||||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
static const int LABELBMFONT_RENDERER_Z = (-1);
|
static const int LABELBMFONT_RENDERER_Z = (-1);
|
||||||
|
|
||||||
|
@ -161,4 +161,4 @@ void TextBMFont::copySpecialProperties(Widget *widget)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @js NA
|
* @js NA
|
||||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
UICCTextField::UICCTextField()
|
UICCTextField::UICCTextField()
|
||||||
: _maxLengthEnabled(false)
|
: _maxLengthEnabled(false)
|
||||||
|
@ -600,4 +600,4 @@ void TextField::copySpecialProperties(Widget *widget)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @js NA
|
* @js NA
|
||||||
|
|
|
@ -28,7 +28,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
Widget::Widget():
|
Widget::Widget():
|
||||||
_enabled(true),
|
_enabled(true),
|
||||||
|
|
|
@ -31,7 +31,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace gui {
|
namespace ui {
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// jsb_cocos2dx_gui_manual.h
|
// jsb_cocos2dx_ui_manual.h
|
||||||
//
|
//
|
||||||
// Created by LinWenhai on 17/11/13.
|
// Created by LinWenhai on 17/11/13.
|
||||||
//
|
//
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
#include "gui/CocosGUI.h"
|
#include "gui/CocosGUI.h"
|
||||||
|
|
||||||
using namespace cocos2d;
|
using namespace cocos2d;
|
||||||
using namespace cocos2d::gui;
|
using namespace cocos2d::ui;
|
||||||
|
|
||||||
class JSStudioEventListenerWrapper: public JSCallbackWrapper {
|
class JSStudioEventListenerWrapper: public JSCallbackWrapper {
|
||||||
public:
|
public:
|
||||||
|
@ -82,7 +82,7 @@ static bool js_cocos2dx_UIWidget_addTouchEventListener(JSContext *cx, uint32_t a
|
||||||
{
|
{
|
||||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
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");
|
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
|
||||||
|
|
||||||
if (argc == 2) {
|
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);
|
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
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");
|
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
|
||||||
|
|
||||||
if (argc == 2) {
|
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);
|
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
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");
|
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
|
||||||
|
|
||||||
if (argc == 2) {
|
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);
|
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
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");
|
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
|
||||||
|
|
||||||
if (argc == 2) {
|
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);
|
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
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");
|
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
|
||||||
|
|
||||||
if (argc == 2) {
|
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);
|
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
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");
|
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
|
||||||
|
|
||||||
if (argc == 2) {
|
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);
|
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
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");
|
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
|
||||||
|
|
||||||
if (argc == 1) {
|
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");
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
JS_ReportError(cx, "Invalid number of arguments");
|
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);
|
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
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");
|
JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object");
|
||||||
|
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);
|
JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);
|
||||||
if (!tmp) return false;
|
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) &&
|
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, "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) &&
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern JSObject* jsb_cocos2d_gui_Widget_prototype;
|
extern JSObject* jsb_cocos2d_ui_Widget_prototype;
|
||||||
extern JSObject* jsb_cocos2d_gui_CheckBox_prototype;
|
extern JSObject* jsb_cocos2d_ui_CheckBox_prototype;
|
||||||
extern JSObject* jsb_cocos2d_gui_Slider_prototype;
|
extern JSObject* jsb_cocos2d_ui_Slider_prototype;
|
||||||
extern JSObject* jsb_cocos2d_gui_TextField_prototype;
|
extern JSObject* jsb_cocos2d_ui_TextField_prototype;
|
||||||
extern JSObject* jsb_cocos2d_gui_LayoutParameter_prototype;
|
extern JSObject* jsb_cocos2d_ui_LayoutParameter_prototype;
|
||||||
extern JSObject* jsb_cocos2d_gui_PageView_prototype;
|
extern JSObject* jsb_cocos2d_ui_PageView_prototype;
|
||||||
extern JSObject* jsb_cocos2d_gui_ListView_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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
#include "jsapi.h"
|
#include "jsapi.h"
|
||||||
#include "jsfriendapi.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__) */
|
#endif /* defined(__jsb_cocos2dx_gui_manual__) */
|
||||||
|
|
|
@ -163,7 +163,7 @@ bool LuaStack::init(void)
|
||||||
register_all_cocos2dx_extension_manual(_state);
|
register_all_cocos2dx_extension_manual(_state);
|
||||||
register_all_cocos2dx_manual_deprecated(_state);
|
register_all_cocos2dx_manual_deprecated(_state);
|
||||||
register_all_cocos2dx_coco_studio_manual(_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(_state);
|
||||||
register_all_cocos2dx_spine_manual(_state);
|
register_all_cocos2dx_spine_manual(_state);
|
||||||
register_glnode_manual(_state);
|
register_glnode_manual(_state);
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include "CocosGUI.h"
|
#include "CocosGUI.h"
|
||||||
#include "CCLuaEngine.h"
|
#include "CCLuaEngine.h"
|
||||||
|
|
||||||
using namespace gui;
|
using namespace ui;
|
||||||
|
|
||||||
class LuaCocoStudioEventListener:public Ref
|
class LuaCocoStudioEventListener:public Ref
|
||||||
{
|
{
|
||||||
|
@ -630,7 +630,7 @@ static void extendLayoutParameter(lua_State* L)
|
||||||
lua_pop(L, 1);
|
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)
|
if (nullptr == L)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -34,7 +34,7 @@ extern "C" {
|
||||||
|
|
||||||
#include "CCRef.h"
|
#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
|
struct LuaStudioEventListenerData
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 [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>
|
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||||
<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 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>
|
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>
|
Some applications may detect min = 0.0, max = 1.0, step = 1.0 and replace a graphical slider bar with a checkbox instead.<br>
|
||||||
|
|
|
@ -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 [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>
|
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||||
<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 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>
|
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>
|
Some applications may detect min = 0.0, max = 1.0, step = 1.0 and replace a graphical slider bar with a checkbox instead.<br>
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
using namespace cocos2d;
|
using namespace cocos2d;
|
||||||
using namespace cocos2d::extension;
|
using namespace cocos2d::extension;
|
||||||
using namespace gui;
|
using namespace ui;
|
||||||
|
|
||||||
class CocosGUITestMainLayer : public Layer
|
class CocosGUITestMainLayer : public Layer
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,7 @@ bool UIButtonTest::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add a label in which the button events will be displayed
|
// Add a label in which the button events will be displayed
|
||||||
_displayValueLabel = gui::Text::create();
|
_displayValueLabel = ui::Text::create();
|
||||||
_displayValueLabel->setText("No Event");
|
_displayValueLabel->setText("No Event");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -30,7 +30,7 @@ bool UIButtonTest::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Button");
|
alert->setText("Button");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -56,19 +56,19 @@ void UIButtonTest::touchEvent(Ref *pSender, TouchEventType type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case gui::TOUCH_EVENT_BEGAN:
|
case ui::TOUCH_EVENT_BEGAN:
|
||||||
_displayValueLabel->setText(String::createWithFormat("Touch Down")->getCString());
|
_displayValueLabel->setText(String::createWithFormat("Touch Down")->getCString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case gui::TOUCH_EVENT_MOVED:
|
case ui::TOUCH_EVENT_MOVED:
|
||||||
_displayValueLabel->setText(String::createWithFormat("Touch Move")->getCString());
|
_displayValueLabel->setText(String::createWithFormat("Touch Move")->getCString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case gui::TOUCH_EVENT_ENDED:
|
case ui::TOUCH_EVENT_ENDED:
|
||||||
_displayValueLabel->setText(String::createWithFormat("Touch Up")->getCString());
|
_displayValueLabel->setText(String::createWithFormat("Touch Up")->getCString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case gui::TOUCH_EVENT_CANCELED:
|
case ui::TOUCH_EVENT_CANCELED:
|
||||||
_displayValueLabel->setText(String::createWithFormat("Touch Cancelled")->getCString());
|
_displayValueLabel->setText(String::createWithFormat("Touch Cancelled")->getCString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ bool UIButtonTest_Scale9::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add a label in which the button events will be displayed
|
// Add a label in which the button events will be displayed
|
||||||
_displayValueLabel = gui::Text::create();
|
_displayValueLabel = ui::Text::create();
|
||||||
_displayValueLabel->setText("No Event");
|
_displayValueLabel->setText("No Event");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -106,7 +106,7 @@ bool UIButtonTest_Scale9::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Button scale9 render");
|
alert->setText("Button scale9 render");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -134,19 +134,19 @@ void UIButtonTest_Scale9::touchEvent(Ref *pSender, TouchEventType type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case gui::TOUCH_EVENT_BEGAN:
|
case ui::TOUCH_EVENT_BEGAN:
|
||||||
_displayValueLabel->setText(String::createWithFormat("Touch Down")->getCString());
|
_displayValueLabel->setText(String::createWithFormat("Touch Down")->getCString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case gui::TOUCH_EVENT_MOVED:
|
case ui::TOUCH_EVENT_MOVED:
|
||||||
_displayValueLabel->setText(String::createWithFormat("Touch Move")->getCString());
|
_displayValueLabel->setText(String::createWithFormat("Touch Move")->getCString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case gui::TOUCH_EVENT_ENDED:
|
case ui::TOUCH_EVENT_ENDED:
|
||||||
_displayValueLabel->setText(String::createWithFormat("Touch Up")->getCString());
|
_displayValueLabel->setText(String::createWithFormat("Touch Up")->getCString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case gui::TOUCH_EVENT_CANCELED:
|
case ui::TOUCH_EVENT_CANCELED:
|
||||||
_displayValueLabel->setText(String::createWithFormat("Touch Cancelled")->getCString());
|
_displayValueLabel->setText(String::createWithFormat("Touch Cancelled")->getCString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ bool UIButtonTest_PressedAction::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add a label in which the button events will be displayed
|
// Add a label in which the button events will be displayed
|
||||||
_displayValueLabel = gui::Text::create();
|
_displayValueLabel = ui::Text::create();
|
||||||
_displayValueLabel->setText("No Event");
|
_displayValueLabel->setText("No Event");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -181,7 +181,7 @@ bool UIButtonTest_PressedAction::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Button Pressed Action");
|
alert->setText("Button Pressed Action");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -208,19 +208,19 @@ void UIButtonTest_PressedAction::touchEvent(Ref *pSender, TouchEventType type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case gui::TOUCH_EVENT_BEGAN:
|
case ui::TOUCH_EVENT_BEGAN:
|
||||||
_displayValueLabel->setText(String::createWithFormat("Touch Down")->getCString());
|
_displayValueLabel->setText(String::createWithFormat("Touch Down")->getCString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case gui::TOUCH_EVENT_MOVED:
|
case ui::TOUCH_EVENT_MOVED:
|
||||||
_displayValueLabel->setText(String::createWithFormat("Touch Move")->getCString());
|
_displayValueLabel->setText(String::createWithFormat("Touch Move")->getCString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case gui::TOUCH_EVENT_ENDED:
|
case ui::TOUCH_EVENT_ENDED:
|
||||||
_displayValueLabel->setText(String::createWithFormat("Touch Up")->getCString());
|
_displayValueLabel->setText(String::createWithFormat("Touch Up")->getCString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case gui::TOUCH_EVENT_CANCELED:
|
case ui::TOUCH_EVENT_CANCELED:
|
||||||
_displayValueLabel->setText(String::createWithFormat("Touch Cancelled")->getCString());
|
_displayValueLabel->setText(String::createWithFormat("Touch Cancelled")->getCString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ bool UIButtonTest_Title::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add a label in which the text button events will be displayed
|
// 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->setText("No Event");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -256,7 +256,7 @@ bool UIButtonTest_Title::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Button with title");
|
alert->setText("Button with title");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -302,4 +302,4 @@ void UIButtonTest_Title::touchEvent(Ref *pSender, TouchEventType type)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UIButtonTest)
|
UI_SCENE_CREATE_FUNC(UIButtonTest)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UIButtonTest_Scale9 : public UIScene
|
class UIButtonTest_Scale9 : public UIScene
|
||||||
|
@ -50,7 +50,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UIButtonTest_Scale9)
|
UI_SCENE_CREATE_FUNC(UIButtonTest_Scale9)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UIButtonTest_PressedAction : public UIScene
|
class UIButtonTest_PressedAction : public UIScene
|
||||||
|
@ -63,7 +63,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UIButtonTest_PressedAction)
|
UI_SCENE_CREATE_FUNC(UIButtonTest_PressedAction)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UIButtonTest_Title : public UIScene
|
class UIButtonTest_Title : public UIScene
|
||||||
|
@ -76,7 +76,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UIButtonTest_Title)
|
UI_SCENE_CREATE_FUNC(UIButtonTest_Title)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__TestCpp__UIButtonTest__) */
|
#endif /* defined(__TestCpp__UIButtonTest__) */
|
||||||
|
|
|
@ -21,7 +21,7 @@ bool UICheckBoxTest::init()
|
||||||
Size widgetSize = _widget->getSize();;
|
Size widgetSize = _widget->getSize();;
|
||||||
|
|
||||||
// Add a label in which the checkbox events will be displayed
|
// Add a label in which the checkbox events will be displayed
|
||||||
_displayValueLabel = gui::Text::create();
|
_displayValueLabel = ui::Text::create();
|
||||||
_displayValueLabel->setText("No Event");
|
_displayValueLabel->setText("No Event");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -30,7 +30,7 @@ bool UICheckBoxTest::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("CheckBox");
|
alert->setText("CheckBox");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -72,4 +72,4 @@ void UICheckBoxTest::selectedEvent(Ref* pSender,CheckBoxEventType type)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UICheckBoxTest)
|
UI_SCENE_CREATE_FUNC(UICheckBoxTest)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__TestCpp__UICheckBoxTest__) */
|
#endif /* defined(__TestCpp__UICheckBoxTest__) */
|
||||||
|
|
|
@ -11,7 +11,7 @@ bool UIImageViewTest::init()
|
||||||
{
|
{
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("ImageView");
|
alert->setText("ImageView");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -72,7 +72,7 @@ bool UIImageViewTest_Scale9::init()
|
||||||
{
|
{
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("ImageView scale9 render");
|
alert->setText("ImageView scale9 render");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(26);
|
alert->setFontSize(26);
|
||||||
|
@ -91,4 +91,4 @@ bool UIImageViewTest_Scale9::init()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ bool UILabelAtlasTest::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("LabelAtlas");
|
alert->setText("LabelAtlas");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -21,7 +21,7 @@ bool UILabelAtlasTest::init()
|
||||||
_uiLayer->addChild(alert);
|
_uiLayer->addChild(alert);
|
||||||
|
|
||||||
// Create the label atlas
|
// 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->setProperty("1234567890", "cocosgui/labelatlas.png", 17, 22, "0");
|
||||||
labelAtlas->setPosition(Point((widgetSize.width) / 2, widgetSize.height / 2.0f));
|
labelAtlas->setPosition(Point((widgetSize.width) / 2, widgetSize.height / 2.0f));
|
||||||
_uiLayer->addChild(labelAtlas);
|
_uiLayer->addChild(labelAtlas);
|
||||||
|
@ -29,4 +29,4 @@ bool UILabelAtlasTest::init()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ bool UILabelBMFontTest::init()
|
||||||
{
|
{
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("LabelBMFont");
|
alert->setText("LabelBMFont");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -20,7 +20,7 @@ bool UILabelBMFontTest::init()
|
||||||
_uiLayer->addChild(alert);
|
_uiLayer->addChild(alert);
|
||||||
|
|
||||||
// Create the LabelBMFont
|
// Create the LabelBMFont
|
||||||
gui::TextBMFont* labelBMFont = gui::TextBMFont::create();
|
ui::TextBMFont* labelBMFont = ui::TextBMFont::create();
|
||||||
labelBMFont->setFntFile("cocosgui/bitmapFontTest2.fnt");
|
labelBMFont->setFntFile("cocosgui/bitmapFontTest2.fnt");
|
||||||
labelBMFont->setText("BMFont");
|
labelBMFont->setText("BMFont");
|
||||||
labelBMFont->setPosition(Point(widgetSize.width / 2, widgetSize.height / 2.0f + labelBMFont->getSize().height / 8.0f));
|
labelBMFont->setPosition(Point(widgetSize.width / 2, widgetSize.height / 2.0f + labelBMFont->getSize().height / 8.0f));
|
||||||
|
@ -29,4 +29,4 @@ bool UILabelBMFontTest::init()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ bool UILabelTest::init()
|
||||||
{
|
{
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Label");
|
alert->setText("Label");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -20,7 +20,7 @@ bool UILabelTest::init()
|
||||||
_uiLayer->addChild(alert);
|
_uiLayer->addChild(alert);
|
||||||
|
|
||||||
// Create the label
|
// Create the label
|
||||||
gui::Text* label = gui::Text::create();
|
ui::Text* label = ui::Text::create();
|
||||||
label->setText("Label");
|
label->setText("Label");
|
||||||
label->setFontName("AmericanTypewriter");
|
label->setFontName("AmericanTypewriter");
|
||||||
label->setFontSize(30);
|
label->setFontSize(30);
|
||||||
|
@ -40,7 +40,7 @@ bool UILabelTest_LineWrap::init()
|
||||||
{
|
{
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Label line wrap");
|
alert->setText("Label line wrap");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -49,7 +49,7 @@ bool UILabelTest_LineWrap::init()
|
||||||
_uiLayer->addChild(alert);
|
_uiLayer->addChild(alert);
|
||||||
|
|
||||||
// Create the line wrap
|
// Create the line wrap
|
||||||
gui::Text* label = gui::Text::create();
|
ui::Text* label = ui::Text::create();
|
||||||
label->setTextAreaSize(Size(280, 150));
|
label->setTextAreaSize(Size(280, 150));
|
||||||
label->setTextHorizontalAlignment(TextHAlignment::CENTER);
|
label->setTextHorizontalAlignment(TextHAlignment::CENTER);
|
||||||
label->setText("Label can line wrap");
|
label->setText("Label can line wrap");
|
||||||
|
@ -72,7 +72,7 @@ bool UILabelTest_Effect::init()
|
||||||
{
|
{
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
gui::Label* alert = gui::Label::create();
|
ui::Label* alert = ui::Label::create();
|
||||||
alert->setText("Label Effect");
|
alert->setText("Label Effect");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -82,7 +82,7 @@ bool UILabelTest_Effect::init()
|
||||||
|
|
||||||
|
|
||||||
// create the shadow only label
|
// create the shadow only label
|
||||||
gui::Label* shadow_label = gui::Label::create();
|
ui::Label* shadow_label = ui::Label::create();
|
||||||
|
|
||||||
Color3B tintColorRed = { 255, 0, 0 };
|
Color3B tintColorRed = { 255, 0, 0 };
|
||||||
Size shadowOffset(12.0f, 12.0f);
|
Size shadowOffset(12.0f, 12.0f);
|
||||||
|
@ -105,7 +105,7 @@ bool UILabelTest_Effect::init()
|
||||||
|
|
||||||
|
|
||||||
// create the stroke only label
|
// 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 tintColorYellow = { 255, 255, 0 };
|
||||||
Color3B strokeColor = { 0, 10, 255 };
|
Color3B strokeColor = { 0, 10, 255 };
|
||||||
|
@ -128,7 +128,7 @@ bool UILabelTest_Effect::init()
|
||||||
|
|
||||||
|
|
||||||
// create the label stroke and shadow
|
// 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 tintColorBlue = { 0, 0, 255 };
|
||||||
Color3B strokeShadowColor = { 255, 0, 0 };
|
Color3B strokeShadowColor = { 255, 0, 0 };
|
||||||
|
@ -170,7 +170,7 @@ bool UILabelTest_TTF::init()
|
||||||
{
|
{
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Label set TTF font");
|
alert->setText("Label set TTF font");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -179,7 +179,7 @@ bool UILabelTest_TTF::init()
|
||||||
_uiLayer->addChild(alert);
|
_uiLayer->addChild(alert);
|
||||||
|
|
||||||
// Create the label
|
// Create the label
|
||||||
gui::Text* label = gui::Text::create();
|
ui::Text* label = ui::Text::create();
|
||||||
label->setText("Label");
|
label->setText("Label");
|
||||||
label->setFontName("fonts/A Damn Mess.ttf");
|
label->setFontName("fonts/A Damn Mess.ttf");
|
||||||
label->setFontSize(30);
|
label->setFontSize(30);
|
||||||
|
|
|
@ -20,7 +20,7 @@ bool UILayoutTest::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Layout");
|
alert->setText("Layout");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -86,7 +86,7 @@ bool UILayoutTest_Color::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Layout color render");
|
alert->setText("Layout color render");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -153,7 +153,7 @@ bool UILayoutTest_Gradient::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Layout gradient render");
|
alert->setText("Layout gradient render");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -220,7 +220,7 @@ bool UILayoutTest_BackGroundImage::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Layout background image");
|
alert->setText("Layout background image");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(20);
|
alert->setFontSize(20);
|
||||||
|
@ -287,7 +287,7 @@ bool UILayoutTest_BackGroundImage_Scale9::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Layout background image scale9");
|
alert->setText("Layout background image scale9");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(20);
|
alert->setFontSize(20);
|
||||||
|
@ -354,7 +354,7 @@ bool UILayoutTest_Layout_Linear_Vertical::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Layout Linear Vertical");
|
alert->setText("Layout Linear Vertical");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(20);
|
alert->setFontSize(20);
|
||||||
|
@ -439,7 +439,7 @@ bool UILayoutTest_Layout_Linear_Horizontal::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Layout Linear Horizontal");
|
alert->setText("Layout Linear Horizontal");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(20);
|
alert->setFontSize(20);
|
||||||
|
@ -524,7 +524,7 @@ bool UILayoutTest_Layout_Relative_Align_Parent::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Layout Relative Align Parent");
|
alert->setText("Layout Relative Align Parent");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(20);
|
alert->setFontSize(20);
|
||||||
|
@ -673,7 +673,7 @@ bool UILayoutTest_Layout_Relative_Location::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Layout Relative Location");
|
alert->setText("Layout Relative Location");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(20);
|
alert->setFontSize(20);
|
||||||
|
@ -778,7 +778,7 @@ bool UILayoutTest_Layout_Grid::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Label* alert = gui::Label::create();
|
ui::Label* alert = ui::Label::create();
|
||||||
alert->setText("Layout Grid");
|
alert->setText("Layout Grid");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(20);
|
alert->setFontSize(20);
|
||||||
|
|
|
@ -27,7 +27,7 @@ bool UIListViewTest_Vertical::init()
|
||||||
{
|
{
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
_displayValueLabel = gui::Text::create();
|
_displayValueLabel = ui::Text::create();
|
||||||
_displayValueLabel->setText("Move by vertical direction");
|
_displayValueLabel->setText("Move by vertical direction");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -36,7 +36,7 @@ bool UIListViewTest_Vertical::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
|
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("ListView vertical");
|
alert->setText("ListView vertical");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -200,7 +200,7 @@ bool UIListViewTest_Horizontal::init()
|
||||||
{
|
{
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
_displayValueLabel = gui::Text::create();
|
_displayValueLabel = ui::Text::create();
|
||||||
_displayValueLabel->setText("Move by horizontal direction");
|
_displayValueLabel->setText("Move by horizontal direction");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -209,7 +209,7 @@ bool UIListViewTest_Horizontal::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
|
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("ListView horizontal");
|
alert->setText("ListView horizontal");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UIListViewTest_Vertical)
|
UI_SCENE_CREATE_FUNC(UIListViewTest_Vertical)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
|
|
||||||
std::vector<std::string> _array;
|
std::vector<std::string> _array;
|
||||||
};
|
};
|
||||||
|
@ -52,7 +52,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UIListViewTest_Horizontal)
|
UI_SCENE_CREATE_FUNC(UIListViewTest_Horizontal)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
|
|
||||||
std::vector<std::string> _array;
|
std::vector<std::string> _array;
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,7 +25,7 @@ bool UILoadingBarTest_Left::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("LoadingBar left");
|
alert->setText("LoadingBar left");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -107,7 +107,7 @@ bool UILoadingBarTest_Right::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text *alert = gui::Text::create();
|
ui::Text *alert = ui::Text::create();
|
||||||
alert->setText("LoadingBar right");
|
alert->setText("LoadingBar right");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -190,7 +190,7 @@ bool UILoadingBarTest_Left_Scale9::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("LoadingBar left scale9 render");
|
alert->setText("LoadingBar left scale9 render");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(20);
|
alert->setFontSize(20);
|
||||||
|
@ -275,7 +275,7 @@ bool UILoadingBarTest_Right_Scale9::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text *alert = gui::Text::create();
|
ui::Text *alert = ui::Text::create();
|
||||||
alert->setText("LoadingBar right scale9 render");
|
alert->setText("LoadingBar right scale9 render");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(20);
|
alert->setFontSize(20);
|
||||||
|
@ -337,4 +337,4 @@ void UILoadingBarTest_Right_Scale9::nextCallback(Ref* sender, TouchEventType typ
|
||||||
unscheduleUpdate();
|
unscheduleUpdate();
|
||||||
UIScene::nextCallback(sender, type);
|
UIScene::nextCallback(sender, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ bool UIPageViewTest::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add a label in which the dragpanel events will be displayed
|
// 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->setText("Move by horizontal direction");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -30,7 +30,7 @@ bool UIPageViewTest::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the black background
|
// Add the black background
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("PageView");
|
alert->setText("PageView");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -65,7 +65,7 @@ bool UIPageViewTest::init()
|
||||||
imageView->setPosition(Point(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f));
|
imageView->setPosition(Point(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f));
|
||||||
layout->addChild(imageView);
|
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->setText(CCString::createWithFormat("page %d", (i + 1))->getCString());
|
||||||
label->setFontName("Marker Felt");
|
label->setFontName("Marker Felt");
|
||||||
label->setFontSize(30);
|
label->setFontSize(30);
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UIPageViewTest)
|
UI_SCENE_CREATE_FUNC(UIPageViewTest)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__TestCpp__UIPageViewTest__) */
|
#endif /* defined(__TestCpp__UIPageViewTest__) */
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "editor-support/cocostudio/CCSGUIReader.h"
|
#include "editor-support/cocostudio/CCSGUIReader.h"
|
||||||
#include "CocosGUIScene.h"
|
#include "CocosGUIScene.h"
|
||||||
|
|
||||||
using namespace gui;
|
using namespace ui;
|
||||||
|
|
||||||
UIScene::UIScene()
|
UIScene::UIScene()
|
||||||
: _sceneTitle(nullptr)
|
: _sceneTitle(nullptr)
|
||||||
|
@ -37,9 +37,9 @@ bool UIScene::init()
|
||||||
|
|
||||||
Layout* root = static_cast<Layout*>(_uiLayer->getChildByTag(81));
|
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));
|
back_label->addTouchEventListener(this, toucheventselector(UIScene::toCocosGUITestScene));
|
||||||
|
|
||||||
Button* left_button = dynamic_cast<Button*>(root->getChildByName("left_Button"));
|
Button* left_button = dynamic_cast<Button*>(root->getChildByName("left_Button"));
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
USING_NS_CC;
|
USING_NS_CC;
|
||||||
USING_NS_CC_EXT;
|
USING_NS_CC_EXT;
|
||||||
using namespace gui;
|
using namespace ui;
|
||||||
|
|
||||||
#define UI_SCENE_CREATE_FUNC(UIScene) \
|
#define UI_SCENE_CREATE_FUNC(UIScene) \
|
||||||
public: \
|
public: \
|
||||||
|
@ -65,7 +65,7 @@ public:
|
||||||
virtual void nextCallback(Ref* sender, TouchEventType type);
|
virtual void nextCallback(Ref* sender, TouchEventType type);
|
||||||
|
|
||||||
/** Title label of the scene. */
|
/** Title label of the scene. */
|
||||||
CC_SYNTHESIZE_READONLY(gui::Text*, _sceneTitle, SceneTitle)
|
CC_SYNTHESIZE_READONLY(Text*, _sceneTitle, SceneTitle)
|
||||||
|
|
||||||
UI_SCENE_CREATE_FUNC(UIScene);
|
UI_SCENE_CREATE_FUNC(UIScene);
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ bool UIScrollViewTest_Vertical::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add a label in which the scrollview alert will be displayed
|
// 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->setText("Move by vertical direction");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -30,7 +30,7 @@ bool UIScrollViewTest_Vertical::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("ScrollView vertical");
|
alert->setText("ScrollView vertical");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -43,7 +43,7 @@ bool UIScrollViewTest_Vertical::init()
|
||||||
Layout* background = dynamic_cast<Layout*>(root->getChildByName("background_Panel"));
|
Layout* background = dynamic_cast<Layout*>(root->getChildByName("background_Panel"));
|
||||||
|
|
||||||
// Create the scrollview by vertical
|
// Create the scrollview by vertical
|
||||||
gui::ScrollView* scrollView = gui::ScrollView::create();
|
ui::ScrollView* scrollView = ui::ScrollView::create();
|
||||||
scrollView->setTouchEnabled(true);
|
scrollView->setTouchEnabled(true);
|
||||||
scrollView->setSize(Size(280.0f, 150.0f));
|
scrollView->setSize(Size(280.0f, 150.0f));
|
||||||
Size backgroundSize = background->getContentSize();
|
Size backgroundSize = background->getContentSize();
|
||||||
|
@ -109,7 +109,7 @@ bool UIScrollViewTest_Horizontal::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add a label in which the scrollview alert will be displayed
|
// 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->setText("Move by horizontal direction");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_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));
|
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5f));
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("ScrollView horizontal");
|
alert->setText("ScrollView horizontal");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -130,7 +130,7 @@ bool UIScrollViewTest_Horizontal::init()
|
||||||
Layout* background = dynamic_cast<Layout*>(root->getChildByName("background_Panel"));
|
Layout* background = dynamic_cast<Layout*>(root->getChildByName("background_Panel"));
|
||||||
|
|
||||||
// Create the scrollview by horizontal
|
// Create the scrollview by horizontal
|
||||||
gui::ScrollView* scrollView = gui::ScrollView::create();
|
ui::ScrollView* scrollView = ui::ScrollView::create();
|
||||||
scrollView->setBounceEnabled(true);
|
scrollView->setBounceEnabled(true);
|
||||||
scrollView->setDirection(SCROLLVIEW_DIR_HORIZONTAL);
|
scrollView->setDirection(SCROLLVIEW_DIR_HORIZONTAL);
|
||||||
scrollView->setTouchEnabled(true);
|
scrollView->setTouchEnabled(true);
|
||||||
|
@ -203,7 +203,7 @@ bool UIScrollViewTest_Both::init()
|
||||||
Size widgetSize = _widget->getSize();;
|
Size widgetSize = _widget->getSize();;
|
||||||
|
|
||||||
// Add a label in which the dragpanel events will be displayed
|
// 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->setText("Move by any direction");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -212,7 +212,7 @@ bool UIScrollViewTest_Both::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("ScrollView both");
|
alert->setText("ScrollView both");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -225,7 +225,7 @@ bool UIScrollViewTest_Both::init()
|
||||||
Layout* background = static_cast<Layout*>(root->getChildByName("background_Panel"));
|
Layout* background = static_cast<Layout*>(root->getChildByName("background_Panel"));
|
||||||
|
|
||||||
// Create the dragpanel
|
// Create the dragpanel
|
||||||
gui::ScrollView* scrollView = gui::ScrollView::create();
|
ui::ScrollView* scrollView = ui::ScrollView::create();
|
||||||
scrollView->setDirection(SCROLLVIEW_DIR_BOTH);
|
scrollView->setDirection(SCROLLVIEW_DIR_BOTH);
|
||||||
scrollView->setTouchEnabled(true);
|
scrollView->setTouchEnabled(true);
|
||||||
scrollView->setBounceEnabled(true);
|
scrollView->setBounceEnabled(true);
|
||||||
|
@ -272,7 +272,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add a label in which the dragpanel events will be displayed
|
// Add a label in which the dragpanel events will be displayed
|
||||||
_displayValueLabel = gui::Text::create();
|
_displayValueLabel = ui::Text::create();
|
||||||
// _displayValueLabel->setText("No Event");
|
// _displayValueLabel->setText("No Event");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -281,7 +281,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("ScrollView scroll to percent both directrion");
|
alert->setText("ScrollView scroll to percent both directrion");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(20);
|
alert->setFontSize(20);
|
||||||
|
@ -293,7 +293,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection::init()
|
||||||
|
|
||||||
Layout* background = static_cast<Layout*>(root->getChildByName("background_Panel"));
|
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->setBackGroundColor(Color3B::GREEN);
|
||||||
sc->setBackGroundColorType(LAYOUT_COLOR_SOLID);
|
sc->setBackGroundColorType(LAYOUT_COLOR_SOLID);
|
||||||
sc->setDirection(SCROLLVIEW_DIR_BOTH);
|
sc->setDirection(SCROLLVIEW_DIR_BOTH);
|
||||||
|
@ -334,7 +334,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add a label in which the dragpanel events will be displayed
|
// Add a label in which the dragpanel events will be displayed
|
||||||
_displayValueLabel = gui::Text::create();
|
_displayValueLabel = ui::Text::create();
|
||||||
// _displayValueLabel->setText("No Event");
|
// _displayValueLabel->setText("No Event");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -343,7 +343,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// 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->setText("ScrollView scroll to percent both directrion bounce");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(20);
|
alert->setFontSize(20);
|
||||||
|
@ -355,7 +355,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init()
|
||||||
|
|
||||||
Layout* background = dynamic_cast<Layout*>(root->getChildByName("background_Panel"));
|
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->setBackGroundColor(Color3B::GREEN);
|
||||||
sc->setBackGroundColorType(LAYOUT_COLOR_SOLID);
|
sc->setBackGroundColorType(LAYOUT_COLOR_SOLID);
|
||||||
sc->setBounceEnabled(true);
|
sc->setBounceEnabled(true);
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UIScrollViewTest_Vertical)
|
UI_SCENE_CREATE_FUNC(UIScrollViewTest_Vertical)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UIScrollViewTest_Horizontal : public UIScene
|
class UIScrollViewTest_Horizontal : public UIScene
|
||||||
|
@ -48,7 +48,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UIScrollViewTest_Horizontal)
|
UI_SCENE_CREATE_FUNC(UIScrollViewTest_Horizontal)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UIScrollViewTest_Both : public UIScene
|
class UIScrollViewTest_Both : public UIScene
|
||||||
|
@ -60,7 +60,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UIScrollViewTest_Both)
|
UI_SCENE_CREATE_FUNC(UIScrollViewTest_Both)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UIScrollViewTest_ScrollToPercentBothDirection : public UIScene
|
class UIScrollViewTest_ScrollToPercentBothDirection : public UIScene
|
||||||
|
@ -72,7 +72,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UIScrollViewTest_ScrollToPercentBothDirection)
|
UI_SCENE_CREATE_FUNC(UIScrollViewTest_ScrollToPercentBothDirection)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UIScrollViewTest_ScrollToPercentBothDirection_Bounce : public UIScene
|
class UIScrollViewTest_ScrollToPercentBothDirection_Bounce : public UIScene
|
||||||
|
@ -84,7 +84,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UIScrollViewTest_ScrollToPercentBothDirection_Bounce)
|
UI_SCENE_CREATE_FUNC(UIScrollViewTest_ScrollToPercentBothDirection_Bounce)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__TestCpp__UIScrollViewTest__) */
|
#endif /* defined(__TestCpp__UIScrollViewTest__) */
|
||||||
|
|
|
@ -22,7 +22,7 @@ bool UISliderTest::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add a label in which the slider alert will be displayed
|
// 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->setText("Move the slider thumb");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -31,7 +31,7 @@ bool UISliderTest::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Slider");
|
alert->setText("Slider");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -97,7 +97,7 @@ bool UISliderTest_Scale9::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add a label in which the slider alert will be displayed
|
// 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->setText("Move the slider thumb");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -106,7 +106,7 @@ bool UISliderTest_Scale9::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text *alert = gui::Text::create();
|
ui::Text *alert = ui::Text::create();
|
||||||
alert->setText("Slider scale9 render");
|
alert->setText("Slider scale9 render");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -157,4 +157,4 @@ void UISliderTest_Scale9::sliderEvent(Ref *pSender, SliderEventType type)
|
||||||
int percent = slider->getPercent();
|
int percent = slider->getPercent();
|
||||||
_displayValueLabel->setText(String::createWithFormat("Percent %d", percent)->getCString());
|
_displayValueLabel->setText(String::createWithFormat("Percent %d", percent)->getCString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UISliderTest)
|
UI_SCENE_CREATE_FUNC(UISliderTest)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UISliderTest_Scale9 : public UIScene
|
class UISliderTest_Scale9 : public UIScene
|
||||||
|
@ -50,7 +50,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UISliderTest_Scale9)
|
UI_SCENE_CREATE_FUNC(UISliderTest_Scale9)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__TestCpp__UISliderTest__) */
|
#endif /* defined(__TestCpp__UISliderTest__) */
|
||||||
|
|
|
@ -20,7 +20,7 @@ bool UITextFieldTest::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add a label in which the textfield events will be displayed
|
// Add a label in which the textfield events will be displayed
|
||||||
_displayValueLabel = gui::Text::create();
|
_displayValueLabel = ui::Text::create();
|
||||||
_displayValueLabel->setText("No Event");
|
_displayValueLabel->setText("No Event");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -29,7 +29,7 @@ bool UITextFieldTest::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("TextField");
|
alert->setText("TextField");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -106,7 +106,7 @@ bool UITextFieldTest_MaxLength::init()
|
||||||
Size screenSize = CCDirector::getInstance()->getWinSize();
|
Size screenSize = CCDirector::getInstance()->getWinSize();
|
||||||
|
|
||||||
// Add a label in which the textfield events will be displayed
|
// Add a label in which the textfield events will be displayed
|
||||||
_displayValueLabel = gui::Text::create();
|
_displayValueLabel = ui::Text::create();
|
||||||
_displayValueLabel->setText("No Event");
|
_displayValueLabel->setText("No Event");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -115,7 +115,7 @@ bool UITextFieldTest_MaxLength::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text *alert = gui::Text::create();
|
ui::Text *alert = ui::Text::create();
|
||||||
alert->setText("TextField max length");
|
alert->setText("TextField max length");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -200,7 +200,7 @@ bool UITextFieldTest_Password::init()
|
||||||
Size screenSize = CCDirector::getInstance()->getWinSize();
|
Size screenSize = CCDirector::getInstance()->getWinSize();
|
||||||
|
|
||||||
// Add a label in which the textfield events will be displayed
|
// Add a label in which the textfield events will be displayed
|
||||||
_displayValueLabel = gui::Text::create();
|
_displayValueLabel = ui::Text::create();
|
||||||
_displayValueLabel->setText("No Event");
|
_displayValueLabel->setText("No Event");
|
||||||
_displayValueLabel->setFontName("Marker Felt");
|
_displayValueLabel->setFontName("Marker Felt");
|
||||||
_displayValueLabel->setFontSize(32);
|
_displayValueLabel->setFontSize(32);
|
||||||
|
@ -209,7 +209,7 @@ bool UITextFieldTest_Password::init()
|
||||||
_uiLayer->addChild(_displayValueLabel);
|
_uiLayer->addChild(_displayValueLabel);
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text *alert = gui::Text::create();
|
ui::Text *alert = ui::Text::create();
|
||||||
alert->setText("TextField password");
|
alert->setText("TextField password");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UITextFieldTest)
|
UI_SCENE_CREATE_FUNC(UITextFieldTest)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UITextFieldTest_MaxLength : public UIScene
|
class UITextFieldTest_MaxLength : public UIScene
|
||||||
|
@ -50,7 +50,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UITextFieldTest_MaxLength)
|
UI_SCENE_CREATE_FUNC(UITextFieldTest_MaxLength)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UITextFieldTest_Password : public UIScene
|
class UITextFieldTest_Password : public UIScene
|
||||||
|
@ -63,6 +63,6 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UI_SCENE_CREATE_FUNC(UITextFieldTest_Password)
|
UI_SCENE_CREATE_FUNC(UITextFieldTest_Password)
|
||||||
gui::Text* _displayValueLabel;
|
ui::Text* _displayValueLabel;
|
||||||
};
|
};
|
||||||
#endif /* defined(__TestCpp__UITextFieldTest__) */
|
#endif /* defined(__TestCpp__UITextFieldTest__) */
|
||||||
|
|
|
@ -21,7 +21,7 @@ bool UIWidgetAddNodeTest::init()
|
||||||
Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
|
|
||||||
// Add the alert
|
// Add the alert
|
||||||
gui::Text* alert = gui::Text::create();
|
ui::Text* alert = ui::Text::create();
|
||||||
alert->setText("Widget Add Node");
|
alert->setText("Widget Add Node");
|
||||||
alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
|
@ -41,4 +41,4 @@ bool UIWidgetAddNodeTest::init()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
using namespace cocos2d;
|
using namespace cocos2d;
|
||||||
using namespace cocostudio;
|
using namespace cocostudio;
|
||||||
using namespace gui;
|
using namespace ui;
|
||||||
|
|
||||||
Layer *Next();
|
Layer *Next();
|
||||||
Layer *Back();
|
Layer *Back();
|
||||||
|
@ -397,7 +397,7 @@ cocos2d::Node* UIComponentTest::createGameScene()
|
||||||
_node = node;
|
_node = node;
|
||||||
|
|
||||||
ComRender *render = static_cast<ComRender*>(_node->getChildByTag(10025)->getComponent("GUIComponent"));
|
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* button = static_cast<Button*>(widget->getChildByName("Button_156"));
|
||||||
button->addTouchEventListener(this, toucheventselector(UIComponentTest::touchEvent));
|
button->addTouchEventListener(this, toucheventselector(UIComponentTest::touchEvent));
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ public:
|
||||||
virtual void onEnter();
|
virtual void onEnter();
|
||||||
virtual void onExit();
|
virtual void onExit();
|
||||||
cocos2d::Node* createGameScene();
|
cocos2d::Node* createGameScene();
|
||||||
void touchEvent(cocos2d::Ref *pSender, cocos2d::gui::TouchEventType type);
|
void touchEvent(cocos2d::Ref *pSender, cocos2d::ui::TouchEventType type);
|
||||||
private:
|
private:
|
||||||
cocos2d::Node* _node;
|
cocos2d::Node* _node;
|
||||||
};
|
};
|
||||||
|
|
|
@ -103,8 +103,8 @@ bool AppDelegate::applicationDidFinishLaunching()
|
||||||
sc->addRegisterCallback(register_all_cocos2dx_builder);
|
sc->addRegisterCallback(register_all_cocos2dx_builder);
|
||||||
sc->addRegisterCallback(register_CCBuilderReader);
|
sc->addRegisterCallback(register_CCBuilderReader);
|
||||||
|
|
||||||
sc->addRegisterCallback(register_all_cocos2dx_gui);
|
sc->addRegisterCallback(register_all_cocos2dx_ui);
|
||||||
sc->addRegisterCallback(register_all_cocos2dx_gui_manual);
|
sc->addRegisterCallback(register_all_cocos2dx_ui_manual);
|
||||||
sc->addRegisterCallback(register_all_cocos2dx_studio);
|
sc->addRegisterCallback(register_all_cocos2dx_studio);
|
||||||
sc->addRegisterCallback(register_all_cocos2dx_studio_manual);
|
sc->addRegisterCallback(register_all_cocos2dx_studio_manual);
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
[cocos2dx_gui]
|
[cocos2dx_gui]
|
||||||
# the prefix to be added to the generated functions. You might or might not use this in your own
|
# the prefix to be added to the generated functions. You might or might not use this in your own
|
||||||
# templates
|
# templates
|
||||||
prefix = cocos2dx_gui
|
prefix = cocos2dx_ui
|
||||||
|
|
||||||
# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)
|
# 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
|
# all classes will be embedded in that namespace
|
||||||
target_namespace = ccui
|
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".
|
# 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::gui
|
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_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_
|
android_flags = -D_SIZE_T_DEFINED_
|
||||||
|
|
|
@ -7,8 +7,8 @@ prefix = cocos2dx_gui
|
||||||
# all classes will be embedded in that namespace
|
# all classes will be embedded in that namespace
|
||||||
target_namespace = ccui
|
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".
|
# 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::gui
|
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_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_
|
android_flags = -D_SIZE_T_DEFINED_
|
||||||
|
|
Loading…
Reference in New Issue