diff --git a/cocos/scripting/lua/script/Cocos2d.lua b/cocos/scripting/lua/script/Cocos2d.lua index c364c7f32a..404e8584b7 100644 --- a/cocos/scripting/lua/script/Cocos2d.lua +++ b/cocos/scripting/lua/script/Cocos2d.lua @@ -291,4 +291,72 @@ function cc.c4f( _r,_g,_b,_a ) return { r = _r, g = _g, b = _b, a = _a } end +--Vertex2F +function cc.vertex2F(_x,_y) + return { x = _x, y = _y } +end +--Vertex3F +function cc.Vertex3F(_x,_y,_z) + return { x = _x, y = _y, z = _z } +end + +--Tex2F +function cc.tex2F(_u,_v) + return { u = _u, v = _v } +end + +--PointSprite +function cc.PointSprite(_pos,_color,_size) + return { pos = _pos, color = _color, size = _size } +end + +--Quad2 +function cc.Quad2(_tl,_tr,_bl,_br) + return { tl = _tl, tr = _tr, bl = _bl, br = _br } +end + +--Quad3 +function cc.Quad3(_tl, _tr, _bl, _br) + return { tl = _tl, tr = _tr, bl = _bl, br = _br } +end + +--V2F_C4B_T2F +function cc.V2F_C4B_T2F(_vertices, _colors, _texCoords) + return { vertices = _vertices, colors = _colors, texCoords = _texCoords } +end + +--V2F_C4F_T2F +function cc.V2F_C4F_T2F(_vertices, _colors, _texCoords) + return { vertices = _vertices, colors = _colors, texCoords = _texCoords } +end + +--V3F_C4B_T2F +function cc.V3F_C4B_T2F(_vertices, _colors, _texCoords) + return { vertices = _vertices, colors = _colors, texCoords = _texCoords } +end + +--V2F_C4B_T2F_Quad +function cc.V2F_C4B_T2F_Quad(_bl, _br, _tl, _tr) + return { bl = _bl, br = _br, tl = _tl, tr = _tr } +end + +--V3F_C4B_T2F_Quad +function cc.V3F_C4B_T2F_Quad(_tl, _bl, _tr, _br) + return { tl = _tl, bl = _bl, tr = _tr, br = _br } +end + +--V2F_C4F_T2F_Quad +function cc.V2F_C4F_T2F_Quad(_bl, _br, _tl, _tr) + return { bl = _bl, br = _br, tl = _tl, tr = _tr } +end + +--T2F_Quad +function cc.T2F_Quad(_bl, _br, _tl, _tr) + return { bl = _bl, br = _br, tl = _tl, tr = _tr } +end + +--AnimationFrameData +function cc.AnimationFrameData( _texCoords, _delay, _size) + return { texCoords = _texCoords, delay = _delay, size = _size } +end diff --git a/cocos/scripting/lua/script/Deprecated.lua b/cocos/scripting/lua/script/Deprecated.lua index 055d417532..935a07514f 100644 --- a/cocos/scripting/lua/script/Deprecated.lua +++ b/cocos/scripting/lua/script/Deprecated.lua @@ -591,20 +591,20 @@ rawset(_G,"ccpIntersectPoint",ccpIntersectPoint) local function vertex2(x,y) - deprecatedTip("vertex2(x,y)","Vertex2F(x,y)") - return Vertex2F(x,y) + deprecatedTip("vertex2(x,y)","cc.vertex2F(x,y)") + return cc.vertex2F(x,y) end rawset(_G,"vertex2",vertex2) local function vertex3(x,y,z) - deprecatedTip("vertex3(x,y,z)","Vertex3F(x,y,z)") - return Vertex3F(x,y,z) + deprecatedTip("vertex3(x,y,z)","cc.Vertex3F(x,y,z)") + return cc.Vertex3F(x,y,z) end rawset(_G,"vertex3",vertex3) local function tex2(u,v) - deprecatedTip("tex2(u,v)","Tex2F(u,v)") - return Tex2F(u,v) + deprecatedTip("tex2(u,v)","cc.tex2f(u,v)") + return cc.tex2f(u,v) end rawset(_G,"tex2",tex2) @@ -615,109 +615,134 @@ end rawset(_G,"ccc4BFromccc4F",ccc4BFromccc4F) local function ccColor3BDeprecated() - deprecatedTip("ccColor3B","Color3B") - return Color3B + deprecatedTip("ccColor3B","cc.c3b(0,0,0)") + return cc.c3b(0,0,0) end -_G["ccColor3B"] = ccColor3BDeprecated() +_G["ccColor3B"] = ccColor3BDeprecated local function ccColor4BDeprecated() - deprecatedTip("ccColor4B","Color4B") - return Color4B + deprecatedTip("ccColor4B","cc.c4b(0,0,0,0)") + return cc.c4b(0,0,0,0) end -_G["ccColor4B"] = ccColor4BDeprecated() +_G["ccColor4B"] = ccColor4BDeprecated local function ccColor4FDeprecated() - deprecatedTip("ccColor4F","Color4F") - return Color4F + deprecatedTip("ccColor4F","cc.c4f(0.0,0.0,0.0,0.0)") + return cc.c4f(0.0,0.0,0.0,0.0) end -_G["ccColor4F"] = ccColor4FDeprecated() +_G["ccColor4F"] = ccColor4FDeprecated local function ccVertex2FDeprecated() - deprecatedTip("ccVertex2F","Vertex2F") - return Vertex2F + deprecatedTip("ccVertex2F","cc.vertex2F(0.0,0.0)") + return cc.vertex2F(0.0,0.0) end -_G["ccVertex2F"] = ccVertex2FDeprecated() +_G["ccVertex2F"] = ccVertex2FDeprecated local function ccVertex3FDeprecated() - deprecatedTip("ccVertex3F","Vertex3F") - return Vertex3F + deprecatedTip("ccVertex3F","cc.Vertex3F(0.0, 0.0, 0.0)") + return cc.Vertex3F(0.0, 0.0, 0.0) end -_G["ccVertex3F"] = ccVertex3FDeprecated() +_G["ccVertex3F"] = ccVertex3FDeprecated local function ccTex2FDeprecated() - deprecatedTip("ccTex2F","Tex2F") - return Tex2F + deprecatedTip("ccTex2F","cc.tex2F(0.0, 0.0)") + return cc.tex2F(0.0, 0.0) end -_G["ccTex2F"] = ccTex2FDeprecated() +_G["ccTex2F"] = ccTex2FDeprecated local function ccPointSpriteDeprecated() - deprecatedTip("ccPointSprite","PointSprite") - return PointSprite + deprecatedTip("ccPointSprite","cc.PointSprite(cc.vertex2F(0.0, 0.0),cc.c4b(0.0, 0.0, 0.0),0)") + return cc.PointSprite(cc.vertex2F(0.0, 0.0),cc.c4b(0.0, 0.0, 0.0),0) end -_G["ccPointSprite"] = ccPointSpriteDeprecated() +_G["ccPointSprite"] = ccPointSpriteDeprecated local function ccQuad2Deprecated() - deprecatedTip("ccQuad2","Quad2") - return Quad2 + deprecatedTip("ccQuad2","cc.Quad2(cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0))") + return cc.Quad2(cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0)) end -_G["ccQuad2"] = ccQuad2Deprecated() +_G["ccQuad2"] = ccQuad2Deprecated local function ccQuad3Deprecated() - deprecatedTip("ccQuad3","Quad3") - return Quad3 + deprecatedTip("ccQuad3","cc.Quad3(cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0))") + return cc.Quad3(cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0)) end -_G["ccQuad3"] = ccQuad3Deprecated() +_G["ccQuad3"] = ccQuad3Deprecated local function ccV2FC4BT2FDeprecated() - deprecatedTip("ccV2F_C4B_T2F","V2F_C4B_T2F") - return V2F_C4B_T2F + deprecatedTip("ccV2F_C4B_T2F","cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0))") + return cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)) end -_G["ccV2F_C4B_T2F"] = ccV2FC4BT2FDeprecated() +_G["ccV2F_C4B_T2F"] = ccV2FC4BT2FDeprecated local function ccV2FC4FT2FDeprecated() - deprecatedTip("ccV2F_C4F_T2F","V2F_C4F_T2F") - return V2F_C4F_T2F + deprecatedTip("ccV2F_C4F_T2F","cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0 , 0.0 , 0.0 ), cc.tex2F(0.0, 0.0))") + return cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0 , 0.0 , 0.0), cc.tex2F(0.0, 0.0)) end -_G["ccV2F_C4F_T2F"] = ccV2FC4FT2FDeprecated() +_G["ccV2F_C4F_T2F"] = ccV2FC4FT2FDeprecated local function ccV3FC4BT2FDeprecated() - deprecatedTip("ccV3F_C4B_T2F","V3F_C4B_T2F") - return V3F_C4B_T2F + deprecatedTip("ccV3F_C4B_T2F","cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0 , 0, 0 ), cc.tex2F(0.0, 0.0))") + return cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0 , 0, 0 ), cc.tex2F(0.0, 0.0)) end -_G["ccV3F_C4B_T2F"] = ccV3FC4BT2FDeprecated() +_G["ccV3F_C4B_T2F"] = ccV3FC4BT2FDeprecated local function ccV2FC4BT2FQuadDeprecated() - deprecatedTip("ccV2F_C4B_T2F_Quad","V2F_C4B_T2F_Quad") - return V2F_C4B_T2F_Quad + deprecatedTip("ccV2F_C4B_T2F_Quad","cc.V2F_C4B_T2F_Quad(cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)))") + return cc.V2F_C4B_T2F_Quad(cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0))) end -_G["ccV2F_C4B_T2F_Quad"] = ccV2FC4BT2FQuadDeprecated() +_G["ccV2F_C4B_T2F_Quad"] = ccV2FC4BT2FQuadDeprecated local function ccV3FC4BT2FQuadDeprecated() - deprecatedTip("ccV3F_C4B_T2F_Quad","V3F_C4B_T2F_Quad") - return V3F_C4B_T2F_Quad + deprecatedTip("ccV3F_C4B_T2F_Quad","cc.V3F_C4B_T2F_Quad(_tl, _bl, _tr, _br)") + return cc.V3F_C4B_T2F_Quad(cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0))) end -_G["ccV3F_C4B_T2F_Quad"] = ccV3FC4BT2FQuadDeprecated() +_G["ccV3F_C4B_T2F_Quad"] = ccV3FC4BT2FQuadDeprecated local function ccV2FC4FT2FQuadDeprecated() - deprecatedTip("ccV2F_C4F_T2F_Quad","V2F_C4F_T2F_Quad") - return V2F_C4F_T2F_Quad + deprecatedTip("ccV2F_C4F_T2F_Quad","cc.V2F_C4F_T2F_Quad(_bl, _br, _tl, _tr)") + return cc.V2F_C4F_T2F_Quad(cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0))) end -_G["ccV2F_C4F_T2F_Quad"] = ccV2FC4FT2FQuadDeprecated() +_G["ccV2F_C4F_T2F_Quad"] = ccV2FC4FT2FQuadDeprecated local function ccT2FQuadDeprecated() - deprecatedTip("ccT2F_Quad","T2F_Quad") - return T2F_Quad + deprecatedTip("ccT2F_Quad","cc.T2F_Quad(_bl, _br, _tl, _tr)") + return cc.T2F_Quad(cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0)) end -_G["ccT2F_Quad"] = ccT2FQuadDeprecated() +_G["ccT2F_Quad"] = ccT2FQuadDeprecated local function ccAnimationFrameDataDeprecated() - deprecatedTip("ccAnimationFrameData","AnimationFrameData") - return AnimationFrameData + deprecatedTip("ccAnimationFrameData","cc.AnimationFrameData( _texCoords, _delay, _size)") + return cc.AnimationFrameData(cc.T2F_Quad(cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0)), 0, cc.size(0,0)) end -_G["ccAnimationFrameData"] = ccAnimationFrameDataDeprecated() +_G["ccAnimationFrameData"] = ccAnimationFrameDataDeprecated + +local function tex2(u,v) + deprecatedTip("tex2(u,v)","cc.tex2f(u,v)") + return cc.tex2f(u,v) +end +rawset(_G,"tex2",tex2) + +local function CCPoint( x, y) + deprecatedTip("CCPoint(x,y)","cc.p(x,y)") + return cc.p(x,y) +end +rawset(_G,"CCPoint",CCPoint) + +local function CCSize( width, height) + deprecatedTip("CCSize(width,height)","cc.size(width,height)") + return cc.size(width,height) +end +rawset(_G,"CCSize",CCSize) + +local function CCRect( x,y, width, height) + deprecatedTip("CCRect(x,y,width,height)","cc.rect(x,y,width,height)") + return cc.rect(x,y,width,height) +end +rawset(_G,"CCRect",CCRect) + --functions of CCControl will be deprecated end local CCControlDeprecated = { } function CCControlDeprecated.addHandleOfControlEvent(self,func,controlEvent) @@ -1047,3 +1072,92 @@ function CCLayerDeprecated.isKeypadEnabled(self) end rawset(cc.Layer, "isKeypadEnabled", CCLayerDeprecated.isKeypadEnabled ) --functions of Layer will be deprecated end + +--functions of ccs.GUIReader will be deprecated begin +local CCSGUIReaderDeprecated = { } +function CCSGUIReaderDeprecated.purgeGUIReader() + deprecatedTip("ccs.GUIReader:purgeGUIReader","ccs.GUIReader:destroyInstance") + return ccs.GUIReader:destroyInstance() +end +rawset(ccs.GUIReader,"purgeGUIReader",CCSGUIReaderDeprecated.purgeGUIReader) +--functions of ccs.GUIReader will be deprecated end + +--functions of ccs.ActionManagerEx will be deprecated begin +local CCSActionManagerExDeprecated = { } +function CCSActionManagerExDeprecated.destroyActionManager() + deprecatedTip("ccs.ActionManagerEx:destroyActionManager","ccs.ActionManagerEx:destroyInstance") + return ccs.ActionManagerEx:destroyInstance() +end +rawset(ccs.ActionManagerEx,"destroyActionManager",CCSActionManagerExDeprecated.destroyActionManager) +--functions of ccs.ActionManagerEx will be deprecated end + +--functions of ccs.SceneReader will be deprecated begin +local CCSSceneReaderDeprecated = { } +function CCSSceneReaderDeprecated.destroySceneReader(self) + deprecatedTip("ccs.SceneReader:destroySceneReader","ccs.SceneReader:destroyInstance") + return self:destroyInstance() +end +rawset(ccs.SceneReader,"destroySceneReader",CCSSceneReaderDeprecated.destroySceneReader) +--functions of ccs.SceneReader will be deprecated end + +--functions of CCArmatureDataManager will be deprecated begin +local CCArmatureDataManagerDeprecated = { } +function CCArmatureDataManagerDeprecated.sharedArmatureDataManager() + deprecatedTip("CCArmatureDataManager:sharedArmatureDataManager","ccs.ArmatureDataManager:getInstance") + return ccs.ArmatureDataManager:getInstance() +end +rawset(CCArmatureDataManager,"sharedArmatureDataManager",CCArmatureDataManagerDeprecated.sharedArmatureDataManager) + +function CCArmatureDataManagerDeprecated.purge() + deprecatedTip("CCArmatureDataManager:purge","ccs.ArmatureDataManager:destoryInstance") + return ccs.ArmatureDataManager:destoryInstance() +end +rawset(CCArmatureDataManager,"purge",CCArmatureDataManagerDeprecated.purge) +--functions of CCArmatureDataManager will be deprecated end + +--functions of GUIReader will be deprecated begin +local GUIReaderDeprecated = { } +function GUIReaderDeprecated.shareReader() + deprecatedTip("GUIReader:shareReader","ccs.GUIReader:getInstance") + return ccs.GUIReader:getInstance() +end +rawset(GUIReader,"shareReader",GUIReaderDeprecated.shareReader) + +function GUIReaderDeprecated.purgeGUIReader() + deprecatedTip("GUIReader:purgeGUIReader","ccs.GUIReader:destroyInstance") + return ccs.GUIReader:destroyInstance() +end +rawset(GUIReader,"purgeGUIReader",GUIReaderDeprecated.purgeGUIReader) +--functions of GUIReader will be deprecated end + +--functions of SceneReader will be deprecated begin +local SceneReaderDeprecated = { } +function SceneReaderDeprecated.sharedSceneReader() + deprecatedTip("SceneReader:sharedSceneReader","ccs.SceneReader:getInstance") + return ccs.SceneReader:getInstance() +end +rawset(SceneReader,"sharedSceneReader",SceneReaderDeprecated.sharedSceneReader) + +function SceneReaderDeprecated.purgeSceneReader(self) + deprecatedTip("SceneReader:purgeSceneReader","ccs.SceneReader:destroyInstance") + return self:destroyInstance() +end +rawset(SceneReader,"purgeSceneReader",SceneReaderDeprecated.purgeSceneReader) +--functions of SceneReader will be deprecated end + +--functions of ActionManager will be deprecated begin +local ActionManagerDeprecated = { } +function ActionManagerDeprecated.shareManager() + deprecatedTip("ActionManager:shareManager","ccs.ActionManagerEx:getInstance") + return ccs.ActionManagerEx:getInstance() +end +rawset(ActionManager,"shareManager",ActionManagerDeprecated.shareManager) + +function ActionManagerDeprecated.purgeActionManager() + deprecatedTip("ActionManager:purgeActionManager","ccs.ActionManagerEx:destroyActionManager") + return ccs.ActionManagerEx:destroyActionManager() +end +rawset(ActionManager,"purgeActionManager",ActionManagerDeprecated.purgeActionManager) +--functions of ActionManager will be deprecated end + + diff --git a/cocos/scripting/lua/script/DeprecatedClass.lua b/cocos/scripting/lua/script/DeprecatedClass.lua index dbd7dfff02..15e94b5189 100644 --- a/cocos/scripting/lua/script/DeprecatedClass.lua +++ b/cocos/scripting/lua/script/DeprecatedClass.lua @@ -1815,13 +1815,298 @@ end _G["CCCallFuncN"] = DeprecatedClass.CCCallFuncN() --CCCallFuncN class will be Deprecated,end ---ccBlendFunc class will be Deprecated,begin -function DeprecatedClass.ccBlendFunc() - deprecatedTip("ccBlendFunc","BlendFunc") - return BlendFunc +--CCArmature class will be Deprecated,begin +function DeprecatedClass.CCArmature() + deprecatedTip("CCArmature","ccs.Armature") + return ccs.Armature end -_G["ccBlendFunc"] = DeprecatedClass.ccBlendFunc() ---ccBlendFunc class will be Deprecated,end +_G["CCArmature"] = DeprecatedClass.CCArmature() +--CCArmature class will be Deprecated,end +--CCArmatureAnimation class will be Deprecated,begin +function DeprecatedClass.CCArmatureAnimation() + deprecatedTip("CCArmatureAnimation","ccs.ArmatureAnimation") + return ccs.ArmatureAnimation +end +_G["CCArmatureAnimation"] = DeprecatedClass.CCArmatureAnimation() +--CCArmatureAnimation class will be Deprecated,end +--CCSkin class will be Deprecated,begin +function DeprecatedClass.CCSkin() + deprecatedTip("CCSkin","ccs.Skin") + return ccs.Skin +end +_G["CCSkin"] = DeprecatedClass.CCSkin() +--CCSkin class will be Deprecated,end +--CCBone class will be Deprecated,begin +function DeprecatedClass.CCBone() + deprecatedTip("CCBone","ccs.Bone") + return ccs.Bone +end +_G["CCBone"] = DeprecatedClass.CCBone() +--CCBone class will be Deprecated,end + +--CCArmatureDataManager class will be Deprecated,begin +function DeprecatedClass.CCArmatureDataManager() + deprecatedTip("CCArmatureDataManager","ccs.ArmatureDataManager") + return ccs.ArmatureDataManager +end +_G["CCArmatureDataManager"] = DeprecatedClass.CCArmatureDataManager() +--CCArmatureDataManager class will be Deprecated,end + +--CCBatchNode class will be Deprecated,begin +function DeprecatedClass.CCBatchNode() + deprecatedTip("CCBatchNode","ccs.BatchNode") + return ccs.BatchNode +end +_G["CCBatchNode"] = DeprecatedClass.CCBatchNode() +--CCBatchNode class will be Deprecated,end + +--CCTween class will be Deprecated,begin +function DeprecatedClass.CCTween() + deprecatedTip("CCTween","ccs.Tween") + return ccs.Tween +end +_G["CCTween"] = DeprecatedClass.CCTween() +--CCTween class will be Deprecated,end + +--CCBaseData class will be Deprecated,begin +function DeprecatedClass.CCBaseData() + deprecatedTip("CCBaseData","ccs.BaseData") + return ccs.BaseData +end +_G["CCBaseData"] = DeprecatedClass.CCBaseData() +--CCBaseData class will be Deprecated,end + +--CCDisplayManager class will be Deprecated,begin +function DeprecatedClass.CCDisplayManager() + deprecatedTip("CCDisplayManager","ccs.DisplayManager") + return ccs.DisplayManager +end +_G["CCDisplayManager"] = DeprecatedClass.CCDisplayManager() +--CCDisplayManager class will be Deprecated,end + +--UIHelper class will be Deprecated,begin +function DeprecatedClass.UIHelper() + deprecatedTip("UIHelper","ccs.UIHelper") + return ccs.UIHelper +end +_G["UIHelper"] = DeprecatedClass.UIHelper() +--UIHelper class will be Deprecated,end + +--UILayout class will be Deprecated,begin +function DeprecatedClass.UILayout() + deprecatedTip("UILayout","ccs.UILayout") + return ccs.UILayout +end +_G["UILayout"] = DeprecatedClass.UILayout() +--UILayout class will be Deprecated,end + +--UIWidget class will be Deprecated,begin +function DeprecatedClass.UIWidget() + deprecatedTip("UIWidget","ccs.UIWidget") + return ccs.UIWidget +end +_G["UIWidget"] = DeprecatedClass.UIWidget() +--UIWidget class will be Deprecated,end + +--UILayer class will be Deprecated,begin +function DeprecatedClass.UILayer() + deprecatedTip("UILayer","ccs.UILayer") + return ccs.UILayer +end +_G["UILayer"] = DeprecatedClass.UILayer() +--UILayer class will be Deprecated,end + +--UIButton class will be Deprecated,begin +function DeprecatedClass.UIButton() + deprecatedTip("UIButton","ccs.UIButton") + return ccs.UIButton +end +_G["UIButton"] = DeprecatedClass.UIButton() +--UIButton class will be Deprecated,end + +--UICheckBox class will be Deprecated,begin +function DeprecatedClass.UICheckBox() + deprecatedTip("UICheckBox","ccs.UICheckBox") + return ccs.UICheckBox +end +_G["UICheckBox"] = DeprecatedClass.UICheckBox() +--UICheckBox class will be Deprecated,end + +--UIImageView class will be Deprecated,begin +function DeprecatedClass.UIImageView() + deprecatedTip("UIImageView","ccs.UIImageView") + return ccs.UIImageView +end +_G["UIImageView"] = DeprecatedClass.UIImageView() +--UIImageView class will be Deprecated,end + +--UILabel class will be Deprecated,begin +function DeprecatedClass.UILabel() + deprecatedTip("UILabel","ccs.UILabel") + return ccs.UILabel +end +_G["UILabel"] = DeprecatedClass.UILabel() +--UILabel class will be Deprecated,end + +--UILabelAtlas class will be Deprecated,begin +function DeprecatedClass.UILabelAtlas() + deprecatedTip("UILabelAtlas","ccs.UILabelAtlas") + return ccs.UILabelAtlas +end +_G["UILabelAtlas"] = DeprecatedClass.UILabelAtlas() +--UILabelAtlas class will be Deprecated,end + +--UILabelBMFont class will be Deprecated,begin +function DeprecatedClass.UILabelBMFont() + deprecatedTip("UILabelBMFont","ccs.UILabelBMFont") + return ccs.UILabelBMFont +end +_G["UILabelBMFont"] = DeprecatedClass.UILabelBMFont() +--UILabelBMFont class will be Deprecated,end + +--UILoadingBar class will be Deprecated,begin +function DeprecatedClass.UILoadingBar() + deprecatedTip("UILoadingBar","ccs.UILoadingBar") + return ccs.UILoadingBar +end +_G["UILoadingBar"] = DeprecatedClass.UILoadingBar() +--UILoadingBar class will be Deprecated,end + +--UISlider class will be Deprecated,begin +function DeprecatedClass.UISlider() + deprecatedTip("UISlider","ccs.UISlider") + return ccs.UISlider +end +_G["UISlider"] = DeprecatedClass.UISlider() +--UISlider class will be Deprecated,end + +--UITextField class will be Deprecated,begin +function DeprecatedClass.UITextField() + deprecatedTip("UITextField","ccs.UITextField") + return ccs.UITextField +end +_G["UITextField"] = DeprecatedClass.UITextField() +--UITextField class will be Deprecated,end + +--UIScrollView class will be Deprecated,begin +function DeprecatedClass.UIScrollView() + deprecatedTip("UIScrollView","ccs.UIScrollView") + return ccs.UIScrollView +end +_G["UIScrollView"] = DeprecatedClass.UIScrollView() +--UIScrollView class will be Deprecated,end + +--UIPageView class will be Deprecated,begin +function DeprecatedClass.UIPageView() + deprecatedTip("UIPageView","ccs.UIPageView") + return ccs.UIPageView +end +_G["UIPageView"] = DeprecatedClass.UIPageView() +--UIPageView class will be Deprecated,end + +--UIListView class will be Deprecated,begin +function DeprecatedClass.UIListView() + deprecatedTip("UIListView","ccs.UIListView") + return ccs.UIListView +end +_G["UIListView"] = DeprecatedClass.UIListView() +--UIListView class will be Deprecated,end + +--UILayoutParameter class will be Deprecated,begin +function DeprecatedClass.UILayoutParameter() + deprecatedTip("UILayoutParameter","ccs.UILayoutParameter") + return ccs.UILayoutParameter +end +_G["UILayoutParameter"] = DeprecatedClass.UILayoutParameter() +--UILayoutParameter class will be Deprecated,end + +--UILinearLayoutParameter class will be Deprecated,begin +function DeprecatedClass.UILinearLayoutParameter() + deprecatedTip("UILinearLayoutParameter","ccs.UILinearLayoutParameter") + return ccs.UILinearLayoutParameter +end +_G["UILinearLayoutParameter"] = DeprecatedClass.UILinearLayoutParameter() +--UILinearLayoutParameter class will be Deprecated,end + +--UIRelativeLayoutParameter class will be Deprecated,begin +function DeprecatedClass.UIRelativeLayoutParameter() + deprecatedTip("UIRelativeLayoutParameter","ccs.UIRelativeLayoutParameter") + return ccs.UIRelativeLayoutParameter +end +_G["UIRelativeLayoutParameter"] = DeprecatedClass.UIRelativeLayoutParameter() +--UIRelativeLayoutParameter class will be Deprecated,end + +--CCComController class will be Deprecated,begin +function DeprecatedClass.CCComController() + deprecatedTip("CCComController","ccs.ComController") + return ccs.CCComController +end +_G["CCComController"] = DeprecatedClass.CCComController() +--CCComController class will be Deprecated,end + +--CCComAudio class will be Deprecated,begin +function DeprecatedClass.CCComAudio() + deprecatedTip("CCComAudio","ccs.ComAudio") + return ccs.ComAudio +end +_G["CCComAudio"] = DeprecatedClass.CCComAudio() +--CCComAudio class will be Deprecated,end + +--CCComAttribute class will be Deprecated,begin +function DeprecatedClass.CCComAttribute() + deprecatedTip("CCComAttribute","ccs.ComAttribute") + return ccs.ComAttribute +end +_G["CCComAttribute"] = DeprecatedClass.CCComAttribute() +--CCComAttribute class will be Deprecated,end + +--CCComRender class will be Deprecated,begin +function DeprecatedClass.CCComRender() + deprecatedTip("CCComRender","ccs.ComRender") + return ccs.ComRender +end +_G["CCComRender"] = DeprecatedClass.CCComRender() +--CCComRender class will be Deprecated,end + +--ActionManager class will be Deprecated,begin +function DeprecatedClass.ActionManager() + deprecatedTip("ActionManager","ccs.ActionManagerEx") + return ccs.ActionManagerEx +end +_G["ActionManager"] = DeprecatedClass.ActionManager() +--CCComRender class will be Deprecated,end + +--SceneReader class will be Deprecated,begin +function DeprecatedClass.SceneReader() + deprecatedTip("SceneReader","ccs.SceneReader") + return ccs.SceneReader +end +_G["SceneReader"] = DeprecatedClass.SceneReader() +--SceneReader class will be Deprecated,end + +--GUIReader class will be Deprecated,begin +function DeprecatedClass.GUIReader() + deprecatedTip("GUIReader","ccs.GUIReader") + return ccs.GUIReader +end +_G["GUIReader"] = DeprecatedClass.GUIReader() +--GUIReader class will be Deprecated,end + +--UIRootWidget class will be Deprecated,begin +function DeprecatedClass.UIRootWidget() + deprecatedTip("UIRootWidget","ccs.UIRootWidget") + return ccs.UIRootWidget +end +_G["UIRootWidget"] = DeprecatedClass.UIRootWidget() +--UIRootWidget class will be Deprecated,end + +--ActionObject class will be Deprecated,begin +function DeprecatedClass.ActionObject() + deprecatedTip("ActionObject","ccs.ActionObject") + return ccs.ActionObject +end +_G["ActionObject"] = DeprecatedClass.ActionObject() +--ActionObject class will be Deprecated,end diff --git a/cocos/scripting/lua/script/DeprecatedEnum.lua b/cocos/scripting/lua/script/DeprecatedEnum.lua index 7c22fe23d8..03c7619f83 100644 --- a/cocos/scripting/lua/script/DeprecatedEnum.lua +++ b/cocos/scripting/lua/script/DeprecatedEnum.lua @@ -394,4 +394,88 @@ _G.kWebSocketScriptHandlerError = cc.WEBSOCKET_ERROR _G.kStateConnecting = cc.WEBSOCKET_STATE_CONNECTING _G.kStateOpen = cc.WEBSOCKET_STATE_OPEN _G.kStateClosing = cc.WEBSOCKET_STATE_CLOSING -_G.kStateClosed = cc.WEBSOCKET_STATE_CLOSED +_G.kStateClosed = cc.WEBSOCKET_STATE_CLOSED + +_G.LAYOUT_COLOR_NONE = ccs.LayoutBackGroundColorType.none +_G.LAYOUT_COLOR_SOLID = ccs.LayoutBackGroundColorType.solid +_G.LAYOUT_COLOR_GRADIENT = ccs.LayoutBackGroundColorType.gradient + +_G.LAYOUT_ABSOLUTE = ccs.LayoutType.absolute +_G.LAYOUT_LINEAR_VERTICAL = ccs.LayoutType.linearVertical +_G.LAYOUT_LINEAR_HORIZONTAL = ccs.LayoutType.linearHorizontal +_G.LAYOUT_RELATIVE = ccs.LayoutType.relative + +_G.BRIGHT_NONE = ccs.BrightStyle.none +_G.BRIGHT_NORMAL = ccs.BrightStyle.normal +_G.BRIGHT_HIGHLIGHT = ccs.BrightStyle.highlight + +_G.WidgetTypeWidget = ccs.WidgetType.widget +_G.WidgetTypeContainer = ccs.WidgetType.container + +_G.UI_TEX_TYPE_LOCAL = ccs.TextureResType.UI_TEX_TYPE_LOCAL +_G.UI_TEX_TYPE_PLIST = ccs.TextureResType.UI_TEX_TYPE_PLIST + +_G.TOUCH_EVENT_BEGAN = ccs.TouchEventType.began +_G.TOUCH_EVENT_MOVED = ccs.TouchEventType.moved +_G.TOUCH_EVENT_ENDED = ccs.TouchEventType.ended +_G.TOUCH_EVENT_CANCELED = ccs.TouchEventType.canceled + +_G.SIZE_ABSOLUTE = ccs.SizeType.absolute +_G.SIZE_PERCENT = ccs.SizeType.percent + +_G.POSITION_ABSOLUTE = ccs.PositionType.absolute +_G.POSITION_PERCENT = ccs.PositionType.percent + +_G.CHECKBOX_STATE_EVENT_SELECTED = ccs.CheckBoxEventType.selected +_G.CHECKBOX_STATE_EVENT_UNSELECTED = ccs.CheckBoxEventType.unselected + +_G.CHECKBOX_STATE_EVENT_SELECTED = ccs.CheckBoxEventType.selected +_G.CHECKBOX_STATE_EVENT_UNSELECTED = ccs.CheckBoxEventType.unselected + +_G.LoadingBarTypeLeft = ccs.LoadingBarType.left +_G.LoadingBarTypeRight = ccs.LoadingBarType.right + +_G.LoadingBarTypeRight = ccs.SliderEventType.percent_changed + +_G.TEXTFIELD_EVENT_ATTACH_WITH_IME = ccs.TextFiledEventType.attach_with_ime +_G.TEXTFIELD_EVENT_DETACH_WITH_IME = ccs.TextFiledEventType.detach_with_ime +_G.TEXTFIELD_EVENT_INSERT_TEXT = ccs.TextFiledEventType.insert_text +_G.TEXTFIELD_EVENT_DELETE_BACKWARD = ccs.TextFiledEventType.delete_backward + +_G.SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccs.SCROLLVIEW_DIR.none +_G.SCROLLVIEW_DIR_VERTICAL = ccs.SCROLLVIEW_DIR.vertical +_G.SCROLLVIEW_DIR_HORIZONTAL = ccs.SCROLLVIEW_DIR.horizontal +_G.SCROLLVIEW_DIR_BOTH = ccs.SCROLLVIEW_DIR.both + +_G.SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccs.ScrollviewEventType.SCROLL_TO_TOP +_G.SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM = ccs.ScrollviewEventType.SCROLL_TO_BOTTOM +_G.SCROLLVIEW_EVENT_SCROLL_TO_LEFT = ccs.ScrollviewEventType.SCROLL_TO_LEFT +_G.SCROLLVIEW_EVENT_SCROLL_TO_RIGHT = ccs.ScrollviewEventType.SCROLL_TO_RIGHT +_G.SCROLLVIEW_EVENT_SCROLLING = ccs.ScrollviewEventType.SCROLLING +_G.SCROLLVIEW_EVENT_BOUNCE_TOP = ccs.ScrollviewEventType.BOUNCE_TOP +_G.SCROLLVIEW_EVENT_BOUNCE_BOTTOM = ccs.ScrollviewEventType.BOUNCE_BOTTOM +_G.SCROLLVIEW_EVENT_BOUNCE_LEFT = ccs.ScrollviewEventType.BOUNCE_LEFT +_G.SCROLLVIEW_EVENT_BOUNCE_RIGHT = ccs.ScrollviewEventType.BOUNCE_RIGHT + +_G.PAGEVIEW_EVENT_TURNING = ccs.PageViewEventType.turning + +_G.PAGEVIEW_TOUCHLEFT = ccs.PVTouchDir.touch_left +_G.PAGEVIEW_TOUCHRIGHT = ccs.PVTouchDir.touch_right + +_G.LISTVIEW_DIR_NONE = ccs.ListViewDirection.none +_G.LISTVIEW_DIR_VERTICAL = ccs.ListViewDirection.vertical +_G.LISTVIEW_DIR_HORIZONTAL = ccs.ListViewDirection.horizontal + +_G.LISTVIEW_MOVE_DIR_NONE = ccs.ListViewMoveDirection.none +_G.LISTVIEW_MOVE_DIR_UP = ccs.ListViewMoveDirection.up +_G.LISTVIEW_MOVE_DIR_DOWN = ccs.ListViewMoveDirection.down +_G.LISTVIEW_MOVE_DIR_LEFT = ccs.ListViewMoveDirection.left +_G.LISTVIEW_MOVE_DIR_RIGHT = ccs.ListViewMoveDirection.right + +_G.LISTVIEW_EVENT_INIT_CHILD = ccs.ListViewEventType.init_child +_G.LISTVIEW_EVENT_UPDATE_CHILD = ccs.ListViewEventType.update_child + +_G.LAYOUT_PARAMETER_NONE = ccs.UILayoutParameterType.none +_G.LAYOUT_PARAMETER_LINEAR = ccs.UILayoutParameterType.linear +_G.LAYOUT_PARAMETER_RELATIVE = ccs.UILayoutParameterType.relative + diff --git a/cocos/scripting/lua/script/StudioConstants.lua b/cocos/scripting/lua/script/StudioConstants.lua index 001ebe7341..107b0f8406 100644 --- a/cocos/scripting/lua/script/StudioConstants.lua +++ b/cocos/scripting/lua/script/StudioConstants.lua @@ -20,11 +20,11 @@ ccs.WidgetType = container = 1, --container } --- ccs.TextureResType = --- { --- "local" = 0, --- "plist" = 1, --- } +ccs.TextureResType = +{ + UI_TEX_TYPE_LOCAL = 0, + UI_TEX_TYPE_PLIST = 1, +} ccs.TouchEventType = { @@ -138,10 +138,15 @@ ccs.SCROLLVIEW_MOVE_DIR = { } ccs.ScrollviewEventType = { - top = 0, - bottom = 1, - left = 2, - right = 3, + SCROLL_TO_TOP = 0, + SCROLL_TO_BOTTOM = 1, + SCROLL_TO_LEFT = 2, + SCROLL_TO_RIGHT = 3, + SCROLLING = 4, + BOUNCE_TOP = 5, + BOUNCE_BOTTOM = 6, + BOUNCE_LEFT = 7, + BOUNCE_RIGHT = 8, } ccs.ListViewDirection = { diff --git a/tools/tolua/cocos2dx_studio.ini b/tools/tolua/cocos2dx_studio.ini index 5fd5cacc31..d38fcd86cd 100644 --- a/tools/tolua/cocos2dx_studio.ini +++ b/tools/tolua/cocos2dx_studio.ini @@ -49,11 +49,9 @@ skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .* UIWidget::[(s|g)etUserObject], UIImageView::[doubleClickEvent] -rename_functions = UIHelper::[instance=getInstance], - ArmatureDataManager::[sharedArmatureDataManager=getInstance], - GUIReader::[shareReader=getInstance], - ActionManagerEx::[shareManager=getInstance purgeActionManager=destroyActionManager], - SceneReader::[purgeSceneReader=destroySceneReader] +rename_functions = GUIReader::[shareReader=getInstance purgeGUIReader=destroyInstance], + ActionManagerEx::[shareManager=getInstance purgeActionManager=destroyInstance], + SceneReader::[purgeSceneReader=destroyInstance] rename_classes =