diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index d6685f2184..f4d07e01b4 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -4,9 +4,8 @@ Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. -Copyright (c) Bytedance Inc. - -https://adxe.org + +http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -47,30 +46,40 @@ THE SOFTWARE. #include "renderer/backend/ProgramState.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) -# include "platform/desktop/CCGLViewImpl-desktop.h" +#include "platform/desktop/CCGLViewImpl-desktop.h" #endif NS_CC_BEGIN // Layer Layer::Layer() +: _touchEnabled(false) +, _accelerometerEnabled(false) +, _keyboardEnabled(false) +, _touchListener(nullptr) +, _keyboardListener(nullptr) +, _accelerationListener(nullptr) +, _touchMode(Touch::DispatchMode::ALL_AT_ONCE) +, _swallowsTouches(true) { _ignoreAnchorPointForPosition = true; setAnchorPoint(Vec2(0.5f, 0.5f)); } -Layer::~Layer() {} +Layer::~Layer() +{ + +} bool Layer::init() { - Sprite::init(); setContentSize(_director->getWinSize()); return true; } -Layer* Layer::create() +Layer *Layer::create() { - Layer* ret = new (std::nothrow) Layer(); + Layer *ret = new (std::nothrow) Layer(); if (ret && ret->init()) { ret->autorelease(); @@ -83,13 +92,204 @@ Layer* Layer::create() } } +int Layer::executeScriptTouchHandler(EventTouch::EventCode eventType, Touch* touch, Event* event) +{ +#if CC_ENABLE_SCRIPT_BINDING + TouchScriptData data(eventType, this, touch, event); + ScriptEvent scriptEvent(kTouchEvent, &data); + return ScriptEngineManager::sendEventToLua(scriptEvent); +#else + CC_UNUSED_PARAM(eventType); + CC_UNUSED_PARAM(touch); + CC_UNUSED_PARAM(event); + return 0; +#endif +} + +int Layer::executeScriptTouchesHandler(EventTouch::EventCode eventType, const std::vector& touches, Event* event) +{ +#if CC_ENABLE_SCRIPT_BINDING + TouchesScriptData data(eventType, this, touches, event); + ScriptEvent scriptEvent(kTouchesEvent, &data); + return ScriptEngineManager::sendEventToLua(scriptEvent); +#else + CC_UNUSED_PARAM(eventType); + CC_UNUSED_PARAM(touches); + CC_UNUSED_PARAM(event); + return 0; +#endif +} + + +void Layer::onAcceleration(Acceleration* acc, Event* /*unused_event*/) +{ +#if CC_ENABLE_SCRIPT_BINDING + BasicScriptData data(this,(void*)acc); + ScriptEvent event(kAccelerometerEvent,&data); + ScriptEngineManager::sendEventToLua(event); +#else + CC_UNUSED_PARAM(acc); +#endif +} + +void Layer::onKeyPressed(EventKeyboard::KeyCode /*keyCode*/, Event* /*unused_event*/) +{ +} + +void Layer::onKeyReleased(EventKeyboard::KeyCode keyCode, Event* /*unused_event*/) +{ +#if CC_ENABLE_SCRIPT_BINDING + KeypadScriptData data(keyCode, this); + ScriptEvent event(kKeypadEvent,&data); + ScriptEngineManager::sendEventToLua(event); +#else + CC_UNUSED_PARAM(keyCode); +#endif +} + +/// Callbacks + +bool Layer::onTouchBegan(Touch *touch, Event *event) +{ +#if CC_ENABLE_SCRIPT_BINDING + return executeScriptTouchHandler(EventTouch::EventCode::BEGAN, touch, event) == 0 ? false : true; +#else + CC_UNUSED_PARAM(touch); + CC_UNUSED_PARAM(event); + CCASSERT(false, "Layer#ccTouchBegan override me"); + return true; +#endif +} + +void Layer::onTouchMoved(Touch *touch, Event *event) +{ +#if CC_ENABLE_SCRIPT_BINDING + executeScriptTouchHandler(EventTouch::EventCode::MOVED, touch, event); +#else + CC_UNUSED_PARAM(touch); + CC_UNUSED_PARAM(event); +#endif +} + +void Layer::onTouchEnded(Touch *touch, Event *event) +{ +#if CC_ENABLE_SCRIPT_BINDING + executeScriptTouchHandler(EventTouch::EventCode::ENDED, touch, event); +#else + CC_UNUSED_PARAM(touch); + CC_UNUSED_PARAM(event); +#endif +} + +void Layer::onTouchCancelled(Touch *touch, Event *event) +{ +#if CC_ENABLE_SCRIPT_BINDING + executeScriptTouchHandler(EventTouch::EventCode::CANCELLED, touch, event); +#else + CC_UNUSED_PARAM(touch); + CC_UNUSED_PARAM(event); +#endif +} + +void Layer::onTouchesBegan(const std::vector& touches, Event *event) +{ +#if CC_ENABLE_SCRIPT_BINDING + executeScriptTouchesHandler(EventTouch::EventCode::BEGAN, touches, event); +#else + CC_UNUSED_PARAM(touches); + CC_UNUSED_PARAM(event); +#endif +} + +void Layer::onTouchesMoved(const std::vector& touches, Event *event) +{ +#if CC_ENABLE_SCRIPT_BINDING + executeScriptTouchesHandler(EventTouch::EventCode::MOVED, touches, event); +#else + CC_UNUSED_PARAM(touches); + CC_UNUSED_PARAM(event); +#endif +} + +void Layer::onTouchesEnded(const std::vector& touches, Event *event) +{ +#if CC_ENABLE_SCRIPT_BINDING + executeScriptTouchesHandler(EventTouch::EventCode::ENDED, touches, event); +#else + CC_UNUSED_PARAM(touches); + CC_UNUSED_PARAM(event); +#endif +} + +void Layer::onTouchesCancelled(const std::vector& touches, Event *event) +{ +#if CC_ENABLE_SCRIPT_BINDING + executeScriptTouchesHandler(EventTouch::EventCode::CANCELLED, touches, event); +#else + CC_UNUSED_PARAM(touches); + CC_UNUSED_PARAM(event); +#endif +} + std::string Layer::getDescription() const { return StringUtils::format("", _tag); } /// LayerColor -LayerColor::LayerColor() {} + +LayerColor::LayerColor() +{ + // default blend function + _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; + + auto& pipelinePS = _customCommand.getPipelineDescriptor().programState; + auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_COLOR); + + //!!! LayerColor private programState don't want affect by Node::_programState, so store at _customCommand + pipelinePS = new backend::ProgramState(program); + + auto vertexLayout = pipelinePS->getVertexLayout(); + const auto& attributeInfo = pipelinePS->getProgram()->getActiveAttributes(); + auto iter = attributeInfo.find("a_position"); + if(iter != attributeInfo.end()) + { + vertexLayout->setAttribute("a_position", iter->second.location, backend::VertexFormat::FLOAT3, 0, false); + } + iter = attributeInfo.find("a_color"); + if(iter != attributeInfo.end()) + { + vertexLayout->setAttribute("a_color", iter->second.location, backend::VertexFormat::FLOAT4, sizeof(_vertexData[0].vertices), false); + } + vertexLayout->setLayout(sizeof(_vertexData[0])); + + _mvpMatrixLocation = pipelinePS->getUniformLocation("u_MVPMatrix"); + + _customCommand.createIndexBuffer(CustomCommand::IndexFormat::U_SHORT, 6, CustomCommand::BufferUsage::STATIC); + unsigned short indices[] = {0, 1, 2, 2, 1, 3}; + _customCommand.updateIndexBuffer(indices, sizeof(indices)); + + _customCommand.createVertexBuffer(sizeof(_vertexData[0]), 4, CustomCommand::BufferUsage::DYNAMIC); + + _customCommand.setDrawType(CustomCommand::DrawType::ELEMENT); + _customCommand.setPrimitiveType(CustomCommand::PrimitiveType::TRIANGLE); +} + +LayerColor::~LayerColor() +{ + CC_SAFE_RELEASE_NULL(_customCommand.getPipelineDescriptor().programState); +} + +/// blendFunc getter +const BlendFunc &LayerColor::getBlendFunc() const +{ + return _blendFunc; +} +/// blendFunc setter +void LayerColor::setBlendFunc(const BlendFunc &var) +{ + _blendFunc = var; +} LayerColor* LayerColor::create() { @@ -105,10 +305,10 @@ LayerColor* LayerColor::create() return ret; } -LayerColor* LayerColor::create(const Color4B& color, float width, float height) +LayerColor * LayerColor::create(const Color4B& color, float width, float height) { - LayerColor* layer = new (std::nothrow) LayerColor(); - if (layer && layer->initWithColor(color, width, height)) + LayerColor * layer = new (std::nothrow) LayerColor(); + if( layer && layer->initWithColor(color,width,height)) { layer->autorelease(); return layer; @@ -117,10 +317,10 @@ LayerColor* LayerColor::create(const Color4B& color, float width, float height) return nullptr; } -LayerColor* LayerColor::create(const Color4B& color) +LayerColor * LayerColor::create(const Color4B& color) { - LayerColor* layer = new (std::nothrow) LayerColor(); - if (layer && layer->initWithColor(color)) + LayerColor * layer = new (std::nothrow) LayerColor(); + if(layer && layer->initWithColor(color)) { layer->autorelease(); return layer; @@ -132,22 +332,30 @@ LayerColor* LayerColor::create(const Color4B& color) bool LayerColor::init() { Size s = _director->getWinSize(); - return initWithColor(Color4B(0, 0, 0, 0), s.width, s.height); + return initWithColor(Color4B(0,0,0,0), s.width, s.height); } bool LayerColor::initWithColor(const Color4B& color, float w, float h) { - if (Sprite::init()) + if (Layer::init()) { - // Anchor behavior same with Layer - _ignoreAnchorPointForPosition = true; - setAnchorPoint(Vec2(0.5f, 0.5f)); - const Rect defaultRect{0.f, 0.f, 2.f, 2.f}; - setTextureRect(defaultRect, false, defaultRect.size); + // default blend function + _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED; + + _displayedColor.r = _realColor.r = color.r; + _displayedColor.g = _realColor.g = color.g; + _displayedColor.b = _realColor.b = color.b; + _displayedOpacity = _realOpacity = color.a; + + for (size_t i = 0; isetContentSize(Size(w, h)); } @@ -175,17 +394,57 @@ void LayerColor::changeHeight(float h) this->setContentSize(Size(_contentSize.width, h)); } +void LayerColor::updateColor() +{ + for (int i = 0; i < 4; i++ ) + { + _vertexData[i].colors.r = _displayedColor.r / 255.0f; + _vertexData[i].colors.g = _displayedColor.g / 255.0f; + _vertexData[i].colors.b = _displayedColor.b / 255.0f; + _vertexData[i].colors.a = _displayedOpacity / 255.0f; + } +} + +void LayerColor::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) +{ + _customCommand.init(_globalZOrder, _blendFunc); + renderer->addCommand(&_customCommand); + + cocos2d::Mat4 projectionMat = _director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); + auto& pipelineDescriptor = _customCommand.getPipelineDescriptor(); + pipelineDescriptor.programState->setUniform(_mvpMatrixLocation, projectionMat.m, sizeof(projectionMat.m)); + + for(int i = 0; i < 4; ++i) + { + Vec4 pos; + pos.x = _squareVertices[i].x; pos.y = _squareVertices[i].y; pos.z = _positionZ; + pos.w = 1; + _modelViewTransform.transformVector(&pos); + _vertexData[i].vertices = Vec3(pos.x,pos.y,pos.z)/pos.w; + } + updateVertexBuffer(); +} + +void LayerColor::updateVertexBuffer() +{ + _customCommand.updateVertexBuffer(_vertexData, sizeof(_vertexData)); +} + // // LayerGradient // -LayerGradient::LayerGradient() {} +LayerGradient::LayerGradient() +{ +} -LayerGradient::~LayerGradient() {} +LayerGradient::~LayerGradient() +{ +} LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end) { - LayerGradient* layer = new (std::nothrow) LayerGradient(); - if (layer && layer->initWithColor(start, end)) + LayerGradient * layer = new (std::nothrow) LayerGradient(); + if( layer && layer->initWithColor(start, end)) { layer->autorelease(); return layer; @@ -196,8 +455,8 @@ LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end) LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end, const Vec2& v) { - LayerGradient* layer = new (std::nothrow) LayerGradient(); - if (layer && layer->initWithColor(start, end, v)) + LayerGradient * layer = new (std::nothrow) LayerGradient(); + if( layer && layer->initWithColor(start, end, v)) { layer->autorelease(); return layer; @@ -232,13 +491,13 @@ bool LayerGradient::initWithColor(const Color4B& start, const Color4B& end) bool LayerGradient::initWithColor(const Color4B& start, const Color4B& end, const Vec2& v) { - _endColor.r = end.r; - _endColor.g = end.g; - _endColor.b = end.b; + _endColor.r = end.r; + _endColor.g = end.g; + _endColor.b = end.b; - _endOpacity = end.a; - _startOpacity = start.a; - _alongVector = v; + _endOpacity = end.a; + _startOpacity = start.a; + _alongVector = v; _compressedInterpolation = true; @@ -247,6 +506,8 @@ bool LayerGradient::initWithColor(const Color4B& start, const Color4B& end, cons void LayerGradient::updateColor() { + LayerColor::updateColor(); + float h = _alongVector.getLength(); if (h == 0) return; @@ -257,48 +518,46 @@ void LayerGradient::updateColor() // Compressed Interpolation mode if (_compressedInterpolation) { - float h2 = 1 / (fabsf(u.x) + fabsf(u.y)); - u = u * (h2 * (float)c); + float h2 = 1 / ( fabsf(u.x) + fabsf(u.y) ); + u = u * (h2 * (float)c); } float opacityf = (float)_displayedOpacity / 255.0f; - Color4F S(_displayedColor.r / 255.0f, _displayedColor.g / 255.0f, _displayedColor.b / 255.0f, - _startOpacity * opacityf / 255.0f); + Color4F S( + _displayedColor.r / 255.0f, + _displayedColor.g / 255.0f, + _displayedColor.b / 255.0f, + _startOpacity * opacityf / 255.0f + ); - Color4F E(_endColor.r / 255.0f, _endColor.g / 255.0f, _endColor.b / 255.0f, _endOpacity * opacityf / 255.0f); + Color4F E( + _endColor.r / 255.0f, + _endColor.g / 255.0f, + _endColor.b / 255.0f, + _endOpacity * opacityf / 255.0f + ); // (-1, -1) - _quad.bl.colors.r = (E.r + (S.r - E.r) * ((c + u.x + u.y) / (2.0f * c))) * 255; - _quad.bl.colors.g = (E.g + (S.g - E.g) * ((c + u.x + u.y) / (2.0f * c))) * 255; - _quad.bl.colors.b = (E.b + (S.b - E.b) * ((c + u.x + u.y) / (2.0f * c))) * 255; - _quad.bl.colors.a = (E.a + (S.a - E.a) * ((c + u.x + u.y) / (2.0f * c))) * 255; - // (1, -1) - _quad.br.colors.r = (E.r + (S.r - E.r) * ((c - u.x + u.y) / (2.0f * c))) * 255; - _quad.br.colors.g = (E.g + (S.g - E.g) * ((c - u.x + u.y) / (2.0f * c))) * 255; - _quad.br.colors.b = (E.b + (S.b - E.b) * ((c - u.x + u.y) / (2.0f * c))) * 255; - _quad.br.colors.a = (E.a + (S.a - E.a) * ((c - u.x + u.y) / (2.0f * c))) * 255; - // (-1, 1) - _quad.tl.colors.r = (E.r + (S.r - E.r) * ((c + u.x - u.y) / (2.0f * c))) * 255; - _quad.tl.colors.g = (E.g + (S.g - E.g) * ((c + u.x - u.y) / (2.0f * c))) * 255; - _quad.tl.colors.b = (E.b + (S.b - E.b) * ((c + u.x - u.y) / (2.0f * c))) * 255; - _quad.tl.colors.a = (E.a + (S.a - E.a) * ((c + u.x - u.y) / (2.0f * c))) * 255; - // (1, 1) - _quad.tr.colors.r = (E.r + (S.r - E.r) * ((c - u.x - u.y) / (2.0f * c))) * 255; - _quad.tr.colors.g = (E.g + (S.g - E.g) * ((c - u.x - u.y) / (2.0f * c))) * 255; - _quad.tr.colors.b = (E.b + (S.b - E.b) * ((c - u.x - u.y) / (2.0f * c))) * 255; - _quad.tr.colors.a = (E.a + (S.a - E.a) * ((c - u.x - u.y) / (2.0f * c))) * 255; - - // renders using batch node - if (_renderMode == RenderMode::QUAD_BATCHNODE) - { - if (_atlasIndex != INDEX_NOT_INITIALIZED) - _textureAtlas->updateQuad(&_quad, _atlasIndex); - else - // no need to set it recursively - // update dirty_, don't update recursiveDirty_ - setDirty(true); - } + _vertexData[0].colors.r = E.r + (S.r - E.r) * ((c + u.x + u.y) / (2.0f * c)); + _vertexData[0].colors.g = E.g + (S.g - E.g) * ((c + u.x + u.y) / (2.0f * c)); + _vertexData[0].colors.b = E.b + (S.b - E.b) * ((c + u.x + u.y) / (2.0f * c)); + _vertexData[0].colors.a = E.a + (S.a - E.a) * ((c + u.x + u.y) / (2.0f * c)); + // (1, -1) + _vertexData[1].colors.r = E.r + (S.r - E.r) * ((c - u.x + u.y) / (2.0f * c)); + _vertexData[1].colors.g = E.g + (S.g - E.g) * ((c - u.x + u.y) / (2.0f * c)); + _vertexData[1].colors.b = E.b + (S.b - E.b) * ((c - u.x + u.y) / (2.0f * c)); + _vertexData[1].colors.a = E.a + (S.a - E.a) * ((c - u.x + u.y) / (2.0f * c)); + // (-1, 1) + _vertexData[2].colors.r = E.r + (S.r - E.r) * ((c + u.x - u.y) / (2.0f * c)); + _vertexData[2].colors.g = E.g + (S.g - E.g) * ((c + u.x - u.y) / (2.0f * c)); + _vertexData[2].colors.b = E.b + (S.b - E.b) * ((c + u.x - u.y) / (2.0f * c)); + _vertexData[2].colors.a = E.a + (S.a - E.a) * ((c + u.x - u.y) / (2.0f * c)); + // (1, 1) + _vertexData[3].colors.r = E.r + (S.r - E.r) * ((c - u.x - u.y) / (2.0f * c)); + _vertexData[3].colors.g = E.g + (S.g - E.g) * ((c - u.x - u.y) / (2.0f * c)); + _vertexData[3].colors.b = E.b + (S.b - E.b) * ((c - u.x - u.y) / (2.0f * c)); + _vertexData[3].colors.a = E.a + (S.a - E.a) * ((c - u.x - u.y) / (2.0f * c)); } const Color3B& LayerGradient::getStartColor() const @@ -374,11 +633,7 @@ std::string LayerGradient::getDescription() const /** * LayerRadialGradient */ -LayerRadialGradient* LayerRadialGradient::create(const Color4B& startColor, - const Color4B& endColor, - float radius, - const Vec2& center, - float expand) +LayerRadialGradient* LayerRadialGradient::create(const Color4B& startColor, const Color4B& endColor, float radius, const Vec2& center, float expand) { auto layerGradient = new LayerRadialGradient(); if (layerGradient && layerGradient->initWithColor(startColor, endColor, radius, center, expand)) @@ -386,7 +641,7 @@ LayerRadialGradient* LayerRadialGradient::create(const Color4B& startColor, layerGradient->autorelease(); return layerGradient; } - + delete layerGradient; return nullptr; } @@ -394,12 +649,12 @@ LayerRadialGradient* LayerRadialGradient::create(const Color4B& startColor, LayerRadialGradient* LayerRadialGradient::create() { auto layerGradient = new LayerRadialGradient(); - if (layerGradient && layerGradient->initWithColor(Color4B::BLACK, Color4B::BLACK, 0, Vec2(0, 0), 0)) + if (layerGradient && layerGradient->initWithColor(Color4B::BLACK, Color4B::BLACK, 0, Vec2(0,0), 0)) { layerGradient->autorelease(); return layerGradient; } - + delete layerGradient; return nullptr; } @@ -407,27 +662,26 @@ LayerRadialGradient* LayerRadialGradient::create() LayerRadialGradient::LayerRadialGradient() { auto& pipelinePS = _customCommand.getPipelineDescriptor().programState; - auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::LAYER_RADIA_GRADIENT); + auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::LAYER_RADIA_GRADIENT); //!!! LayerRadialGradient private programState don't want affect by Node::_programState, so store at _customCommand - pipelinePS = new backend::ProgramState(program); - _mvpMatrixLocation = pipelinePS->getUniformLocation("u_MVPMatrix"); + pipelinePS = new backend::ProgramState(program); + _mvpMatrixLocation = pipelinePS->getUniformLocation("u_MVPMatrix"); _startColorLocation = pipelinePS->getUniformLocation("u_startColor"); - _endColorLocation = pipelinePS->getUniformLocation("u_endColor"); - _centerLocation = pipelinePS->getUniformLocation("u_center"); - _radiusLocation = pipelinePS->getUniformLocation("u_radius"); - _expandLocation = pipelinePS->getUniformLocation("u_expand"); + _endColorLocation = pipelinePS->getUniformLocation("u_endColor"); + _centerLocation = pipelinePS->getUniformLocation("u_center"); + _radiusLocation = pipelinePS->getUniformLocation("u_radius"); + _expandLocation = pipelinePS->getUniformLocation("u_expand"); - auto vertexLayout = pipelinePS->getVertexLayout(); + auto vertexLayout = pipelinePS->getVertexLayout(); const auto& attributeInfo = pipelinePS->getProgram()->getActiveAttributes(); - auto iter = attributeInfo.find("a_position"); - if (iter != attributeInfo.end()) + auto iter = attributeInfo.find("a_position"); + if(iter != attributeInfo.end()) { vertexLayout->setAttribute("a_position", iter->second.location, backend::VertexFormat::FLOAT2, 0, false); } vertexLayout->setLayout(sizeof(_vertices[0])); - _customCommand.createVertexBuffer(sizeof(_vertices[0]), sizeof(_vertices) / sizeof(_vertices[0]), - CustomCommand::BufferUsage::STATIC); + _customCommand.createVertexBuffer(sizeof(_vertices[0]), sizeof(_vertices) / sizeof(_vertices[0]), CustomCommand::BufferUsage::STATIC); _customCommand.setDrawType(CustomCommand::DrawType::ARRAY); _customCommand.setPrimitiveType(CustomCommand::PrimitiveType::TRIANGLE_STRIP); } @@ -437,43 +691,39 @@ LayerRadialGradient::~LayerRadialGradient() CC_SAFE_RELEASE_NULL(_customCommand.getPipelineDescriptor().programState); } -bool LayerRadialGradient::initWithColor(const cocos2d::Color4B& startColor, - const cocos2d::Color4B& endColor, - float radius, - const Vec2& center, - float expand) +bool LayerRadialGradient::initWithColor(const cocos2d::Color4B &startColor, const cocos2d::Color4B &endColor, float radius, const Vec2& center, float expand) { // should do it before Layer::init() for (int i = 0; i < 4; ++i) _vertices[i] = {0.0f, 0.0f}; - + if (Layer::init()) { convertColor4B24F(_startColorRend, startColor); _startColor = startColor; - + convertColor4B24F(_endColorRend, endColor); _endColor = endColor; - + _expand = expand; - + setRadius(radius); setCenter(center); - + return true; } - + return false; } -void LayerRadialGradient::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) +void LayerRadialGradient::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) { _customCommand.init(_globalZOrder, _blendFunc); renderer->addCommand(&_customCommand); const auto& projectionMat = _director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); - auto programState = _customCommand.getPipelineDescriptor().programState; - Mat4 finalMat = projectionMat * transform; + auto programState = _customCommand.getPipelineDescriptor().programState; + Mat4 finalMat = projectionMat * transform; programState->setUniform(_mvpMatrixLocation, finalMat.m, sizeof(finalMat.m)); programState->setUniform(_startColorLocation, &_startColorRend, sizeof(_startColorRend)); @@ -497,7 +747,7 @@ void LayerRadialGradient::setContentSize(const Size& size) void LayerRadialGradient::setStartOpacity(uint8_t opacity) { _startColorRend.a = opacity / 255.0f; - _startColor.a = opacity; + _startColor.a = opacity; } uint8_t LayerRadialGradient::getStartOpacity() const @@ -508,7 +758,7 @@ uint8_t LayerRadialGradient::getStartOpacity() const void LayerRadialGradient::setEndOpacity(uint8_t opacity) { _endColorRend.a = opacity / 255.0f; - _endColor.a = opacity; + _endColor.a = opacity; } uint8_t LayerRadialGradient::getEndOpacity() const @@ -551,7 +801,7 @@ void LayerRadialGradient::setStartColor(const Color3B& color) setStartColor(Color4B(color)); } -void LayerRadialGradient::setStartColor(const cocos2d::Color4B& color) +void LayerRadialGradient::setStartColor(const cocos2d::Color4B &color) { _startColor = color; convertColor4B24F(_startColorRend, _startColor); @@ -572,7 +822,7 @@ void LayerRadialGradient::setEndColor(const Color3B& color) setEndColor(Color4B(color)); } -void LayerRadialGradient::setEndColor(const cocos2d::Color4B& color) +void LayerRadialGradient::setEndColor(const cocos2d::Color4B &color) { _endColor = color; convertColor4B24F(_endColorRend, _endColor); @@ -588,6 +838,16 @@ Color3B LayerRadialGradient::getEndColor3B() const return Color3B(_endColor); } +void LayerRadialGradient::setBlendFunc(const BlendFunc& blendFunc) +{ + _blendFunc = blendFunc; +} + +BlendFunc LayerRadialGradient::getBlendFunc() const +{ + return _blendFunc; +} + void LayerRadialGradient::convertColor4B24F(Color4F& outColor, const Color4B& inColor) { outColor.r = inColor.r / 255.0f; @@ -596,25 +856,28 @@ void LayerRadialGradient::convertColor4B24F(Color4F& outColor, const Color4B& in outColor.a = inColor.a / 255.0f; } + /// MultiplexLayer -LayerMultiplex::LayerMultiplex() : _enabledLayer(0) {} +LayerMultiplex::LayerMultiplex() +: _enabledLayer(0) +{ +} LayerMultiplex::~LayerMultiplex() { - for (const auto& layer : _layers) - { + for(const auto &layer : _layers) { layer->cleanup(); } } -LayerMultiplex* LayerMultiplex::create(Layer* layer, ...) +LayerMultiplex * LayerMultiplex::create(Layer * layer, ...) { va_list args; - va_start(args, layer); + va_start(args,layer); - LayerMultiplex* multiplexLayer = new (std::nothrow) LayerMultiplex(); - if (multiplexLayer && multiplexLayer->initWithLayers(layer, args)) + LayerMultiplex * multiplexLayer = new (std::nothrow) LayerMultiplex(); + if(multiplexLayer && multiplexLayer->initWithLayers(layer, args)) { multiplexLayer->autorelease(); va_end(args); @@ -625,7 +888,7 @@ LayerMultiplex* LayerMultiplex::create(Layer* layer, ...) return nullptr; } -LayerMultiplex* LayerMultiplex::createWithLayer(Layer* layer) +LayerMultiplex * LayerMultiplex::createWithLayer(Layer* layer) { return LayerMultiplex::create(layer, nullptr); } @@ -666,7 +929,7 @@ void LayerMultiplex::addLayer(Layer* layer) { sEngine->retainScriptObject(this, layer); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.pushBack(layer); } @@ -680,7 +943,7 @@ bool LayerMultiplex::init() return false; } -bool LayerMultiplex::initWithLayers(Layer* layer, va_list params) +bool LayerMultiplex::initWithLayers(Layer *layer, va_list params) { if (Layer::init()) { @@ -691,20 +954,19 @@ bool LayerMultiplex::initWithLayers(Layer* layer, va_list params) { sEngine->retainScriptObject(this, layer); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.pushBack(layer); - Layer* l = va_arg(params, Layer*); - while (l) - { + Layer *l = va_arg(params,Layer*); + while( l ) { #if CC_ENABLE_GC_FOR_NATIVE_OBJECTS if (sEngine) { sEngine->retainScriptObject(this, l); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.pushBack(l); - l = va_arg(params, Layer*); + l = va_arg(params,Layer*); } _enabledLayer = 0; @@ -723,7 +985,7 @@ bool LayerMultiplex::initWithArray(const Vector& arrayOfLayers) auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { - for (const auto& layer : arrayOfLayers) + for (const auto &layer : arrayOfLayers) { if (layer) { @@ -731,7 +993,7 @@ bool LayerMultiplex::initWithArray(const Vector& arrayOfLayers) } } } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.reserve(arrayOfLayers.size()); _layers.pushBack(arrayOfLayers); @@ -744,24 +1006,24 @@ bool LayerMultiplex::initWithArray(const Vector& arrayOfLayers) void LayerMultiplex::switchTo(int n) { - + switchTo(n, true); } void LayerMultiplex::switchTo(int n, bool cleanup) { - CCASSERT(n < _layers.size(), "Invalid index in MultiplexLayer switchTo message"); - + CCASSERT( n < _layers.size(), "Invalid index in MultiplexLayer switchTo message" ); + this->removeChild(_layers.at(_enabledLayer), cleanup); - + _enabledLayer = n; - + this->addChild(_layers.at(n)); } void LayerMultiplex::switchToAndReleaseMe(int n) { - CCASSERT(n < _layers.size(), "Invalid index in MultiplexLayer switchTo message"); + CCASSERT( n < _layers.size(), "Invalid index in MultiplexLayer switchTo message" ); this->removeChild(_layers.at(_enabledLayer), true); #if CC_ENABLE_GC_FOR_NATIVE_OBJECTS @@ -770,8 +1032,8 @@ void LayerMultiplex::switchToAndReleaseMe(int n) { sEngine->releaseScriptObject(this, _layers.at(_enabledLayer)); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS - +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS + _layers.replace(_enabledLayer, nullptr); _enabledLayer = n; diff --git a/cocos/2d/CCLayer.h b/cocos/2d/CCLayer.h index d4aa84ed52..7ff96b2122 100644 --- a/cocos/2d/CCLayer.h +++ b/cocos/2d/CCLayer.h @@ -3,9 +3,9 @@ Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) Bytedance Inc. +Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. -https://adxe.org +http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -28,7 +28,6 @@ THE SOFTWARE. #pragma once #include "2d/CCNode.h" -#include "2d/CCSprite.h" #include "base/CCProtocols.h" #include "renderer/CCCustomCommand.h" @@ -41,13 +40,26 @@ NS_CC_BEGIN * @{ */ +class __Set; +class TouchScriptHandlerEntry; + +class EventListenerTouch; +class EventListenerKeyboard; +class EventListenerAcceleration; + +class Touch; + // // Layer // /** @class Layer - * @brief Layer is a subclass of Node + * @brief Layer is a subclass of Node that implements the TouchEventsDelegate protocol. + +All features from Node are valid, plus the following new features: +- It can receive iPhone Touches +- It can receive Accelerometer input */ -class CC_DLL Layer : public Sprite +class CC_DLL Layer : public Node { public: /** Creates a fullscreen black layer. @@ -56,6 +68,95 @@ public: */ static Layer *create(); + /* Callback function should not be deprecated, it will generate lots of warnings. + Since 'setTouchEnabled' was deprecated, it will make warnings if developer overrides onTouchXXX and invokes setTouchEnabled(true) instead of using EventDispatcher::addEventListenerWithXXX. + */ + /** Callback function for touch began. + * + * @param touch Touch information. + * @param unused_event Event information. + * @return if return false, onTouchMoved, onTouchEnded, onTouchCancelled will never called. + * @js NA + */ + virtual bool onTouchBegan(Touch *touch, Event *unused_event); + /** Callback function for touch moved. + * + * @param touch Touch information. + * @param unused_event Event information. + * @js NA + */ + virtual void onTouchMoved(Touch *touch, Event *unused_event); + /** Callback function for touch ended. + * + * @param touch Touch information. + * @param unused_event Event information. + * @js NA + */ + virtual void onTouchEnded(Touch *touch, Event *unused_event); + /** Callback function for touch cancelled. + * + * @param touch Touch information. + * @param unused_event Event information. + * @js NA + */ + virtual void onTouchCancelled(Touch *touch, Event *unused_event); + + /** Callback function for multiple touches began. + * + * @param touches Touches information. + * @param unused_event Event information. + * @js NA + */ + virtual void onTouchesBegan(const std::vector& touches, Event *unused_event); + /** Callback function for multiple touches moved. + * + * @param touches Touches information. + * @param unused_event Event information. + * @js NA + */ + virtual void onTouchesMoved(const std::vector& touches, Event *unused_event); + /** Callback function for multiple touches ended. + * + * @param touches Touches information. + * @param unused_event Event information. + * @js NA + */ + virtual void onTouchesEnded(const std::vector& touches, Event *unused_event); + /** Callback function for multiple touches cancelled. + * + * @param touches Touches information. + * @param unused_event Event information. + * @js NA + */ + virtual void onTouchesCancelled(const std::vector&touches, Event *unused_event); + + /* Callback function should not be deprecated, it will generate lots of warnings. + Since 'setAccelerometerEnabled' was deprecated, it will make warnings if developer overrides onAcceleration and invokes setAccelerometerEnabled(true) instead of using EventDispatcher::addEventListenerWithXXX. + */ + /** Callback function for acceleration. + * @param acc Acceleration information. + * @param unused_event Event information. + * @js NA + */ + virtual void onAcceleration(Acceleration* acc, Event* unused_event); + + + /* Callback function should not be deprecated, it will generate lots of warnings. + Since 'setKeyboardEnabled' was deprecated, it will make warnings if developer overrides onKeyXXX and invokes setKeyboardEnabled(true) instead of using EventDispatcher::addEventListenerWithXXX. + */ + /** Callback function for key pressed. + * @param keyCode KeyCode information. + * @param event Event information. + * @js NA + */ + virtual void onKeyPressed(EventKeyboard::KeyCode keyCode, Event* event); + /** Callback function for key released. + * @param keyCode KeyCode information. + * @param event Event information. + * @js NA + */ + virtual void onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event); + // Overrides virtual std::string getDescription() const override; @@ -65,6 +166,21 @@ CC_CONSTRUCTOR_ACCESS: virtual bool init() override; +protected: + + int executeScriptTouchHandler(EventTouch::EventCode eventType, Touch* touch, Event* event); + int executeScriptTouchesHandler(EventTouch::EventCode eventType, const std::vector& touches, Event* event); + + bool _touchEnabled; + bool _accelerometerEnabled; + bool _keyboardEnabled; + EventListener* _touchListener; + EventListenerKeyboard* _keyboardListener; + EventListenerAcceleration* _accelerationListener; + + Touch::DispatchMode _touchMode; + bool _swallowsTouches; + private: CC_DISALLOW_COPY_AND_ASSIGN(Layer); @@ -80,7 +196,7 @@ All features from Layer are valid, plus the following new features: - opacity - RGB colors */ -class CC_DLL LayerColor : public Layer +class CC_DLL LayerColor : public Layer, public BlendProtocol { public: @@ -122,12 +238,46 @@ public: */ void changeWidthAndHeight(float w, float h); + // + // Overrides + // + virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; + + virtual void setContentSize(const Size & var) override; + /** BlendFunction. Conforms to BlendProtocol protocol */ + /** + * @lua NA + */ + virtual const BlendFunc& getBlendFunc() const override; + /** + *@code + *When this function bound into js or lua,the parameter will be changed + *In js: var setBlendFunc(var src, var dst) + *In lua: local setBlendFunc(local src, local dst) + *@endcode + */ + virtual void setBlendFunc(const BlendFunc& blendFunc) override; + CC_CONSTRUCTOR_ACCESS: LayerColor(); + virtual ~LayerColor(); + bool init() override; bool initWithColor(const Color4B& color, float width, float height); bool initWithColor(const Color4B& color); +protected: + + virtual void updateColor() override; + void updateVertexBuffer(); + + BlendFunc _blendFunc; + Vec2 _squareVertices[4]; + CustomCommand _customCommand; + + V3F_C4F _vertexData[4]; + + backend::UniformLocation _mvpMatrixLocation; private: CC_DISALLOW_COPY_AND_ASSIGN(LayerColor); @@ -330,6 +480,9 @@ public: Color4B getEndColor() const; Color3B getEndColor3B() const; + void setBlendFunc(const BlendFunc& blendFunc); + BlendFunc getBlendFunc() const; + CC_CONSTRUCTOR_ACCESS: LayerRadialGradient(); virtual ~LayerRadialGradient(); @@ -351,6 +504,8 @@ private: float _expand = 0.f; CustomCommand _customCommand; + BlendFunc _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED; + backend::UniformLocation _mvpMatrixLocation; backend::UniformLocation _startColorLocation; backend::UniformLocation _endColorLocation; diff --git a/cocos/2d/CCMenu.h b/cocos/2d/CCMenu.h index 729f3fd853..11a89183fe 100644 --- a/cocos/2d/CCMenu.h +++ b/cocos/2d/CCMenu.h @@ -139,10 +139,10 @@ public: */ virtual void setEnabled(bool value) { _enabled = value; }; - virtual bool onTouchBegan(Touch* touch, Event* event); - virtual void onTouchEnded(Touch* touch, Event* event); - virtual void onTouchCancelled(Touch* touch, Event* event); - virtual void onTouchMoved(Touch* touch, Event* event); + virtual bool onTouchBegan(Touch* touch, Event* event) override; + virtual void onTouchEnded(Touch* touch, Event* event) override; + virtual void onTouchCancelled(Touch* touch, Event* event) override; + virtual void onTouchMoved(Touch* touch, Event* event) override; // overrides virtual void removeChild(Node* child, bool cleanup) override; diff --git a/cocos/ui/UILayout.h b/cocos/ui/UILayout.h index 52861c9e2d..ce316b9664 100644 --- a/cocos/ui/UILayout.h +++ b/cocos/ui/UILayout.h @@ -1,8 +1,9 @@ /**************************************************************************** Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. +Copyright (c) Bytedance Inc. -http://www.cocos2d-x.org +https://adxe.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -120,9 +121,9 @@ public: { ABSOLUTE, VERTICAL, - CENTER_VERTICAL, HORIZONTAL, - RELATIVE + RELATIVE, + CENTER_VERTICAL, }; /** diff --git a/extensions/GUI/CCControlExtension/CCControl.h b/extensions/GUI/CCControlExtension/CCControl.h index 851bfd3c9c..d281eca154 100644 --- a/extensions/GUI/CCControlExtension/CCControl.h +++ b/extensions/GUI/CCControlExtension/CCControl.h @@ -157,10 +157,10 @@ public: */ virtual Vec2 getTouchLocation(Touch* touch); - virtual bool onTouchBegan(Touch* touch, Event* event); - virtual void onTouchMoved(Touch* touch, Event* event); - virtual void onTouchEnded(Touch* touch, Event* event); - virtual void onTouchCancelled(Touch* touch, Event* event); + virtual bool onTouchBegan(Touch* touch, Event* event) override; + virtual void onTouchMoved(Touch* touch, Event* event) override; + virtual void onTouchEnded(Touch* touch, Event* event) override; + virtual void onTouchCancelled(Touch* touch, Event* event) override; /** * Returns a boolean value that indicates whether a touch is inside the bounds diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index d2d0fb90de..fd791d2fa1 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -241,10 +241,10 @@ public: bool isClippingToBounds() { return _clippingToBounds; } void setClippingToBounds(bool bClippingToBounds) { _clippingToBounds = bClippingToBounds; } - virtual bool onTouchBegan(Touch *touch, Event *event); - virtual void onTouchMoved(Touch *touch, Event *event); - virtual void onTouchEnded(Touch *touch, Event *event); - virtual void onTouchCancelled(Touch *touch, Event *event); + virtual bool onTouchBegan(Touch *touch, Event *event) override; + virtual void onTouchMoved(Touch *touch, Event *event) override; + virtual void onTouchEnded(Touch *touch, Event *event) override; + virtual void onTouchCancelled(Touch *touch, Event *event) override; // Overrides virtual void setContentSize(const Size & size) override; diff --git a/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index fcd09f828d..ef1786bf6b 100644 --- a/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -52052,6 +52052,34 @@ int lua_cocos2dx_DrawNode_drawSolidCircle(lua_State* tolua_S) } #endif argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 5) { + cocos2d::Vec2 arg0; + ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.DrawNode:drawSolidCircle"); + + if (!ok) { break; } + double arg1; + ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.DrawNode:drawSolidCircle"); + + if (!ok) { break; } + double arg2; + ok &= luaval_to_number(tolua_S, 4,&arg2, "cc.DrawNode:drawSolidCircle"); + + if (!ok) { break; } + unsigned int arg3; + ok &= luaval_to_uint32(tolua_S, 5,&arg3, "cc.DrawNode:drawSolidCircle"); + + if (!ok) { break; } + cocos2d::Color4F arg4; + ok &=luaval_to_color4f(tolua_S, 6, &arg4, "cc.DrawNode:drawSolidCircle"); + + if (!ok) { break; } + cobj->drawSolidCircle(arg0, arg1, arg2, arg3, arg4); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; do{ if (argc == 7) { cocos2d::Vec2 arg0; @@ -52088,79 +52116,7 @@ int lua_cocos2dx_DrawNode_drawSolidCircle(lua_State* tolua_S) } }while(0); ok = true; - do{ - if (argc == 9) { - cocos2d::Vec2 arg0; - ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - double arg1; - ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - double arg2; - ok &= luaval_to_number(tolua_S, 4,&arg2, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - unsigned int arg3; - ok &= luaval_to_uint32(tolua_S, 5,&arg3, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - double arg4; - ok &= luaval_to_number(tolua_S, 6,&arg4, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - double arg5; - ok &= luaval_to_number(tolua_S, 7,&arg5, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - cocos2d::Color4F arg6; - ok &=luaval_to_color4f(tolua_S, 8, &arg6, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - double arg7; - ok &= luaval_to_number(tolua_S, 9,&arg7, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - cocos2d::Color4F arg8; - ok &=luaval_to_color4f(tolua_S, 10, &arg8, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - cobj->drawSolidCircle(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 5) { - cocos2d::Vec2 arg0; - ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - double arg1; - ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - double arg2; - ok &= luaval_to_number(tolua_S, 4,&arg2, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - unsigned int arg3; - ok &= luaval_to_uint32(tolua_S, 5,&arg3, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - cocos2d::Color4F arg4; - ok &=luaval_to_color4f(tolua_S, 6, &arg4, "cc.DrawNode:drawSolidCircle"); - - if (!ok) { break; } - cobj->drawSolidCircle(arg0, arg1, arg2, arg3, arg4); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.DrawNode:drawSolidCircle",argc, 5); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.DrawNode:drawSolidCircle",argc, 7); return 0; #if COCOS2D_DEBUG >= 1 @@ -57589,2207 +57545,6 @@ int lua_register_cocos2dx_LabelAtlas(lua_State* tolua_S) return 1; } -int lua_cocos2dx_Sprite_setSpriteFrame(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setSpriteFrame'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 1) { - cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:setSpriteFrame"); - - if (!ok) { break; } - cobj->setSpriteFrame(arg0); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:setSpriteFrame"); - - if (!ok) { break; } - cobj->setSpriteFrame(arg0); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setSpriteFrame",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setSpriteFrame'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTexture'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 1) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:setTexture"); - - if (!ok) { break; } - cobj->setTexture(arg0); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:setTexture"); - - if (!ok) { break; } - cobj->setTexture(arg0); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setTexture",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTexture'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getTexture'", nullptr); - return 0; - } - cocos2d::Texture2D* ret = cobj->getTexture(); - object_to_luaval(tolua_S, "cc.Texture2D",(cocos2d::Texture2D*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getTexture",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setFlippedY(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setFlippedY'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setFlippedY"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setFlippedY'", nullptr); - return 0; - } - cobj->setFlippedY(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setFlippedY",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setFlippedY'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setFlippedX(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setFlippedX'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setFlippedX"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setFlippedX'", nullptr); - return 0; - } - cobj->setFlippedX(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setFlippedX",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setFlippedX'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getResourceType(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getResourceType'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getResourceType'", nullptr); - return 0; - } - int ret = cobj->getResourceType(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getResourceType",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getResourceType'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - std::string arg0; - unsigned int arg1; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:setDisplayFrameWithAnimationName"); - - ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.Sprite:setDisplayFrameWithAnimationName"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'", nullptr); - return 0; - } - cobj->setDisplayFrameWithAnimationName(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setDisplayFrameWithAnimationName",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getBatchNode(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getBatchNode'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getBatchNode'", nullptr); - return 0; - } - cocos2d::SpriteBatchNode* ret = cobj->getBatchNode(); - object_to_luaval(tolua_S, "cc.SpriteBatchNode",(cocos2d::SpriteBatchNode*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getBatchNode",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getBatchNode'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getOffsetPosition(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getOffsetPosition'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getOffsetPosition'", nullptr); - return 0; - } - const cocos2d::Vec2& ret = cobj->getOffsetPosition(); - vec2_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getOffsetPosition",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getOffsetPosition'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getCenterRect(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getCenterRect'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getCenterRect'", nullptr); - return 0; - } - cocos2d::Rect ret = cobj->getCenterRect(); - rect_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getCenterRect",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getCenterRect'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setCenterRectNormalized(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setCenterRectNormalized'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Rect arg0; - - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setCenterRectNormalized"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setCenterRectNormalized'", nullptr); - return 0; - } - cobj->setCenterRectNormalized(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setCenterRectNormalized",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setCenterRectNormalized'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_isStretchEnabled(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isStretchEnabled'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isStretchEnabled'", nullptr); - return 0; - } - bool ret = cobj->isStretchEnabled(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isStretchEnabled",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isStretchEnabled'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setTextureRect(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTextureRect'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 3) { - cocos2d::Rect arg0; - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setTextureRect"); - - if (!ok) { break; } - bool arg1; - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.Sprite:setTextureRect"); - - if (!ok) { break; } - cocos2d::Size arg2; - ok &= luaval_to_size(tolua_S, 4, &arg2, "cc.Sprite:setTextureRect"); - - if (!ok) { break; } - cobj->setTextureRect(arg0, arg1, arg2); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - cocos2d::Rect arg0; - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setTextureRect"); - - if (!ok) { break; } - cobj->setTextureRect(arg0); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setTextureRect",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setTextureRect'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_initWithSpriteFrameName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithSpriteFrameName'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:initWithSpriteFrameName"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_initWithSpriteFrameName'", nullptr); - return 0; - } - bool ret = cobj->initWithSpriteFrameName(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:initWithSpriteFrameName",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithSpriteFrameName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setStretchEnabled(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setStretchEnabled'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setStretchEnabled"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setStretchEnabled'", nullptr); - return 0; - } - cobj->setStretchEnabled(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setStretchEnabled",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setStretchEnabled'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_isFrameDisplayed(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFrameDisplayed'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::SpriteFrame* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:isFrameDisplayed"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isFrameDisplayed'", nullptr); - return 0; - } - bool ret = cobj->isFrameDisplayed(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isFrameDisplayed",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isFrameDisplayed'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getAtlasIndex(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getAtlasIndex'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getAtlasIndex'", nullptr); - return 0; - } - unsigned int ret = cobj->getAtlasIndex(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getAtlasIndex",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getAtlasIndex'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setTextureAtlas(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTextureAtlas'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::TextureAtlas* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0, "cc.Sprite:setTextureAtlas"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setTextureAtlas'", nullptr); - return 0; - } - cobj->setTextureAtlas(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setTextureAtlas",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setTextureAtlas'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setBatchNode(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setBatchNode'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::SpriteBatchNode* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteBatchNode",&arg0, "cc.Sprite:setBatchNode"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setBatchNode'", nullptr); - return 0; - } - cobj->setBatchNode(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setBatchNode",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setBatchNode'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getBlendFunc(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getBlendFunc'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getBlendFunc'", nullptr); - return 0; - } - const cocos2d::BlendFunc& ret = cobj->getBlendFunc(); - blendfunc_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getBlendFunc",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getBlendFunc'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setCenterRect(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setCenterRect'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Rect arg0; - - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setCenterRect"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setCenterRect'", nullptr); - return 0; - } - cobj->setCenterRect(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setCenterRect",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setCenterRect'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getSpriteFrame(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getSpriteFrame'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getSpriteFrame'", nullptr); - return 0; - } - cocos2d::SpriteFrame* ret = cobj->getSpriteFrame(); - object_to_luaval(tolua_S, "cc.SpriteFrame",(cocos2d::SpriteFrame*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getSpriteFrame",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getSpriteFrame'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setVertexLayout(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setVertexLayout'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setVertexLayout'", nullptr); - return 0; - } - cobj->setVertexLayout(); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setVertexLayout",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setVertexLayout'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_removeAllChildrenWithCleanup(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:removeAllChildrenWithCleanup"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'", nullptr); - return 0; - } - cobj->removeAllChildrenWithCleanup(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:removeAllChildrenWithCleanup",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getResourceName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getResourceName'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getResourceName'", nullptr); - return 0; - } - const std::string& ret = cobj->getResourceName(); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getResourceName",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getResourceName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_isDirty(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isDirty'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isDirty'", nullptr); - return 0; - } - bool ret = cobj->isDirty(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isDirty",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isDirty'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getCenterRectNormalized(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getCenterRectNormalized'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getCenterRectNormalized'", nullptr); - return 0; - } - cocos2d::Rect ret = cobj->getCenterRectNormalized(); - rect_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getCenterRectNormalized",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getCenterRectNormalized'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setAtlasIndex(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setAtlasIndex'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - unsigned int arg0; - - ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Sprite:setAtlasIndex"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setAtlasIndex'", nullptr); - return 0; - } - cobj->setAtlasIndex(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setAtlasIndex",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setAtlasIndex'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_initWithTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithTexture'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:initWithTexture"); - - if (!ok) { break; } - bool ret = cobj->initWithTexture(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); - - if (!ok) { break; } - bool ret = cobj->initWithTexture(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 3) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:initWithTexture"); - - if (!ok) { break; } - bool arg2; - ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.Sprite:initWithTexture"); - - if (!ok) { break; } - bool ret = cobj->initWithTexture(arg0, arg1, arg2); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:initWithTexture",argc, 3); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setDirty(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setDirty'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setDirty"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setDirty'", nullptr); - return 0; - } - cobj->setDirty(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setDirty",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setDirty'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_isTextureRectRotated(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isTextureRectRotated'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isTextureRectRotated'", nullptr); - return 0; - } - bool ret = cobj->isTextureRectRotated(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isTextureRectRotated",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isTextureRectRotated'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getTextureRect(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTextureRect'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getTextureRect'", nullptr); - return 0; - } - const cocos2d::Rect& ret = cobj->getTextureRect(); - rect_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getTextureRect",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getTextureRect'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_initWithFile(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithFile'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:initWithFile"); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:initWithFile"); - - if (!ok) { break; } - bool ret = cobj->initWithFile(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:initWithFile"); - - if (!ok) { break; } - bool ret = cobj->initWithFile(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:initWithFile",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithFile'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setBlendFunc(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setBlendFunc'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::BlendFunc arg0; - - ok &= luaval_to_blendfunc(tolua_S, 2, &arg0, "cc.Sprite:setBlendFunc"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setBlendFunc'", nullptr); - return 0; - } - cobj->setBlendFunc(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setBlendFunc",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setBlendFunc'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getTextureAtlas(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTextureAtlas'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getTextureAtlas'", nullptr); - return 0; - } - cocos2d::TextureAtlas* ret = cobj->getTextureAtlas(); - object_to_luaval(tolua_S, "cc.TextureAtlas",(cocos2d::TextureAtlas*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getTextureAtlas",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getTextureAtlas'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_initWithSpriteFrame(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithSpriteFrame'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::SpriteFrame* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:initWithSpriteFrame"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_initWithSpriteFrame'", nullptr); - return 0; - } - bool ret = cobj->initWithSpriteFrame(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:initWithSpriteFrame",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithSpriteFrame'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_isFlippedX(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFlippedX'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isFlippedX'", nullptr); - return 0; - } - bool ret = cobj->isFlippedX(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isFlippedX",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isFlippedX'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_isFlippedY(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFlippedY'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isFlippedY'", nullptr); - return 0; - } - bool ret = cobj->isFlippedY(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isFlippedY",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isFlippedY'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setVertexRect(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setVertexRect'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Rect arg0; - - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setVertexRect"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setVertexRect'", nullptr); - return 0; - } - cobj->setVertexRect(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setVertexRect",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setVertexRect'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_createWithTexture(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S)-1; - - do - { - if (argc == 2) - { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 3) - { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - bool arg2; - ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1, arg2); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 1) - { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - } while (0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "cc.Sprite:createWithTexture",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithTexture'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_Sprite_createWithSpriteFrameName(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:createWithSpriteFrameName"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_createWithSpriteFrameName'", nullptr); - return 0; - } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrameName(arg0); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite:createWithSpriteFrameName",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithSpriteFrameName'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_Sprite_createWithSpriteFrame(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:createWithSpriteFrame"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_createWithSpriteFrame'", nullptr); - return 0; - } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrame(arg0); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite:createWithSpriteFrame",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithSpriteFrame'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_Sprite_constructor(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_constructor'", nullptr); - return 0; - } - cobj = new cocos2d::Sprite(); - cobj->autorelease(); - int ID = (int)cobj->_ID ; - int* luaID = &cobj->_luaID ; - toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.Sprite"); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:Sprite",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_constructor'.",&tolua_err); -#endif - - return 0; -} - -static int lua_cocos2dx_Sprite_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (Sprite)"); - return 0; -} - -int lua_register_cocos2dx_Sprite(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.Sprite"); - tolua_cclass(tolua_S,"Sprite","cc.Sprite","cc.Node",nullptr); - - tolua_beginmodule(tolua_S,"Sprite"); - tolua_function(tolua_S,"new",lua_cocos2dx_Sprite_constructor); - tolua_function(tolua_S,"setSpriteFrame",lua_cocos2dx_Sprite_setSpriteFrame); - tolua_function(tolua_S,"setTexture",lua_cocos2dx_Sprite_setTexture); - tolua_function(tolua_S,"getTexture",lua_cocos2dx_Sprite_getTexture); - tolua_function(tolua_S,"setFlippedY",lua_cocos2dx_Sprite_setFlippedY); - tolua_function(tolua_S,"setFlippedX",lua_cocos2dx_Sprite_setFlippedX); - tolua_function(tolua_S,"getResourceType",lua_cocos2dx_Sprite_getResourceType); - tolua_function(tolua_S,"setDisplayFrameWithAnimationName",lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName); - tolua_function(tolua_S,"getBatchNode",lua_cocos2dx_Sprite_getBatchNode); - tolua_function(tolua_S,"getOffsetPosition",lua_cocos2dx_Sprite_getOffsetPosition); - tolua_function(tolua_S,"getCenterRect",lua_cocos2dx_Sprite_getCenterRect); - tolua_function(tolua_S,"setCenterRectNormalized",lua_cocos2dx_Sprite_setCenterRectNormalized); - tolua_function(tolua_S,"isStretchEnabled",lua_cocos2dx_Sprite_isStretchEnabled); - tolua_function(tolua_S,"setTextureRect",lua_cocos2dx_Sprite_setTextureRect); - tolua_function(tolua_S,"initWithSpriteFrameName",lua_cocos2dx_Sprite_initWithSpriteFrameName); - tolua_function(tolua_S,"setStretchEnabled",lua_cocos2dx_Sprite_setStretchEnabled); - tolua_function(tolua_S,"isFrameDisplayed",lua_cocos2dx_Sprite_isFrameDisplayed); - tolua_function(tolua_S,"getAtlasIndex",lua_cocos2dx_Sprite_getAtlasIndex); - tolua_function(tolua_S,"setTextureAtlas",lua_cocos2dx_Sprite_setTextureAtlas); - tolua_function(tolua_S,"setBatchNode",lua_cocos2dx_Sprite_setBatchNode); - tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_Sprite_getBlendFunc); - tolua_function(tolua_S,"setCenterRect",lua_cocos2dx_Sprite_setCenterRect); - tolua_function(tolua_S,"getSpriteFrame",lua_cocos2dx_Sprite_getSpriteFrame); - tolua_function(tolua_S,"setVertexLayout",lua_cocos2dx_Sprite_setVertexLayout); - tolua_function(tolua_S,"removeAllChildrenWithCleanup",lua_cocos2dx_Sprite_removeAllChildrenWithCleanup); - tolua_function(tolua_S,"getResourceName",lua_cocos2dx_Sprite_getResourceName); - tolua_function(tolua_S,"isDirty",lua_cocos2dx_Sprite_isDirty); - tolua_function(tolua_S,"getCenterRectNormalized",lua_cocos2dx_Sprite_getCenterRectNormalized); - tolua_function(tolua_S,"setAtlasIndex",lua_cocos2dx_Sprite_setAtlasIndex); - tolua_function(tolua_S,"initWithTexture",lua_cocos2dx_Sprite_initWithTexture); - tolua_function(tolua_S,"setDirty",lua_cocos2dx_Sprite_setDirty); - tolua_function(tolua_S,"isTextureRectRotated",lua_cocos2dx_Sprite_isTextureRectRotated); - tolua_function(tolua_S,"getTextureRect",lua_cocos2dx_Sprite_getTextureRect); - tolua_function(tolua_S,"initWithFile",lua_cocos2dx_Sprite_initWithFile); - tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_Sprite_setBlendFunc); - tolua_function(tolua_S,"getTextureAtlas",lua_cocos2dx_Sprite_getTextureAtlas); - tolua_function(tolua_S,"initWithSpriteFrame",lua_cocos2dx_Sprite_initWithSpriteFrame); - tolua_function(tolua_S,"isFlippedX",lua_cocos2dx_Sprite_isFlippedX); - tolua_function(tolua_S,"isFlippedY",lua_cocos2dx_Sprite_isFlippedY); - tolua_function(tolua_S,"setVertexRect",lua_cocos2dx_Sprite_setVertexRect); - tolua_function(tolua_S,"createWithTexture", lua_cocos2dx_Sprite_createWithTexture); - tolua_function(tolua_S,"createWithSpriteFrameName", lua_cocos2dx_Sprite_createWithSpriteFrameName); - tolua_function(tolua_S,"createWithSpriteFrame", lua_cocos2dx_Sprite_createWithSpriteFrame); - tolua_endmodule(tolua_S); - auto typeName = typeid(cocos2d::Sprite).name(); // rtti is literal storage - g_luaType[reinterpret_cast(typeName)] = "cc.Sprite"; - g_typeCast[typeName] = "cc.Sprite"; - return 1; -} - int lua_cocos2dx_Layer_create(lua_State* tolua_S) { int argc = 0; @@ -59870,7 +57625,7 @@ static int lua_cocos2dx_Layer_finalize(lua_State* tolua_S) int lua_register_cocos2dx_Layer(lua_State* tolua_S) { tolua_usertype(tolua_S,"cc.Layer"); - tolua_cclass(tolua_S,"Layer","cc.Layer","cc.Sprite",nullptr); + tolua_cclass(tolua_S,"Layer","cc.Layer","cc.Node",nullptr); tolua_beginmodule(tolua_S,"Layer"); tolua_function(tolua_S,"new",lua_cocos2dx_Layer_constructor); @@ -59935,7 +57690,7 @@ int lua_cocos2dx_LayerColor_changeWidthAndHeight(lua_State* tolua_S) return 0; } -int lua_cocos2dx_LayerColor_changeHeight(lua_State* tolua_S) +int lua_cocos2dx_LayerColor_getBlendFunc(lua_State* tolua_S) { int argc = 0; cocos2d::LayerColor* cobj = nullptr; @@ -59955,7 +57710,104 @@ int lua_cocos2dx_LayerColor_changeHeight(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_changeHeight'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_getBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerColor_getBlendFunc'", nullptr); + return 0; + } + const cocos2d::BlendFunc& ret = cobj->getBlendFunc(); + blendfunc_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerColor:getBlendFunc",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerColor_getBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_LayerColor_setBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::LayerColor* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.LayerColor",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::LayerColor*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_setBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::BlendFunc arg0; + + ok &= luaval_to_blendfunc(tolua_S, 2, &arg0, "cc.LayerColor:setBlendFunc"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerColor_setBlendFunc'", nullptr); + return 0; + } + cobj->setBlendFunc(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerColor:setBlendFunc",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerColor_setBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_LayerColor_changeWidth(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::LayerColor* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.LayerColor",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::LayerColor*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_changeWidth'", nullptr); return 0; } #endif @@ -59965,22 +57817,22 @@ int lua_cocos2dx_LayerColor_changeHeight(lua_State* tolua_S) { double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.LayerColor:changeHeight"); + ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.LayerColor:changeWidth"); if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerColor_changeHeight'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerColor_changeWidth'", nullptr); return 0; } - cobj->changeHeight(arg0); + cobj->changeWidth(arg0); lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerColor:changeHeight",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerColor:changeWidth",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerColor_changeHeight'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerColor_changeWidth'.",&tolua_err); #endif return 0; @@ -60048,7 +57900,7 @@ int lua_cocos2dx_LayerColor_initWithColor(lua_State* tolua_S) return 0; } -int lua_cocos2dx_LayerColor_changeWidth(lua_State* tolua_S) +int lua_cocos2dx_LayerColor_changeHeight(lua_State* tolua_S) { int argc = 0; cocos2d::LayerColor* cobj = nullptr; @@ -60068,7 +57920,7 @@ int lua_cocos2dx_LayerColor_changeWidth(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_changeWidth'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_changeHeight'", nullptr); return 0; } #endif @@ -60078,22 +57930,22 @@ int lua_cocos2dx_LayerColor_changeWidth(lua_State* tolua_S) { double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.LayerColor:changeWidth"); + ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.LayerColor:changeHeight"); if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerColor_changeWidth'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerColor_changeHeight'", nullptr); return 0; } - cobj->changeWidth(arg0); + cobj->changeHeight(arg0); lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerColor:changeWidth",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerColor:changeHeight",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerColor_changeWidth'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerColor_changeHeight'.",&tolua_err); #endif return 0; @@ -60213,9 +58065,11 @@ int lua_register_cocos2dx_LayerColor(lua_State* tolua_S) tolua_beginmodule(tolua_S,"LayerColor"); tolua_function(tolua_S,"new",lua_cocos2dx_LayerColor_constructor); tolua_function(tolua_S,"changeWidthAndHeight",lua_cocos2dx_LayerColor_changeWidthAndHeight); - tolua_function(tolua_S,"changeHeight",lua_cocos2dx_LayerColor_changeHeight); - tolua_function(tolua_S,"initWithColor",lua_cocos2dx_LayerColor_initWithColor); + tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_LayerColor_getBlendFunc); + tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_LayerColor_setBlendFunc); tolua_function(tolua_S,"changeWidth",lua_cocos2dx_LayerColor_changeWidth); + tolua_function(tolua_S,"initWithColor",lua_cocos2dx_LayerColor_initWithColor); + tolua_function(tolua_S,"changeHeight",lua_cocos2dx_LayerColor_changeHeight); tolua_function(tolua_S,"create", lua_cocos2dx_LayerColor_create); tolua_endmodule(tolua_S); auto typeName = typeid(cocos2d::LayerColor).name(); // rtti is literal storage @@ -61058,6 +58912,53 @@ int lua_cocos2dx_LayerRadialGradient_getStartColor(lua_State* tolua_S) return 0; } +int lua_cocos2dx_LayerRadialGradient_getBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::LayerRadialGradient* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.LayerRadialGradient",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::LayerRadialGradient*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerRadialGradient_getBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerRadialGradient_getBlendFunc'", nullptr); + return 0; + } + cocos2d::BlendFunc ret = cobj->getBlendFunc(); + blendfunc_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerRadialGradient:getBlendFunc",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerRadialGradient_getBlendFunc'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_LayerRadialGradient_getStartColor3B(lua_State* tolua_S) { int argc = 0; @@ -61809,6 +59710,56 @@ int lua_cocos2dx_LayerRadialGradient_getExpand(lua_State* tolua_S) return 0; } +int lua_cocos2dx_LayerRadialGradient_setBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::LayerRadialGradient* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.LayerRadialGradient",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::LayerRadialGradient*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerRadialGradient_setBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::BlendFunc arg0; + + ok &= luaval_to_blendfunc(tolua_S, 2, &arg0, "cc.LayerRadialGradient:setBlendFunc"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerRadialGradient_setBlendFunc'", nullptr); + return 0; + } + cobj->setBlendFunc(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerRadialGradient:setBlendFunc",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerRadialGradient_setBlendFunc'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_LayerRadialGradient_getRadius(lua_State* tolua_S) { int argc = 0; @@ -61964,6 +59915,7 @@ int lua_register_cocos2dx_LayerRadialGradient(lua_State* tolua_S) tolua_beginmodule(tolua_S,"LayerRadialGradient"); tolua_function(tolua_S,"new",lua_cocos2dx_LayerRadialGradient_constructor); tolua_function(tolua_S,"getStartColor",lua_cocos2dx_LayerRadialGradient_getStartColor); + tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_LayerRadialGradient_getBlendFunc); tolua_function(tolua_S,"getStartColor3B",lua_cocos2dx_LayerRadialGradient_getStartColor3B); tolua_function(tolua_S,"getStartOpacity",lua_cocos2dx_LayerRadialGradient_getStartOpacity); tolua_function(tolua_S,"setCenter",lua_cocos2dx_LayerRadialGradient_setCenter); @@ -61979,6 +59931,7 @@ int lua_register_cocos2dx_LayerRadialGradient(lua_State* tolua_S) tolua_function(tolua_S,"setRadius",lua_cocos2dx_LayerRadialGradient_setRadius); tolua_function(tolua_S,"setStartColor",lua_cocos2dx_LayerRadialGradient_setStartColor); tolua_function(tolua_S,"getExpand",lua_cocos2dx_LayerRadialGradient_getExpand); + tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_LayerRadialGradient_setBlendFunc); tolua_function(tolua_S,"getRadius",lua_cocos2dx_LayerRadialGradient_getRadius); tolua_function(tolua_S,"create", lua_cocos2dx_LayerRadialGradient_create); tolua_endmodule(tolua_S); @@ -77015,6 +74968,2207 @@ int lua_register_cocos2dx_ProtectedNode(lua_State* tolua_S) return 1; } +int lua_cocos2dx_Sprite_setSpriteFrame(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setSpriteFrame'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 1) { + cocos2d::SpriteFrame* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:setSpriteFrame"); + + if (!ok) { break; } + cobj->setSpriteFrame(arg0); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:setSpriteFrame"); + + if (!ok) { break; } + cobj->setSpriteFrame(arg0); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setSpriteFrame",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setSpriteFrame'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTexture'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 1) { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:setTexture"); + + if (!ok) { break; } + cobj->setTexture(arg0); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:setTexture"); + + if (!ok) { break; } + cobj->setTexture(arg0); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setTexture",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTexture'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getTexture'", nullptr); + return 0; + } + cocos2d::Texture2D* ret = cobj->getTexture(); + object_to_luaval(tolua_S, "cc.Texture2D",(cocos2d::Texture2D*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getTexture",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setFlippedY(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setFlippedY'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setFlippedY"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setFlippedY'", nullptr); + return 0; + } + cobj->setFlippedY(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setFlippedY",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setFlippedY'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setFlippedX(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setFlippedX'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setFlippedX"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setFlippedX'", nullptr); + return 0; + } + cobj->setFlippedX(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setFlippedX",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setFlippedX'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getResourceType(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getResourceType'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getResourceType'", nullptr); + return 0; + } + int ret = cobj->getResourceType(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getResourceType",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getResourceType'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + unsigned int arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:setDisplayFrameWithAnimationName"); + + ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.Sprite:setDisplayFrameWithAnimationName"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'", nullptr); + return 0; + } + cobj->setDisplayFrameWithAnimationName(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setDisplayFrameWithAnimationName",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getBatchNode(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getBatchNode'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getBatchNode'", nullptr); + return 0; + } + cocos2d::SpriteBatchNode* ret = cobj->getBatchNode(); + object_to_luaval(tolua_S, "cc.SpriteBatchNode",(cocos2d::SpriteBatchNode*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getBatchNode",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getBatchNode'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getOffsetPosition(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getOffsetPosition'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getOffsetPosition'", nullptr); + return 0; + } + const cocos2d::Vec2& ret = cobj->getOffsetPosition(); + vec2_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getOffsetPosition",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getOffsetPosition'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getCenterRect(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getCenterRect'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getCenterRect'", nullptr); + return 0; + } + cocos2d::Rect ret = cobj->getCenterRect(); + rect_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getCenterRect",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getCenterRect'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setCenterRectNormalized(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setCenterRectNormalized'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Rect arg0; + + ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setCenterRectNormalized"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setCenterRectNormalized'", nullptr); + return 0; + } + cobj->setCenterRectNormalized(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setCenterRectNormalized",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setCenterRectNormalized'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_isStretchEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isStretchEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isStretchEnabled'", nullptr); + return 0; + } + bool ret = cobj->isStretchEnabled(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isStretchEnabled",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isStretchEnabled'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setTextureRect(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTextureRect'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 3) { + cocos2d::Rect arg0; + ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setTextureRect"); + + if (!ok) { break; } + bool arg1; + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.Sprite:setTextureRect"); + + if (!ok) { break; } + cocos2d::Size arg2; + ok &= luaval_to_size(tolua_S, 4, &arg2, "cc.Sprite:setTextureRect"); + + if (!ok) { break; } + cobj->setTextureRect(arg0, arg1, arg2); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + cocos2d::Rect arg0; + ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setTextureRect"); + + if (!ok) { break; } + cobj->setTextureRect(arg0); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setTextureRect",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setTextureRect'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_initWithSpriteFrameName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithSpriteFrameName'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:initWithSpriteFrameName"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_initWithSpriteFrameName'", nullptr); + return 0; + } + bool ret = cobj->initWithSpriteFrameName(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:initWithSpriteFrameName",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithSpriteFrameName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setStretchEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setStretchEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setStretchEnabled"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setStretchEnabled'", nullptr); + return 0; + } + cobj->setStretchEnabled(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setStretchEnabled",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setStretchEnabled'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_isFrameDisplayed(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFrameDisplayed'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::SpriteFrame* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:isFrameDisplayed"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isFrameDisplayed'", nullptr); + return 0; + } + bool ret = cobj->isFrameDisplayed(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isFrameDisplayed",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isFrameDisplayed'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getAtlasIndex(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getAtlasIndex'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getAtlasIndex'", nullptr); + return 0; + } + unsigned int ret = cobj->getAtlasIndex(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getAtlasIndex",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getAtlasIndex'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setTextureAtlas(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTextureAtlas'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::TextureAtlas* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0, "cc.Sprite:setTextureAtlas"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setTextureAtlas'", nullptr); + return 0; + } + cobj->setTextureAtlas(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setTextureAtlas",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setTextureAtlas'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setBatchNode(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setBatchNode'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::SpriteBatchNode* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteBatchNode",&arg0, "cc.Sprite:setBatchNode"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setBatchNode'", nullptr); + return 0; + } + cobj->setBatchNode(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setBatchNode",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setBatchNode'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getBlendFunc'", nullptr); + return 0; + } + const cocos2d::BlendFunc& ret = cobj->getBlendFunc(); + blendfunc_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getBlendFunc",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setCenterRect(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setCenterRect'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Rect arg0; + + ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setCenterRect"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setCenterRect'", nullptr); + return 0; + } + cobj->setCenterRect(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setCenterRect",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setCenterRect'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getSpriteFrame(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getSpriteFrame'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getSpriteFrame'", nullptr); + return 0; + } + cocos2d::SpriteFrame* ret = cobj->getSpriteFrame(); + object_to_luaval(tolua_S, "cc.SpriteFrame",(cocos2d::SpriteFrame*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getSpriteFrame",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getSpriteFrame'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setVertexLayout(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setVertexLayout'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setVertexLayout'", nullptr); + return 0; + } + cobj->setVertexLayout(); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setVertexLayout",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setVertexLayout'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_removeAllChildrenWithCleanup(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:removeAllChildrenWithCleanup"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'", nullptr); + return 0; + } + cobj->removeAllChildrenWithCleanup(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:removeAllChildrenWithCleanup",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getResourceName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getResourceName'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getResourceName'", nullptr); + return 0; + } + const std::string& ret = cobj->getResourceName(); + lua_pushlstring(tolua_S,ret.c_str(),ret.length()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getResourceName",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getResourceName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_isDirty(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isDirty'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isDirty'", nullptr); + return 0; + } + bool ret = cobj->isDirty(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isDirty",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isDirty'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getCenterRectNormalized(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getCenterRectNormalized'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getCenterRectNormalized'", nullptr); + return 0; + } + cocos2d::Rect ret = cobj->getCenterRectNormalized(); + rect_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getCenterRectNormalized",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getCenterRectNormalized'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setAtlasIndex(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setAtlasIndex'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + unsigned int arg0; + + ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Sprite:setAtlasIndex"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setAtlasIndex'", nullptr); + return 0; + } + cobj->setAtlasIndex(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setAtlasIndex",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setAtlasIndex'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_initWithTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithTexture'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); + + if (!ok) { break; } + cocos2d::Rect arg1; + ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:initWithTexture"); + + if (!ok) { break; } + bool ret = cobj->initWithTexture(arg0, arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); + + if (!ok) { break; } + bool ret = cobj->initWithTexture(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 3) { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); + + if (!ok) { break; } + cocos2d::Rect arg1; + ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:initWithTexture"); + + if (!ok) { break; } + bool arg2; + ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.Sprite:initWithTexture"); + + if (!ok) { break; } + bool ret = cobj->initWithTexture(arg0, arg1, arg2); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:initWithTexture",argc, 3); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setDirty(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setDirty'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setDirty"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setDirty'", nullptr); + return 0; + } + cobj->setDirty(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setDirty",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setDirty'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_isTextureRectRotated(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isTextureRectRotated'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isTextureRectRotated'", nullptr); + return 0; + } + bool ret = cobj->isTextureRectRotated(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isTextureRectRotated",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isTextureRectRotated'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getTextureRect(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTextureRect'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getTextureRect'", nullptr); + return 0; + } + const cocos2d::Rect& ret = cobj->getTextureRect(); + rect_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getTextureRect",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getTextureRect'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_initWithFile(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithFile'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:initWithFile"); + + if (!ok) { break; } + cocos2d::Rect arg1; + ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:initWithFile"); + + if (!ok) { break; } + bool ret = cobj->initWithFile(arg0, arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:initWithFile"); + + if (!ok) { break; } + bool ret = cobj->initWithFile(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:initWithFile",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithFile'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::BlendFunc arg0; + + ok &= luaval_to_blendfunc(tolua_S, 2, &arg0, "cc.Sprite:setBlendFunc"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setBlendFunc'", nullptr); + return 0; + } + cobj->setBlendFunc(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setBlendFunc",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getTextureAtlas(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTextureAtlas'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_getTextureAtlas'", nullptr); + return 0; + } + cocos2d::TextureAtlas* ret = cobj->getTextureAtlas(); + object_to_luaval(tolua_S, "cc.TextureAtlas",(cocos2d::TextureAtlas*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getTextureAtlas",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getTextureAtlas'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_initWithSpriteFrame(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithSpriteFrame'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::SpriteFrame* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:initWithSpriteFrame"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_initWithSpriteFrame'", nullptr); + return 0; + } + bool ret = cobj->initWithSpriteFrame(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:initWithSpriteFrame",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithSpriteFrame'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_isFlippedX(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFlippedX'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isFlippedX'", nullptr); + return 0; + } + bool ret = cobj->isFlippedX(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isFlippedX",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isFlippedX'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_isFlippedY(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFlippedY'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isFlippedY'", nullptr); + return 0; + } + bool ret = cobj->isFlippedY(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isFlippedY",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isFlippedY'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setVertexRect(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setVertexRect'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Rect arg0; + + ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setVertexRect"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setVertexRect'", nullptr); + return 0; + } + cobj->setVertexRect(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setVertexRect",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setVertexRect'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_createWithTexture(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S)-1; + + do + { + if (argc == 2) + { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); + if (!ok) { break; } + cocos2d::Rect arg1; + ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:createWithTexture"); + if (!ok) { break; } + cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1); + object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 3) + { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); + if (!ok) { break; } + cocos2d::Rect arg1; + ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:createWithTexture"); + if (!ok) { break; } + bool arg2; + ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.Sprite:createWithTexture"); + if (!ok) { break; } + cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1, arg2); + object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 1) + { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); + if (!ok) { break; } + cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0); + object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); + return 1; + } + } while (0); + ok = true; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "cc.Sprite:createWithTexture",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithTexture'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_Sprite_createWithSpriteFrameName(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:createWithSpriteFrameName"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_createWithSpriteFrameName'", nullptr); + return 0; + } + cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrameName(arg0); + object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite:createWithSpriteFrameName",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithSpriteFrameName'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_Sprite_createWithSpriteFrame(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::SpriteFrame* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:createWithSpriteFrame"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_createWithSpriteFrame'", nullptr); + return 0; + } + cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrame(arg0); + object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite:createWithSpriteFrame",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithSpriteFrame'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_Sprite_constructor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_constructor'", nullptr); + return 0; + } + cobj = new cocos2d::Sprite(); + cobj->autorelease(); + int ID = (int)cobj->_ID ; + int* luaID = &cobj->_luaID ; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.Sprite"); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:Sprite",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_constructor'.",&tolua_err); +#endif + + return 0; +} + +static int lua_cocos2dx_Sprite_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Sprite)"); + return 0; +} + +int lua_register_cocos2dx_Sprite(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Sprite"); + tolua_cclass(tolua_S,"Sprite","cc.Sprite","cc.Node",nullptr); + + tolua_beginmodule(tolua_S,"Sprite"); + tolua_function(tolua_S,"new",lua_cocos2dx_Sprite_constructor); + tolua_function(tolua_S,"setSpriteFrame",lua_cocos2dx_Sprite_setSpriteFrame); + tolua_function(tolua_S,"setTexture",lua_cocos2dx_Sprite_setTexture); + tolua_function(tolua_S,"getTexture",lua_cocos2dx_Sprite_getTexture); + tolua_function(tolua_S,"setFlippedY",lua_cocos2dx_Sprite_setFlippedY); + tolua_function(tolua_S,"setFlippedX",lua_cocos2dx_Sprite_setFlippedX); + tolua_function(tolua_S,"getResourceType",lua_cocos2dx_Sprite_getResourceType); + tolua_function(tolua_S,"setDisplayFrameWithAnimationName",lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName); + tolua_function(tolua_S,"getBatchNode",lua_cocos2dx_Sprite_getBatchNode); + tolua_function(tolua_S,"getOffsetPosition",lua_cocos2dx_Sprite_getOffsetPosition); + tolua_function(tolua_S,"getCenterRect",lua_cocos2dx_Sprite_getCenterRect); + tolua_function(tolua_S,"setCenterRectNormalized",lua_cocos2dx_Sprite_setCenterRectNormalized); + tolua_function(tolua_S,"isStretchEnabled",lua_cocos2dx_Sprite_isStretchEnabled); + tolua_function(tolua_S,"setTextureRect",lua_cocos2dx_Sprite_setTextureRect); + tolua_function(tolua_S,"initWithSpriteFrameName",lua_cocos2dx_Sprite_initWithSpriteFrameName); + tolua_function(tolua_S,"setStretchEnabled",lua_cocos2dx_Sprite_setStretchEnabled); + tolua_function(tolua_S,"isFrameDisplayed",lua_cocos2dx_Sprite_isFrameDisplayed); + tolua_function(tolua_S,"getAtlasIndex",lua_cocos2dx_Sprite_getAtlasIndex); + tolua_function(tolua_S,"setTextureAtlas",lua_cocos2dx_Sprite_setTextureAtlas); + tolua_function(tolua_S,"setBatchNode",lua_cocos2dx_Sprite_setBatchNode); + tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_Sprite_getBlendFunc); + tolua_function(tolua_S,"setCenterRect",lua_cocos2dx_Sprite_setCenterRect); + tolua_function(tolua_S,"getSpriteFrame",lua_cocos2dx_Sprite_getSpriteFrame); + tolua_function(tolua_S,"setVertexLayout",lua_cocos2dx_Sprite_setVertexLayout); + tolua_function(tolua_S,"removeAllChildrenWithCleanup",lua_cocos2dx_Sprite_removeAllChildrenWithCleanup); + tolua_function(tolua_S,"getResourceName",lua_cocos2dx_Sprite_getResourceName); + tolua_function(tolua_S,"isDirty",lua_cocos2dx_Sprite_isDirty); + tolua_function(tolua_S,"getCenterRectNormalized",lua_cocos2dx_Sprite_getCenterRectNormalized); + tolua_function(tolua_S,"setAtlasIndex",lua_cocos2dx_Sprite_setAtlasIndex); + tolua_function(tolua_S,"initWithTexture",lua_cocos2dx_Sprite_initWithTexture); + tolua_function(tolua_S,"setDirty",lua_cocos2dx_Sprite_setDirty); + tolua_function(tolua_S,"isTextureRectRotated",lua_cocos2dx_Sprite_isTextureRectRotated); + tolua_function(tolua_S,"getTextureRect",lua_cocos2dx_Sprite_getTextureRect); + tolua_function(tolua_S,"initWithFile",lua_cocos2dx_Sprite_initWithFile); + tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_Sprite_setBlendFunc); + tolua_function(tolua_S,"getTextureAtlas",lua_cocos2dx_Sprite_getTextureAtlas); + tolua_function(tolua_S,"initWithSpriteFrame",lua_cocos2dx_Sprite_initWithSpriteFrame); + tolua_function(tolua_S,"isFlippedX",lua_cocos2dx_Sprite_isFlippedX); + tolua_function(tolua_S,"isFlippedY",lua_cocos2dx_Sprite_isFlippedY); + tolua_function(tolua_S,"setVertexRect",lua_cocos2dx_Sprite_setVertexRect); + tolua_function(tolua_S,"createWithTexture", lua_cocos2dx_Sprite_createWithTexture); + tolua_function(tolua_S,"createWithSpriteFrameName", lua_cocos2dx_Sprite_createWithSpriteFrameName); + tolua_function(tolua_S,"createWithSpriteFrame", lua_cocos2dx_Sprite_createWithSpriteFrame); + tolua_endmodule(tolua_S); + auto typeName = typeid(cocos2d::Sprite).name(); // rtti is literal storage + g_luaType[reinterpret_cast(typeName)] = "cc.Sprite"; + g_typeCast[typeName] = "cc.Sprite"; + return 1; +} + int lua_cocos2dx_RenderTexture_setVirtualViewport(lua_State* tolua_S) { int argc = 0; @@ -106225,7 +106379,6 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_EaseQuadraticActionOut(tolua_S); lua_register_cocos2dx_TransitionProgress(tolua_S); lua_register_cocos2dx_TransitionProgressVertical(tolua_S); - lua_register_cocos2dx_Sprite(tolua_S); lua_register_cocos2dx_Layer(tolua_S); lua_register_cocos2dx_Grid3DAction(tolua_S); lua_register_cocos2dx_BaseLight(tolua_S); @@ -106419,6 +106572,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_MotionStreak(tolua_S); lua_register_cocos2dx_RotateBy(tolua_S); lua_register_cocos2dx_FileUtils(tolua_S); + lua_register_cocos2dx_Sprite(tolua_S); lua_register_cocos2dx_TransitionSlideInT(tolua_S); lua_register_cocos2dx_ProgressTo(tolua_S); lua_register_cocos2dx_TransitionProgressOutIn(tolua_S); diff --git a/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index facd9cb94e..2bcb64b12d 100644 --- a/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -2325,6 +2325,10 @@ int register_all_cocos2dx(lua_State* tolua_S); + + + + diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.h b/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.h index ef82f8bdf8..92b4b7e6ff 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.h +++ b/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.h @@ -71,8 +71,8 @@ public: void onTouchMoved(cocos2d::Touch* touch, cocos2d::Event* event); void onTouchEnded(cocos2d::Touch* touch, cocos2d::Event* event); - void onKeyPressed(cocos2d::EventKeyboard::KeyCode code, cocos2d::Event* event); - void onKeyReleased(cocos2d::EventKeyboard::KeyCode code, cocos2d::Event* event); + void onKeyPressed(cocos2d::EventKeyboard::KeyCode code, cocos2d::Event* event) override; + void onKeyReleased(cocos2d::EventKeyboard::KeyCode code, cocos2d::Event* event) override; void onMouseDown(cocos2d::Event* event); void onMouseUp(cocos2d::Event* event); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp index a30b8c0bf2..05796254ab 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp @@ -135,7 +135,7 @@ void UIRadioButtonTest::deleteRadioButton(Ref* sender) { RadioButton* radioButton = _radioButtonGroup->getRadioButtonByIndex((int)_radioButtonGroup->getNumberOfRadioButtons() - 1); _radioButtonGroup->removeRadioButton(radioButton); - _uiLayer->removeChild(radioButton, true); + _uiLayer->removeChild(radioButton); } }