diff --git a/AUTHORS b/AUTHORS index af63114d5a..bca68ac83b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -793,6 +793,9 @@ Developers: LoungeKatt Corrected a mistake of building android project in README.md + + flashjay + Remove deprecated code in lua tests & template Retired Core Developers: WenSheng Yang diff --git a/cocos/scripting/lua-bindings/auto/api/Helper.lua b/cocos/scripting/lua-bindings/auto/api/Helper.lua index 777b62a0fe..7777897e6e 100644 --- a/cocos/scripting/lua-bindings/auto/api/Helper.lua +++ b/cocos/scripting/lua-bindings/auto/api/Helper.lua @@ -2,13 +2,6 @@ -------------------------------- -- @module Helper --------------------------------- --- @function [parent=#Helper] seekActionWidgetByActionTag --- @param self --- @param #ccui.Widget widget --- @param #int int --- @return Widget#Widget ret (return value: ccui.Widget) - -------------------------------- -- @function [parent=#Helper] seekWidgetByTag -- @param self @@ -17,10 +10,10 @@ -- @return Widget#Widget ret (return value: ccui.Widget) -------------------------------- --- @function [parent=#Helper] seekWidgetByRelativeName +-- @function [parent=#Helper] seekActionWidgetByActionTag -- @param self -- @param #ccui.Widget widget --- @param #char char +-- @param #int int -- @return Widget#Widget ret (return value: ccui.Widget) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/Slider.lua b/cocos/scripting/lua-bindings/auto/api/Slider.lua index 2e6bbacca6..7ac618430b 100644 --- a/cocos/scripting/lua-bindings/auto/api/Slider.lua +++ b/cocos/scripting/lua-bindings/auto/api/Slider.lua @@ -111,6 +111,12 @@ -- @param self -- @return string#string ret (return value: string) +-------------------------------- +-- @function [parent=#Slider] hitTest +-- @param self +-- @param #point_table point +-- @return bool#bool ret (return value: bool) + -------------------------------- -- @function [parent=#Slider] getContentSize -- @param self diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp.REMOVED.git-id b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp.REMOVED.git-id index 96b25dd5ca..6dff430fb1 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp.REMOVED.git-id +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp.REMOVED.git-id @@ -1 +1 @@ -4fac42101ef2fb9622f22ccabc18c918622908ad \ No newline at end of file +d608beef525313b9c497786a1dd7b2460ff65d84 \ No newline at end of file diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index 3a1b0bb858..75d07761f8 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -366,7 +366,6 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); - #endif // __cocos2dx_ui_h__ diff --git a/cocos/ui/UISlider.cpp b/cocos/ui/UISlider.cpp index 37d6845325..7d03f3d0f4 100644 --- a/cocos/ui/UISlider.cpp +++ b/cocos/ui/UISlider.cpp @@ -377,6 +377,16 @@ void Slider::setPercent(int percent) spriteRenderer->setTextureRect(rect, spriteRenderer->isTextureRectRotated(), rect.size); } } + +bool Slider::hitTest(const cocos2d::Point &pt) +{ + Point nsp = this->_slidBallNormalRenderer->convertToNodeSpace(pt); + Rect ballRect = this->_slidBallNormalRenderer->getTextureRect(); + if (ballRect.containsPoint(nsp)) { + return true; + } + return false; +} bool Slider::onTouchBegan(Touch *touch, Event *unusedEvent) { diff --git a/cocos/ui/UISlider.h b/cocos/ui/UISlider.h index c3ab3cffcc..de702eacef 100644 --- a/cocos/ui/UISlider.h +++ b/cocos/ui/UISlider.h @@ -189,6 +189,8 @@ public: //override "ignoreContentAdaptWithSize" method of widget. virtual void ignoreContentAdaptWithSize(bool ignore) override; + //override the widget's hitTest function to perfom its own + virtual bool hitTest(const Point &pt) override; /** * Returns the "class name" of widget. */ diff --git a/external/chipmunk/src/cpCollision.c b/external/chipmunk/src/cpCollision.c index 439314efb6..3474dc6700 100644 --- a/external/chipmunk/src/cpCollision.c +++ b/external/chipmunk/src/cpCollision.c @@ -21,7 +21,10 @@ #include #include -#include + +#ifndef WIN32 +#include +#endif #include "chipmunk_private.h" diff --git a/templates/cocos2dx_files.json.REMOVED.git-id b/templates/cocos2dx_files.json.REMOVED.git-id index 089a8e7561..c937acbc30 100644 --- a/templates/cocos2dx_files.json.REMOVED.git-id +++ b/templates/cocos2dx_files.json.REMOVED.git-id @@ -1 +1 @@ -d53bc7d6e68a49984c5971344f59bba8414d142b \ No newline at end of file +8cce920bd091a03ab1e10db03eb397451b0d70c5 \ No newline at end of file diff --git a/templates/lua-template-default/src/main.lua b/templates/lua-template-default/src/main.lua index ec894a7787..3be63ad14f 100644 --- a/templates/lua-template-default/src/main.lua +++ b/templates/lua-template-default/src/main.lua @@ -1,4 +1,6 @@ require "Cocos2d" +require "Cocos2dConstants" + -- cclog cclog = function(...) print(string.format(...)) @@ -43,7 +45,7 @@ local function main() local frameHeight = 95 -- create dog animate - local textureDog = cc.TextureCache:getInstance():addImage("dog.png") + local textureDog = cc.Director:getInstance():getTextureCache():addImage("dog.png") local rect = cc.rect(0, 0, frameWidth, frameHeight) local frame0 = cc.SpriteFrame:createWithTexture(textureDog, rect) rect = cc.rect(frameWidth, 0, frameWidth, frameHeight) @@ -206,7 +208,7 @@ local function main() -- uncomment below for the BlackBerry version local bgMusicPath = nil if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) then - bgMusicPath = CCFileUtils:getInstance():fullPathForFilename("res/background.caf") + bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("res/background.caf") else bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("res/background.mp3") end diff --git a/templates/lua-template-runtime/src/main.lua b/templates/lua-template-runtime/src/main.lua index ec894a7787..3be63ad14f 100644 --- a/templates/lua-template-runtime/src/main.lua +++ b/templates/lua-template-runtime/src/main.lua @@ -1,4 +1,6 @@ require "Cocos2d" +require "Cocos2dConstants" + -- cclog cclog = function(...) print(string.format(...)) @@ -43,7 +45,7 @@ local function main() local frameHeight = 95 -- create dog animate - local textureDog = cc.TextureCache:getInstance():addImage("dog.png") + local textureDog = cc.Director:getInstance():getTextureCache():addImage("dog.png") local rect = cc.rect(0, 0, frameWidth, frameHeight) local frame0 = cc.SpriteFrame:createWithTexture(textureDog, rect) rect = cc.rect(frameWidth, 0, frameWidth, frameHeight) @@ -206,7 +208,7 @@ local function main() -- uncomment below for the BlackBerry version local bgMusicPath = nil if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) then - bgMusicPath = CCFileUtils:getInstance():fullPathForFilename("res/background.caf") + bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("res/background.caf") else bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("res/background.mp3") end diff --git a/tests/lua-empty-test/src/hello.lua b/tests/lua-empty-test/src/hello.lua index 2916f16686..4041c89bb2 100644 --- a/tests/lua-empty-test/src/hello.lua +++ b/tests/lua-empty-test/src/hello.lua @@ -1,4 +1,6 @@ require "Cocos2d" +require "Cocos2dConstants" + -- cclog cclog = function(...) print(string.format(...)) @@ -39,7 +41,7 @@ local function main() local frameHeight = 95 -- create dog animate - local textureDog = cc.TextureCache:getInstance():addImage("res/dog.png") + local textureDog = cc.Director:getInstance():getTextureCache():addImage("res/dog.png") local rect = cc.rect(0, 0, frameWidth, frameHeight) local frame0 = cc.SpriteFrame:createWithTexture(textureDog, rect) rect = cc.rect(frameWidth, 0, frameWidth, frameHeight) @@ -195,7 +197,7 @@ local function main() -- uncomment below for the BlackBerry version local bgMusicPath = nil if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) then - bgMusicPath = CCFileUtils:getInstance():fullPathForFilename("res/background.caf") + bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("res/background.caf") else bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("res/background.mp3") end