mirror of https://github.com/axmolengine/axmol.git
commit
1cbe2ec840
3
AUTHORS
3
AUTHORS
|
@ -678,6 +678,9 @@ Developers:
|
|||
seobyeongky
|
||||
Updates spine runtime.
|
||||
|
||||
luocker
|
||||
Fix a bug that string itself is also modified in `String::componentsSeparatedByString`.
|
||||
|
||||
Retired Core Developers:
|
||||
WenSheng Yang
|
||||
Author of windows port, CCTextField,
|
||||
|
|
|
@ -15,6 +15,7 @@ cocos2d-x-3.0beta0 ?? 2013
|
|||
[FIX] LabelBMFont string can't be shown integrally.
|
||||
[FIX] Deprecates FileUtils::getFileData, adds FileUtils::getStringFromFile/getDataFromFile.
|
||||
[FIX] GUI refactoring: Removes UI prefix, Widget is inherited from Node, uses new containers(Vector<T>, Map<K,V>).
|
||||
[FIX] String itself is also modified in `String::componentsSeparatedByString`.
|
||||
[Android]
|
||||
[NEW] build/android-build.sh: add supporting to generate .apk file
|
||||
[FIX] XMLHttpRequest receives wrong binary array.
|
||||
|
|
|
@ -1076,6 +1076,8 @@ void DisplayLinkDirector::startAnimation()
|
|||
}
|
||||
|
||||
_invalid = false;
|
||||
|
||||
Application::getInstance()->setAnimationInterval(_animationInterval);
|
||||
}
|
||||
|
||||
void DisplayLinkDirector::mainLoop()
|
||||
|
|
|
@ -185,6 +185,11 @@ void ShaderCache::reloadDefaultShaders()
|
|||
p->reset();
|
||||
loadDefaultShader(p, kShaderType_PositionTextureColor);
|
||||
|
||||
// Position Texture Color without MVP shader
|
||||
p = getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP);
|
||||
p->reset();
|
||||
loadDefaultShader(p, kShaderType_PositionTextureColor_noMVP);
|
||||
|
||||
// Position Texture Color alpha test
|
||||
p = getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST);
|
||||
p->reset();
|
||||
|
|
|
@ -204,7 +204,7 @@ protected:
|
|||
ValueMap _properties;
|
||||
|
||||
//! tile properties
|
||||
IntValueMap _tileProperties;
|
||||
ValueMapIntKey _tileProperties;
|
||||
|
||||
private:
|
||||
CC_DISALLOW_COPY_AND_ASSIGN(TMXTiledMap);
|
||||
|
|
|
@ -536,7 +536,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
|||
}
|
||||
else if ( tmxMapInfo->getParentElement() == TMXPropertyTile )
|
||||
{
|
||||
IntValueMap& dict = tmxMapInfo->getTileProperties().at(tmxMapInfo->getParentGID()).asIntKeyMap();
|
||||
ValueMapIntKey& dict = tmxMapInfo->getTileProperties().at(tmxMapInfo->getParentGID()).asIntKeyMap();
|
||||
|
||||
int propertyName = attributeDict["name"].asInt();
|
||||
dict[propertyName] = attributeDict["value"];
|
||||
|
|
|
@ -195,8 +195,8 @@ public:
|
|||
/* initializes parsing of an XML string, either a tmx (Map) string or tsx (Tileset) string */
|
||||
bool parseXMLString(const std::string& xmlString);
|
||||
|
||||
IntValueMap& getTileProperties() { return _tileProperties; };
|
||||
void setTileProperties(const IntValueMap& tileProperties) {
|
||||
ValueMapIntKey& getTileProperties() { return _tileProperties; };
|
||||
void setTileProperties(const ValueMapIntKey& tileProperties) {
|
||||
_tileProperties = tileProperties;
|
||||
};
|
||||
|
||||
|
@ -311,7 +311,7 @@ protected:
|
|||
//! current string
|
||||
std::string _currentString;
|
||||
//! tile properties
|
||||
IntValueMap _tileProperties;
|
||||
ValueMapIntKey _tileProperties;
|
||||
unsigned int _currentFirstGID;
|
||||
};
|
||||
|
||||
|
|
|
@ -65,11 +65,14 @@ Renderer::~Renderer()
|
|||
glDeleteVertexArrays(1, &_quadVAO);
|
||||
GL::bindVAO(0);
|
||||
}
|
||||
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||
NotificationCenter::getInstance()->removeObserver(this, EVNET_COME_TO_FOREGROUND);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Renderer::initGLView()
|
||||
{
|
||||
#if 0//CC_ENABLE_CACHE_TEXTURE_DATA
|
||||
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||
// listen the event when app go to background
|
||||
NotificationCenter::getInstance()->addObserver(this,
|
||||
callfuncO_selector(Renderer::onBackToForeground),
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#define __CCMAP_H__
|
||||
|
||||
#include "ccMacros.h"
|
||||
|
||||
#include "CCObject.h"
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
|
@ -62,6 +62,7 @@ public:
|
|||
Map<K, V>()
|
||||
: _data()
|
||||
{
|
||||
static_assert(std::is_convertible<V, Object*>::value, "Invalid Type for cocos2d::Map<K, V>!");
|
||||
CCLOGINFO("In the default constructor of Map!");
|
||||
}
|
||||
|
||||
|
@ -69,6 +70,7 @@ public:
|
|||
explicit Map<K, V>(ssize_t capacity)
|
||||
: _data()
|
||||
{
|
||||
static_assert(std::is_convertible<V, Object*>::value, "Invalid Type for cocos2d::Map<K, V>!");
|
||||
CCLOGINFO("In the constructor with capacity of Map!");
|
||||
_data.reserve(capacity);
|
||||
}
|
||||
|
@ -76,6 +78,7 @@ public:
|
|||
/** Copy constructor */
|
||||
Map<K, V>(const Map<K, V>& other)
|
||||
{
|
||||
static_assert(std::is_convertible<V, Object*>::value, "Invalid Type for cocos2d::Map<K, V>!");
|
||||
CCLOGINFO("In the copy constructor of Map!");
|
||||
_data = other._data;
|
||||
addRefForAllObjects();
|
||||
|
@ -84,6 +87,7 @@ public:
|
|||
/** Move constructor */
|
||||
Map<K, V>(Map<K, V>&& other)
|
||||
{
|
||||
static_assert(std::is_convertible<V, Object*>::value, "Invalid Type for cocos2d::Map<K, V>!");
|
||||
CCLOGINFO("In the move constructor of Map!");
|
||||
_data = std::move(other._data);
|
||||
}
|
||||
|
|
|
@ -181,20 +181,20 @@ void __String::appendWithFormat(const char* format, ...)
|
|||
__Array* __String::componentsSeparatedByString(const char *delimiter)
|
||||
{
|
||||
__Array* result = __Array::create();
|
||||
|
||||
std::string strTmp = _string;
|
||||
size_t cutAt;
|
||||
while( (cutAt = _string.find_first_of(delimiter)) != _string.npos )
|
||||
while( (cutAt = strTmp.find_first_of(delimiter)) != strTmp.npos )
|
||||
{
|
||||
if(cutAt > 0)
|
||||
{
|
||||
result->addObject(__String::create(_string.substr(0, cutAt)));
|
||||
result->addObject(__String::create(strTmp.substr(0, cutAt)));
|
||||
}
|
||||
_string = _string.substr(cutAt + 1);
|
||||
strTmp = strTmp.substr(cutAt + 1);
|
||||
}
|
||||
|
||||
if(_string.length() > 0)
|
||||
if(strTmp.length() > 0)
|
||||
{
|
||||
result->addObject(__String::create(_string));
|
||||
result->addObject(__String::create(strTmp));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -32,7 +32,7 @@ const Value Value::Null;
|
|||
Value::Value()
|
||||
: _vectorData(new ValueVector())
|
||||
, _mapData(new ValueMap())
|
||||
, _intKeyMapData(new IntValueMap())
|
||||
, _intKeyMapData(new ValueMapIntKey())
|
||||
, _type(Type::NONE)
|
||||
{
|
||||
|
||||
|
@ -137,19 +137,19 @@ Value::Value(ValueMap&& v)
|
|||
*_mapData = std::move(v);
|
||||
}
|
||||
|
||||
Value::Value(const IntValueMap& v)
|
||||
Value::Value(const ValueMapIntKey& v)
|
||||
: _vectorData(nullptr)
|
||||
, _mapData(nullptr)
|
||||
, _intKeyMapData(new IntValueMap())
|
||||
, _intKeyMapData(new ValueMapIntKey())
|
||||
, _type(Type::INT_KEY_MAP)
|
||||
{
|
||||
*_intKeyMapData = v;
|
||||
}
|
||||
|
||||
Value::Value(IntValueMap&& v)
|
||||
Value::Value(ValueMapIntKey&& v)
|
||||
: _vectorData(nullptr)
|
||||
, _mapData(nullptr)
|
||||
, _intKeyMapData(new IntValueMap())
|
||||
, _intKeyMapData(new ValueMapIntKey())
|
||||
, _type(Type::INT_KEY_MAP)
|
||||
{
|
||||
*_intKeyMapData = std::move(v);
|
||||
|
@ -209,7 +209,7 @@ Value& Value::operator= (const Value& other)
|
|||
break;
|
||||
case Type::INT_KEY_MAP:
|
||||
if (_intKeyMapData == nullptr)
|
||||
_intKeyMapData = new IntValueMap();
|
||||
_intKeyMapData = new ValueMapIntKey();
|
||||
*_intKeyMapData = *other._intKeyMapData;
|
||||
break;
|
||||
default:
|
||||
|
@ -357,20 +357,20 @@ Value& Value::operator= (ValueMap&& v)
|
|||
return *this;
|
||||
}
|
||||
|
||||
Value& Value::operator= (const IntValueMap& v)
|
||||
Value& Value::operator= (const ValueMapIntKey& v)
|
||||
{
|
||||
clear();
|
||||
_type = Type::INT_KEY_MAP;
|
||||
_intKeyMapData = new IntValueMap();
|
||||
_intKeyMapData = new ValueMapIntKey();
|
||||
*_intKeyMapData = v;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Value& Value::operator= (IntValueMap&& v)
|
||||
Value& Value::operator= (ValueMapIntKey&& v)
|
||||
{
|
||||
clear();
|
||||
_type = Type::INT_KEY_MAP;
|
||||
_intKeyMapData = new IntValueMap();
|
||||
_intKeyMapData = new ValueMapIntKey();
|
||||
*_intKeyMapData = std::move(v);
|
||||
return *this;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ class Value;
|
|||
|
||||
typedef std::vector<Value> ValueVector;
|
||||
typedef std::unordered_map<std::string, Value> ValueMap;
|
||||
typedef std::unordered_map<int, Value> IntValueMap;
|
||||
typedef std::unordered_map<int, Value> ValueMapIntKey;
|
||||
|
||||
class Value
|
||||
{
|
||||
|
@ -59,8 +59,8 @@ public:
|
|||
explicit Value(const ValueMap& v);
|
||||
explicit Value(ValueMap&& v);
|
||||
|
||||
explicit Value(const IntValueMap& v);
|
||||
explicit Value(IntValueMap&& v);
|
||||
explicit Value(const ValueMapIntKey& v);
|
||||
explicit Value(ValueMapIntKey&& v);
|
||||
|
||||
Value(const Value& other);
|
||||
Value(Value&& other);
|
||||
|
@ -84,8 +84,8 @@ public:
|
|||
Value& operator= (const ValueMap& v);
|
||||
Value& operator= (ValueMap&& v);
|
||||
|
||||
Value& operator= (const IntValueMap& v);
|
||||
Value& operator= (IntValueMap&& v);
|
||||
Value& operator= (const ValueMapIntKey& v);
|
||||
Value& operator= (ValueMapIntKey&& v);
|
||||
|
||||
unsigned char asByte() const;
|
||||
int asInt() const;
|
||||
|
@ -100,8 +100,8 @@ public:
|
|||
inline ValueMap& asValueMap() { return *_mapData; }
|
||||
inline const ValueMap& asValueMap() const { return *_mapData; }
|
||||
|
||||
inline IntValueMap& asIntKeyMap() { return *_intKeyMapData; }
|
||||
inline const IntValueMap& asIntKeyMap() const { return *_intKeyMapData; }
|
||||
inline ValueMapIntKey& asIntKeyMap() { return *_intKeyMapData; }
|
||||
inline const ValueMapIntKey& asIntKeyMap() const { return *_intKeyMapData; }
|
||||
|
||||
inline bool isNull() const { return _type == Type::NONE; }
|
||||
|
||||
|
@ -138,7 +138,7 @@ private:
|
|||
std::string _strData;
|
||||
ValueVector* _vectorData;
|
||||
ValueMap* _mapData;
|
||||
IntValueMap* _intKeyMapData;
|
||||
ValueMapIntKey* _intKeyMapData;
|
||||
|
||||
Type _type;
|
||||
};
|
||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
|||
#define __CCVECTOR_H__
|
||||
|
||||
#include "ccMacros.h"
|
||||
|
||||
#include "CCObject.h"
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <algorithm> // for std::find
|
||||
|
@ -68,13 +68,14 @@ public:
|
|||
Vector<T>()
|
||||
: _data()
|
||||
{
|
||||
|
||||
static_assert(std::is_convertible<T, Object*>::value, "Invalid Type for cocos2d::Vector<T>!");
|
||||
}
|
||||
|
||||
/** Constructor with a capacity */
|
||||
explicit Vector<T>(ssize_t capacity)
|
||||
: _data()
|
||||
{
|
||||
static_assert(std::is_convertible<T, Object*>::value, "Invalid Type for cocos2d::Vector<T>!");
|
||||
CCLOGINFO("In the default constructor with capacity of Vector.");
|
||||
reserve(capacity);
|
||||
}
|
||||
|
@ -89,6 +90,7 @@ public:
|
|||
/** Copy constructor */
|
||||
Vector<T>(const Vector<T>& other)
|
||||
{
|
||||
static_assert(std::is_convertible<T, Object*>::value, "Invalid Type for cocos2d::Vector<T>!");
|
||||
CCLOGINFO("In the copy constructor!");
|
||||
_data = other._data;
|
||||
addRefForAllObjects();
|
||||
|
@ -97,6 +99,7 @@ public:
|
|||
/** Move constructor */
|
||||
Vector<T>(Vector<T>&& other)
|
||||
{
|
||||
static_assert(std::is_convertible<T, Object*>::value, "Invalid Type for cocos2d::Vector<T>!");
|
||||
CCLOGINFO("In the move constructor of Vector!");
|
||||
_data = std::move(other._data);
|
||||
}
|
||||
|
|
|
@ -151,10 +151,6 @@ void ActionNode::initActionNodeFromRoot(Object* root)
|
|||
{
|
||||
Node* rootNode = dynamic_cast<Node*>(root);
|
||||
if (rootNode != NULL)
|
||||
{
|
||||
log("Need a definition of <initActionNodeFromRoot> for gameObject");
|
||||
}
|
||||
else
|
||||
{
|
||||
Widget* rootWidget = dynamic_cast<Widget*>(root);
|
||||
if (rootWidget != NULL)
|
||||
|
@ -165,7 +161,7 @@ void ActionNode::initActionNodeFromRoot(Object* root)
|
|||
setObject(widget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ActionNode::setUnitTime(float fTime)
|
||||
|
|
|
@ -619,7 +619,7 @@ void WidgetPropertiesReader0250::setPropsForLabelAtlasFromJsonDictionary(Widget*
|
|||
const char* cmft = dicHelper->getStringValue_json(options, "charMapFile");
|
||||
cmf_tp = tp_c.append(cmft).c_str();
|
||||
|
||||
labelAtlas->setProperty(dicHelper->getStringValue_json(options, "stringValue"),cmf_tp,dicHelper->getIntValue_json(options, "itemWidth"),dicHelper->getIntValue_json(options,"itemHeight"),dicHelper->getStringValue_json(options, "startCharMap"));
|
||||
labelAtlas->setProperty(dicHelper->getStringValue_json(options, "stringValue"),cmf_tp,dicHelper->getIntValue_json(options, "itemWidth") / CC_CONTENT_SCALE_FACTOR() ,dicHelper->getIntValue_json(options,"itemHeight") / CC_CONTENT_SCALE_FACTOR(), dicHelper->getStringValue_json(options, "startCharMap"));
|
||||
}
|
||||
setColorPropsForWidgetFromJsonDictionary(widget,options);
|
||||
}
|
||||
|
@ -1025,7 +1025,23 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(JsonDictionary *dat
|
|||
Widget* child = widgetFromJsonDictionary(subData);
|
||||
if (child)
|
||||
{
|
||||
widget->addChild(child);
|
||||
PageView* pageView = dynamic_cast<PageView*>(widget);
|
||||
if (pageView)
|
||||
{
|
||||
pageView->addPage(static_cast<Layout*>(child));
|
||||
}
|
||||
else
|
||||
{
|
||||
ListView* listView = dynamic_cast<ListView*>(widget);
|
||||
if (listView)
|
||||
{
|
||||
listView->pushBackCustomItem(child);
|
||||
}
|
||||
else
|
||||
{
|
||||
widget->addChild(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
CC_SAFE_DELETE(subData);
|
||||
}
|
||||
|
@ -1525,7 +1541,7 @@ void WidgetPropertiesReader0300::setPropsForLabelAtlasFromJsonDictionary(Widget*
|
|||
std::string tp_c = m_strFilePath;
|
||||
const char* cmfPath = dicHelper->getStringValue_json(cmftDic, "path");
|
||||
const char* cmf_tp = tp_c.append(cmfPath).c_str();
|
||||
labelAtlas->setProperty(dicHelper->getStringValue_json(options, "stringValue"),cmf_tp,dicHelper->getIntValue_json(options, "itemWidth"),dicHelper->getIntValue_json(options,"itemHeight"),dicHelper->getStringValue_json(options, "startCharMap"));
|
||||
labelAtlas->setProperty(dicHelper->getStringValue_json(options, "stringValue"),cmf_tp,dicHelper->getIntValue_json(options, "itemWidth") / CC_CONTENT_SCALE_FACTOR(),dicHelper->getIntValue_json(options,"itemHeight") / CC_CONTENT_SCALE_FACTOR(), dicHelper->getStringValue_json(options, "startCharMap"));
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
|
@ -1931,11 +1947,26 @@ void WidgetPropertiesReader0300::setPropsForLabelBMFontFromJsonDictionary(Widget
|
|||
|
||||
void WidgetPropertiesReader0300::setPropsForPageViewFromJsonDictionary(Widget*widget,JsonDictionary* options)
|
||||
{
|
||||
|
||||
setPropsForLayoutFromJsonDictionary(widget, options);
|
||||
}
|
||||
|
||||
void WidgetPropertiesReader0300::setPropsForListViewFromJsonDictionary(Widget* widget, JsonDictionary* options)
|
||||
{
|
||||
setPropsForLayoutFromJsonDictionary(widget, options);
|
||||
|
||||
ListView* listView = static_cast<ListView*>(widget);
|
||||
|
||||
float innerWidth = DICTOOL->getFloatValue_json(options, "innerWidth");
|
||||
float innerHeight = DICTOOL->getFloatValue_json(options, "innerHeight");
|
||||
listView->setInnerContainerSize(Size(innerWidth, innerHeight));
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -5,15 +5,13 @@ LOCAL_MODULE := cocos_gui_static
|
|||
|
||||
LOCAL_MODULE_FILENAME := libgui
|
||||
|
||||
LOCAL_SRC_FILES := UIRootWidget.cpp \
|
||||
LOCAL_SRC_FILES := \
|
||||
UIWidget.cpp \
|
||||
UILayout.cpp \
|
||||
UILayoutParameter.cpp \
|
||||
UILayoutDefine.cpp \
|
||||
CocosGUI.cpp \
|
||||
UIHelper.cpp \
|
||||
UIInputManager.cpp \
|
||||
UILayer.cpp \
|
||||
UIListView.cpp \
|
||||
UIPageView.cpp \
|
||||
UIScrollView.cpp \
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
set(GUI_SRC
|
||||
UIRootWidget.cpp
|
||||
UIWidget.cpp
|
||||
UILayout.cpp
|
||||
UILayoutParameter.cpp
|
||||
UILayoutDefine.cpp
|
||||
CocosGUI.cpp
|
||||
UIHelper.cpp
|
||||
UIInputManager.cpp
|
||||
UILayer.cpp
|
||||
UIListView.cpp
|
||||
UIPageView.cpp
|
||||
UIScrollView.cpp
|
||||
|
|
|
@ -38,7 +38,7 @@ Widget* UIHelper::seekWidgetByTag(Widget* root, int tag)
|
|||
{
|
||||
return root;
|
||||
}
|
||||
Vector<Node*> arrayRootChildren = root->getChildren();
|
||||
const auto& arrayRootChildren = root->getChildren();
|
||||
int length = arrayRootChildren.size();
|
||||
for (int i=0;i<length;i++)
|
||||
{
|
||||
|
@ -62,11 +62,10 @@ Widget* UIHelper::seekWidgetByName(Widget* root, const char *name)
|
|||
{
|
||||
return root;
|
||||
}
|
||||
Vector<Node*> arrayRootChildren = root->getChildren();
|
||||
int length = arrayRootChildren.size();
|
||||
for (int i=0;i<length;i++)
|
||||
const auto& arrayRootChildren = root->getChildren();
|
||||
for (auto& subWidget : arrayRootChildren)
|
||||
{
|
||||
Widget* child = static_cast<Widget*>(arrayRootChildren.at(i));
|
||||
Widget* child = static_cast<Widget*>(subWidget);
|
||||
Widget* res = seekWidgetByName(child,name);
|
||||
if (res != nullptr)
|
||||
{
|
||||
|
@ -82,11 +81,10 @@ Widget* UIHelper::seekWidgetByRelativeName(Widget *root, const char *name)
|
|||
{
|
||||
return nullptr;
|
||||
}
|
||||
Vector<Node*> arrayRootChildren = root->getChildren();
|
||||
int length = arrayRootChildren.size();
|
||||
for (int i=0;i<length;i++)
|
||||
const auto& arrayRootChildren = root->getChildren();
|
||||
for (auto& subWidget : arrayRootChildren)
|
||||
{
|
||||
Widget* child = static_cast<Widget*>(arrayRootChildren.at(i));
|
||||
Widget* child = static_cast<Widget*>(subWidget);
|
||||
RelativeLayoutParameter* layoutParameter = dynamic_cast<RelativeLayoutParameter*>(child->getLayoutParameter(LAYOUT_PARAMETER_RELATIVE));
|
||||
if (layoutParameter && strcmp(layoutParameter->getRelativeName(), name) == 0)
|
||||
{
|
||||
|
@ -107,11 +105,10 @@ Widget* UIHelper::seekActionWidgetByActionTag(Widget* root, int tag)
|
|||
{
|
||||
return root;
|
||||
}
|
||||
Vector<Node*> arrayRootChildren = root->getChildren();
|
||||
int length = arrayRootChildren.size();
|
||||
for (int i=0;i<length;i++)
|
||||
const auto& arrayRootChildren = root->getChildren();
|
||||
for (auto& subWidget : arrayRootChildren)
|
||||
{
|
||||
Widget* child = static_cast<Widget*>(arrayRootChildren.at(i));
|
||||
Widget* child = static_cast<Widget*>(subWidget);
|
||||
Widget* res = seekActionWidgetByActionTag(child,tag);
|
||||
if (res != nullptr)
|
||||
{
|
||||
|
|
|
@ -709,6 +709,11 @@ LayoutType Layout::getLayoutType() const
|
|||
{
|
||||
return _layoutType;
|
||||
}
|
||||
|
||||
void Layout::requestDoLayout()
|
||||
{
|
||||
_doLayoutDirty = true;
|
||||
}
|
||||
|
||||
void Layout::doLayout()
|
||||
{
|
||||
|
@ -722,12 +727,12 @@ void Layout::doLayout()
|
|||
break;
|
||||
case LAYOUT_LINEAR_VERTICAL:
|
||||
{
|
||||
int length = _widgetChildren.size();
|
||||
Size layoutSize = getSize();
|
||||
float topBoundary = layoutSize.height;
|
||||
for (int i=0; i<length; ++i)
|
||||
|
||||
for (auto& subWidget : _widgetChildren)
|
||||
{
|
||||
Widget* child = static_cast<Widget*>(_widgetChildren.at(i));
|
||||
Widget* child = static_cast<Widget*>(subWidget);
|
||||
LinearLayoutParameter* layoutParameter = dynamic_cast<LinearLayoutParameter*>(child->getLayoutParameter(LAYOUT_PARAMETER_LINEAR));
|
||||
|
||||
if (layoutParameter)
|
||||
|
@ -762,12 +767,11 @@ void Layout::doLayout()
|
|||
}
|
||||
case LAYOUT_LINEAR_HORIZONTAL:
|
||||
{
|
||||
int length = _widgetChildren.size();
|
||||
Size layoutSize = getSize();
|
||||
float leftBoundary = 0.0f;
|
||||
for (int i=0; i<length; ++i)
|
||||
for (auto& subWidget : _widgetChildren)
|
||||
{
|
||||
Widget* child = static_cast<Widget*>(_widgetChildren.at(i));
|
||||
Widget* child = static_cast<Widget*>(subWidget);
|
||||
LinearLayoutParameter* layoutParameter = dynamic_cast<LinearLayoutParameter*>(child->getLayoutParameter(LAYOUT_PARAMETER_LINEAR));
|
||||
|
||||
if (layoutParameter)
|
||||
|
@ -802,22 +806,19 @@ void Layout::doLayout()
|
|||
}
|
||||
case LAYOUT_RELATIVE:
|
||||
{
|
||||
int length = _widgetChildren.size();
|
||||
int unlayoutChildCount = length;
|
||||
int unlayoutChildCount = _widgetChildren.size();
|
||||
Size layoutSize = getSize();
|
||||
|
||||
for (int i=0; i<length; i++)
|
||||
for (auto& subWidget : _widgetChildren)
|
||||
{
|
||||
Widget* child = static_cast<Widget*>(_widgetChildren.at(i));
|
||||
Widget* child = static_cast<Widget*>(subWidget);
|
||||
RelativeLayoutParameter* layoutParameter = dynamic_cast<RelativeLayoutParameter*>(child->getLayoutParameter(LAYOUT_PARAMETER_RELATIVE));
|
||||
layoutParameter->_put = false;
|
||||
}
|
||||
|
||||
while (unlayoutChildCount > 0)
|
||||
{
|
||||
for (int i=0; i<length; i++)
|
||||
for (auto& subWidget : _widgetChildren)
|
||||
{
|
||||
Widget* child = static_cast<Widget*>(_widgetChildren.at(i));
|
||||
Widget* child = static_cast<Widget*>(subWidget);
|
||||
RelativeLayoutParameter* layoutParameter = dynamic_cast<RelativeLayoutParameter*>(child->getLayoutParameter(LAYOUT_PARAMETER_RELATIVE));
|
||||
|
||||
if (layoutParameter)
|
||||
|
|
|
@ -212,6 +212,8 @@ public:
|
|||
virtual void visit();
|
||||
|
||||
virtual void sortAllChildren() override;
|
||||
|
||||
void requestDoLayout();
|
||||
protected:
|
||||
//override "init" method of widget.
|
||||
virtual bool init() override;
|
||||
|
|
|
@ -90,9 +90,8 @@ void ListView::updateInnerContainerSize()
|
|||
{
|
||||
int length = _items.size();
|
||||
float totalHeight = (length - 1) * _itemsMargin;
|
||||
for (int i=0; i<length; i++)
|
||||
for (auto& item : _items)
|
||||
{
|
||||
Widget* item = _items.at(i);
|
||||
totalHeight += item->getSize().height;
|
||||
}
|
||||
float finalWidth = _size.width;
|
||||
|
@ -104,9 +103,8 @@ void ListView::updateInnerContainerSize()
|
|||
{
|
||||
int length = _items.size();
|
||||
float totalWidth = (length - 1) * _itemsMargin;
|
||||
for (int i=0; i<length; i++)
|
||||
for (auto& item : _items)
|
||||
{
|
||||
Widget* item = _items.at(i);
|
||||
totalWidth += item->getSize().width;
|
||||
}
|
||||
float finalWidth = totalWidth;
|
||||
|
@ -362,6 +360,11 @@ void ListView::setDirection(SCROLLVIEW_DIR dir)
|
|||
}
|
||||
ScrollView::setDirection(dir);
|
||||
}
|
||||
|
||||
void ListView::requestRefreshView()
|
||||
{
|
||||
_refreshViewDirty = true;
|
||||
}
|
||||
|
||||
void ListView::refreshView()
|
||||
{
|
||||
|
@ -441,12 +444,9 @@ Widget* ListView::createCloneInstance()
|
|||
|
||||
void ListView::copyClonedWidgetChildren(Widget* model)
|
||||
{
|
||||
Vector<Widget*> arrayItems = getItems();
|
||||
|
||||
int length = arrayItems.size();
|
||||
for (int i=0; i<length; i++)
|
||||
auto& arrayItems = getItems();
|
||||
for (auto& item : arrayItems)
|
||||
{
|
||||
Widget* item = arrayItems.at(i);
|
||||
pushBackCustomItem(item->clone());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -165,6 +165,8 @@ public:
|
|||
|
||||
virtual std::string getDescription() const override;
|
||||
|
||||
void requestRefreshView();
|
||||
|
||||
protected:
|
||||
virtual void addChild(Node* child) override{ScrollView::addChild(child);};
|
||||
virtual void addChild(Node * child, int zOrder) override{ScrollView::addChild(child, zOrder);};
|
||||
|
|
|
@ -181,7 +181,7 @@ void PageView::insertPage(Layout* page, int idx)
|
|||
page->setSize(pvSize);
|
||||
}
|
||||
int length = _pages.size();
|
||||
for (int i=(idx+1); i<length; i++) {
|
||||
for (int i=(idx+1); i<length; i++){
|
||||
Widget* behindPage = _pages.at(i);
|
||||
Point formerPos = behindPage->getPosition();
|
||||
behindPage->setPosition(Point(formerPos.x+getSize().width, 0));
|
||||
|
@ -268,10 +268,8 @@ void PageView::onSizeChanged()
|
|||
void PageView::updateChildrenSize()
|
||||
{
|
||||
Size selfSize = getSize();
|
||||
int length = _pages.size();
|
||||
for (long i=0; i<length; i++)
|
||||
for (auto& page : _pages)
|
||||
{
|
||||
Layout* page = _pages.at(i);
|
||||
page->setSize(selfSize);
|
||||
}
|
||||
}
|
||||
|
@ -410,13 +408,11 @@ void PageView::onTouchCancelled(Touch *touch, Event *unusedEvent)
|
|||
|
||||
void PageView::movePages(float offset)
|
||||
{
|
||||
int length = _pages.size();
|
||||
for (int i = 0; i < length; i++)
|
||||
for (auto& page : _pages)
|
||||
{
|
||||
Widget* child = _pages.at(i);
|
||||
_movePagePoint.x = child->getPosition().x + offset;
|
||||
_movePagePoint.y = child->getPosition().y;
|
||||
child->setPosition(_movePagePoint);
|
||||
_movePagePoint.x = page->getPosition().x + offset;
|
||||
_movePagePoint.y = page->getPosition().y;
|
||||
page->setPosition(_movePagePoint);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -606,11 +602,9 @@ Widget* PageView::createCloneInstance()
|
|||
|
||||
void PageView::copyClonedWidgetChildren(Widget* model)
|
||||
{
|
||||
Vector<Layout*> modelPages = dynamic_cast<PageView*>(model)->getPages();
|
||||
int length = modelPages.size();
|
||||
for (int i=0; i<length; i++)
|
||||
auto& modelPages = dynamic_cast<PageView*>(model)->getPages();
|
||||
for (auto& page : modelPages)
|
||||
{
|
||||
Layout* page = modelPages.at(i);
|
||||
addPage(dynamic_cast<Layout*>(page->clone()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -977,10 +977,11 @@ Widget* Widget::createCloneInstance()
|
|||
|
||||
void Widget::copyClonedWidgetChildren(Widget* model)
|
||||
{
|
||||
int length = model->getChildren().size();
|
||||
for (int i=0; i<length; i++)
|
||||
auto& modelChildren = model->getChildren();
|
||||
|
||||
for (auto& subWidget : modelChildren)
|
||||
{
|
||||
Widget* child = static_cast<Widget*>(model->getChildren().at(i));
|
||||
Widget* child = static_cast<Widget*>(subWidget);
|
||||
addChild(child->clone());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit afd23aedea6035df78b877da9f6b672c0a0fe346
|
||||
Subproject commit 6f6b1240ecac0cbf3e4a2a0bd7356b708c054daf
|
|
@ -1 +1 @@
|
|||
9af2a4febb0a58cf084fc9adfb24c1ac8138cd27
|
||||
f6783c2706a67552d6f361fa099b647158bc79ba
|
|
@ -299,8 +299,8 @@ JSBool js_CocosBuilder_create(JSContext *cx, uint32_t argc, jsval *vp)
|
|||
|
||||
}
|
||||
|
||||
extern JSObject* jsb_CCBReader_prototype;
|
||||
extern JSObject* jsb_CCBAnimationManager_prototype;
|
||||
extern JSObject* jsb_cocosbuilder_CCBReader_prototype;
|
||||
extern JSObject* jsb_cocosbuilder_CCBAnimationManager_prototype;
|
||||
|
||||
void register_CCBuilderReader(JSContext *cx, JSObject *obj) {
|
||||
JS::RootedValue nsval(cx);
|
||||
|
@ -319,6 +319,6 @@ void register_CCBuilderReader(JSContext *cx, JSObject *obj) {
|
|||
JS_DefineFunction(cx, tmpObj, "create", js_CocosBuilder_create, 2, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, tmpObj, "loadScene", js_cocos2dx_CCBReader_createSceneWithNodeGraphFromFile, 2, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
|
||||
JS_DefineFunction(cx, jsb_CCBReader_prototype, "load", js_cocos2dx_CCBReader_readNodeGraphFromFile, 2, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_CCBAnimationManager_prototype, "setCompletedAnimationCallback", js_cocos2dx_CCBAnimationManager_animationCompleteCallback, 2, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocosbuilder_CCBReader_prototype, "load", js_cocos2dx_CCBReader_readNodeGraphFromFile, 2, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocosbuilder_CCBAnimationManager_prototype, "setCompletedAnimationCallback", js_cocos2dx_CCBAnimationManager_animationCompleteCallback, 2, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
}
|
||||
|
|
|
@ -227,14 +227,14 @@ static JSBool jsb_Animation_addArmatureFileInfoAsyncCallFunc(JSContext *cx, uint
|
|||
return JS_FALSE;
|
||||
}
|
||||
|
||||
extern JSObject* jsb_ArmatureAnimation_prototype;
|
||||
extern JSObject* jsb_ArmatureDataManager_prototype;
|
||||
extern JSObject* jsb_cocostudio_ArmatureAnimation_prototype;
|
||||
extern JSObject* jsb_cocostudio_ArmatureDataManager_prototype;
|
||||
|
||||
void register_all_cocos2dx_studio_manual(JSContext* cx, JSObject* global)
|
||||
{
|
||||
JS_DefineFunction(cx, jsb_ArmatureAnimation_prototype, "setMovementEventCallFunc", js_cocos2dx_ArmatureAnimation_setMovementEventCallFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocostudio_ArmatureAnimation_prototype, "setMovementEventCallFunc", js_cocos2dx_ArmatureAnimation_setMovementEventCallFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
|
||||
JS_DefineFunction(cx, jsb_ArmatureAnimation_prototype, "setFrameEventCallFunc", js_cocos2dx_ArmatureAnimation_setFrameEventCallFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocostudio_ArmatureAnimation_prototype, "setFrameEventCallFunc", js_cocos2dx_ArmatureAnimation_setFrameEventCallFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
|
||||
JS_DefineFunction(cx, jsb_ArmatureDataManager_prototype, "addArmatureFileInfoAsync", jsb_Animation_addArmatureFileInfoAsyncCallFunc, 3, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocostudio_ArmatureDataManager_prototype, "addArmatureFileInfoAsync", jsb_Animation_addArmatureFileInfoAsyncCallFunc, 3, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
}
|
|
@ -288,15 +288,15 @@ public:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
virtual long numberOfCellsInTableView(TableView *table)
|
||||
virtual ssize_t numberOfCellsInTableView(TableView *table)
|
||||
{
|
||||
jsval ret;
|
||||
bool ok = callJSDelegate(table, "numberOfCellsInTableView", ret);
|
||||
if (ok)
|
||||
{
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
long count = 0;
|
||||
JSBool isSucceed = jsval_to_long(cx, ret, &count);
|
||||
ssize_t count = 0;
|
||||
JSBool isSucceed = jsval_to_ssize(cx, ret, &count);
|
||||
if (isSucceed) return count;
|
||||
}
|
||||
return 0;
|
||||
|
@ -781,19 +781,19 @@ static JSBool js_cocos2dx_CCControl_removeTargetWithActionForControlEvents(JSCon
|
|||
return JS_FALSE;
|
||||
}
|
||||
|
||||
extern JSObject* jsb_ScrollView_prototype;
|
||||
extern JSObject* jsb_TableView_prototype;
|
||||
extern JSObject* jsb_EditBox_prototype;
|
||||
extern JSObject* jsb_Control_prototype;
|
||||
extern JSObject* jsb_cocos2d_extension_ScrollView_prototype;
|
||||
extern JSObject* jsb_cocos2d_extension_TableView_prototype;
|
||||
extern JSObject* jsb_cocos2d_extension_EditBox_prototype;
|
||||
extern JSObject* jsb_cocos2d_extension_Control_prototype;
|
||||
|
||||
void register_all_cocos2dx_extension_manual(JSContext* cx, JSObject* global)
|
||||
{
|
||||
JS_DefineFunction(cx, jsb_ScrollView_prototype, "setDelegate", js_cocos2dx_CCScrollView_setDelegate, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_TableView_prototype, "setDelegate", js_cocos2dx_CCTableView_setDelegate, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_TableView_prototype, "setDataSource", js_cocos2dx_CCTableView_setDataSource, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_EditBox_prototype, "setDelegate", js_cocos2dx_CCEditBox_setDelegate, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_Control_prototype, "addTargetWithActionForControlEvents", js_cocos2dx_CCControl_addTargetWithActionForControlEvents, 3, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_Control_prototype, "removeTargetWithActionForControlEvents", js_cocos2dx_CCControl_removeTargetWithActionForControlEvents, 3, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_extension_ScrollView_prototype, "setDelegate", js_cocos2dx_CCScrollView_setDelegate, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_extension_TableView_prototype, "setDelegate", js_cocos2dx_CCTableView_setDelegate, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_extension_TableView_prototype, "setDataSource", js_cocos2dx_CCTableView_setDataSource, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_extension_EditBox_prototype, "setDelegate", js_cocos2dx_CCEditBox_setDelegate, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_extension_Control_prototype, "addTargetWithActionForControlEvents", js_cocos2dx_CCControl_addTargetWithActionForControlEvents, 3, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_extension_Control_prototype, "removeTargetWithActionForControlEvents", js_cocos2dx_CCControl_removeTargetWithActionForControlEvents, 3, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
|
||||
JSObject *tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, "(function () { return cc.TableView; })()"));
|
||||
JS_DefineFunction(cx, tmpObj, "create", js_cocos2dx_CCTableView_create, 3, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
|
|
|
@ -81,7 +81,7 @@ static JSBool js_cocos2dx_UIWidget_addTouchEventListener(JSContext *cx, uint32_t
|
|||
{
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
gui::UIWidget* cobj = (gui::UIWidget *)(proxy ? proxy->ptr : NULL);
|
||||
gui::Widget* cobj = (gui::Widget *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 2) {
|
||||
|
@ -106,7 +106,7 @@ static JSBool js_cocos2dx_UICheckBox_addEventListener(JSContext *cx, uint32_t ar
|
|||
{
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
gui::UICheckBox* cobj = (gui::UICheckBox *)(proxy ? proxy->ptr : NULL);
|
||||
gui::CheckBox* cobj = (gui::CheckBox *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 2) {
|
||||
|
@ -131,7 +131,7 @@ static JSBool js_cocos2dx_UISlider_addEventListener(JSContext *cx, uint32_t argc
|
|||
{
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
gui::UISlider* cobj = (gui::UISlider *)(proxy ? proxy->ptr : NULL);
|
||||
gui::Slider* cobj = (gui::Slider *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 2) {
|
||||
|
@ -156,7 +156,7 @@ static JSBool js_cocos2dx_UITextField_addEventListener(JSContext *cx, uint32_t a
|
|||
{
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
gui::UITextField* cobj = (gui::UITextField *)(proxy ? proxy->ptr : NULL);
|
||||
gui::TextField* cobj = (gui::TextField *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 2) {
|
||||
|
@ -181,7 +181,7 @@ static JSBool js_cocos2dx_UIPageView_addEventListener(JSContext *cx, uint32_t ar
|
|||
{
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
gui::UIPageView* cobj = (gui::UIPageView *)(proxy ? proxy->ptr : NULL);
|
||||
gui::PageView* cobj = (gui::PageView *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 2) {
|
||||
|
@ -206,7 +206,7 @@ static JSBool js_cocos2dx_UIListView_addEventListener(JSContext *cx, uint32_t ar
|
|||
{
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
gui::UIListView* cobj = (gui::UIListView *)(proxy ? proxy->ptr : NULL);
|
||||
gui::ListView* cobj = (gui::ListView *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 2) {
|
||||
|
@ -231,7 +231,7 @@ static JSBool js_cocos2dx_LayoutParameter_setMargin(JSContext *cx, uint32_t argc
|
|||
{
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
gui::UILayoutParameter* cobj = (gui::UILayoutParameter *)(proxy ? proxy->ptr : NULL);
|
||||
gui::LayoutParameter* cobj = (gui::LayoutParameter *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 1) {
|
||||
|
@ -253,7 +253,7 @@ static JSBool js_cocos2dx_LayoutParameter_setMargin(JSContext *cx, uint32_t argc
|
|||
|
||||
JSB_PRECONDITION3(ok, cx, JS_FALSE, "Error processing arguments");
|
||||
|
||||
cobj->setMargin(gui::UIMargin(left,top,right,bottom));
|
||||
cobj->setMargin(gui::Margin(left,top,right,bottom));
|
||||
return JS_TRUE;
|
||||
}
|
||||
JS_ReportError(cx, "Invalid number of arguments");
|
||||
|
@ -264,13 +264,13 @@ static JSBool js_cocos2dx_LayoutParameter_getMargin(JSContext *cx, uint32_t argc
|
|||
{
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
gui::UILayoutParameter* cobj = (gui::UILayoutParameter *)(proxy ? proxy->ptr : NULL);
|
||||
gui::LayoutParameter* cobj = (gui::LayoutParameter *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 0) {
|
||||
JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);
|
||||
if (!tmp) return JS_FALSE;
|
||||
gui::UIMargin margin = cobj->getMargin();
|
||||
gui::Margin margin = cobj->getMargin();
|
||||
JSBool ok = JS_DefineProperty(cx, tmp, "left", DOUBLE_TO_JSVAL(margin.left), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&
|
||||
JS_DefineProperty(cx, tmp, "top", DOUBLE_TO_JSVAL(margin.top), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&
|
||||
JS_DefineProperty(cx, tmp, "right", DOUBLE_TO_JSVAL(margin.right), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&
|
||||
|
@ -289,29 +289,29 @@ static JSBool js_cocos2dx_LayoutParameter_getMargin(JSContext *cx, uint32_t argc
|
|||
return JS_FALSE;
|
||||
}
|
||||
|
||||
extern JSObject* jsb_UIWidget_prototype;
|
||||
extern JSObject* jsb_UICheckBox_prototype;
|
||||
extern JSObject* jsb_UISlider_prototype;
|
||||
extern JSObject* jsb_UITextField_prototype;
|
||||
extern JSObject* jsb_UILayoutParameter_prototype;
|
||||
extern JSObject* jsb_UIPageView_prototype;
|
||||
extern JSObject* jsb_UIListView_prototype;
|
||||
extern JSObject* jsb_cocos2d_gui_Widget_prototype;
|
||||
extern JSObject* jsb_cocos2d_gui_CheckBox_prototype;
|
||||
extern JSObject* jsb_cocos2d_gui_Slider_prototype;
|
||||
extern JSObject* jsb_cocos2d_gui_TextField_prototype;
|
||||
extern JSObject* jsb_cocos2d_gui_LayoutParameter_prototype;
|
||||
extern JSObject* jsb_cocos2d_gui_PageView_prototype;
|
||||
extern JSObject* jsb_cocos2d_gui_ListView_prototype;
|
||||
|
||||
void register_all_cocos2dx_gui_manual(JSContext* cx, JSObject* global)
|
||||
{
|
||||
JS_DefineFunction(cx, jsb_UIWidget_prototype, "addTouchEventListener", js_cocos2dx_UIWidget_addTouchEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_gui_Widget_prototype, "addTouchEventListener", js_cocos2dx_UIWidget_addTouchEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
|
||||
JS_DefineFunction(cx, jsb_UICheckBox_prototype, "addEventListenerCheckBox", js_cocos2dx_UICheckBox_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_gui_CheckBox_prototype, "addEventListenerCheckBox", js_cocos2dx_UICheckBox_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
|
||||
JS_DefineFunction(cx, jsb_UISlider_prototype, "addEventListenerSlider", js_cocos2dx_UISlider_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_gui_Slider_prototype, "addEventListenerSlider", js_cocos2dx_UISlider_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
|
||||
JS_DefineFunction(cx, jsb_UITextField_prototype, "addEventListenerTextField", js_cocos2dx_UITextField_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_gui_TextField_prototype, "addEventListenerTextField", js_cocos2dx_UITextField_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
|
||||
JS_DefineFunction(cx, jsb_UIPageView_prototype, "addEventListenerPageView", js_cocos2dx_UIPageView_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_gui_PageView_prototype, "addEventListenerPageView", js_cocos2dx_UIPageView_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
|
||||
JS_DefineFunction(cx, jsb_UIListView_prototype, "addEventListenerListView", js_cocos2dx_UIListView_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_gui_ListView_prototype, "addEventListenerListView", js_cocos2dx_UIListView_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
|
||||
JS_DefineFunction(cx, jsb_UILayoutParameter_prototype, "setMargin", js_cocos2dx_LayoutParameter_setMargin, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_gui_LayoutParameter_prototype, "setMargin", js_cocos2dx_LayoutParameter_setMargin, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
|
||||
JS_DefineFunction(cx, jsb_UILayoutParameter_prototype, "getMargin", js_cocos2dx_LayoutParameter_getMargin, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_cocos2d_gui_LayoutParameter_prototype, "getMargin", js_cocos2dx_LayoutParameter_getMargin, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
}
|
|
@ -89,7 +89,7 @@ JSBool js_cocos2dx_GLNode_create(JSContext *cx, uint32_t argc, jsval *vp)
|
|||
return JS_TRUE;
|
||||
}
|
||||
|
||||
extern JSObject* jsb_Node_prototype;
|
||||
extern JSObject* jsb_cocos2d_Node_prototype;
|
||||
|
||||
void js_register_cocos2dx_GLNode(JSContext *cx, JSObject *global) {
|
||||
js_cocos2dx_GLNode_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||
|
@ -120,7 +120,7 @@ void js_register_cocos2dx_GLNode(JSContext *cx, JSObject *global) {
|
|||
|
||||
js_cocos2dx_GLNode_prototype = JS_InitClass(
|
||||
cx, global,
|
||||
jsb_Node_prototype,
|
||||
jsb_cocos2d_Node_prototype,
|
||||
js_cocos2dx_GLNode_class,
|
||||
js_cocos2dx_GLNode_constructor, 0, // constructor
|
||||
properties,
|
||||
|
@ -140,7 +140,7 @@ void js_register_cocos2dx_GLNode(JSContext *cx, JSObject *global) {
|
|||
p = (js_type_class_t *)malloc(sizeof(js_type_class_t));
|
||||
p->jsclass = js_cocos2dx_GLNode_class;
|
||||
p->proto = js_cocos2dx_GLNode_prototype;
|
||||
p->parentProto = jsb_Node_prototype;
|
||||
p->parentProto = jsb_cocos2d_Node_prototype;
|
||||
_js_global_type_map.insert(std::make_pair(typeName, p));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1034,7 +1034,7 @@ JSBool jsval_to_ccvaluemap(JSContext* cx, jsval v, cocos2d::ValueMap* ret)
|
|||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JSBool jsval_to_ccintvaluemap(JSContext* cx, jsval v, cocos2d::IntValueMap* ret)
|
||||
JSBool jsval_to_ccvaluemapintkey(JSContext* cx, jsval v, cocos2d::ValueMapIntKey* ret)
|
||||
{
|
||||
if (JSVAL_IS_NULL(v) || JSVAL_IS_VOID(v))
|
||||
{
|
||||
|
@ -1049,7 +1049,7 @@ JSBool jsval_to_ccintvaluemap(JSContext* cx, jsval v, cocos2d::IntValueMap* ret)
|
|||
|
||||
JSObject* it = JS_NewPropertyIterator(cx, tmp);
|
||||
|
||||
IntValueMap& dict = *ret;
|
||||
ValueMapIntKey& dict = *ret;
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
@ -2040,7 +2040,7 @@ jsval ccvalue_to_jsval(JSContext* cx, const cocos2d::Value& v)
|
|||
ret = ccvaluemap_to_jsval(cx, obj.asValueMap());
|
||||
break;
|
||||
case Value::Type::INT_KEY_MAP:
|
||||
ret = ccintvaluemap_to_jsval(cx, obj.asIntKeyMap());
|
||||
ret = ccvaluemapintkey_to_jsval(cx, obj.asIntKeyMap());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -2082,7 +2082,7 @@ jsval ccvaluemap_to_jsval(JSContext* cx, const cocos2d::ValueMap& v)
|
|||
dictElement = ccvaluemap_to_jsval(cx, obj.asValueMap());
|
||||
break;
|
||||
case Value::Type::INT_KEY_MAP:
|
||||
dictElement = ccintvaluemap_to_jsval(cx, obj.asIntKeyMap());
|
||||
dictElement = ccvaluemapintkey_to_jsval(cx, obj.asIntKeyMap());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -2096,7 +2096,7 @@ jsval ccvaluemap_to_jsval(JSContext* cx, const cocos2d::ValueMap& v)
|
|||
return OBJECT_TO_JSVAL(jsRet);
|
||||
}
|
||||
|
||||
jsval ccintvaluemap_to_jsval(JSContext* cx, const cocos2d::IntValueMap& v)
|
||||
jsval ccvaluemapintkey_to_jsval(JSContext* cx, const cocos2d::ValueMapIntKey& v)
|
||||
{
|
||||
JSObject* jsRet = JS_NewObject(cx, NULL, NULL, NULL);
|
||||
|
||||
|
@ -2131,7 +2131,7 @@ jsval ccintvaluemap_to_jsval(JSContext* cx, const cocos2d::IntValueMap& v)
|
|||
dictElement = ccvaluemap_to_jsval(cx, obj.asValueMap());
|
||||
break;
|
||||
case Value::Type::INT_KEY_MAP:
|
||||
dictElement = ccintvaluemap_to_jsval(cx, obj.asIntKeyMap());
|
||||
dictElement = ccvaluemapintkey_to_jsval(cx, obj.asIntKeyMap());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -2176,7 +2176,7 @@ jsval ccvaluevector_to_jsval(JSContext* cx, const cocos2d::ValueVector& v)
|
|||
arrElement = ccvaluemap_to_jsval(cx, obj.asValueMap());
|
||||
break;
|
||||
case Value::Type::INT_KEY_MAP:
|
||||
arrElement = ccintvaluemap_to_jsval(cx, obj.asIntKeyMap());
|
||||
arrElement = ccvaluemapintkey_to_jsval(cx, obj.asIntKeyMap());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -149,7 +149,7 @@ JSBool jsval_to_ccvector(JSContext* cx, jsval v, cocos2d::Vector<T>* ret)
|
|||
|
||||
JSBool jsval_to_ccvalue(JSContext* cx, jsval v, cocos2d::Value* ret);
|
||||
JSBool jsval_to_ccvaluemap(JSContext* cx, jsval v, cocos2d::ValueMap* ret);
|
||||
JSBool jsval_to_ccintvaluemap(JSContext* cx, jsval v, cocos2d::IntValueMap* ret);
|
||||
JSBool jsval_to_ccvaluemapintkey(JSContext* cx, jsval v, cocos2d::ValueMapIntKey* ret);
|
||||
JSBool jsval_to_ccvaluevector(JSContext* cx, jsval v, cocos2d::ValueVector* ret);
|
||||
JSBool jsval_to_ssize( JSContext *cx, jsval vp, ssize_t* ret);
|
||||
JSBool jsval_to_std_vector_string( JSContext *cx, jsval vp, std::vector<std::string>* ret);
|
||||
|
@ -292,7 +292,7 @@ jsval ccmap_string_key_to_jsval(JSContext* cx, const cocos2d::Map<std::string, T
|
|||
|
||||
jsval ccvalue_to_jsval(JSContext* cx, const cocos2d::Value& v);
|
||||
jsval ccvaluemap_to_jsval(JSContext* cx, const cocos2d::ValueMap& v);
|
||||
jsval ccintvaluemap_to_jsval(JSContext* cx, const cocos2d::IntValueMap& v);
|
||||
jsval ccvaluemapintkey_to_jsval(JSContext* cx, const cocos2d::ValueMapIntKey& v);
|
||||
jsval ccvaluevector_to_jsval(JSContext* cx, const cocos2d::ValueVector& v);
|
||||
jsval ssize_to_jsval(JSContext *cx, ssize_t v);
|
||||
|
||||
|
|
|
@ -1253,7 +1253,7 @@ bool luaval_to_ccvaluemap(lua_State* L, int lo, cocos2d::ValueMap* ret)
|
|||
|
||||
return ok;
|
||||
}
|
||||
bool luaval_to_ccintvaluemap(lua_State* L, int lo, cocos2d::IntValueMap* ret)
|
||||
bool luaval_to_ccvaluemapintkey(lua_State* L, int lo, cocos2d::ValueMapIntKey* ret)
|
||||
{
|
||||
if (nullptr == L || nullptr == ret)
|
||||
return false;
|
||||
|
@ -1274,7 +1274,7 @@ bool luaval_to_ccintvaluemap(lua_State* L, int lo, cocos2d::IntValueMap* ret)
|
|||
std::string stringValue = "";
|
||||
int intKey = 0;
|
||||
bool boolVal = false;
|
||||
IntValueMap& dict = *ret;
|
||||
ValueMapIntKey& dict = *ret;
|
||||
lua_pushnil(L); /* first key L: lotable ..... nil */
|
||||
while ( 0 != lua_next(L, lo ) ) /* L: lotable ..... key value */
|
||||
{
|
||||
|
@ -1882,7 +1882,7 @@ void ccvalue_to_luaval(lua_State* L,const cocos2d::Value& inValue)
|
|||
ccvaluemap_to_luaval(L, obj.asValueMap());
|
||||
break;
|
||||
case Value::Type::INT_KEY_MAP:
|
||||
ccintvaluemap_to_luaval(L, obj.asIntKeyMap());
|
||||
ccvaluemapintkey_to_luaval(L, obj.asIntKeyMap());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -1947,7 +1947,7 @@ void ccvaluemap_to_luaval(lua_State* L,const cocos2d::ValueMap& inValue)
|
|||
case Value::Type::INT_KEY_MAP:
|
||||
{
|
||||
lua_pushstring(L, key.c_str());
|
||||
ccintvaluemap_to_luaval(L, obj.asIntKeyMap());
|
||||
ccvaluemapintkey_to_luaval(L, obj.asIntKeyMap());
|
||||
lua_rawset(L, -3);
|
||||
}
|
||||
break;
|
||||
|
@ -1956,7 +1956,7 @@ void ccvaluemap_to_luaval(lua_State* L,const cocos2d::ValueMap& inValue)
|
|||
}
|
||||
}
|
||||
}
|
||||
void ccintvaluemap_to_luaval(lua_State* L, const cocos2d::IntValueMap& inValue)
|
||||
void ccvaluemapintkey_to_luaval(lua_State* L, const cocos2d::ValueMapIntKey& inValue)
|
||||
{
|
||||
lua_newtable(L);
|
||||
|
||||
|
@ -2019,7 +2019,7 @@ void ccintvaluemap_to_luaval(lua_State* L, const cocos2d::IntValueMap& inValue)
|
|||
case Value::Type::INT_KEY_MAP:
|
||||
{
|
||||
lua_pushstring(L, key.c_str());
|
||||
ccintvaluemap_to_luaval(L, obj.asIntKeyMap());
|
||||
ccvaluemapintkey_to_luaval(L, obj.asIntKeyMap());
|
||||
lua_rawset(L, -3);
|
||||
}
|
||||
break;
|
||||
|
@ -2092,7 +2092,7 @@ void ccvaluevector_to_luaval(lua_State* L, const cocos2d::ValueVector& inValue)
|
|||
case Value::Type::INT_KEY_MAP:
|
||||
{
|
||||
lua_pushnumber(L, (lua_Number)index);
|
||||
ccintvaluemap_to_luaval(L, obj.asIntKeyMap());
|
||||
ccvaluemapintkey_to_luaval(L, obj.asIntKeyMap());
|
||||
lua_rawset(L, -3);
|
||||
++index;
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@ bool luaval_to_ccmap_string_key(lua_State* L, int lo, cocos2d::Map<std::string,
|
|||
|
||||
extern bool luaval_to_ccvalue(lua_State* L, int lo, cocos2d::Value* ret);
|
||||
extern bool luaval_to_ccvaluemap(lua_State* L, int lo, cocos2d::ValueMap* ret);
|
||||
extern bool luaval_to_ccintvaluemap(lua_State* L, int lo, cocos2d::IntValueMap* ret);
|
||||
extern bool luaval_to_ccvaluemapintkey(lua_State* L, int lo, cocos2d::ValueMapIntKey* ret);
|
||||
extern bool luaval_to_ccvaluevector(lua_State* L, int lo, cocos2d::ValueVector* ret);
|
||||
|
||||
|
||||
|
@ -245,6 +245,6 @@ void ccmap_string_key_to_luaval(lua_State* L, const cocos2d::Map<std::string, T>
|
|||
|
||||
void ccvalue_to_luaval(lua_State* L,const cocos2d::Value& inValue);
|
||||
void ccvaluemap_to_luaval(lua_State* L,const cocos2d::ValueMap& inValue);
|
||||
void ccintvaluemap_to_luaval(lua_State* L, const cocos2d::IntValueMap& inValue);
|
||||
void ccvaluemapintkey_to_luaval(lua_State* L, const cocos2d::ValueMapIntKey& inValue);
|
||||
void ccvaluevector_to_luaval(lua_State* L, const cocos2d::ValueVector& inValue);
|
||||
#endif //__COCOS2DX_SCRIPTING_LUA_COCOS2DXSUPPORT_LUABAISCCONVERSIONS_H__
|
||||
|
|
|
@ -63,24 +63,24 @@ void LuaCocoStudioEventListener::eventCallbackFunc(Object* sender,int eventType)
|
|||
}
|
||||
}
|
||||
|
||||
static int lua_cocos2dx_UIWidget_addTouchEventListener(lua_State* L)
|
||||
static int lua_cocos2dx_Widget_addTouchEventListener(lua_State* L)
|
||||
{
|
||||
if (nullptr == L)
|
||||
return 0;
|
||||
|
||||
int argc = 0;
|
||||
UIWidget* self = nullptr;
|
||||
Widget* self = nullptr;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
if (!tolua_isusertype(L,1,"UIWidget",0,&tolua_err)) goto tolua_lerror;
|
||||
if (!tolua_isusertype(L,1,"Widget",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
self = static_cast<UIWidget*>(tolua_tousertype(L,1,0));
|
||||
self = static_cast<Widget*>(tolua_tousertype(L,1,0));
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (nullptr == self) {
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_UIWidget_addTouchEventListener'\n", NULL);
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_Widget_addTouchEventListener'\n", NULL);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -112,7 +112,7 @@ static int lua_cocos2dx_UIWidget_addTouchEventListener(lua_State* L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
CCLOG("'addTouchEventListener' function of UIWidget has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
CCLOG("'addTouchEventListener' function of Widget has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
|
@ -122,35 +122,35 @@ tolua_lerror:
|
|||
#endif
|
||||
}
|
||||
|
||||
static void extendUIWidget(lua_State* L)
|
||||
static void extendWidget(lua_State* L)
|
||||
{
|
||||
lua_pushstring(L, "UIWidget");
|
||||
lua_pushstring(L, "Widget");
|
||||
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||
if (lua_istable(L,-1))
|
||||
{
|
||||
tolua_function(L, "addTouchEventListener", lua_cocos2dx_UIWidget_addTouchEventListener);
|
||||
tolua_function(L, "addTouchEventListener", lua_cocos2dx_Widget_addTouchEventListener);
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
||||
static int lua_cocos2dx_UICheckBox_addEventListenerCheckBox(lua_State* L)
|
||||
static int lua_cocos2dx_CheckBox_addEventListenerCheckBox(lua_State* L)
|
||||
{
|
||||
if (nullptr == L)
|
||||
return 0;
|
||||
|
||||
int argc = 0;
|
||||
UICheckBox* self = nullptr;
|
||||
CheckBox* self = nullptr;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
if (!tolua_isusertype(L,1,"UICheckBox",0,&tolua_err)) goto tolua_lerror;
|
||||
if (!tolua_isusertype(L,1,"CheckBox",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
self = static_cast<UICheckBox*>(tolua_tousertype(L,1,0));
|
||||
self = static_cast<CheckBox*>(tolua_tousertype(L,1,0));
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (nullptr == self) {
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_UICheckBox_addEventListenerCheckBox'\n", NULL);
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_CheckBox_addEventListenerCheckBox'\n", NULL);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -180,7 +180,7 @@ static int lua_cocos2dx_UICheckBox_addEventListenerCheckBox(lua_State* L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
CCLOG("'addEventListenerCheckBox' function of UICheckBox has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
CCLOG("'addEventListenerCheckBox' function of CheckBox has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
|
@ -191,35 +191,35 @@ tolua_lerror:
|
|||
}
|
||||
|
||||
|
||||
static void extendUICheckBox(lua_State* L)
|
||||
static void extendCheckBox(lua_State* L)
|
||||
{
|
||||
lua_pushstring(L, "UICheckBox");
|
||||
lua_pushstring(L, "CheckBox");
|
||||
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||
if (lua_istable(L,-1))
|
||||
{
|
||||
tolua_function(L, "addEventListenerCheckBox", lua_cocos2dx_UICheckBox_addEventListenerCheckBox);
|
||||
tolua_function(L, "addEventListenerCheckBox", lua_cocos2dx_CheckBox_addEventListenerCheckBox);
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
||||
static int lua_cocos2dx_UISlider_addEventListenerSlider(lua_State* L)
|
||||
static int lua_cocos2dx_Slider_addEventListenerSlider(lua_State* L)
|
||||
{
|
||||
if (nullptr == L)
|
||||
return 0;
|
||||
|
||||
int argc = 0;
|
||||
UISlider* self = nullptr;
|
||||
Slider* self = nullptr;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
if (!tolua_isusertype(L,1,"UISlider",0,&tolua_err)) goto tolua_lerror;
|
||||
if (!tolua_isusertype(L,1,"Slider",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
self = static_cast<UISlider*>(tolua_tousertype(L,1,0));
|
||||
self = static_cast<Slider*>(tolua_tousertype(L,1,0));
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (nullptr == self) {
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_UISlider_addEventListenerSlider'\n", NULL);
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_Slider_addEventListenerSlider'\n", NULL);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -249,7 +249,7 @@ static int lua_cocos2dx_UISlider_addEventListenerSlider(lua_State* L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
CCLOG("'addEventListenerSlider' function of UISlider has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
CCLOG("'addEventListenerSlider' function of Slider has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -260,35 +260,35 @@ tolua_lerror:
|
|||
#endif
|
||||
}
|
||||
|
||||
static void extendUISlider(lua_State* L)
|
||||
static void extendSlider(lua_State* L)
|
||||
{
|
||||
lua_pushstring(L, "UISlider");
|
||||
lua_pushstring(L, "Slider");
|
||||
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||
if (lua_istable(L,-1))
|
||||
{
|
||||
tolua_function(L, "addEventListenerSlider", lua_cocos2dx_UISlider_addEventListenerSlider);
|
||||
tolua_function(L, "addEventListenerSlider", lua_cocos2dx_Slider_addEventListenerSlider);
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
||||
static int lua_cocos2dx_UITextField_addEventListenerTextField(lua_State* L)
|
||||
static int lua_cocos2dx_TextField_addEventListenerTextField(lua_State* L)
|
||||
{
|
||||
if (nullptr == L)
|
||||
return 0;
|
||||
|
||||
int argc = 0;
|
||||
UITextField* self = nullptr;
|
||||
TextField* self = nullptr;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
if (!tolua_isusertype(L,1,"UITextField",0,&tolua_err)) goto tolua_lerror;
|
||||
if (!tolua_isusertype(L,1,"TextField",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
self = static_cast<UITextField*>(tolua_tousertype(L,1,0));
|
||||
self = static_cast<TextField*>(tolua_tousertype(L,1,0));
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (nullptr == self) {
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_UITextField_addEventListenerTextField'\n", NULL);
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_TextField_addEventListenerTextField'\n", NULL);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -318,7 +318,7 @@ static int lua_cocos2dx_UITextField_addEventListenerTextField(lua_State* L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
CCLOG("'addEventListenerTextField' function of UITextField has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
CCLOG("'addEventListenerTextField' function of TextField has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -329,35 +329,35 @@ tolua_lerror:
|
|||
#endif
|
||||
}
|
||||
|
||||
static void extendUITextField(lua_State* L)
|
||||
static void extendTextField(lua_State* L)
|
||||
{
|
||||
lua_pushstring(L, "UITextField");
|
||||
lua_pushstring(L, "TextField");
|
||||
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||
if (lua_istable(L,-1))
|
||||
{
|
||||
tolua_function(L, "addEventListenerTextField", lua_cocos2dx_UITextField_addEventListenerTextField);
|
||||
tolua_function(L, "addEventListenerTextField", lua_cocos2dx_TextField_addEventListenerTextField);
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
||||
static int lua_cocos2dx_UIPageView_addEventListenerPageView(lua_State* L)
|
||||
static int lua_cocos2dx_PageView_addEventListenerPageView(lua_State* L)
|
||||
{
|
||||
if (nullptr == L)
|
||||
return 0;
|
||||
|
||||
int argc = 0;
|
||||
UIPageView* self = nullptr;
|
||||
PageView* self = nullptr;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
if (!tolua_isusertype(L,1,"UIPageView",0,&tolua_err)) goto tolua_lerror;
|
||||
if (!tolua_isusertype(L,1,"PageView",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
self = static_cast<UIPageView*>(tolua_tousertype(L,1,0));
|
||||
self = static_cast<PageView*>(tolua_tousertype(L,1,0));
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (nullptr == self) {
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_UIPageView_addEventListenerPageView'\n", NULL);
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_PageView_addEventListenerPageView'\n", NULL);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -387,7 +387,7 @@ static int lua_cocos2dx_UIPageView_addEventListenerPageView(lua_State* L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
CCLOG("'addEventListenerPageView' function of UIPageView has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
CCLOG("'addEventListenerPageView' function of PageView has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -398,35 +398,35 @@ tolua_lerror:
|
|||
#endif
|
||||
}
|
||||
|
||||
static void extendUIPageView(lua_State* L)
|
||||
static void extendPageView(lua_State* L)
|
||||
{
|
||||
lua_pushstring(L, "UIPageView");
|
||||
lua_pushstring(L, "PageView");
|
||||
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||
if (lua_istable(L,-1))
|
||||
{
|
||||
tolua_function(L, "addEventListenerPageView", lua_cocos2dx_UIPageView_addEventListenerPageView);
|
||||
tolua_function(L, "addEventListenerPageView", lua_cocos2dx_PageView_addEventListenerPageView);
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
||||
static int lua_cocos2dx_UIListView_addEventListenerListView(lua_State* L)
|
||||
static int lua_cocos2dx_ListView_addEventListenerListView(lua_State* L)
|
||||
{
|
||||
if (nullptr == L)
|
||||
return 0;
|
||||
|
||||
int argc = 0;
|
||||
UIListView* self = nullptr;
|
||||
ListView* self = nullptr;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
if (!tolua_isusertype(L,1,"UIListView",0,&tolua_err)) goto tolua_lerror;
|
||||
if (!tolua_isusertype(L,1,"ListView",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
self = static_cast<UIListView*>(tolua_tousertype(L,1,0));
|
||||
self = static_cast<ListView*>(tolua_tousertype(L,1,0));
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (nullptr == self) {
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_UIListView_addEventListenerListView'\n", NULL);
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_ListView_addEventListenerListView'\n", NULL);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -456,7 +456,7 @@ static int lua_cocos2dx_UIListView_addEventListenerListView(lua_State* L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
CCLOG("'addEventListenerListView' function of UIListView has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
CCLOG("'addEventListenerListView' function of ListView has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -467,35 +467,35 @@ tolua_lerror:
|
|||
#endif
|
||||
}
|
||||
|
||||
static void extendUIListView(lua_State* L)
|
||||
static void extendListView(lua_State* L)
|
||||
{
|
||||
lua_pushstring(L, "UIListView");
|
||||
lua_pushstring(L, "ListView");
|
||||
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||
if (lua_istable(L,-1))
|
||||
{
|
||||
tolua_function(L, "addEventListenerListView", lua_cocos2dx_UIListView_addEventListenerListView);
|
||||
tolua_function(L, "addEventListenerListView", lua_cocos2dx_ListView_addEventListenerListView);
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
||||
static int lua_cocos2dx_UILayoutParameter_setMargin(lua_State* L)
|
||||
static int lua_cocos2dx_LayoutParameter_setMargin(lua_State* L)
|
||||
{
|
||||
if (nullptr == L)
|
||||
return 0;
|
||||
|
||||
int argc = 0;
|
||||
UILayoutParameter* self = nullptr;
|
||||
LayoutParameter* self = nullptr;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
if (!tolua_isusertype(L,1,"UILayoutParameter",0,&tolua_err)) goto tolua_lerror;
|
||||
if (!tolua_isusertype(L,1,"LayoutParameter",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
self = static_cast<UILayoutParameter*>(tolua_tousertype(L,1,0));
|
||||
self = static_cast<LayoutParameter*>(tolua_tousertype(L,1,0));
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (nullptr == self) {
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_UILayoutParameter_setMargin'\n", NULL);
|
||||
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_LayoutParameter_setMargin'\n", NULL);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -510,7 +510,7 @@ static int lua_cocos2dx_UILayoutParameter_setMargin(lua_State* L)
|
|||
}
|
||||
#endif
|
||||
|
||||
UIMargin margin;
|
||||
Margin margin;
|
||||
lua_pushstring(L, "left");
|
||||
lua_gettable(L,2);
|
||||
margin.left = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);
|
||||
|
@ -535,7 +535,7 @@ static int lua_cocos2dx_UILayoutParameter_setMargin(lua_State* L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
CCLOG("'setMargin' function of UILayoutParameter has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
CCLOG("'setMargin' function of LayoutParameter has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -546,20 +546,20 @@ tolua_lerror:
|
|||
#endif
|
||||
}
|
||||
|
||||
static int lua_cocos2dx_UILayoutParameter_getMargin(lua_State* L)
|
||||
static int lua_cocos2dx_LayoutParameter_getMargin(lua_State* L)
|
||||
{
|
||||
if (nullptr == L)
|
||||
return 0;
|
||||
|
||||
int argc = 0;
|
||||
UILayoutParameter* self = nullptr;
|
||||
LayoutParameter* self = nullptr;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
if (!tolua_isusertype(L,1,"LayoutParameter",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
self = static_cast<UILayoutParameter*>(tolua_tousertype(L,1,0));
|
||||
self = static_cast<LayoutParameter*>(tolua_tousertype(L,1,0));
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (nullptr == self) {
|
||||
|
@ -571,7 +571,7 @@ static int lua_cocos2dx_UILayoutParameter_getMargin(lua_State* L)
|
|||
|
||||
if (0 == argc)
|
||||
{
|
||||
UIMargin margin = self->getMargin();
|
||||
Margin margin = self->getMargin();
|
||||
|
||||
lua_newtable(L);
|
||||
|
||||
|
@ -607,12 +607,12 @@ tolua_lerror:
|
|||
|
||||
static void extendLayoutParameter(lua_State* L)
|
||||
{
|
||||
lua_pushstring(L, "UILayoutParameter");
|
||||
lua_pushstring(L, "LayoutParameter");
|
||||
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||
if (lua_istable(L,-1))
|
||||
{
|
||||
tolua_function(L, "setMargin", lua_cocos2dx_UILayoutParameter_setMargin);
|
||||
tolua_function(L, "getMargin", lua_cocos2dx_UILayoutParameter_getMargin);
|
||||
tolua_function(L, "setMargin", lua_cocos2dx_LayoutParameter_setMargin);
|
||||
tolua_function(L, "getMargin", lua_cocos2dx_LayoutParameter_getMargin);
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
@ -911,12 +911,12 @@ int register_all_cocos2dx_coco_studio_manual(lua_State* L)
|
|||
{
|
||||
if (nullptr == L)
|
||||
return 0;
|
||||
extendUIWidget(L);
|
||||
extendUICheckBox(L);
|
||||
extendUISlider(L);
|
||||
extendUITextField(L);
|
||||
extendUIPageView(L);
|
||||
extendUIListView(L);
|
||||
extendWidget(L);
|
||||
extendCheckBox(L);
|
||||
extendSlider(L);
|
||||
extendTextField(L);
|
||||
extendPageView(L);
|
||||
extendListView(L);
|
||||
extendLayoutParameter(L);
|
||||
extendArmatureAnimation(L);
|
||||
extendArmatureDataManager(L);
|
||||
|
|
|
@ -1026,7 +1026,7 @@ public:
|
|||
LUA_TableViewDataSource(){}
|
||||
virtual ~LUA_TableViewDataSource(){}
|
||||
|
||||
virtual Size tableCellSizeForIndex(TableView *table, long idx)
|
||||
virtual Size tableCellSizeForIndex(TableView *table, ssize_t idx)
|
||||
{
|
||||
if (nullptr != table )
|
||||
{
|
||||
|
@ -1052,7 +1052,7 @@ public:
|
|||
return Size::ZERO;
|
||||
}
|
||||
|
||||
virtual TableViewCell* tableCellAtIndex(TableView *table, long idx)
|
||||
virtual TableViewCell* tableCellAtIndex(TableView *table, ssize_t idx)
|
||||
{
|
||||
if (nullptr != table )
|
||||
{
|
||||
|
@ -1078,7 +1078,7 @@ public:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
virtual long numberOfCellsInTableView(TableView *table)
|
||||
virtual ssize_t numberOfCellsInTableView(TableView *table)
|
||||
{
|
||||
if (nullptr != table )
|
||||
{
|
||||
|
@ -1094,7 +1094,7 @@ public:
|
|||
Double* numbers = dynamic_cast<Double*>(resultArray.getObjectAtIndex(0));
|
||||
if (NULL != numbers)
|
||||
{
|
||||
return (long)numbers->getValue();
|
||||
return (ssize_t)numbers->getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ public:
|
|||
*
|
||||
* @return number of cells
|
||||
*/
|
||||
virtual long numberOfCellsInTableView(TableView *table) = 0;
|
||||
virtual ssize_t numberOfCellsInTableView(TableView *table) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -41,13 +41,11 @@ add_executable(${APP_NAME}
|
|||
${SAMPLE_SRC}
|
||||
)
|
||||
|
||||
#get our resources
|
||||
add_custom_command(TARGET ${APP_NAME} PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Resources ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if(WIN32 AND MSVC)
|
||||
|
||||
#get our resources
|
||||
add_custom_command(TARGET ${APP_NAME} PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Resources ${CMAKE_CURRENT_BINARY_DIR})
|
||||
#get our dlls
|
||||
add_custom_command(TARGET ${APP_NAME} PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
|
@ -62,6 +60,16 @@ if(WIN32 AND MSVC)
|
|||
#Visual Studio Defaults to wrong type
|
||||
set_target_properties(${APP_NAME} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS")
|
||||
set_target_properties(${APP_NAME} PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")
|
||||
else()
|
||||
set(APP_BIN_DIR "${CMAKE_SOURCE_DIR}/bin/${APP_NAME}")
|
||||
|
||||
set_target_properties(${APP_NAME} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}")
|
||||
|
||||
pre_build(${APP_NAME}
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${APP_NAME} audio cocos2d)
|
||||
|
|
|
@ -65,21 +65,18 @@ Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp \
|
|||
Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIDragPanelTest/UIDragPanelTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIPanelTest/UIPanelTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UITextAreaTest/UITextAreaTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp \
|
||||
Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \
|
||||
Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \
|
||||
Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \
|
||||
|
|
|
@ -63,21 +63,18 @@ set(SAMPLE_SRC
|
|||
Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIDragPanelTest/UIDragPanelTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIPanelTest/UIPanelTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UITextAreaTest/UITextAreaTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp
|
||||
Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp
|
||||
Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp
|
||||
Classes/NewRendererTest/NewRendererTest.cpp
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "Box2dView.h"
|
||||
#include "GLES-Render.h"
|
||||
#include "Test.h"
|
||||
#include "renderer/CCRenderer.h"
|
||||
#include "renderer/CCCustomCommand.h"
|
||||
|
||||
#define kAccelerometerFrequency 30
|
||||
#define FRAMES_BETWEEN_PRESSES_FOR_DOUBLE_CLICK 10
|
||||
|
@ -210,15 +212,22 @@ void Box2DView::draw()
|
|||
{
|
||||
Layer::draw();
|
||||
|
||||
CustomCommand *cmd = CustomCommand::getCommandPool().generateCommand();
|
||||
cmd->init(0, _vertexZ);
|
||||
cmd->func = CC_CALLBACK_0(Box2DView::onDraw, this);
|
||||
Director::getInstance()->getRenderer()->addCommand(cmd);
|
||||
}
|
||||
|
||||
void Box2DView::onDraw()
|
||||
{
|
||||
kmMat4 oldMat;
|
||||
kmGLGetMatrix(KM_GL_MODELVIEW, &oldMat);
|
||||
kmGLLoadMatrix(&_modelViewTransform);
|
||||
GL::enableVertexAttribs( cocos2d::GL::VERTEX_ATTRIB_FLAG_POSITION );
|
||||
|
||||
kmGLPushMatrix();
|
||||
|
||||
m_test->m_world->DrawDebugData();
|
||||
|
||||
kmGLPopMatrix();
|
||||
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
|
||||
kmGLLoadMatrix(&oldMat);
|
||||
}
|
||||
|
||||
Box2DView::~Box2DView()
|
||||
|
|
|
@ -50,6 +50,8 @@ public:
|
|||
//virtual void accelerometer(UIAccelerometer* accelerometer, Acceleration* acceleration);
|
||||
|
||||
static Box2DView* viewWithEntryID(int entryId);
|
||||
protected:
|
||||
void onDraw();
|
||||
};
|
||||
|
||||
class Box2dTestBedScene : public TestScene
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
#include "ClippingNodeTest.h"
|
||||
#include "../testResource.h"
|
||||
#include "renderer/CCRenderer.h"
|
||||
#include "renderer/CCCustomCommand.h"
|
||||
|
||||
enum {
|
||||
kTagTitleLabel = 1,
|
||||
|
@ -596,8 +598,14 @@ void RawStencilBufferTest::draw()
|
|||
|
||||
auto planeSize = winPoint * (1.0 / _planeCount);
|
||||
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
Renderer *renderer = Director::getInstance()->getRenderer();
|
||||
|
||||
CustomCommand *cmd = CustomCommand::getCommandPool().generateCommand();
|
||||
cmd->init(0, _vertexZ);
|
||||
cmd->func = CC_CALLBACK_0(RawStencilBufferTest::onEnableStencil, this);
|
||||
renderer->addCommand(cmd);
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < _planeCount; i++) {
|
||||
|
||||
|
@ -608,21 +616,21 @@ void RawStencilBufferTest::draw()
|
|||
spritePoint.x += planeSize.x / 2;
|
||||
spritePoint.y = 0;
|
||||
_sprite->setPosition( spritePoint );
|
||||
|
||||
this->setupStencilForClippingOnPlane(i);
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
|
||||
DrawPrimitives::drawSolidRect(Point::ZERO, stencilPoint, Color4F(1, 1, 1, 1));
|
||||
|
||||
cmd = CustomCommand::getCommandPool().generateCommand();
|
||||
cmd->init(0, _vertexZ);
|
||||
cmd->func = CC_CALLBACK_0(RawStencilBufferTest::onBeforeDrawClip, this, i, stencilPoint);
|
||||
renderer->addCommand(cmd);
|
||||
|
||||
kmGLPushMatrix();
|
||||
this->transform();
|
||||
_sprite->visit();
|
||||
kmGLPopMatrix();
|
||||
|
||||
this->setupStencilForDrawingOnPlane(i);
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
|
||||
DrawPrimitives::drawSolidRect(Point::ZERO, winPoint, _planeColor[i]);
|
||||
cmd = CustomCommand::getCommandPool().generateCommand();
|
||||
cmd->init(0, _vertexZ);
|
||||
cmd->func = CC_CALLBACK_0(RawStencilBufferTest::onBeforeDrawSprite, this, i, winPoint);
|
||||
renderer->addCommand(cmd);
|
||||
|
||||
kmGLPushMatrix();
|
||||
this->transform();
|
||||
|
@ -630,10 +638,40 @@ void RawStencilBufferTest::draw()
|
|||
kmGLPopMatrix();
|
||||
}
|
||||
|
||||
cmd = CustomCommand::getCommandPool().generateCommand();
|
||||
cmd->init(0, _vertexZ);
|
||||
cmd->func = CC_CALLBACK_0(RawStencilBufferTest::onDisableStencil, this);
|
||||
renderer->addCommand(cmd);
|
||||
|
||||
}
|
||||
|
||||
void RawStencilBufferTest::onEnableStencil()
|
||||
{
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
}
|
||||
|
||||
void RawStencilBufferTest::onDisableStencil()
|
||||
{
|
||||
glDisable(GL_STENCIL_TEST);
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
}
|
||||
|
||||
void RawStencilBufferTest::onBeforeDrawClip(int planeIndex, const Point& pt)
|
||||
{
|
||||
this->setupStencilForClippingOnPlane(planeIndex);
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
DrawPrimitives::drawSolidRect(Point::ZERO, pt, Color4F(1, 1, 1, 1));
|
||||
}
|
||||
|
||||
void RawStencilBufferTest::onBeforeDrawSprite(int planeIndex, const Point& pt)
|
||||
{
|
||||
this->setupStencilForDrawingOnPlane(planeIndex);
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
|
||||
DrawPrimitives::drawSolidRect(Point::ZERO, pt, _planeColor[planeIndex]);
|
||||
}
|
||||
|
||||
void RawStencilBufferTest::setupStencilForClippingOnPlane(GLint plane)
|
||||
{
|
||||
GLint planeMask = 0x1 << plane;
|
||||
|
|
|
@ -156,6 +156,11 @@ public:
|
|||
virtual void setupStencilForClippingOnPlane(GLint plane);
|
||||
virtual void setupStencilForDrawingOnPlane(GLint plane);
|
||||
|
||||
protected:
|
||||
void onEnableStencil();
|
||||
void onDisableStencil();
|
||||
void onBeforeDrawClip(int planeIndex, const Point& pt);
|
||||
void onBeforeDrawSprite(int planeIndex, const Point& pt);
|
||||
protected:
|
||||
Sprite* _sprite;
|
||||
};
|
||||
|
|
|
@ -96,7 +96,7 @@ TableViewCell* TableViewTestLayer::tableCellAtIndex(TableView *table, ssize_t id
|
|||
return cell;
|
||||
}
|
||||
|
||||
long TableViewTestLayer::numberOfCellsInTableView(TableView *table)
|
||||
ssize_t TableViewTestLayer::numberOfCellsInTableView(TableView *table)
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
virtual void tableCellTouched(cocos2d::extension::TableView* table, cocos2d::extension::TableViewCell* cell);
|
||||
virtual cocos2d::Size tableCellSizeForIndex(cocos2d::extension::TableView *table, ssize_t idx);
|
||||
virtual cocos2d::extension::TableViewCell* tableCellAtIndex(cocos2d::extension::TableView *table, ssize_t idx);
|
||||
virtual long numberOfCellsInTableView(cocos2d::extension::TableView *table);
|
||||
virtual ssize_t numberOfCellsInTableView(cocos2d::extension::TableView *table);
|
||||
};
|
||||
|
||||
#endif // __TABLEVIEWTESTSCENE_H__
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "LabelTestNew.h"
|
||||
#include "../testResource.h"
|
||||
#include "renderer/CCRenderer.h"
|
||||
#include "renderer/CCCustomCommand.h"
|
||||
|
||||
enum {
|
||||
kTagTileMap = 1,
|
||||
|
@ -300,9 +302,24 @@ LabelFNTSpriteActions::LabelFNTSpriteActions()
|
|||
|
||||
void LabelFNTSpriteActions::draw()
|
||||
{
|
||||
CustomCommand *cmd = CustomCommand::getCommandPool().generateCommand();
|
||||
cmd->init(0, _vertexZ);
|
||||
cmd->func = CC_CALLBACK_0(LabelFNTSpriteActions::onDraw, this);
|
||||
Director::getInstance()->getRenderer()->addCommand(cmd);
|
||||
|
||||
}
|
||||
|
||||
void LabelFNTSpriteActions::onDraw()
|
||||
{
|
||||
kmMat4 oldMat;
|
||||
kmGLGetMatrix(KM_GL_MODELVIEW, &oldMat);
|
||||
kmGLLoadMatrix(&_modelViewTransform);
|
||||
|
||||
auto s = Director::getInstance()->getWinSize();
|
||||
DrawPrimitives::drawLine( Point(0, s.height/2), Point(s.width, s.height/2) );
|
||||
DrawPrimitives::drawLine( Point(s.width/2, 0), Point(s.width/2, s.height) );
|
||||
|
||||
kmGLLoadMatrix(&oldMat);
|
||||
}
|
||||
|
||||
void LabelFNTSpriteActions::step(float dt)
|
||||
|
@ -897,6 +914,18 @@ std::string LabelFNTBounds::subtitle() const
|
|||
|
||||
void LabelFNTBounds::draw()
|
||||
{
|
||||
CustomCommand *cmd = CustomCommand::getCommandPool().generateCommand();
|
||||
cmd->init(0, _vertexZ);
|
||||
cmd->func = CC_CALLBACK_0(LabelFNTBounds::onDraw, this);
|
||||
Director::getInstance()->getRenderer()->addCommand(cmd);
|
||||
}
|
||||
|
||||
void LabelFNTBounds::onDraw()
|
||||
{
|
||||
kmMat4 oldMat;
|
||||
kmGLGetMatrix(KM_GL_MODELVIEW, &oldMat);
|
||||
kmGLLoadMatrix(&_modelViewTransform);
|
||||
|
||||
auto labelSize = label1->getContentSize();
|
||||
auto origin = Director::getInstance()->getWinSize();
|
||||
|
||||
|
@ -911,6 +940,8 @@ void LabelFNTBounds::draw()
|
|||
Point(origin.width, labelSize.height + origin.height)
|
||||
};
|
||||
DrawPrimitives::drawPoly(vertices, 4, true);
|
||||
|
||||
kmGLLoadMatrix(&oldMat);
|
||||
}
|
||||
|
||||
LabelTTFLongLineWrapping::LabelTTFLongLineWrapping()
|
||||
|
|
|
@ -60,6 +60,8 @@ public:
|
|||
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
protected:
|
||||
void onDraw();
|
||||
};
|
||||
|
||||
class LabelFNTPadding : public AtlasDemoNew
|
||||
|
@ -223,6 +225,8 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
private:
|
||||
Label *label1;
|
||||
protected:
|
||||
void onDraw();
|
||||
};
|
||||
|
||||
class LabelTTFLongLineWrapping : public AtlasDemoNew
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// local import
|
||||
#include "Texture2dTest.h"
|
||||
#include "../testResource.h"
|
||||
#include "renderer/CCRenderer.h"
|
||||
#include "renderer/CCCustomCommand.h"
|
||||
|
||||
enum {
|
||||
kTagLabel = 1,
|
||||
|
@ -1765,12 +1767,25 @@ std::string TextureDrawAtPoint::subtitle() const
|
|||
void TextureDrawAtPoint::draw()
|
||||
{
|
||||
TextureDemo::draw();
|
||||
|
||||
CustomCommand *cmd = CustomCommand::getCommandPool().generateCommand();
|
||||
cmd->init(0, _vertexZ);
|
||||
cmd->func = CC_CALLBACK_0(TextureDrawAtPoint::onDraw, this);
|
||||
Director::getInstance()->getRenderer()->addCommand(cmd);
|
||||
|
||||
}
|
||||
|
||||
void TextureDrawAtPoint::onDraw()
|
||||
{
|
||||
kmMat4 oldMat;
|
||||
kmGLGetMatrix(KM_GL_MODELVIEW, &oldMat);
|
||||
kmGLLoadMatrix(&_modelViewTransform);
|
||||
auto s = Director::getInstance()->getWinSize();
|
||||
|
||||
|
||||
_tex1->drawAtPoint(Point(s.width/2-50, s.height/2 - 50));
|
||||
_Tex2F->drawAtPoint(Point(s.width/2+50, s.height/2 - 50));
|
||||
|
||||
|
||||
kmGLLoadMatrix(&oldMat);
|
||||
}
|
||||
|
||||
// TextureDrawInRect
|
||||
|
@ -1795,14 +1810,28 @@ void TextureDrawInRect::draw()
|
|||
{
|
||||
TextureDemo::draw();
|
||||
|
||||
auto s = Director::getInstance()->getWinSize();
|
||||
CustomCommand *cmd = CustomCommand::getCommandPool().generateCommand();
|
||||
cmd->init(0, _vertexZ);
|
||||
cmd->func = CC_CALLBACK_0(TextureDrawInRect::onDraw, this);
|
||||
Director::getInstance()->getRenderer()->addCommand(cmd);
|
||||
|
||||
}
|
||||
|
||||
void TextureDrawInRect::onDraw()
|
||||
{
|
||||
kmMat4 oldMat;
|
||||
kmGLGetMatrix(KM_GL_MODELVIEW, &oldMat);
|
||||
kmGLLoadMatrix(&_modelViewTransform);
|
||||
|
||||
auto s = Director::getInstance()->getWinSize();
|
||||
|
||||
auto rect1 = Rect( s.width/2 - 80, 20, _tex1->getContentSize().width * 0.5f, _tex1->getContentSize().height *2 );
|
||||
auto rect2 = Rect( s.width/2 + 80, s.height/2, _tex1->getContentSize().width * 2, _tex1->getContentSize().height * 0.5f );
|
||||
|
||||
|
||||
_tex1->drawInRect(rect1);
|
||||
_Tex2F->drawInRect(rect2);
|
||||
|
||||
|
||||
kmGLLoadMatrix(&oldMat);
|
||||
}
|
||||
|
||||
std::string TextureDrawInRect::title() const
|
||||
|
|
|
@ -441,6 +441,8 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
virtual void onEnter();
|
||||
virtual void draw();
|
||||
protected:
|
||||
void onDraw();
|
||||
private:
|
||||
Texture2D* _tex1, *_Tex2F;
|
||||
};
|
||||
|
@ -454,6 +456,8 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
virtual void onEnter();
|
||||
virtual void draw();
|
||||
protected:
|
||||
void onDraw();
|
||||
private:
|
||||
Texture2D* _tex1, *_Tex2F;
|
||||
};
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "TileMapTest.h"
|
||||
#include "../testResource.h"
|
||||
#include "renderer/CCRenderer.h"
|
||||
#include "renderer/CCCustomCommand.h"
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -597,6 +599,18 @@ TMXOrthoObjectsTest::TMXOrthoObjectsTest()
|
|||
|
||||
void TMXOrthoObjectsTest::draw()
|
||||
{
|
||||
CustomCommand *cmd = CustomCommand::getCommandPool().generateCommand();
|
||||
cmd->init(0, _vertexZ);
|
||||
cmd->func = CC_CALLBACK_0(TMXOrthoObjectsTest::onDraw, this);
|
||||
Director::getInstance()->getRenderer()->addCommand(cmd);
|
||||
}
|
||||
|
||||
void TMXOrthoObjectsTest::onDraw()
|
||||
{
|
||||
kmMat4 oldMat;
|
||||
kmGLGetMatrix(KM_GL_MODELVIEW, &oldMat);
|
||||
kmGLLoadMatrix(&_modelViewTransform);
|
||||
|
||||
auto map = static_cast<TMXTiledMap*>( getChildByTag(kTagTileMap) );
|
||||
auto group = map->getObjectGroup("Object Group 1");
|
||||
|
||||
|
@ -620,6 +634,8 @@ void TMXOrthoObjectsTest::draw()
|
|||
|
||||
glLineWidth(1);
|
||||
}
|
||||
|
||||
kmGLLoadMatrix(&oldMat);
|
||||
}
|
||||
|
||||
std::string TMXOrthoObjectsTest::title() const
|
||||
|
@ -657,6 +673,18 @@ TMXIsoObjectsTest::TMXIsoObjectsTest()
|
|||
|
||||
void TMXIsoObjectsTest::draw()
|
||||
{
|
||||
CustomCommand *cmd = CustomCommand::getCommandPool().generateCommand();
|
||||
cmd->init(0, _vertexZ);
|
||||
cmd->func = CC_CALLBACK_0(TMXIsoObjectsTest::onDraw, this);
|
||||
Director::getInstance()->getRenderer()->addCommand(cmd);
|
||||
}
|
||||
|
||||
void TMXIsoObjectsTest::onDraw()
|
||||
{
|
||||
kmMat4 oldMat;
|
||||
kmGLGetMatrix(KM_GL_MODELVIEW, &oldMat);
|
||||
kmGLLoadMatrix(&_modelViewTransform);
|
||||
|
||||
auto map = (TMXTiledMap*) getChildByTag(kTagTileMap);
|
||||
auto group = map->getObjectGroup("Object Group 1");
|
||||
|
||||
|
@ -678,6 +706,8 @@ void TMXIsoObjectsTest::draw()
|
|||
|
||||
glLineWidth(1);
|
||||
}
|
||||
|
||||
kmGLLoadMatrix(&oldMat);
|
||||
}
|
||||
|
||||
std::string TMXIsoObjectsTest::title() const
|
||||
|
@ -1445,9 +1475,21 @@ TMXGIDObjectsTest::TMXGIDObjectsTest()
|
|||
|
||||
void TMXGIDObjectsTest::draw()
|
||||
{
|
||||
CustomCommand *cmd = CustomCommand::getCommandPool().generateCommand();
|
||||
cmd->init(0, _vertexZ);
|
||||
cmd->func = CC_CALLBACK_0(TMXGIDObjectsTest::onDraw, this);
|
||||
Director::getInstance()->getRenderer()->addCommand(cmd);
|
||||
}
|
||||
|
||||
void TMXGIDObjectsTest::onDraw()
|
||||
{
|
||||
kmMat4 oldMat;
|
||||
kmGLGetMatrix(KM_GL_MODELVIEW, &oldMat);
|
||||
kmGLLoadMatrix(&_modelViewTransform);
|
||||
|
||||
auto map = (TMXTiledMap*)getChildByTag(kTagTileMap);
|
||||
auto group = map->getObjectGroup("Object Layer 1");
|
||||
|
||||
|
||||
auto& objects = group->getObjects();
|
||||
for (auto& obj : objects)
|
||||
{
|
||||
|
@ -1457,16 +1499,18 @@ void TMXGIDObjectsTest::draw()
|
|||
float y = dict["y"].asFloat();
|
||||
float width = dict["width"].asFloat();
|
||||
float height = dict["height"].asFloat();
|
||||
|
||||
|
||||
glLineWidth(3);
|
||||
|
||||
|
||||
DrawPrimitives::drawLine(Point(x, y), Point(x + width, y));
|
||||
DrawPrimitives::drawLine(Point(x + width, y), Point(x + width, y + height));
|
||||
DrawPrimitives::drawLine(Point(x + width,y + height), Point(x,y + height));
|
||||
DrawPrimitives::drawLine(Point(x,y + height), Point(x,y));
|
||||
|
||||
|
||||
glLineWidth(1);
|
||||
}
|
||||
|
||||
kmGLLoadMatrix(&oldMat);
|
||||
}
|
||||
|
||||
std::string TMXGIDObjectsTest::title() const
|
||||
|
|
|
@ -135,6 +135,8 @@ public:
|
|||
|
||||
virtual void draw();
|
||||
virtual std::string subtitle() const override;
|
||||
protected:
|
||||
void onDraw();
|
||||
};
|
||||
|
||||
class TMXIsoObjectsTest : public TileDemo
|
||||
|
@ -145,6 +147,8 @@ public:
|
|||
|
||||
virtual void draw();
|
||||
virtual std::string subtitle() const override;
|
||||
protected:
|
||||
void onDraw();
|
||||
};
|
||||
|
||||
class TMXResizeTest : public TileDemo
|
||||
|
@ -279,6 +283,10 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
virtual void draw();
|
||||
|
||||
protected:
|
||||
void onDraw();
|
||||
|
||||
};
|
||||
|
||||
class TileMapTestScene : public TestScene
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 8777403545dbc9a131a8ae12ad6293194bd331d6
|
||||
Subproject commit c842ccaa4b31121ac5f7be99ca64cafeb8d422c5
|
|
@ -7,6 +7,9 @@ prefix = cocos2dx_gui
|
|||
# all classes will be embedded in that namespace
|
||||
target_namespace = ccs
|
||||
|
||||
# the native namespace in which this module locates, this parameter is used for avoid conflict of the same class name in different modules, as "cocos2d::Label" <-> "cocos2d::gui::Label".
|
||||
cpp_namespace = cocos2d::gui
|
||||
|
||||
android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include
|
||||
android_flags = -D_SIZE_T_DEFINED_
|
||||
|
||||
|
@ -27,7 +30,7 @@ headers = %(cocosdir)s/cocos/gui/CocosGUI.h
|
|||
|
||||
# what classes to produce code for. You can use regular expressions here. When testing the regular
|
||||
# expression, it will be enclosed in "^$", like this: "^Menu*$".
|
||||
classes = UIHelper UILayout UIWidget UILayer UIButton UICheckBox UIImageView UILabel UILabelAtlas UILabelBMFont UILoadingBar UISlider UISwitch UITextField UIScrollView UIPageView UIListView UILayoutParameter UILinearLayoutParameter UIRelativeLayoutParameter
|
||||
classes = Helper Layout Widget Layer Button CheckBox ImageView Label LabelAtlas LabelBMFont LoadingBar Slider Switch TextField ScrollView PageView ListView LayoutParameter LinearLayoutParameter RelativeLayoutParameter
|
||||
|
||||
# what should we skip? in the format ClassName::[function function]
|
||||
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
|
||||
|
@ -37,10 +40,10 @@ classes = UIHelper UILayout UIWidget UILayer UIButton UICheckBox UIImageView UIL
|
|||
# functions from all classes.
|
||||
|
||||
skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*HSV onTouch.* onAcc.* onKey.* onRegisterTouchListener (s|g)etBlendFunc ccTouch.*],
|
||||
UIWidget::[(s|g)etUserObject],
|
||||
UILayer::[getInputManager],
|
||||
UILayoutParameter::[(s|g)etMargin],
|
||||
UIImageView::[doubleClickEvent checkDoubleClick]
|
||||
Widget::[(s|g)etUserObject],
|
||||
Layer::[getInputManager],
|
||||
LayoutParameter::[(s|g)etMargin],
|
||||
ImageView::[doubleClickEvent checkDoubleClick]
|
||||
|
||||
rename_functions =
|
||||
|
||||
|
@ -50,14 +53,14 @@ rename_classes =
|
|||
remove_prefix =
|
||||
|
||||
# classes for which there will be no "parent" lookup
|
||||
classes_have_no_parents = UIHelper
|
||||
classes_have_no_parents = Helper
|
||||
|
||||
# base classes which will be skipped when their sub-classes found them.
|
||||
base_classes_to_skip = Object
|
||||
|
||||
# classes that create no constructor
|
||||
# Set is special and we will use a hand-written constructor
|
||||
abstract_classes = UIHelper
|
||||
abstract_classes = Helper
|
||||
|
||||
# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.
|
||||
script_control_cpp = no
|
||||
|
|
|
@ -7,6 +7,9 @@ prefix = cocos2dx_studio
|
|||
# all classes will be embedded in that namespace
|
||||
target_namespace = ccs
|
||||
|
||||
# the native namespace in which this module locates, this parameter is used for avoid conflict of the same class name in different modules, as "cocos2d::Label" <-> "cocos2d::gui::Label".
|
||||
cpp_namespace = cocos2d::gui cocostudio
|
||||
|
||||
android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include
|
||||
android_flags = -D_SIZE_T_DEFINED_
|
||||
|
||||
|
@ -27,7 +30,7 @@ headers = %(cocosdir)s/cocos/gui/CocosGUI.h %(cocosdir)s/cocos/editor-support/co
|
|||
|
||||
# what classes to produce code for. You can use regular expressions here. When testing the regular
|
||||
# expression, it will be enclosed in "^$", like this: "^Menu*$".
|
||||
classes = Armature ArmatureAnimation Skin Bone ArmatureDataManager \w+Data$ UIWidget UILayout UIRootWidget UIButton UICheckBox UIImageView UILabel UICCLabelAtlas UILabelAtlas UILoadingBar UIScrollView UISlider UICCTextField UITextField UIListView UILabelBMFont UIPageView UIHelper UILayer UILayoutParameter GUIReader UILinearLayoutParameter UIRelativeLayoutParameter SceneReader ActionManagerEx ComAudio ComController ComAttribute ComRender BatchNode
|
||||
classes = Armature ArmatureAnimation Skin Bone ArmatureDataManager \w+Data$ Widget Layout RootWidget Button CheckBox ImageView Label CCLabelAtlas LabelAtlas LoadingBar ScrollView Slider CCTextField TextField ListView LabelBMFont PageView Helper Layer LayoutParameter GReader LinearLayoutParameter RelativeLayoutParameter SceneReader ActionManagerEx ComAudio ComController ComAttribute ComRender BatchNode
|
||||
|
||||
# what should we skip? in the format ClassName::[function function]
|
||||
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
|
||||
|
@ -42,11 +45,11 @@ skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*
|
|||
Skin::[(s|g)etSkinData],
|
||||
ArmatureAnimation::[updateHandler updateFrameData frameEvent setMovementEventCallFunc setFrameEventCallFunc],
|
||||
Bone::[(s|g)etIgnoreMovementBoneData],
|
||||
UILayer::[getInputManager],
|
||||
UILayoutParameter::[(s|g)etMargin],
|
||||
UIHelper::[init],
|
||||
GUIReader::[setPropsForImageButtonFromJsonDictionary],
|
||||
UIImageView::[doubleClickEvent]
|
||||
Layer::[getInputManager],
|
||||
LayoutParameter::[(s|g)etMargin],
|
||||
Helper::[init],
|
||||
GReader::[setPropsForImageButtonFromJsonDictionary],
|
||||
ImageView::[doubleClickEvent]
|
||||
|
||||
rename_functions = GUIReader::[shareReader=getInstance purgeGUIReader=destroyInstance],
|
||||
ActionManagerEx::[shareManager=getInstance purgeActionManager=destroyInstance],
|
||||
|
|
Loading…
Reference in New Issue