mirror of https://github.com/axmolengine/axmol.git
Merge branch 'luamerage' of https://github.com/chuanweizhang2013/cocos2d-x into luamerage
This commit is contained in:
commit
bf9d3e93b1
|
@ -1 +1 @@
|
|||
2ba216b4ae56fa741405d81c01614f325fc19874
|
||||
b8bc5839895bfc413816baa425d43a2b8e48205d
|
|
@ -1 +1 @@
|
|||
71a61fb97a4db05adaabc4cc03035fe419cc35d6
|
||||
bbf0323293cba3d7ee58ef36706831a8761692d8
|
|
@ -598,17 +598,6 @@ void Node::setTag(int var)
|
|||
_tag = var;
|
||||
}
|
||||
|
||||
//name getter
|
||||
std::string& Node::getName()
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
//name setter
|
||||
void Node::setName(const std::string& name)
|
||||
{
|
||||
_name = name;
|
||||
}
|
||||
/// userData setter
|
||||
void Node::setUserData(void *var)
|
||||
{
|
||||
|
@ -713,44 +702,6 @@ Node* Node::getChildByTag(int tag)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
Node* Node::getChildByName(const std::string& name)
|
||||
{
|
||||
for (auto& child : _children)
|
||||
{
|
||||
|
||||
if(child->_name == name)
|
||||
{
|
||||
return child;
|
||||
}
|
||||
|
||||
auto found = child->getChildByName(name);
|
||||
if(found != nullptr)
|
||||
{
|
||||
return found;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Node::enumerateChildrenByName(const std::string& name, const std::function<void(Node* node, bool* stop)>& callback)
|
||||
{
|
||||
for (auto& child : _children)
|
||||
{
|
||||
|
||||
if(child->_name == name)
|
||||
{
|
||||
bool stop = false;
|
||||
callback(child, &stop);
|
||||
if(stop == true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
child->enumerateChildrenByName(name, callback);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* "add" logic MUST only be on this method
|
||||
* If a class want's to extend the 'addChild' behavior it only needs
|
||||
* to override this method
|
||||
|
|
|
@ -645,15 +645,6 @@ public:
|
|||
* @return a Node object whose tag equals to the input parameter
|
||||
*/
|
||||
virtual Node * getChildByTag(int tag);
|
||||
|
||||
/**
|
||||
* get a child node with its name, will recursively search the whole node tree
|
||||
*
|
||||
* @param name A string identifier to find the child node.
|
||||
*
|
||||
* @return the first Node object whose name equals to the input parameter
|
||||
*/
|
||||
virtual Node* getChildByName(const std::string& name);
|
||||
/**
|
||||
* Returns the array of the node's children
|
||||
*
|
||||
|
@ -768,47 +759,7 @@ public:
|
|||
*/
|
||||
virtual void setTag(int tag);
|
||||
|
||||
/// @{
|
||||
/// @name name
|
||||
|
||||
/**
|
||||
* Returns a name that is used to identify the node easily.
|
||||
*
|
||||
* You can set name to node then identify them easily.
|
||||
@code
|
||||
|
||||
// set name
|
||||
node1->setName("player");
|
||||
node2->setName("monster");
|
||||
node3->setName("boss");
|
||||
parent->addChild(node1);
|
||||
parent->addChild(node2);
|
||||
parent->addChild(node3);
|
||||
// identify by name
|
||||
Node* player = nullptr;
|
||||
player = parent->getChildByName("player")
|
||||
@endcode
|
||||
*
|
||||
* @return A string that identifies the node.
|
||||
*/
|
||||
virtual std::string& getName();
|
||||
/**
|
||||
* Changes the name that is used to identify the node easily.
|
||||
*
|
||||
* Please refer to getName for the sample code.
|
||||
*
|
||||
* @param name A string that indentifies the node.
|
||||
*/
|
||||
virtual void setName(const std::string& name);
|
||||
/**
|
||||
* Search the children to perform processing for nodes which share a name.
|
||||
* Note: this function will search the whole node tree recursively.
|
||||
* @param name the name to search for
|
||||
* @param callback, A callback to execute on nodes that match the name parameter. The callback takes the following arguments:
|
||||
* node: A node that matches the name.
|
||||
* stop: A pointer to a Boolean variable. Your callback can set this to true to terminate the enumeration.
|
||||
*/
|
||||
virtual void enumerateChildrenByName(const std::string& name, const std::function<void(Node* node, bool* stop)>& callback);
|
||||
/**
|
||||
* Returns a custom user data pointer
|
||||
*
|
||||
|
|
|
@ -78,12 +78,6 @@
|
|||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Node] getChildByName
|
||||
-- @param self
|
||||
-- @param #string str
|
||||
-- @return Node#Node ret (return value: cc.Node)
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Node] updateDisplayedOpacity
|
||||
-- @param self
|
||||
|
@ -100,10 +94,9 @@
|
|||
-- @param #float float
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Node] enumerateChildrenByName
|
||||
-- @function [parent=#Node] setScaleY
|
||||
-- @param self
|
||||
-- @param #string str
|
||||
-- @param #function func
|
||||
-- @param #float float
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Node] setScaleX
|
||||
|
@ -211,11 +204,6 @@
|
|||
-- @param self
|
||||
-- @param #cc.Node node
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Node] getName
|
||||
-- @param self
|
||||
-- @return string#string ret (return value: string)
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Node] getRotation3D
|
||||
-- @param self
|
||||
|
@ -330,10 +318,15 @@
|
|||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Node] runAction
|
||||
-- overload function: visit()
|
||||
--
|
||||
-- overload function: visit(cc.Renderer, kmMat4, bool)
|
||||
--
|
||||
-- @function [parent=#Node] visit
|
||||
-- @param self
|
||||
-- @param #cc.Action action
|
||||
-- @return Action#Action ret (return value: cc.Action)
|
||||
-- @param #cc.Renderer renderer
|
||||
-- @param #kmMat4 kmmat4
|
||||
-- @param #bool bool
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Node] setShaderProgram
|
||||
|
@ -351,15 +344,10 @@
|
|||
-- @return point_table#point_table ret (return value: point_table)
|
||||
|
||||
--------------------------------
|
||||
-- overload function: visit()
|
||||
--
|
||||
-- overload function: visit(cc.Renderer, kmMat4, bool)
|
||||
--
|
||||
-- @function [parent=#Node] visit
|
||||
-- @function [parent=#Node] runAction
|
||||
-- @param self
|
||||
-- @param #cc.Renderer renderer
|
||||
-- @param #kmMat4 kmmat4
|
||||
-- @param #bool bool
|
||||
-- @param #cc.Action action
|
||||
-- @return Action#Action ret (return value: cc.Action)
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Node] setScheduler
|
||||
|
@ -391,11 +379,6 @@
|
|||
-- @param #int int
|
||||
-- @return Action#Action ret (return value: cc.Action)
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Node] setName
|
||||
-- @param self
|
||||
-- @param #string str
|
||||
|
||||
--------------------------------
|
||||
-- overload function: setAdditionalTransform(cc.AffineTransform)
|
||||
--
|
||||
|
@ -504,11 +487,6 @@
|
|||
-- @param self
|
||||
-- @param #float float
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Node] setScaleY
|
||||
-- @param self
|
||||
-- @param #float float
|
||||
|
||||
--------------------------------
|
||||
-- overload function: setScale(float, float)
|
||||
--
|
||||
|
|
|
@ -47,6 +47,11 @@
|
|||
-- @param self
|
||||
-- @return array_table#array_table ret (return value: array_table)
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Widget] getLayoutSize
|
||||
-- @param self
|
||||
-- @return size_table#size_table ret (return value: size_table)
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Widget] setPositionType
|
||||
-- @param self
|
||||
|
@ -63,8 +68,13 @@
|
|||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- overload function: updateSizeAndPosition(size_table)
|
||||
--
|
||||
-- overload function: updateSizeAndPosition()
|
||||
--
|
||||
-- @function [parent=#Widget] updateSizeAndPosition
|
||||
-- @param self
|
||||
-- @param #size_table size
|
||||
|
||||
--------------------------------
|
||||
-- @function [parent=#Widget] getBottomInParent
|
||||
|
|
|
@ -1 +1 @@
|
|||
fa5cf8075e2b31cc61b8c17783dbdc435feae281
|
||||
b0dc5acd96b5d7e94c40c01097a6f969719a6110
|
|
@ -1541,10 +1541,6 @@ int register_all_cocos2dx(lua_State* tolua_S);
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
c9cf8f3050b95aec88a2452e60fe492252ad30c3
|
||||
d0b810bd90f5639ba15e03fc5e083b762225a16d
|
|
@ -346,6 +346,7 @@ int register_all_cocos2dx_ui(lua_State* tolua_S);
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // __cocos2dx_ui_h__
|
||||
|
|
|
@ -28,6 +28,41 @@ NS_CC_BEGIN
|
|||
|
||||
namespace ui {
|
||||
|
||||
ScrollInnerContainer::ScrollInnerContainer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ScrollInnerContainer::~ScrollInnerContainer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ScrollInnerContainer* ScrollInnerContainer::create()
|
||||
{
|
||||
ScrollInnerContainer* widget = new ScrollInnerContainer();
|
||||
if (widget && widget->init())
|
||||
{
|
||||
widget->autorelease();
|
||||
return widget;
|
||||
}
|
||||
CC_SAFE_DELETE(widget);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const Size& ScrollInnerContainer::getLayoutSize()
|
||||
{
|
||||
Widget* parent = getWidgetParent();
|
||||
if (parent)
|
||||
{
|
||||
return parent->getSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
return _size;
|
||||
}
|
||||
}
|
||||
|
||||
static const float AUTOSCROLLMAXSPEED = 1000.0f;
|
||||
|
||||
const Point SCROLLDIR_UP = Point(0.0f, 1.0f);
|
||||
|
@ -233,7 +268,7 @@ void ScrollView::addChild(Node * child, int zOrder)
|
|||
|
||||
void ScrollView::addChild(Node *child, int zOrder, int tag)
|
||||
{
|
||||
return _innerContainer->addChild(child, zOrder, tag);
|
||||
_innerContainer->addChild(child, zOrder, tag);
|
||||
}
|
||||
|
||||
void ScrollView::removeAllChildren()
|
||||
|
|
|
@ -32,6 +32,15 @@ NS_CC_BEGIN
|
|||
|
||||
namespace ui {
|
||||
|
||||
class ScrollInnerContainer : public Layout
|
||||
{
|
||||
public:
|
||||
ScrollInnerContainer();
|
||||
virtual ~ScrollInnerContainer();
|
||||
static ScrollInnerContainer* create();
|
||||
virtual const Size& getLayoutSize() override;
|
||||
};
|
||||
|
||||
enum SCROLLVIEW_DIR
|
||||
{
|
||||
SCROLLVIEW_DIR_NONE,
|
||||
|
|
|
@ -396,6 +396,21 @@ void Widget::setSizePercent(const Point &percent)
|
|||
}
|
||||
|
||||
void Widget::updateSizeAndPosition()
|
||||
{
|
||||
Widget* widgetParent = getWidgetParent();
|
||||
Size pSize;
|
||||
if (widgetParent)
|
||||
{
|
||||
pSize = widgetParent->getLayoutSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
pSize = _parent->getContentSize();
|
||||
}
|
||||
updateSizeAndPosition(pSize);
|
||||
}
|
||||
|
||||
void Widget::updateSizeAndPosition(const cocos2d::Size &parentSize)
|
||||
{
|
||||
switch (_sizeType)
|
||||
{
|
||||
|
@ -409,45 +424,22 @@ void Widget::updateSizeAndPosition()
|
|||
{
|
||||
_size = _customSize;
|
||||
}
|
||||
Widget* widgetParent = getWidgetParent();
|
||||
if (widgetParent)
|
||||
{
|
||||
Size pSize = widgetParent->getSize();
|
||||
float spx = 0.0f;
|
||||
float spy = 0.0f;
|
||||
if (pSize.width > 0.0f)
|
||||
if (parentSize.width > 0.0f)
|
||||
{
|
||||
spx = _customSize.width / pSize.width;
|
||||
spx = _customSize.width / parentSize.width;
|
||||
}
|
||||
if (pSize.height > 0.0f)
|
||||
if (parentSize.height > 0.0f)
|
||||
{
|
||||
spy = _customSize.height / pSize.height;
|
||||
spy = _customSize.height / parentSize.height;
|
||||
}
|
||||
_sizePercent = Point(spx, spy);
|
||||
}
|
||||
else
|
||||
{
|
||||
Size pSize = _parent->getContentSize();
|
||||
float spx = 0.0f;
|
||||
float spy = 0.0f;
|
||||
if (pSize.width > 0.0f)
|
||||
{
|
||||
spx = _customSize.width / pSize.width;
|
||||
}
|
||||
if (pSize.height > 0.0f)
|
||||
{
|
||||
spy = _customSize.height / pSize.height;
|
||||
}
|
||||
_sizePercent = Point(spx, spy);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SIZE_PERCENT:
|
||||
{
|
||||
Widget* widgetParent = getWidgetParent();
|
||||
if (widgetParent)
|
||||
{
|
||||
Size cSize = Size(widgetParent->getSize().width * _sizePercent.x , widgetParent->getSize().height * _sizePercent.y);
|
||||
Size cSize = Size(parentSize.width * _sizePercent.x , parentSize.height * _sizePercent.y);
|
||||
if (_ignoreSize)
|
||||
{
|
||||
_size = getContentSize();
|
||||
|
@ -457,22 +449,8 @@ void Widget::updateSizeAndPosition()
|
|||
_size = cSize;
|
||||
}
|
||||
_customSize = cSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
Size cSize = Size(_parent->getContentSize().width * _sizePercent.x , _parent->getContentSize().height * _sizePercent.y);
|
||||
if (_ignoreSize)
|
||||
{
|
||||
_size = getContentSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
_size = cSize;
|
||||
}
|
||||
_customSize = cSize;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -482,46 +460,19 @@ void Widget::updateSizeAndPosition()
|
|||
{
|
||||
case POSITION_ABSOLUTE:
|
||||
{
|
||||
Widget* widgetParent = getWidgetParent();
|
||||
if (widgetParent)
|
||||
{
|
||||
Size pSize = widgetParent->getSize();
|
||||
if (pSize.width <= 0.0f || pSize.height <= 0.0f)
|
||||
if (parentSize.width <= 0.0f || parentSize.height <= 0.0f)
|
||||
{
|
||||
_positionPercent = Point::ZERO;
|
||||
}
|
||||
else
|
||||
{
|
||||
_positionPercent = Point(absPos.x / pSize.width, absPos.y / pSize.height);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Size pSize = _parent->getContentSize();
|
||||
if (pSize.width <= 0.0f || pSize.height <= 0.0f)
|
||||
{
|
||||
_positionPercent = Point::ZERO;
|
||||
}
|
||||
else
|
||||
{
|
||||
_positionPercent = Point(absPos.x / pSize.width, absPos.y / pSize.height);
|
||||
}
|
||||
_positionPercent = Point(absPos.x / parentSize.width, absPos.y / parentSize.height);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case POSITION_PERCENT:
|
||||
{
|
||||
Widget* widgetParent = getWidgetParent();
|
||||
if (widgetParent)
|
||||
{
|
||||
Size parentSize = widgetParent->getSize();
|
||||
absPos = Point(parentSize.width * _positionPercent.x, parentSize.height * _positionPercent.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
Size parentSize = _parent->getContentSize();
|
||||
absPos = Point(parentSize.width * _positionPercent.x, parentSize.height * _positionPercent.y);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -550,6 +550,8 @@ public:
|
|||
|
||||
const Size& getCustomSize() const;
|
||||
|
||||
virtual const Size& getLayoutSize() {return _size;};
|
||||
|
||||
/**
|
||||
* Returns size percent of widget
|
||||
*
|
||||
|
@ -642,6 +644,8 @@ public:
|
|||
|
||||
void updateSizeAndPosition();
|
||||
|
||||
void updateSizeAndPosition(const Size& parentSize);
|
||||
|
||||
/*temp action*/
|
||||
void setActionTag(int tag);
|
||||
int getActionTag();
|
||||
|
|
|
@ -1,158 +0,0 @@
|
|||
|
||||
|
||||
#include "ButtonReader.h"
|
||||
#include "ui/UIButton.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
static ButtonReader* instanceButtonReader = NULL;
|
||||
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(ButtonReader)
|
||||
|
||||
ButtonReader::ButtonReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ButtonReader::~ButtonReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ButtonReader* ButtonReader::getInstance()
|
||||
{
|
||||
if (!instanceButtonReader)
|
||||
{
|
||||
instanceButtonReader = new ButtonReader();
|
||||
}
|
||||
return instanceButtonReader;
|
||||
}
|
||||
|
||||
void ButtonReader::purge()
|
||||
{
|
||||
CC_SAFE_DELETE(instanceButtonReader);
|
||||
}
|
||||
|
||||
void ButtonReader::setPropsFromJsonDictionary(Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
WidgetReader::setPropsFromJsonDictionary(widget, options);
|
||||
|
||||
|
||||
std::string jsonPath = GUIReader::getInstance()->getFilePath();
|
||||
|
||||
Button* button = static_cast<Button*>(widget);
|
||||
bool scale9Enable = DICTOOL->getBooleanValue_json(options, "scale9Enable");
|
||||
button->setScale9Enabled(scale9Enable);
|
||||
|
||||
const rapidjson::Value& normalDic = DICTOOL->getSubDictionary_json(options, "normalData");
|
||||
int normalType = DICTOOL->getIntValue_json(normalDic, "resourceType");
|
||||
switch (normalType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_n = jsonPath;
|
||||
const char* normalFileName = DICTOOL->getStringValue_json(normalDic, "path");
|
||||
const char* normalFileName_tp = (normalFileName && (strcmp(normalFileName, "") != 0))?tp_n.append(normalFileName).c_str():nullptr;
|
||||
button->loadTextureNormal(normalFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* normalFileName = DICTOOL->getStringValue_json(normalDic, "path");
|
||||
button->loadTextureNormal(normalFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
const rapidjson::Value& pressedDic = DICTOOL->getSubDictionary_json(options, "pressedData");
|
||||
int pressedType = DICTOOL->getIntValue_json(pressedDic, "resourceType");
|
||||
switch (pressedType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_p = jsonPath;
|
||||
const char* pressedFileName = DICTOOL->getStringValue_json(pressedDic, "path");
|
||||
const char* pressedFileName_tp = (pressedFileName && (strcmp(pressedFileName, "") != 0))?tp_p.append(pressedFileName).c_str():nullptr;
|
||||
button->loadTexturePressed(pressedFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* pressedFileName = DICTOOL->getStringValue_json(pressedDic, "path");
|
||||
button->loadTexturePressed(pressedFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
const rapidjson::Value& disabledDic = DICTOOL->getSubDictionary_json(options, "disabledData");
|
||||
int disabledType = DICTOOL->getIntValue_json(disabledDic, "resourceType");
|
||||
switch (disabledType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_d = jsonPath;
|
||||
const char* disabledFileName = DICTOOL->getStringValue_json(disabledDic, "path");
|
||||
const char* disabledFileName_tp = (disabledFileName && (strcmp(disabledFileName, "") != 0))?tp_d.append(disabledFileName).c_str():nullptr;
|
||||
button->loadTextureDisabled(disabledFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* disabledFileName = DICTOOL->getStringValue_json(disabledDic, "path");
|
||||
button->loadTextureDisabled(disabledFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (scale9Enable)
|
||||
{
|
||||
float cx = DICTOOL->getFloatValue_json(options, "capInsetsX");
|
||||
float cy = DICTOOL->getFloatValue_json(options, "capInsetsY");
|
||||
float cw = DICTOOL->getFloatValue_json(options, "capInsetsWidth");
|
||||
float ch = DICTOOL->getFloatValue_json(options, "capInsetsHeight");
|
||||
|
||||
button->setCapInsets(Rect(cx, cy, cw, ch));
|
||||
bool sw = DICTOOL->checkObjectExist_json(options, "scale9Width");
|
||||
bool sh = DICTOOL->checkObjectExist_json(options, "scale9Height");
|
||||
if (sw && sh)
|
||||
{
|
||||
float swf = DICTOOL->getFloatValue_json(options, "scale9Width");
|
||||
float shf = DICTOOL->getFloatValue_json(options, "scale9Height");
|
||||
button->setSize(Size(swf, shf));
|
||||
}
|
||||
}
|
||||
bool tt = DICTOOL->checkObjectExist_json(options, "text");
|
||||
if (tt)
|
||||
{
|
||||
const char* text = DICTOOL->getStringValue_json(options, "text");
|
||||
if (text)
|
||||
{
|
||||
button->setTitleText(text);
|
||||
}
|
||||
}
|
||||
|
||||
bool cr = DICTOOL->checkObjectExist_json(options, "textColorR");
|
||||
bool cg = DICTOOL->checkObjectExist_json(options, "textColorG");
|
||||
bool cb = DICTOOL->checkObjectExist_json(options, "textColorB");
|
||||
int cri = cr?DICTOOL->getIntValue_json(options, "textColorR"):255;
|
||||
int cgi = cg?DICTOOL->getIntValue_json(options, "textColorG"):255;
|
||||
int cbi = cb?DICTOOL->getIntValue_json(options, "textColorB"):255;
|
||||
button->setTitleColor(Color3B(cri,cgi,cbi));
|
||||
bool fs = DICTOOL->checkObjectExist_json(options, "fontSize");
|
||||
if (fs)
|
||||
{
|
||||
button->setTitleFontSize(DICTOOL->getIntValue_json(options, "fontSize"));
|
||||
}
|
||||
bool fn = DICTOOL->checkObjectExist_json(options, "fontName");
|
||||
if (fn)
|
||||
{
|
||||
button->setTitleFontName(DICTOOL->getStringValue_json(options, "fontName"));
|
||||
}
|
||||
|
||||
|
||||
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__ButtonReader__
|
||||
#define __TestCpp__ButtonReader__
|
||||
|
||||
#include "../WidgetReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class ButtonReader : public WidgetReader
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
ButtonReader();
|
||||
virtual ~ButtonReader();
|
||||
|
||||
static ButtonReader* getInstance();
|
||||
static void purge();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__ButtonReader__) */
|
|
@ -1,153 +0,0 @@
|
|||
|
||||
|
||||
#include "CheckBoxReader.h"
|
||||
#include "ui/UICheckBox.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
static CheckBoxReader* instanceCheckBoxReader = NULL;
|
||||
using cocos2d::ui::CheckBox;
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(CheckBoxReader)
|
||||
|
||||
CheckBoxReader::CheckBoxReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CheckBoxReader::~CheckBoxReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CheckBoxReader* CheckBoxReader::getInstance()
|
||||
{
|
||||
if (!instanceCheckBoxReader)
|
||||
{
|
||||
instanceCheckBoxReader = new CheckBoxReader();
|
||||
}
|
||||
return instanceCheckBoxReader;
|
||||
}
|
||||
|
||||
void CheckBoxReader::setPropsFromJsonDictionary(Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
WidgetReader::setPropsFromJsonDictionary(widget, options);
|
||||
|
||||
|
||||
std::string jsonPath = GUIReader::getInstance()->getFilePath();
|
||||
|
||||
CheckBox* checkBox = static_cast<CheckBox*>(widget);
|
||||
|
||||
const rapidjson::Value& backGroundDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxData");
|
||||
int backGroundType = DICTOOL->getIntValue_json(backGroundDic, "resourceType");
|
||||
switch (backGroundType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_b = jsonPath;
|
||||
const char* backGroundFileName = DICTOOL->getStringValue_json(backGroundDic, "path");
|
||||
const char* backGroundFileName_tp = (backGroundFileName && (strcmp(backGroundFileName, "") != 0))?tp_b.append(backGroundFileName).c_str():nullptr;
|
||||
checkBox->loadTextureBackGround(backGroundFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* backGroundFileName = DICTOOL->getStringValue_json(backGroundDic, "path");
|
||||
checkBox->loadTextureBackGround(backGroundFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
const rapidjson::Value& backGroundSelectedDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxSelectedData");
|
||||
int backGroundSelectedType = DICTOOL->getIntValue_json(backGroundSelectedDic, "resourceType");
|
||||
switch (backGroundSelectedType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_bs = jsonPath;
|
||||
const char* backGroundSelectedFileName = DICTOOL->getStringValue_json(backGroundSelectedDic, "path");
|
||||
const char* backGroundSelectedFileName_tp = (backGroundSelectedFileName && (strcmp(backGroundSelectedFileName, "") != 0))?tp_bs.append(backGroundSelectedFileName).c_str():nullptr;
|
||||
checkBox->loadTextureBackGroundSelected(backGroundSelectedFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* backGroundSelectedFileName = DICTOOL->getStringValue_json(backGroundSelectedDic, "path");
|
||||
checkBox->loadTextureBackGroundSelected(backGroundSelectedFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
const rapidjson::Value& frontCrossDic = DICTOOL->getSubDictionary_json(options, "frontCrossData");
|
||||
int frontCrossType = DICTOOL->getIntValue_json(frontCrossDic, "resourceType");
|
||||
switch (frontCrossType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_c = jsonPath;
|
||||
const char* frontCrossFileName = DICTOOL->getStringValue_json(frontCrossDic, "path");
|
||||
const char* frontCrossFileName_tp = (frontCrossFileName && (strcmp(frontCrossFileName, "") != 0))?tp_c.append(frontCrossFileName).c_str():nullptr;
|
||||
checkBox->loadTextureFrontCross(frontCrossFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* frontCrossFileName = DICTOOL->getStringValue_json(frontCrossDic, "path");
|
||||
checkBox->loadTextureFrontCross(frontCrossFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
const rapidjson::Value& backGroundDisabledDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxDisabledData");
|
||||
int backGroundDisabledType = DICTOOL->getIntValue_json(backGroundDisabledDic, "resourceType");
|
||||
switch (backGroundDisabledType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_bd = jsonPath;
|
||||
const char* backGroundDisabledFileName = DICTOOL->getStringValue_json(backGroundDisabledDic, "path");
|
||||
const char* backGroundDisabledFileName_tp = (backGroundDisabledFileName && (strcmp(backGroundDisabledFileName, "") != 0))?tp_bd.append(backGroundDisabledFileName).c_str():nullptr;
|
||||
checkBox->loadTextureBackGroundDisabled(backGroundDisabledFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* backGroundDisabledFileName = DICTOOL->getStringValue_json(backGroundDisabledDic, "path");
|
||||
checkBox->loadTextureBackGroundDisabled(backGroundDisabledFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
const rapidjson::Value& frontCrossDisabledDic = DICTOOL->getSubDictionary_json(options, "frontCrossDisabledData");
|
||||
int frontCrossDisabledType = DICTOOL->getIntValue_json(frontCrossDisabledDic, "resourceType");
|
||||
switch (frontCrossDisabledType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_cd = jsonPath;
|
||||
const char* frontCrossDisabledFileName = DICTOOL->getStringValue_json(options, "path");
|
||||
const char* frontCrossDisabledFileName_tp = (frontCrossDisabledFileName && (strcmp(frontCrossDisabledFileName, "") != 0))?tp_cd.append(frontCrossDisabledFileName).c_str():nullptr;
|
||||
checkBox->loadTextureFrontCrossDisabled(frontCrossDisabledFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* frontCrossDisabledFileName = DICTOOL->getStringValue_json(options, "path");
|
||||
checkBox->loadTextureFrontCrossDisabled(frontCrossDisabledFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__CheckBoxReader__
|
||||
#define __TestCpp__CheckBoxReader__
|
||||
|
||||
#include "../WidgetReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class CheckBoxReader : public WidgetReader
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
CheckBoxReader();
|
||||
virtual ~CheckBoxReader();
|
||||
|
||||
static CheckBoxReader* getInstance();
|
||||
static void purge();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__CheckBoxReader__) */
|
|
@ -1,98 +0,0 @@
|
|||
|
||||
|
||||
#include "ImageViewReader.h"
|
||||
#include "ui/UIImageView.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
static ImageViewReader* instanceImageViewReader = NULL;
|
||||
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(ImageViewReader)
|
||||
|
||||
ImageViewReader::ImageViewReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ImageViewReader::~ImageViewReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ImageViewReader* ImageViewReader::getInstance()
|
||||
{
|
||||
if (!instanceImageViewReader)
|
||||
{
|
||||
instanceImageViewReader = new ImageViewReader();
|
||||
}
|
||||
return instanceImageViewReader;
|
||||
}
|
||||
|
||||
void ImageViewReader::setPropsFromJsonDictionary(Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
WidgetReader::setPropsFromJsonDictionary(widget, options);
|
||||
|
||||
|
||||
std::string jsonPath = GUIReader::getInstance()->getFilePath();
|
||||
|
||||
ImageView* imageView = static_cast<ImageView*>(widget);
|
||||
|
||||
const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, "fileNameData");
|
||||
int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType");
|
||||
switch (imageFileNameType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_i = jsonPath;
|
||||
const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, "path");
|
||||
const char* imageFileName_tp = nullptr;
|
||||
if (imageFileName && (strcmp(imageFileName, "") != 0))
|
||||
{
|
||||
imageFileName_tp = tp_i.append(imageFileName).c_str();
|
||||
imageView->loadTexture(imageFileName_tp);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, "path");
|
||||
imageView->loadTexture(imageFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
bool scale9EnableExist = DICTOOL->checkObjectExist_json(options, "scale9Enable");
|
||||
bool scale9Enable = false;
|
||||
if (scale9EnableExist)
|
||||
{
|
||||
scale9Enable = DICTOOL->getBooleanValue_json(options, "scale9Enable");
|
||||
}
|
||||
imageView->setScale9Enabled(scale9Enable);
|
||||
|
||||
|
||||
if (scale9Enable)
|
||||
{
|
||||
bool sw = DICTOOL->checkObjectExist_json(options, "scale9Width");
|
||||
bool sh = DICTOOL->checkObjectExist_json(options, "scale9Height");
|
||||
if (sw && sh)
|
||||
{
|
||||
float swf = DICTOOL->getFloatValue_json(options, "scale9Width");
|
||||
float shf = DICTOOL->getFloatValue_json(options, "scale9Height");
|
||||
imageView->setSize(Size(swf, shf));
|
||||
}
|
||||
|
||||
float cx = DICTOOL->getFloatValue_json(options, "capInsetsX");
|
||||
float cy = DICTOOL->getFloatValue_json(options, "capInsetsY");
|
||||
float cw = DICTOOL->getFloatValue_json(options, "capInsetsWidth");
|
||||
float ch = DICTOOL->getFloatValue_json(options, "capInsetsHeight");
|
||||
|
||||
imageView->setCapInsets(Rect(cx, cy, cw, ch));
|
||||
|
||||
}
|
||||
|
||||
|
||||
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__ImageViewReader__
|
||||
#define __TestCpp__ImageViewReader__
|
||||
|
||||
#include "../WidgetReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class ImageViewReader : public WidgetReader
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
ImageViewReader();
|
||||
virtual ~ImageViewReader();
|
||||
|
||||
static ImageViewReader* getInstance();
|
||||
static void purge();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__ImageViewReader__) */
|
|
@ -1,119 +0,0 @@
|
|||
|
||||
|
||||
#include "LayoutReader.h"
|
||||
#include "ui/UILayout.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
static LayoutReader* instanceLayoutReader = NULL;
|
||||
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(LayoutReader)
|
||||
|
||||
LayoutReader::LayoutReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LayoutReader::~LayoutReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LayoutReader* LayoutReader::getInstance()
|
||||
{
|
||||
if (!instanceLayoutReader)
|
||||
{
|
||||
instanceLayoutReader = new LayoutReader();
|
||||
}
|
||||
return instanceLayoutReader;
|
||||
}
|
||||
|
||||
void LayoutReader::setPropsFromJsonDictionary(ui::Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
WidgetReader::setPropsFromJsonDictionary(widget, options);
|
||||
|
||||
|
||||
std::string jsonPath = GUIReader::getInstance()->getFilePath();
|
||||
|
||||
Layout* panel = static_cast<Layout*>(widget);
|
||||
|
||||
/* adapt screen gui */
|
||||
float w = 0, h = 0;
|
||||
bool adaptScrenn = DICTOOL->getBooleanValue_json(options, "adaptScreen");
|
||||
if (adaptScrenn)
|
||||
{
|
||||
Size screenSize = CCDirector::getInstance()->getWinSize();
|
||||
w = screenSize.width;
|
||||
h = screenSize.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
w = DICTOOL->getFloatValue_json(options, "width");
|
||||
h = DICTOOL->getFloatValue_json(options, "height");
|
||||
}
|
||||
panel->setSize(Size(w, h));
|
||||
/**/
|
||||
|
||||
bool backGroundScale9Enable = DICTOOL->getBooleanValue_json(options, "backGroundScale9Enable");
|
||||
panel->setBackGroundImageScale9Enabled(backGroundScale9Enable);
|
||||
int cr = DICTOOL->getIntValue_json(options, "bgColorR");
|
||||
int cg = DICTOOL->getIntValue_json(options, "bgColorG");
|
||||
int cb = DICTOOL->getIntValue_json(options, "bgColorB");
|
||||
|
||||
int scr = DICTOOL->getIntValue_json(options, "bgStartColorR");
|
||||
int scg = DICTOOL->getIntValue_json(options, "bgStartColorG");
|
||||
int scb = DICTOOL->getIntValue_json(options, "bgStartColorB");
|
||||
|
||||
int ecr = DICTOOL->getIntValue_json(options, "bgEndColorR");
|
||||
int ecg = DICTOOL->getIntValue_json(options, "bgEndColorG");
|
||||
int ecb = DICTOOL->getIntValue_json(options, "bgEndColorB");
|
||||
|
||||
float bgcv1 = DICTOOL->getFloatValue_json(options, "vectorX");
|
||||
float bgcv2 = DICTOOL->getFloatValue_json(options, "vectorY");
|
||||
panel->setBackGroundColorVector(Point(bgcv1, bgcv2));
|
||||
|
||||
int co = DICTOOL->getIntValue_json(options, "bgColorOpacity");
|
||||
|
||||
int colorType = DICTOOL->getIntValue_json(options, "colorType");
|
||||
panel->setBackGroundColorType(LayoutBackGroundColorType(colorType));
|
||||
panel->setBackGroundColor(Color3B(scr, scg, scb),Color3B(ecr, ecg, ecb));
|
||||
panel->setBackGroundColor(Color3B(cr, cg, cb));
|
||||
panel->setBackGroundColorOpacity(co);
|
||||
|
||||
|
||||
const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, "backGroundImageData");
|
||||
int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType");
|
||||
switch (imageFileNameType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_b = jsonPath;
|
||||
const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, "path");
|
||||
const char* imageFileName_tp = (imageFileName && (strcmp(imageFileName, "") != 0))?tp_b.append(imageFileName).c_str():nullptr;
|
||||
panel->setBackGroundImage(imageFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, "path");
|
||||
panel->setBackGroundImage(imageFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (backGroundScale9Enable)
|
||||
{
|
||||
float cx = DICTOOL->getFloatValue_json(options, "capInsetsX");
|
||||
float cy = DICTOOL->getFloatValue_json(options, "capInsetsY");
|
||||
float cw = DICTOOL->getFloatValue_json(options, "capInsetsWidth");
|
||||
float ch = DICTOOL->getFloatValue_json(options, "capInsetsHeight");
|
||||
panel->setBackGroundImageCapInsets(Rect(cx, cy, cw, ch));
|
||||
}
|
||||
panel->setLayoutType((LayoutType)DICTOOL->getIntValue_json(options, "layoutType"));
|
||||
|
||||
|
||||
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__LayoutReader__
|
||||
#define __TestCpp__LayoutReader__
|
||||
|
||||
#include "../WidgetReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class LayoutReader : public WidgetReader
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
LayoutReader();
|
||||
virtual ~LayoutReader();
|
||||
|
||||
static LayoutReader* getInstance();
|
||||
static void purge();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__LayoutReader__) */
|
|
@ -1,48 +0,0 @@
|
|||
|
||||
|
||||
#include "ListViewReader.h"
|
||||
#include "ui/UIListView.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
static ListViewReader* instanceListViewReader = NULL;
|
||||
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(ListViewReader)
|
||||
|
||||
ListViewReader::ListViewReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ListViewReader::~ListViewReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ListViewReader* ListViewReader::getInstance()
|
||||
{
|
||||
if (!instanceListViewReader)
|
||||
{
|
||||
instanceListViewReader = new ListViewReader();
|
||||
}
|
||||
return instanceListViewReader;
|
||||
}
|
||||
|
||||
void ListViewReader::setPropsFromJsonDictionary(ui::Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
ScrollViewReader::setPropsFromJsonDictionary(widget, options);
|
||||
|
||||
|
||||
ListView* listView = static_cast<ListView*>(widget);
|
||||
|
||||
int direction = DICTOOL->getFloatValue_json(options, "direction");
|
||||
listView->setDirection((SCROLLVIEW_DIR)direction);
|
||||
|
||||
ListViewGravity gravity = (ListViewGravity)DICTOOL->getIntValue_json(options, "gravity");
|
||||
listView->setGravity(gravity);
|
||||
|
||||
float itemMargin = DICTOOL->getFloatValue_json(options, "itemMargin");
|
||||
listView->setItemsMargin(itemMargin);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__ListViewReader__
|
||||
#define __TestCpp__ListViewReader__
|
||||
|
||||
#include "../ScrollViewReader/ScrollViewReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class ListViewReader : public ScrollViewReader
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
ListViewReader();
|
||||
virtual ~ListViewReader();
|
||||
|
||||
static ListViewReader* getInstance();
|
||||
static void purge();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__ListViewReader__) */
|
|
@ -1,91 +0,0 @@
|
|||
|
||||
|
||||
#include "LoadingBarReader.h"
|
||||
#include "ui/UILoadingBar.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
static LoadingBarReader* instanceLoadingBar = NULL;
|
||||
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(LoadingBarReader)
|
||||
|
||||
LoadingBarReader::LoadingBarReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LoadingBarReader::~LoadingBarReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LoadingBarReader* LoadingBarReader::getInstance()
|
||||
{
|
||||
if (!instanceLoadingBar)
|
||||
{
|
||||
instanceLoadingBar = new LoadingBarReader();
|
||||
}
|
||||
return instanceLoadingBar;
|
||||
}
|
||||
|
||||
void LoadingBarReader::setPropsFromJsonDictionary(Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
WidgetReader::setPropsFromJsonDictionary(widget, options);
|
||||
|
||||
|
||||
std::string jsonPath = GUIReader::getInstance()->getFilePath();
|
||||
|
||||
LoadingBar* loadingBar = static_cast<LoadingBar*>(widget);
|
||||
|
||||
const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, "textureData");
|
||||
int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType");
|
||||
switch (imageFileNameType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_i = jsonPath;
|
||||
const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, "path");
|
||||
const char* imageFileName_tp = nullptr;
|
||||
if (imageFileName && (strcmp(imageFileName, "") != 0))
|
||||
{
|
||||
imageFileName_tp = tp_i.append(imageFileName).c_str();
|
||||
loadingBar->loadTexture(imageFileName_tp);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, "path");
|
||||
loadingBar->loadTexture(imageFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* gui mark add load bar scale9 parse */
|
||||
bool scale9Enable = DICTOOL->getBooleanValue_json(options, "scale9Enable");
|
||||
loadingBar->setScale9Enabled(scale9Enable);
|
||||
|
||||
if (scale9Enable)
|
||||
{
|
||||
float cx = DICTOOL->getFloatValue_json(options, "capInsetsX");
|
||||
float cy = DICTOOL->getFloatValue_json(options, "capInsetsY");
|
||||
float cw = DICTOOL->getFloatValue_json(options, "capInsetsWidth");
|
||||
float ch = DICTOOL->getFloatValue_json(options, "capInsetsHeight");
|
||||
|
||||
loadingBar->setCapInsets(Rect(cx, cy, cw, ch));
|
||||
|
||||
float width = DICTOOL->getFloatValue_json(options, "width");
|
||||
float height = DICTOOL->getFloatValue_json(options, "height");
|
||||
loadingBar->setSize(Size(width, height));
|
||||
}
|
||||
/**/
|
||||
|
||||
loadingBar->setDirection(LoadingBarType(DICTOOL->getIntValue_json(options, "direction")));
|
||||
loadingBar->setPercent(DICTOOL->getIntValue_json(options, "percent"));
|
||||
|
||||
|
||||
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__LoadingBarReader__
|
||||
#define __TestCpp__LoadingBarReader__
|
||||
|
||||
#include "../WidgetReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class LoadingBarReader : public WidgetReader
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
LoadingBarReader();
|
||||
virtual ~LoadingBarReader();
|
||||
|
||||
static LoadingBarReader* getInstance();
|
||||
static void purge();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__LoadingBarReader__) */
|
|
@ -1,35 +0,0 @@
|
|||
|
||||
|
||||
#include "PageViewReader.h"
|
||||
#include "ui/UIPageView.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
static PageViewReader* instancePageViewReader = NULL;
|
||||
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(PageViewReader)
|
||||
|
||||
PageViewReader::PageViewReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
PageViewReader::~PageViewReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
PageViewReader* PageViewReader::getInstance()
|
||||
{
|
||||
if (!instancePageViewReader)
|
||||
{
|
||||
instancePageViewReader = new PageViewReader();
|
||||
}
|
||||
return instancePageViewReader;
|
||||
}
|
||||
|
||||
void PageViewReader::setPropsFromJsonDictionary(ui::Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
LayoutReader::setPropsFromJsonDictionary(widget, options);
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__PageViewReader__
|
||||
#define __TestCpp__PageViewReader__
|
||||
|
||||
#include "../LayoutReader/LayoutReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class PageViewReader : public LayoutReader
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
PageViewReader();
|
||||
virtual ~PageViewReader();
|
||||
|
||||
static PageViewReader* getInstance();
|
||||
static void purge();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(ui::Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__PageViewReader__) */
|
|
@ -1,47 +0,0 @@
|
|||
|
||||
|
||||
#include "ScrollViewReader.h"
|
||||
#include "ui/UIScrollView.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
static ScrollViewReader* instanceScrollViewReader = NULL;
|
||||
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(ScrollViewReader)
|
||||
|
||||
ScrollViewReader::ScrollViewReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ScrollViewReader::~ScrollViewReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ScrollViewReader* ScrollViewReader::getInstance()
|
||||
{
|
||||
if (!instanceScrollViewReader)
|
||||
{
|
||||
instanceScrollViewReader = new ScrollViewReader();
|
||||
}
|
||||
return instanceScrollViewReader;
|
||||
}
|
||||
|
||||
void ScrollViewReader::setPropsFromJsonDictionary(Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
LayoutReader::setPropsFromJsonDictionary(widget, options);
|
||||
|
||||
|
||||
ScrollView* scrollView = static_cast<ScrollView*>(widget);
|
||||
float innerWidth = DICTOOL->getFloatValue_json(options, "innerWidth");
|
||||
float innerHeight = DICTOOL->getFloatValue_json(options, "innerHeight");
|
||||
scrollView->setInnerContainerSize(Size(innerWidth, innerHeight));
|
||||
int direction = DICTOOL->getFloatValue_json(options, "direction");
|
||||
scrollView->setDirection((SCROLLVIEW_DIR)direction);
|
||||
scrollView->setBounceEnabled(DICTOOL->getBooleanValue_json(options, "bounceEnable"));
|
||||
|
||||
|
||||
LayoutReader::setColorPropsFromJsonDictionary(widget, options);
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__ScrollViewReader__
|
||||
#define __TestCpp__ScrollViewReader__
|
||||
|
||||
#include "../LayoutReader/LayoutReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class ScrollViewReader : public LayoutReader
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
ScrollViewReader();
|
||||
virtual ~ScrollViewReader();
|
||||
|
||||
static ScrollViewReader* getInstance();
|
||||
static void purge();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__ScrollViewReader__) */
|
|
@ -1,192 +0,0 @@
|
|||
|
||||
|
||||
#include "SliderReader.h"
|
||||
#include "ui/UISlider.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
static SliderReader* instanceSliderReader = NULL;
|
||||
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(SliderReader)
|
||||
|
||||
SliderReader::SliderReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SliderReader::~SliderReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SliderReader* SliderReader::getInstance()
|
||||
{
|
||||
if (!instanceSliderReader)
|
||||
{
|
||||
instanceSliderReader = new SliderReader();
|
||||
}
|
||||
return instanceSliderReader;
|
||||
}
|
||||
|
||||
void SliderReader::setPropsFromJsonDictionary(Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
WidgetReader::setPropsFromJsonDictionary(widget, options);
|
||||
|
||||
|
||||
std::string jsonPath = GUIReader::getInstance()->getFilePath();
|
||||
|
||||
Slider* slider = static_cast<Slider*>(widget);
|
||||
|
||||
bool barTextureScale9Enable = DICTOOL->getBooleanValue_json(options, "barTextureScale9Enable");
|
||||
slider->setScale9Enabled(barTextureScale9Enable);
|
||||
bool bt = DICTOOL->checkObjectExist_json(options, "barFileName");
|
||||
float barLength = DICTOOL->getFloatValue_json(options, "length");
|
||||
if (bt)
|
||||
{
|
||||
if (barTextureScale9Enable)
|
||||
{
|
||||
|
||||
const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, "barFileNameData");
|
||||
int imageFileType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType");
|
||||
switch (imageFileType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_b = jsonPath;
|
||||
const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, "path");
|
||||
const char* imageFileName_tp = (imageFileName && (strcmp(imageFileName, "") != 0))?tp_b.append(imageFileName).c_str():nullptr;
|
||||
slider->loadBarTexture(imageFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, "path");
|
||||
slider->loadBarTexture(imageFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
slider->setSize(Size(barLength, slider->getContentSize().height));
|
||||
}
|
||||
else
|
||||
{
|
||||
const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, "barFileNameData");
|
||||
int imageFileType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType");
|
||||
switch (imageFileType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_b = jsonPath;
|
||||
const char*imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, "path");
|
||||
const char* imageFileName_tp = (imageFileName && (strcmp(imageFileName, "") != 0))?tp_b.append(imageFileName).c_str():nullptr;
|
||||
slider->loadBarTexture(imageFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char*imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, "path");
|
||||
slider->loadBarTexture(imageFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const rapidjson::Value& normalDic = DICTOOL->getSubDictionary_json(options, "ballNormalData");
|
||||
int normalType = DICTOOL->getIntValue_json(normalDic, "resourceType");
|
||||
switch (normalType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_n = jsonPath;
|
||||
const char* normalFileName = DICTOOL->getStringValue_json(normalDic, "path");
|
||||
const char* normalFileName_tp = (normalFileName && (strcmp(normalFileName, "") != 0))?tp_n.append(normalFileName).c_str():nullptr;
|
||||
slider->loadSlidBallTextureNormal(normalFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* normalFileName = DICTOOL->getStringValue_json(normalDic, "path");
|
||||
slider->loadSlidBallTextureNormal(normalFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
const rapidjson::Value& pressedDic = DICTOOL->getSubDictionary_json(options, "ballPressedData");
|
||||
int pressedType = DICTOOL->getIntValue_json(pressedDic, "resourceType");
|
||||
switch (pressedType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_p = jsonPath;
|
||||
const char* pressedFileName = DICTOOL->getStringValue_json(pressedDic, "path");
|
||||
const char* pressedFileName_tp = (pressedFileName && (strcmp(pressedFileName, "") != 0))?tp_p.append(pressedFileName).c_str():nullptr;
|
||||
slider->loadSlidBallTexturePressed(pressedFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* pressedFileName = DICTOOL->getStringValue_json(pressedDic, "path");
|
||||
slider->loadSlidBallTexturePressed(pressedFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
const rapidjson::Value& disabledDic = DICTOOL->getSubDictionary_json(options, "ballDisabledData");
|
||||
int disabledType = DICTOOL->getIntValue_json(disabledDic, "resourceType");
|
||||
switch (disabledType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_d = jsonPath;
|
||||
const char* disabledFileName = DICTOOL->getStringValue_json(disabledDic, "path");
|
||||
const char* disabledFileName_tp = (disabledFileName && (strcmp(disabledFileName, "") != 0))?tp_d.append(disabledFileName).c_str():nullptr;
|
||||
slider->loadSlidBallTextureDisabled(disabledFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* disabledFileName = DICTOOL->getStringValue_json(disabledDic, "path");
|
||||
slider->loadSlidBallTextureDisabled(disabledFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
slider->setPercent(DICTOOL->getIntValue_json(options, "percent"));
|
||||
|
||||
const rapidjson::Value& progressBarDic = DICTOOL->getSubDictionary_json(options, "progressBarData");
|
||||
int progressBarType = DICTOOL->getIntValue_json(progressBarDic, "resourceType");
|
||||
switch (progressBarType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_b = jsonPath;
|
||||
const char* imageFileName = DICTOOL->getStringValue_json(progressBarDic, "path");
|
||||
const char* imageFileName_tp = (imageFileName && (strcmp(imageFileName, "") != 0))?tp_b.append(imageFileName).c_str():nullptr;
|
||||
slider->loadProgressBarTexture(imageFileName_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
const char* imageFileName = DICTOOL->getStringValue_json(progressBarDic, "path");
|
||||
slider->loadProgressBarTexture(imageFileName,UI_TEX_TYPE_PLIST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__SliderReader__
|
||||
#define __TestCpp__SliderReader__
|
||||
|
||||
#include "../WidgetReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class SliderReader : public WidgetReader
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
SliderReader();
|
||||
virtual ~SliderReader();
|
||||
|
||||
static SliderReader* getInstance();
|
||||
static void purge();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__SliderReader__) */
|
|
@ -1,69 +0,0 @@
|
|||
|
||||
|
||||
#include "TextAtlasReader.h"
|
||||
#include "ui/UITextAtlas.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
static TextAtlasReader* instanceTextAtalsReader = NULL;
|
||||
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(TextAtlasReader)
|
||||
|
||||
TextAtlasReader::TextAtlasReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
TextAtlasReader::~TextAtlasReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
TextAtlasReader* TextAtlasReader::getInstance()
|
||||
{
|
||||
if (!instanceTextAtalsReader)
|
||||
{
|
||||
instanceTextAtalsReader = new TextAtlasReader();
|
||||
}
|
||||
return instanceTextAtalsReader;
|
||||
}
|
||||
|
||||
void TextAtlasReader::setPropsFromJsonDictionary(Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
WidgetReader::setPropsFromJsonDictionary(widget, options);
|
||||
|
||||
|
||||
std::string jsonPath = GUIReader::getInstance()->getFilePath();
|
||||
|
||||
TextAtlas* labelAtlas = static_cast<TextAtlas*>(widget);
|
||||
bool sv = DICTOOL->checkObjectExist_json(options, "stringValue");
|
||||
bool cmf = DICTOOL->checkObjectExist_json(options, "charMapFile");
|
||||
bool iw = DICTOOL->checkObjectExist_json(options, "itemWidth");
|
||||
bool ih = DICTOOL->checkObjectExist_json(options, "itemHeight");
|
||||
bool scm = DICTOOL->checkObjectExist_json(options, "startCharMap");
|
||||
if (sv && cmf && iw && ih && scm)
|
||||
{
|
||||
const rapidjson::Value& cmftDic = DICTOOL->getSubDictionary_json(options, "charMapFileData");
|
||||
int cmfType = DICTOOL->getIntValue_json(cmftDic, "resourceType");
|
||||
switch (cmfType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_c = jsonPath;
|
||||
const char* cmfPath = DICTOOL->getStringValue_json(cmftDic, "path");
|
||||
const char* cmf_tp = tp_c.append(cmfPath).c_str();
|
||||
labelAtlas->setProperty(DICTOOL->getStringValue_json(options, "stringValue"),cmf_tp,DICTOOL->getIntValue_json(options, "itemWidth"),DICTOOL->getIntValue_json(options,"itemHeight"), DICTOOL->getStringValue_json(options, "startCharMap"));
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
CCLOG("Wrong res type of LabelAtlas!");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__TextAtlasReader__
|
||||
#define __TestCpp__TextAtlasReader__
|
||||
|
||||
#include "../WidgetReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class TextAtlasReader : public WidgetReader
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
TextAtlasReader();
|
||||
virtual ~TextAtlasReader();
|
||||
|
||||
static TextAtlasReader* getInstance();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__TextAtlasReader__) */
|
|
@ -1,65 +0,0 @@
|
|||
|
||||
|
||||
#include "TextBMFontReader.h"
|
||||
#include "ui/UITextBMFont.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
static TextBMFontReader* instanceTextBMFontReader = NULL;
|
||||
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(TextBMFontReader)
|
||||
|
||||
TextBMFontReader::TextBMFontReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
TextBMFontReader::~TextBMFontReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
TextBMFontReader* TextBMFontReader::getInstance()
|
||||
{
|
||||
if (!instanceTextBMFontReader)
|
||||
{
|
||||
instanceTextBMFontReader = new TextBMFontReader();
|
||||
}
|
||||
return instanceTextBMFontReader;
|
||||
}
|
||||
|
||||
void TextBMFontReader::setPropsFromJsonDictionary(Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
WidgetReader::setPropsFromJsonDictionary(widget, options);
|
||||
|
||||
|
||||
std::string jsonPath = GUIReader::getInstance()->getFilePath();
|
||||
|
||||
TextBMFont* labelBMFont = static_cast<TextBMFont*>(widget);
|
||||
|
||||
const rapidjson::Value& cmftDic = DICTOOL->getSubDictionary_json(options, "fileNameData");
|
||||
int cmfType = DICTOOL->getIntValue_json(cmftDic, "resourceType");
|
||||
switch (cmfType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
std::string tp_c = jsonPath;
|
||||
const char* cmfPath = DICTOOL->getStringValue_json(cmftDic, "path");
|
||||
const char* cmf_tp = tp_c.append(cmfPath).c_str();
|
||||
labelBMFont->setFntFile(cmf_tp);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
CCLOG("Wrong res type of LabelAtlas!");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
const char* text = DICTOOL->getStringValue_json(options, "text");
|
||||
labelBMFont->setText(text);
|
||||
|
||||
|
||||
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__TextBMFontReader__
|
||||
#define __TestCpp__TextBMFontReader__
|
||||
|
||||
#include "../WidgetReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class TextBMFontReader : public WidgetReader
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
TextBMFontReader();
|
||||
virtual ~TextBMFontReader();
|
||||
|
||||
static TextBMFontReader* getInstance();
|
||||
static void purge();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__TextBMFontReader__) */
|
|
@ -1,84 +0,0 @@
|
|||
|
||||
|
||||
#include "TextFieldReader.h"
|
||||
#include "ui/UITextField.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
static TextFieldReader* instanceTextFieldReader = NULL;
|
||||
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(TextFieldReader)
|
||||
|
||||
TextFieldReader::TextFieldReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
TextFieldReader::~TextFieldReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
TextFieldReader* TextFieldReader::getInstance()
|
||||
{
|
||||
if (!instanceTextFieldReader)
|
||||
{
|
||||
instanceTextFieldReader = new TextFieldReader();
|
||||
}
|
||||
return instanceTextFieldReader;
|
||||
}
|
||||
|
||||
void TextFieldReader::setPropsFromJsonDictionary(Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
WidgetReader::setPropsFromJsonDictionary(widget, options);
|
||||
|
||||
|
||||
TextField* textField = static_cast<TextField*>(widget);
|
||||
bool ph = DICTOOL->checkObjectExist_json(options, "placeHolder");
|
||||
if (ph)
|
||||
{
|
||||
textField->setPlaceHolder(DICTOOL->getStringValue_json(options, "placeHolder"));
|
||||
}
|
||||
textField->setText(DICTOOL->getStringValue_json(options, "text"));
|
||||
bool fs = DICTOOL->checkObjectExist_json(options, "fontSize");
|
||||
if (fs)
|
||||
{
|
||||
textField->setFontSize(DICTOOL->getIntValue_json(options, "fontSize"));
|
||||
}
|
||||
bool fn = DICTOOL->checkObjectExist_json(options, "fontName");
|
||||
if (fn)
|
||||
{
|
||||
textField->setFontName(DICTOOL->getStringValue_json(options, "fontName"));
|
||||
}
|
||||
bool tsw = DICTOOL->checkObjectExist_json(options, "touchSizeWidth");
|
||||
bool tsh = DICTOOL->checkObjectExist_json(options, "touchSizeHeight");
|
||||
if (tsw && tsh)
|
||||
{
|
||||
textField->setTouchSize(Size(DICTOOL->getFloatValue_json(options, "touchSizeWidth"), DICTOOL->getFloatValue_json(options,"touchSizeHeight")));
|
||||
}
|
||||
|
||||
float dw = DICTOOL->getFloatValue_json(options, "width");
|
||||
float dh = DICTOOL->getFloatValue_json(options, "height");
|
||||
if (dw > 0.0f || dh > 0.0f)
|
||||
{
|
||||
//textField->setSize(Size(dw, dh));
|
||||
}
|
||||
bool maxLengthEnable = DICTOOL->getBooleanValue_json(options, "maxLengthEnable");
|
||||
textField->setMaxLengthEnabled(maxLengthEnable);
|
||||
|
||||
if (maxLengthEnable)
|
||||
{
|
||||
int maxLength = DICTOOL->getIntValue_json(options, "maxLength");
|
||||
textField->setMaxLength(maxLength);
|
||||
}
|
||||
bool passwordEnable = DICTOOL->getBooleanValue_json(options, "passwordEnable");
|
||||
textField->setPasswordEnabled(passwordEnable);
|
||||
if (passwordEnable)
|
||||
{
|
||||
textField->setPasswordStyleText(DICTOOL->getStringValue_json(options, "passwordStyleText"));
|
||||
}
|
||||
|
||||
|
||||
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__TextFieldReader__
|
||||
#define __TestCpp__TextFieldReader__
|
||||
|
||||
#include "../WidgetReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class TextFieldReader : public WidgetReader
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
TextFieldReader();
|
||||
virtual ~TextFieldReader();
|
||||
|
||||
static TextFieldReader* getInstance();
|
||||
static void purge();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__TextFieldReader__) */
|
|
@ -1,74 +0,0 @@
|
|||
|
||||
|
||||
#include "TextReader.h"
|
||||
#include "ui/UIText.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
static TextReader* instanceTextReader = NULL;
|
||||
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(TextReader)
|
||||
|
||||
TextReader::TextReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
TextReader::~TextReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
TextReader* TextReader::getInstance()
|
||||
{
|
||||
if (!instanceTextReader)
|
||||
{
|
||||
instanceTextReader = new TextReader();
|
||||
}
|
||||
return instanceTextReader;
|
||||
}
|
||||
|
||||
void TextReader::setPropsFromJsonDictionary(Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
WidgetReader::setPropsFromJsonDictionary(widget, options);
|
||||
|
||||
|
||||
std::string jsonPath = GUIReader::getInstance()->getFilePath();
|
||||
|
||||
Text* label = static_cast<Text*>(widget);
|
||||
bool touchScaleChangeAble = DICTOOL->getBooleanValue_json(options, "touchScaleEnable");
|
||||
label->setTouchScaleChangeEnabled(touchScaleChangeAble);
|
||||
const char* text = DICTOOL->getStringValue_json(options, "text");
|
||||
label->setText(text);
|
||||
bool fs = DICTOOL->checkObjectExist_json(options, "fontSize");
|
||||
if (fs)
|
||||
{
|
||||
label->setFontSize(DICTOOL->getIntValue_json(options, "fontSize"));
|
||||
}
|
||||
bool fn = DICTOOL->checkObjectExist_json(options, "fontName");
|
||||
if (fn)
|
||||
{
|
||||
label->setFontName(DICTOOL->getStringValue_json(options, "fontName"));
|
||||
}
|
||||
bool aw = DICTOOL->checkObjectExist_json(options, "areaWidth");
|
||||
bool ah = DICTOOL->checkObjectExist_json(options, "areaHeight");
|
||||
if (aw && ah)
|
||||
{
|
||||
Size size = Size(DICTOOL->getFloatValue_json(options, "areaWidth"),DICTOOL->getFloatValue_json(options,"areaHeight"));
|
||||
label->setTextAreaSize(size);
|
||||
}
|
||||
bool ha = DICTOOL->checkObjectExist_json(options, "hAlignment");
|
||||
if (ha)
|
||||
{
|
||||
label->setTextHorizontalAlignment((TextHAlignment)DICTOOL->getIntValue_json(options, "hAlignment"));
|
||||
}
|
||||
bool va = DICTOOL->checkObjectExist_json(options, "vAlignment");
|
||||
if (va)
|
||||
{
|
||||
label->setTextVerticalAlignment((TextVAlignment)DICTOOL->getIntValue_json(options, "vAlignment"));
|
||||
}
|
||||
|
||||
|
||||
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__TextReader__
|
||||
#define __TestCpp__TextReader__
|
||||
|
||||
#include "../WidgetReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class TextReader : public WidgetReader
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
TextReader();
|
||||
virtual ~TextReader();
|
||||
|
||||
static TextReader* getInstance();
|
||||
static void purge();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__TextReader__) */
|
|
@ -1,173 +0,0 @@
|
|||
|
||||
|
||||
#include "WidgetReader.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
using namespace cocos2d::ui;
|
||||
static WidgetReader* instanceWidgetReader = NULL;
|
||||
|
||||
IMPLEMENT_CLASS_WIDGET_READER_INFO(WidgetReader)
|
||||
|
||||
WidgetReader::WidgetReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
WidgetReader::~WidgetReader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
WidgetReader* WidgetReader::getInstance()
|
||||
{
|
||||
if (!instanceWidgetReader)
|
||||
{
|
||||
instanceWidgetReader = new WidgetReader();
|
||||
}
|
||||
return instanceWidgetReader;
|
||||
}
|
||||
|
||||
void WidgetReader::purge()
|
||||
{
|
||||
CC_SAFE_DELETE(instanceWidgetReader);
|
||||
}
|
||||
|
||||
void WidgetReader::setPropsFromJsonDictionary(cocos2d::ui::Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
bool ignoreSizeExsit = DICTOOL->checkObjectExist_json(options, "ignoreSize");
|
||||
if (ignoreSizeExsit)
|
||||
{
|
||||
widget->ignoreContentAdaptWithSize(DICTOOL->getBooleanValue_json(options, "ignoreSize"));
|
||||
}
|
||||
|
||||
widget->setSizeType((SizeType)DICTOOL->getIntValue_json(options, "sizeType"));
|
||||
widget->setPositionType((PositionType)DICTOOL->getIntValue_json(options, "positionType"));
|
||||
|
||||
widget->setSizePercent(Point(DICTOOL->getFloatValue_json(options, "sizePercentX"), DICTOOL->getFloatValue_json(options, "sizePercentY")));
|
||||
widget->setPositionPercent(Point(DICTOOL->getFloatValue_json(options, "positionPercentX"), DICTOOL->getFloatValue_json(options, "positionPercentY")));
|
||||
|
||||
/* adapt screen */
|
||||
float w = 0, h = 0;
|
||||
bool adaptScrenn = DICTOOL->getBooleanValue_json(options, "adaptScreen");
|
||||
if (adaptScrenn)
|
||||
{
|
||||
Size screenSize = CCDirector::getInstance()->getWinSize();
|
||||
w = screenSize.width;
|
||||
h = screenSize.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
w = DICTOOL->getFloatValue_json(options, "width");
|
||||
h = DICTOOL->getFloatValue_json(options, "height");
|
||||
}
|
||||
widget->setSize(Size(w, h));
|
||||
// before
|
||||
/*
|
||||
float w = DICTOOL->getFloatValue_json(options, "width");
|
||||
float h = DICTOOL->getFloatValue_json(options, "height");
|
||||
widget->setSize(CCSizeMake(w, h));
|
||||
*/
|
||||
/**/
|
||||
|
||||
widget->setTag(DICTOOL->getIntValue_json(options, "tag"));
|
||||
widget->setActionTag(DICTOOL->getIntValue_json(options, "actiontag"));
|
||||
widget->setTouchEnabled(DICTOOL->getBooleanValue_json(options, "touchAble"));
|
||||
const char* name = DICTOOL->getStringValue_json(options, "name");
|
||||
const char* widgetName = name?name:"default";
|
||||
widget->setName(widgetName);
|
||||
float x = DICTOOL->getFloatValue_json(options, "x");
|
||||
float y = DICTOOL->getFloatValue_json(options, "y");
|
||||
widget->setPosition(Point(x,y));
|
||||
bool sx = DICTOOL->checkObjectExist_json(options, "scaleX");
|
||||
if (sx)
|
||||
{
|
||||
widget->setScaleX(DICTOOL->getFloatValue_json(options, "scaleX"));
|
||||
}
|
||||
bool sy = DICTOOL->checkObjectExist_json(options, "scaleY");
|
||||
if (sy)
|
||||
{
|
||||
widget->setScaleY(DICTOOL->getFloatValue_json(options, "scaleY"));
|
||||
}
|
||||
bool rt = DICTOOL->checkObjectExist_json(options, "rotation");
|
||||
if (rt)
|
||||
{
|
||||
widget->setRotation(DICTOOL->getFloatValue_json(options, "rotation"));
|
||||
}
|
||||
bool vb = DICTOOL->checkObjectExist_json(options, "visible");
|
||||
if (vb)
|
||||
{
|
||||
widget->setVisible(DICTOOL->getBooleanValue_json(options, "visible"));
|
||||
}
|
||||
int z = DICTOOL->getIntValue_json(options, "ZOrder");
|
||||
widget->setLocalZOrder(z);
|
||||
|
||||
bool layout = DICTOOL->checkObjectExist_json(options, "layoutParameter");
|
||||
if (layout)
|
||||
{
|
||||
const rapidjson::Value& layoutParameterDic = DICTOOL->getSubDictionary_json(options, "layoutParameter");
|
||||
int paramType = DICTOOL->getIntValue_json(layoutParameterDic, "type");
|
||||
LayoutParameter* parameter = nullptr;
|
||||
switch (paramType)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
parameter = LinearLayoutParameter::create();
|
||||
int gravity = DICTOOL->getIntValue_json(layoutParameterDic, "gravity");
|
||||
((LinearLayoutParameter*)parameter)->setGravity((LinearGravity)gravity);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
parameter = RelativeLayoutParameter::create();
|
||||
RelativeLayoutParameter* rParameter = (RelativeLayoutParameter*)parameter;
|
||||
const char* relativeName = DICTOOL->getStringValue_json(layoutParameterDic, "relativeName");
|
||||
rParameter->setRelativeName(relativeName);
|
||||
const char* relativeToName = DICTOOL->getStringValue_json(layoutParameterDic, "relativeToName");
|
||||
rParameter->setRelativeToWidgetName(relativeToName);
|
||||
int align = DICTOOL->getIntValue_json(layoutParameterDic, "align");
|
||||
rParameter->setAlign((RelativeAlign)align);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (parameter)
|
||||
{
|
||||
float mgl = DICTOOL->getFloatValue_json(layoutParameterDic, "marginLeft");
|
||||
float mgt = DICTOOL->getFloatValue_json(layoutParameterDic, "marginTop");
|
||||
float mgr = DICTOOL->getFloatValue_json(layoutParameterDic, "marginRight");
|
||||
float mgb = DICTOOL->getFloatValue_json(layoutParameterDic, "marginDown");
|
||||
parameter->setMargin(Margin(mgl, mgt, mgr, mgb));
|
||||
widget->setLayoutParameter(parameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WidgetReader::setColorPropsFromJsonDictionary(ui::Widget *widget, const rapidjson::Value &options)
|
||||
{
|
||||
bool op = DICTOOL->checkObjectExist_json(options, "opacity");
|
||||
if (op)
|
||||
{
|
||||
widget->setOpacity(DICTOOL->getIntValue_json(options, "opacity"));
|
||||
}
|
||||
bool cr = DICTOOL->checkObjectExist_json(options, "colorR");
|
||||
bool cg = DICTOOL->checkObjectExist_json(options, "colorG");
|
||||
bool cb = DICTOOL->checkObjectExist_json(options, "colorB");
|
||||
int colorR = cr ? DICTOOL->getIntValue_json(options, "colorR") : 255;
|
||||
int colorG = cg ? DICTOOL->getIntValue_json(options, "colorG") : 255;
|
||||
int colorB = cb ? DICTOOL->getIntValue_json(options, "colorB") : 255;
|
||||
widget->setColor(Color3B(colorR, colorG, colorB));
|
||||
bool apx = DICTOOL->checkObjectExist_json(options, "anchorPointX");
|
||||
float apxf = apx ? DICTOOL->getFloatValue_json(options, "anchorPointX") : ((widget->getWidgetType() == WidgetTypeWidget) ? 0.5f : 0.0f);
|
||||
bool apy = DICTOOL->checkObjectExist_json(options, "anchorPointY");
|
||||
float apyf = apy ? DICTOOL->getFloatValue_json(options, "anchorPointY") : ((widget->getWidgetType() == WidgetTypeWidget) ? 0.5f : 0.0f);
|
||||
widget->setAnchorPoint(Point(apxf, apyf));
|
||||
bool flipX = DICTOOL->getBooleanValue_json(options, "flipX");
|
||||
bool flipY = DICTOOL->getBooleanValue_json(options, "flipY");
|
||||
widget->setFlipX(flipX);
|
||||
widget->setFlipY(flipY);
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__WidgetReader__
|
||||
#define __TestCpp__WidgetReader__
|
||||
|
||||
#include "WidgetReaderProtocol.h"
|
||||
#include "CCSGUIReader.h"
|
||||
#include "ui/GUIDefine.h"
|
||||
#include "ui/UIWidget.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class WidgetReader : public Object, public WidgetReaderProtocol
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS_WIDGET_READER_INFO
|
||||
|
||||
WidgetReader();
|
||||
virtual ~WidgetReader();
|
||||
|
||||
static WidgetReader* getInstance();
|
||||
static void purge();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
virtual void setColorPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__WidgetReader__) */
|
|
@ -1,53 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TestCpp__WidgetReaderProtocol__
|
||||
#define __TestCpp__WidgetReaderProtocol__
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include "cocostudio/DictionaryHelper.h"
|
||||
|
||||
namespace cocos2d
|
||||
{
|
||||
namespace ui
|
||||
{
|
||||
class Widget;
|
||||
}
|
||||
}
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace cocos2d::ui;
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class WidgetReaderProtocol
|
||||
{
|
||||
public:
|
||||
virtual ~WidgetReaderProtocol() {};
|
||||
|
||||
virtual void setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options) = 0;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(__TestCpp__WidgetReaderProtocol__) */
|
|
@ -102,6 +102,7 @@ Control::~Control()
|
|||
|
||||
void Control::sendActionsForControlEvents(EventType controlEvents)
|
||||
{
|
||||
retain();
|
||||
// For each control events
|
||||
for (int i = 0; i < kControlEventTotalNumber; i++)
|
||||
{
|
||||
|
@ -126,6 +127,7 @@ void Control::sendActionsForControlEvents(EventType controlEvents)
|
|||
#endif
|
||||
}
|
||||
}
|
||||
release();
|
||||
}
|
||||
void Control::addTargetWithActionForControlEvents(Ref* target, Handler action, EventType controlEvents)
|
||||
{
|
||||
|
|
|
@ -1 +1 @@
|
|||
9f3063090daa92453372f232d777b4b625e31f98
|
||||
879acef60464ae6a0af99e8e5d809245f8cdbe56
|
|
@ -57,7 +57,6 @@ static std::function<Layer*()> createFunctions[] =
|
|||
CL(Test4),
|
||||
CL(Test5),
|
||||
CL(Test6),
|
||||
CL(NodeEnumChildByNameTest),
|
||||
CL(StressTest1),
|
||||
CL(StressTest2),
|
||||
CL(NodeToWorld),
|
||||
|
@ -353,64 +352,6 @@ std::string Test6::subtitle() const
|
|||
return "remove/cleanup with children";
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
//
|
||||
// NodeEnumChildByNameTest
|
||||
//
|
||||
//------------------------------------------------------------------
|
||||
void NodeEnumChildByNameTest::onEnter()
|
||||
{
|
||||
TestCocosNodeDemo::onEnter();
|
||||
auto sp10 = Sprite::create(s_pathSister1);
|
||||
auto sp11 = Sprite::create(s_pathSister1);
|
||||
auto sp12 = Sprite::create(s_pathSister1);
|
||||
auto sp20 = Sprite::create(s_pathSister2);
|
||||
auto sp21 = Sprite::create(s_pathSister2);
|
||||
auto sp22 = Sprite::create(s_pathSister2);
|
||||
|
||||
sp10->setPosition(Point(100,60));
|
||||
sp11->setPosition(Point(100,160));
|
||||
sp12->setPosition(Point(100,260));
|
||||
sp20->setPosition(Point(380,60));
|
||||
sp21->setPosition(Point(380,160));
|
||||
sp22->setPosition(Point(380,260));
|
||||
|
||||
sp10->setName("sister1");
|
||||
sp11->setName("sister1");
|
||||
sp12->setName("sister1");
|
||||
sp20->setName("sister2");
|
||||
sp21->setName("sister2");
|
||||
sp22->setName("sister2");
|
||||
|
||||
addChild(sp10);
|
||||
addChild(sp11);
|
||||
addChild(sp12);
|
||||
addChild(sp20);
|
||||
addChild(sp21);
|
||||
addChild(sp22);
|
||||
|
||||
enumerateChildrenByName("sister1",
|
||||
[](Node* node, bool* stop)
|
||||
{
|
||||
auto rot = RotateBy::create(2, 360);
|
||||
auto rot_back = rot->reverse();
|
||||
auto forever1 = RepeatForever::create(Sequence::create(rot, rot_back, NULL));
|
||||
node->runAction(forever1);
|
||||
});
|
||||
enumerateChildrenByName("sister2",
|
||||
[](Node* node, bool* stop)
|
||||
{
|
||||
auto actionUp = JumpBy::create(2, Point(0,0), 80, 4);
|
||||
auto forever2 = RepeatForever::create(Sequence::create(actionUp, NULL));
|
||||
node->runAction(forever2);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
std::string NodeEnumChildByNameTest::subtitle() const
|
||||
{
|
||||
return "Enum child nodes by name";
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
//
|
||||
|
|
|
@ -263,14 +263,6 @@ protected:
|
|||
Sprite *_sprite;
|
||||
};
|
||||
|
||||
class NodeEnumChildByNameTest : public TestCocosNodeDemo
|
||||
{
|
||||
public:
|
||||
CREATE_FUNC(NodeEnumChildByNameTest);
|
||||
virtual void onEnter() override;
|
||||
virtual std::string subtitle() const override;
|
||||
};
|
||||
|
||||
class CocosNodeTestScene : public TestScene
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue