axmol/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dFunc.lua

1015 lines
38 KiB
Lua
Raw Normal View History

2014-10-11 01:27:12 +08:00
2014-03-10 14:04:58 +08:00
--tip
local function deprecatedTip(old_name,new_name)
print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********")
end
--functions of CCDirector will be deprecated,begin
local CCDirectorDeprecated = { }
function CCDirectorDeprecated.sharedDirector()
deprecatedTip("CCDirector:sharedDirector","cc.Director:getInstance")
return cc.Director:getInstance()
end
2014-10-17 14:15:30 +08:00
CCDirector.sharedDirector = CCDirectorDeprecated.sharedDirector
2014-03-10 14:04:58 +08:00
--functions of CCDirector will be deprecated,end
--functions of CCTextureCache will be deprecated begin
local TextureCacheDeprecated = {}
function TextureCacheDeprecated.getInstance(self)
deprecatedTip("cc.TextureCache:getInstance","cc.Director:getInstance():getTextureCache")
return cc.Director:getInstance():getTextureCache()
end
2014-10-17 14:15:30 +08:00
cc.TextureCache.getInstance = TextureCacheDeprecated.getInstance
2014-03-10 14:04:58 +08:00
function TextureCacheDeprecated.destroyInstance(self)
deprecatedTip("cc.TextureCache:destroyInstance","cc.Director:getInstance():destroyTextureCache")
return cc.Director:getInstance():destroyTextureCache()
end
2014-10-17 14:15:30 +08:00
cc.TextureCache.destroyInstance = TextureCacheDeprecated.destroyInstance
2014-03-10 14:04:58 +08:00
function TextureCacheDeprecated.dumpCachedTextureInfo(self)
deprecatedTip("self:dumpCachedTextureInfo","self:getCachedTextureInfo")
return print(self:getCachedTextureInfo())
end
2014-10-17 14:15:30 +08:00
cc.TextureCache.dumpCachedTextureInfo = TextureCacheDeprecated.dumpCachedTextureInfo
2014-03-10 14:04:58 +08:00
local CCTextureCacheDeprecated = { }
function CCTextureCacheDeprecated.sharedTextureCache()
deprecatedTip("CCTextureCache:sharedTextureCache","CCTextureCache:getInstance")
return cc.TextureCache:getInstance()
end
rawset(CCTextureCache,"sharedTextureCache",CCTextureCacheDeprecated.sharedTextureCache)
function CCTextureCacheDeprecated.purgeSharedTextureCache()
deprecatedTip("CCTextureCache:purgeSharedTextureCache","CCTextureCache:destroyInstance")
return cc.TextureCache:destroyInstance()
end
rawset(CCTextureCache,"purgeSharedTextureCache",CCTextureCacheDeprecated.purgeSharedTextureCache)
function CCTextureCacheDeprecated.addUIImage(self, image, key)
deprecatedTip("CCTextureCache:addUIImage","CCTextureCache:addImage")
return self:addImage(image,key)
end
2014-10-17 14:15:30 +08:00
CCTextureCache.addUIImage = CCTextureCacheDeprecated.addUIImage
2014-03-10 14:04:58 +08:00
--functions of CCTextureCache will be deprecated end
--functions of CCAnimation will be deprecated begin
local CCAnimationDeprecated = {}
function CCAnimationDeprecated.addSpriteFrameWithFileName(self,...)
deprecatedTip("CCAnimationDeprecated:addSpriteFrameWithFileName","cc.Animation:addSpriteFrameWithFile")
return self:addSpriteFrameWithFile(...)
end
2014-10-17 14:15:30 +08:00
CCAnimation.addSpriteFrameWithFileName = CCAnimationDeprecated.addSpriteFrameWithFileName
2014-03-10 14:04:58 +08:00
--functions of CCAnimation will be deprecated end
--functions of CCAnimationCache will be deprecated begin
local CCAnimationCacheDeprecated = { }
function CCAnimationCacheDeprecated.sharedAnimationCache()
deprecatedTip("CCAnimationCache:sharedAnimationCache","CCAnimationCache:getInstance")
return CCAnimationCache:getInstance()
end
2014-10-17 14:15:30 +08:00
CCAnimationCache.sharedAnimationCache = CCAnimationCacheDeprecated.sharedAnimationCache
2014-03-10 14:04:58 +08:00
function CCAnimationCacheDeprecated.purgeSharedAnimationCache()
deprecatedTip("CCAnimationCache:purgeSharedAnimationCache","CCAnimationCache:destroyInstance")
return CCAnimationCache:destroyInstance()
end
2014-10-17 14:15:30 +08:00
CCAnimationCache.purgeSharedAnimationCache = CCAnimationCacheDeprecated.purgeSharedAnimationCache
2014-03-10 14:04:58 +08:00
function CCAnimationCacheDeprecated.addAnimationsWithFile(self,...)
deprecatedTip("CCAnimationCache:addAnimationsWithFile","cc.AnimationCache:addAnimations")
return self:addAnimations(...)
end
2014-10-17 14:15:30 +08:00
CCAnimationCache.addAnimationsWithFile = CCAnimationCacheDeprecated.addAnimationsWithFile
2014-03-10 14:04:58 +08:00
function CCAnimationCacheDeprecated.animationByName(self,...)
deprecatedTip("CCAnimationCache:animationByName","cc.AnimationCache:getAnimation")
return self:getAnimation(...)
end
2014-10-17 14:15:30 +08:00
CCAnimationCache.animationByName = CCAnimationCacheDeprecated.animationByName
2014-03-10 14:04:58 +08:00
function CCAnimationCacheDeprecated.removeAnimationByName(self)
deprecatedTip("CCAnimationCache:removeAnimationByName","cc.AnimationCache:removeAnimation")
return self:removeAnimation()
end
2014-10-17 14:15:30 +08:00
CCAnimationCache.removeAnimationByName = CCAnimationCacheDeprecated.removeAnimationByName
2014-03-10 14:04:58 +08:00
--functions of CCAnimationCache will be deprecated end
--functions of CCFileUtils will be deprecated end
local CCFileUtilsDeprecated = { }
function CCFileUtilsDeprecated.sharedFileUtils()
deprecatedTip("CCFileUtils:sharedFileUtils","CCFileUtils:getInstance")
return cc.FileUtils:getInstance()
end
2014-10-17 14:15:30 +08:00
CCFileUtils.sharedFileUtils = CCFileUtilsDeprecated.sharedFileUtils
2014-03-10 14:04:58 +08:00
function CCFileUtilsDeprecated.purgeFileUtils()
deprecatedTip("CCFileUtils:purgeFileUtils","CCFileUtils:destroyInstance")
return cc.FileUtils:destroyInstance()
end
2014-10-17 14:15:30 +08:00
CCFileUtils.purgeFileUtils = CCFileUtilsDeprecated.purgeFileUtils
2014-03-10 14:04:58 +08:00
--functions of CCFileUtils will be deprecated end
--functions of CCMenu will be deprecated begin
local CCMenuDeprecated = { }
function CCMenuDeprecated.createWithItem(self,...)
deprecatedTip("CCMenuDeprecated:createWithItem","cc.Menu:createWithItem")
return self:create(...)
end
2014-10-17 14:15:30 +08:00
CCMenu.createWithItem = CCMenuDeprecated.createWithItem
2014-03-10 14:04:58 +08:00
function CCMenuDeprecated.setHandlerPriority(self)
print("\n********** \n".."setHandlerPriority was deprecated in 3.0. \n**********")
end
2014-10-17 14:15:30 +08:00
CCMenu.setHandlerPriority = CCMenuDeprecated.setHandlerPriority
2014-03-10 14:04:58 +08:00
--functions of CCMenu will be deprecated end
--functions of CCNode will be deprecated begin
local CCNodeDeprecated = { }
function CCNodeDeprecated.boundingBox(self)
deprecatedTip("CCNode:boundingBox","cc.Node:getBoundingBox")
return self:getBoundingBox()
end
2014-10-17 14:15:30 +08:00
CCNode.boundingBox = CCNodeDeprecated.boundingBox
2014-03-10 14:04:58 +08:00
function CCNodeDeprecated.numberOfRunningActions(self)
deprecatedTip("CCNode:numberOfRunningActions","cc.Node:getNumberOfRunningActions")
return self:getNumberOfRunningActions()
end
2014-10-17 14:15:30 +08:00
CCNode.numberOfRunningActions = CCNodeDeprecated.numberOfRunningActions
2014-03-10 14:04:58 +08:00
function CCNodeDeprecated.removeFromParentAndCleanup(self,...)
deprecatedTip("CCNode:removeFromParentAndCleanup","cc.Node:removeFromParent")
return self:removeFromParent(...)
end
2014-10-17 14:15:30 +08:00
CCNode.removeFromParentAndCleanup = CCNodeDeprecated.removeFromParentAndCleanup
2014-03-10 14:04:58 +08:00
--functions of CCNode will be deprecated end
--CCDrawPrimitives will be deprecated begin
local function CCDrawPrimitivesClassDeprecated()
deprecatedTip("CCDrawPrimitives","cc.DrawPrimitives")
return cc.DrawPrimitives
end
2014-10-17 14:15:30 +08:00
_G.CCDrawPrimitives = CCDrawPrimitivesClassDeprecated()
2014-03-10 14:04:58 +08:00
--functions of CCDrawPrimitives will be deprecated begin
local CCDrawPrimitivesDeprecated = { }
function CCDrawPrimitivesDeprecated.ccDrawPoint(pt)
deprecatedTip("ccDrawPoint","cc.DrawPrimitives.drawPoint")
return cc.DrawPrimitives.drawPoint(pt)
end
2014-10-17 14:15:30 +08:00
_G.ccDrawPoint = CCDrawPrimitivesDeprecated.ccDrawPoint
2014-03-10 14:04:58 +08:00
function CCDrawPrimitivesDeprecated.ccDrawLine(origin,destination)
deprecatedTip("ccDrawLine","cc.DrawPrimitives.drawLine")
return cc.DrawPrimitives.drawLine(origin,destination)
end
2014-10-17 14:15:30 +08:00
_G.ccDrawLine = CCDrawPrimitivesDeprecated.ccDrawLine
2014-03-10 14:04:58 +08:00
function CCDrawPrimitivesDeprecated.ccDrawRect(origin,destination)
deprecatedTip("ccDrawRect","cc.DrawPrimitives.drawRect")
return cc.DrawPrimitives.drawRect(origin,destination)
end
2014-10-17 14:15:30 +08:00
_G.ccDrawRect = CCDrawPrimitivesDeprecated.ccDrawRect
2014-03-10 14:04:58 +08:00
function CCDrawPrimitivesDeprecated.ccDrawSolidRect(origin,destination,color)
deprecatedTip("ccDrawSolidRect","cc.DrawPrimitives.drawSolidRect")
return cc.DrawPrimitives.drawSolidRect(origin,destination,color)
end
2014-10-17 14:15:30 +08:00
_G.ccDrawSolidRect = CCDrawPrimitivesDeprecated.ccDrawSolidRect
2014-03-10 14:04:58 +08:00
-- params:... may represent two param(xScale,yScale) or nil
function CCDrawPrimitivesDeprecated.ccDrawCircle(center,radius,angle,segments,drawLineToCenter,...)
deprecatedTip("ccDrawCircle","cc.DrawPrimitives.drawCircle")
return cc.DrawPrimitives.drawCircle(center,radius,angle,segments,drawLineToCenter,...)
end
2014-10-17 14:15:30 +08:00
_G.ccDrawCircle = CCDrawPrimitivesDeprecated.ccDrawCircle
2014-03-10 14:04:58 +08:00
-- params:... may represent two param(xScale,yScale) or nil
function CCDrawPrimitivesDeprecated.ccDrawSolidCircle(center,radius,angle,segments,...)
deprecatedTip("ccDrawSolidCircle","cc.DrawPrimitives.drawSolidCircle")
return cc.DrawPrimitives.drawSolidCircle(center,radius,angle,segments,...)
end
2014-10-17 14:15:30 +08:00
_G.ccDrawSolidCircle = CCDrawPrimitivesDeprecated.ccDrawSolidCircle
2014-03-10 14:04:58 +08:00
function CCDrawPrimitivesDeprecated.ccDrawQuadBezier(origin,control,destination,segments)
deprecatedTip("ccDrawQuadBezier","cc.DrawPrimitives.drawQuadBezier")
return cc.DrawPrimitives.drawQuadBezier(origin,control,destination,segments)
end
2014-10-17 14:15:30 +08:00
_G.ccDrawQuadBezier = CCDrawPrimitivesDeprecated.ccDrawQuadBezier
2014-03-10 14:04:58 +08:00
function CCDrawPrimitivesDeprecated.ccDrawCubicBezier(origin,control1,control2,destination,segments)
deprecatedTip("ccDrawCubicBezier","cc.DrawPrimitives.drawCubicBezier")
return cc.DrawPrimitives.drawCubicBezier(origin,control1,control2,destination,segments)
end
2014-10-17 14:15:30 +08:00
_G.ccDrawCubicBezier = CCDrawPrimitivesDeprecated.ccDrawCubicBezier
2014-03-10 14:04:58 +08:00
function CCDrawPrimitivesDeprecated.ccDrawCatmullRom(arrayOfControlPoints,segments)
deprecatedTip("ccDrawCatmullRom","cc.DrawPrimitives.drawCatmullRom")
return cc.DrawPrimitives.drawCatmullRom(arrayOfControlPoints,segments)
end
2014-10-17 14:15:30 +08:00
_G.ccDrawCatmullRom = CCDrawPrimitivesDeprecated.ccDrawCatmullRom
2014-03-10 14:04:58 +08:00
function CCDrawPrimitivesDeprecated.ccDrawCardinalSpline(config,tension,segments)
deprecatedTip("ccDrawCardinalSpline","cc.DrawPrimitives.drawCardinalSpline")
return cc.DrawPrimitives.drawCardinalSpline(config,tension,segments)
end
2014-10-17 14:15:30 +08:00
_G.ccDrawCardinalSpline = CCDrawPrimitivesDeprecated.ccDrawCardinalSpline
2014-03-10 14:04:58 +08:00
function CCDrawPrimitivesDeprecated.ccDrawColor4B(r,g,b,a)
deprecatedTip("ccDrawColor4B","cc.DrawPrimitives.drawColor4B")
return cc.DrawPrimitives.drawColor4B(r,g,b,a)
end
2014-10-17 14:15:30 +08:00
_G.ccDrawColor4B = CCDrawPrimitivesDeprecated.ccDrawColor4B
2014-03-10 14:04:58 +08:00
function CCDrawPrimitivesDeprecated.ccDrawColor4F(r,g,b,a)
deprecatedTip("ccDrawColor4F","cc.DrawPrimitives.drawColor4F")
return cc.DrawPrimitives.drawColor4F(r,g,b,a)
end
2014-10-17 14:15:30 +08:00
_G.ccDrawColor4F = CCDrawPrimitivesDeprecated.ccDrawColor4F
2014-03-10 14:04:58 +08:00
function CCDrawPrimitivesDeprecated.ccPointSize(pointSize)
deprecatedTip("ccPointSize","cc.DrawPrimitives.setPointSize")
return cc.DrawPrimitives.setPointSize(pointSize)
end
2014-10-17 14:15:30 +08:00
_G.ccPointSize = CCDrawPrimitivesDeprecated.ccPointSize
2014-03-10 14:04:58 +08:00
--functions of CCDrawPrimitives will be deprecated end
--CCDrawPrimitives will be deprecated end
local CCProgressTimerDeprecated = {}
function CCProgressTimerDeprecated.setReverseProgress(self,...)
deprecatedTip("CCProgressTimer","CCProgressTimer:setReverseDirection")
return self:setReverseDirection(...)
end
2014-10-17 14:15:30 +08:00
CCProgressTimer.setReverseProgress = CCProgressTimerDeprecated.setReverseProgress
2014-03-10 14:04:58 +08:00
--functions of CCSpriteFrameCache will be deprecated begin
local CCSpriteFrameCacheDeprecated = { }
function CCSpriteFrameCacheDeprecated.spriteFrameByName(self,szName)
deprecatedTip("CCSpriteFrameCache:spriteFrameByName","CCSpriteFrameCache:getSpriteFrameByName")
return self:getSpriteFrameByName(szName)
end
2014-10-17 14:15:30 +08:00
CCSpriteFrameCache.spriteFrameByName = CCSpriteFrameCacheDeprecated.spriteFrameByName
2014-03-10 14:04:58 +08:00
function CCSpriteFrameCacheDeprecated.sharedSpriteFrameCache()
deprecatedTip("CCSpriteFrameCache:sharedSpriteFrameCache","CCSpriteFrameCache:getInstance")
return CCSpriteFrameCache:getInstance()
end
2014-10-17 14:15:30 +08:00
CCSpriteFrameCache.sharedSpriteFrameCache = CCSpriteFrameCacheDeprecated.sharedSpriteFrameCache
2014-03-10 14:04:58 +08:00
function CCSpriteFrameCacheDeprecated.purgeSharedSpriteFrameCache()
deprecatedTip("CCSpriteFrameCache:purgeSharedSpriteFrameCache","CCSpriteFrameCache:destroyInstance")
return CCSpriteFrameCache:destroyInstance()
end
2014-10-17 14:15:30 +08:00
CCSpriteFrameCache.purgeSharedSpriteFrameCache = CCSpriteFrameCacheDeprecated.purgeSharedSpriteFrameCache
2014-03-10 14:04:58 +08:00
function CCSpriteFrameCacheDeprecated.addSpriteFramesWithFile(self,...)
deprecatedTip("CCSpriteFrameCache:addSpriteFramesWithFile","CCSpriteFrameCache:addSpriteFrames")
return self:addSpriteFrames(...)
end
rawset(CCSpriteFrameCache,"addSpriteFramesWithFile",CCSpriteFrameCacheDeprecated.addSpriteFramesWithFile)
2014-03-10 14:04:58 +08:00
function CCSpriteFrameCacheDeprecated.getSpriteFrameByName(self,...)
deprecatedTip("CCSpriteFrameCache:getSpriteFrameByName","CCSpriteFrameCache:getSpriteFrame")
return self:getSpriteFrame(...)
end
2014-10-17 14:15:30 +08:00
CCSpriteFrameCache.getSpriteFrameByName = CCSpriteFrameCacheDeprecated.getSpriteFrameByName
2014-03-10 14:04:58 +08:00
--functions of CCSpriteFrameCache will be deprecated end
--functions of CCLabelAtlas will be deprecated begin
local CCLabelAtlasDeprecated = {}
function CCLabelAtlasDeprecated.create(self,...)
deprecatedTip("CCLabelAtlas:create","CCLabelAtlas:_create")
return self:_create(...)
end
2014-10-17 14:15:30 +08:00
CCLabelAtlas.create = CCLabelAtlasDeprecated.create
2014-03-10 14:04:58 +08:00
--functions of CCLabelAtlas will be deprecated end
---------------------------
--global functions wil be deprecated, begin
local function CCRectMake(x,y,width,height)
deprecatedTip("CCRectMake(x,y,width,height)","cc.rect(x,y,width,height) in lua")
return cc.rect(x,y,width,height)
end
2014-10-17 14:15:30 +08:00
_G.CCRectMake = CCRectMake
2014-03-10 14:04:58 +08:00
local function ccc3(r,g,b)
deprecatedTip("ccc3(r,g,b)","cc.c3b(r,g,b)")
return cc.c3b(r,g,b)
end
2014-10-17 14:15:30 +08:00
_G.ccc3 = ccc3
2014-03-10 14:04:58 +08:00
local function ccp(x,y)
deprecatedTip("ccp(x,y)","cc.p(x,y)")
return cc.p(x,y)
2014-10-11 01:27:12 +08:00
end
2014-10-17 14:15:30 +08:00
_G.ccp = ccp
2014-03-10 14:04:58 +08:00
local function CCSizeMake(width,height)
deprecatedTip("CCSizeMake(width,height)","cc.size(width,height)")
return cc.size(width,height)
end
2014-10-17 14:15:30 +08:00
_G.CCSizeMake = CCSizeMake
2014-03-10 14:04:58 +08:00
local function ccc4(r,g,b,a)
deprecatedTip("ccc4(r,g,b,a)","cc.c4b(r,g,b,a)")
return cc.c4b(r,g,b,a)
end
2014-10-17 14:15:30 +08:00
_G.ccc4 = ccc4
2014-03-10 14:04:58 +08:00
local function ccc4FFromccc3B(color3B)
deprecatedTip("ccc4FFromccc3B(color3B)","cc.c4f(color3B.r / 255.0,color3B.g / 255.0,color3B.b / 255.0,1.0)")
return cc.c4f(color3B.r/255.0, color3B.g/255.0, color3B.b/255.0, 1.0)
end
2014-10-17 14:15:30 +08:00
_G.ccc4FFromccc3B = ccc4FFromccc3B
2014-03-10 14:04:58 +08:00
local function ccc4f(r,g,b,a)
deprecatedTip("ccc4f(r,g,b,a)","cc.c4f(r,g,b,a)")
return cc.c4f(r,g,b,a)
end
2014-10-17 14:15:30 +08:00
_G.ccc4f = ccc4f
2014-03-10 14:04:58 +08:00
local function ccc4FFromccc4B(color4B)
deprecatedTip("ccc4FFromccc4B(color4B)","cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)")
2014-10-11 01:27:12 +08:00
return cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)
2014-03-10 14:04:58 +08:00
end
2014-10-17 14:15:30 +08:00
_G.ccc4FFromccc4B = ccc4FFromccc4B
2014-03-10 14:04:58 +08:00
local function ccc4FEqual(a,b)
deprecatedTip("ccc4FEqual(a,b)","a:equals(b)")
return a:equals(b)
end
2014-10-17 14:15:30 +08:00
_G.ccc4FEqual = ccc4FEqual
2014-03-10 14:04:58 +08:00
--global functions wil be deprecated, end
--functions of _G will be deprecated begin
local function ccpLineIntersect(a,b,c,d,s,t)
deprecatedTip("ccpLineIntersect","cc.pIsLineIntersect")
return cc.pIsLineIntersect(a,b,c,d,s,t)
end
2014-10-17 14:15:30 +08:00
_G.ccpLineIntersect = ccpLineIntersect
2014-03-10 14:04:58 +08:00
local function CCPointMake(x,y)
deprecatedTip("CCPointMake(x,y)","cc.p(x,y)")
return cc.p(x,y)
2014-10-11 01:27:12 +08:00
end
2014-10-17 14:15:30 +08:00
_G.CCPointMake = CCPointMake
2014-03-10 14:04:58 +08:00
local function ccpNeg(pt)
deprecatedTip("ccpNeg","cc.pSub")
return cc.pSub({x = 0,y = 0}, pt)
end
2014-10-17 14:15:30 +08:00
_G.ccpNeg = ccpNeg
2014-03-10 14:04:58 +08:00
local function ccpAdd(pt1,pt2)
deprecatedTip("ccpAdd","cc.pAdd")
return cc.pAdd(pt1,pt2)
end
2014-10-17 14:15:30 +08:00
_G.ccpAdd = ccpAdd
2014-03-10 14:04:58 +08:00
local function ccpSub(pt1,pt2)
deprecatedTip("ccpSub","cc.pSub")
return cc.pSub(pt1,pt2)
end
2014-10-17 14:15:30 +08:00
_G.ccpSub = ccpSub
2014-03-10 14:04:58 +08:00
local function ccpMult(pt,factor)
deprecatedTip("ccpMult","cc.pMul")
return cc.pMul(pt,factor)
end
2014-10-17 14:15:30 +08:00
_G.ccpMult = ccpMult
2014-03-10 14:04:58 +08:00
local function ccpMidpoint(pt1,pt2)
deprecatedTip("ccpMidpoint","cc.pMidpoint")
return cc.pMidpoint(pt1,pt2)
end
2014-10-17 14:15:30 +08:00
_G.ccpMidpoint = ccpMidpoint
2014-03-10 14:04:58 +08:00
local function ccpDot(pt1,pt2)
deprecatedTip("ccpDot","cc.pDot")
return cc.pDot(pt1,pt2)
end
2014-10-17 14:15:30 +08:00
_G.ccpDot = ccpDot
2014-03-10 14:04:58 +08:00
local function ccpCross(pt1,pt2)
deprecatedTip("ccpCross","cc.pCross")
return cc.pCross(pt1, pt2)
end
2014-10-17 14:15:30 +08:00
_G.ccpCross = ccpCross
2014-03-10 14:04:58 +08:00
local function ccpPerp(pt)
deprecatedTip("ccpPerp","cc.pPerp")
return cc.pPerp(pt)
end
2014-10-17 14:15:30 +08:00
_G.ccpPerp = ccpPerp
2014-03-10 14:04:58 +08:00
local function ccpRPerp(pt)
deprecatedTip("ccpRPerp","cc.RPerp")
return cc.RPerp(pt)
end
2014-10-17 14:15:30 +08:00
_G.ccpRPerp = ccpRPerp
2014-03-10 14:04:58 +08:00
local function ccpProject(pt1,pt2)
deprecatedTip("ccpProject","cc.pProject")
return cc.pProject(pt1,pt2)
end
2014-10-17 14:15:30 +08:00
_G.ccpProject = ccpProject
2014-03-10 14:04:58 +08:00
local function ccpRotate(pt1,pt2)
deprecatedTip("ccpRotate","cc.pRotate")
return cc.pRotate(pt1,pt2)
end
2014-10-17 14:15:30 +08:00
_G.ccpRotate = ccpRotate
2014-03-10 14:04:58 +08:00
local function ccpUnrotate(pt1,pt2)
deprecatedTip("ccpUnrotate","cc.pUnrotate")
return cc.pUnrotate(pt1,pt2)
end
2014-10-17 14:15:30 +08:00
_G.ccpUnrotate = ccpUnrotate
2014-03-10 14:04:58 +08:00
local function ccpLengthSQ(pt)
deprecatedTip("ccpLengthSQ","cc.pLengthSQ")
return cc.pLengthSQ(pt)
end
2014-10-17 14:15:30 +08:00
_G.ccpLengthSQ = ccpLengthSQ
2014-03-10 14:04:58 +08:00
local function ccpDistanceSQ(pt1,pt2)
deprecatedTip("ccpDistanceSQ","cc.pDistanceSQ")
return cc.pDistanceSQ(pt1,pt2)
end
2014-10-17 14:15:30 +08:00
_G.ccpDistanceSQ = ccpDistanceSQ
2014-03-10 14:04:58 +08:00
local function ccpLength(pt)
deprecatedTip("ccpLength","cc.pGetLength")
return cc.pGetLength(pt)
end
2014-10-17 14:15:30 +08:00
_G.ccpLength = ccpLength
2014-03-10 14:04:58 +08:00
local function ccpDistance(pt1,pt2)
deprecatedTip("ccpDistance","cc.pGetDistance")
return cc.pGetDistance(pt1, pt2)
end
2014-10-17 14:15:30 +08:00
_G.ccpDistance = ccpDistance
2014-03-10 14:04:58 +08:00
local function ccpNormalize(pt)
deprecatedTip("ccpNormalize","cc.pNormalize")
return cc.pNormalize(pt)
end
2014-10-17 14:15:30 +08:00
_G.ccpNormalize = ccpNormalize
2014-03-10 14:04:58 +08:00
local function ccpForAngle(angle)
deprecatedTip("ccpForAngle","cc.pForAngle")
return cc.pForAngle(angle)
end
2014-10-17 14:15:30 +08:00
_G.ccpForAngle = ccpForAngle
2014-03-10 14:04:58 +08:00
local function ccpToAngle(pt)
deprecatedTip("ccpToAngle","cc.pToAngleSelf")
return cc.pToAngleSelf(pt)
end
2014-10-17 14:15:30 +08:00
_G.ccpToAngle = ccpToAngle
2014-03-10 14:04:58 +08:00
local function ccpClamp(pt1,pt2,pt3)
deprecatedTip("ccpClamp","cc.pGetClampPoint")
return cc.pGetClampPoint(pt1,pt2,pt3)
end
2014-10-17 14:15:30 +08:00
_G.ccpClamp = ccpClamp
2014-03-10 14:04:58 +08:00
local function ccpFromSize(sz)
deprecatedTip("ccpFromSize(sz)","cc.pFromSize")
return cc.pFromSize(sz)
end
2014-10-17 14:15:30 +08:00
_G.ccpFromSize = ccpFromSize
2014-03-10 14:04:58 +08:00
local function ccpLerp(pt1,pt2,alpha)
deprecatedTip("ccpLerp","cc.pLerp")
2014-10-11 01:27:12 +08:00
return cc.pLerp(pt1,pt2,alpha)
2014-03-10 14:04:58 +08:00
end
2014-10-17 14:15:30 +08:00
_G.ccpLerp = ccpLerp
2014-03-10 14:04:58 +08:00
local function ccpFuzzyEqual(pt1,pt2,variance)
deprecatedTip("ccpFuzzyEqual","cc.pFuzzyEqual")
return cc.pFuzzyEqual(pt1,pt2,variance)
end
2014-10-17 14:15:30 +08:00
_G.ccpFuzzyEqual = ccpFuzzyEqual
2014-03-10 14:04:58 +08:00
local function ccpCompMult(pt1,pt2)
deprecatedTip("ccpCompMult","cc.p")
return cc.p(pt1.x * pt2.x , pt1.y * pt2.y)
end
2014-10-17 14:15:30 +08:00
_G.ccpCompMult = ccpCompMult
2014-03-10 14:04:58 +08:00
local function ccpAngleSigned(pt1,pt2)
deprecatedTip("ccpAngleSigned","cc.pGetAngle")
return cc.pGetAngle(pt1, pt2)
end
2014-10-17 14:15:30 +08:00
_G.ccpAngleSigned = ccpAngleSigned
2014-03-10 14:04:58 +08:00
local function ccpAngle(pt1,pt2)
deprecatedTip("ccpAngle","cc.pGetAngle")
return cc.pGetAngle(pt1,ptw)
end
2014-10-17 14:15:30 +08:00
_G.ccpAngle = ccpAngle
2014-03-10 14:04:58 +08:00
local function ccpRotateByAngle(pt1,pt2,angle)
deprecatedTip("ccpRotateByAngle","cc.pRotateByAngle")
return cc.pRotateByAngle(pt1, pt2, angle)
end
2014-10-17 14:15:30 +08:00
_G.ccpRotateByAngle = ccpRotateByAngle
2014-03-10 14:04:58 +08:00
local function ccpSegmentIntersect(pt1,pt2,pt3,pt4)
deprecatedTip("ccpSegmentIntersect","cc.pIsSegmentIntersect")
return cc.pIsSegmentIntersect(pt1,pt2,pt3,pt4)
end
2014-10-17 14:15:30 +08:00
_G.ccpSegmentIntersect = ccpSegmentIntersect
2014-03-10 14:04:58 +08:00
local function ccpIntersectPoint(pt1,pt2,pt3,pt4)
deprecatedTip("ccpIntersectPoint","cc.pGetIntersectPoint")
return cc.pGetIntersectPoint(pt1,pt2,pt3,pt4)
end
2014-10-17 14:15:30 +08:00
_G.ccpIntersectPoint = ccpIntersectPoint
2014-03-10 14:04:58 +08:00
local function vertex2(x,y)
deprecatedTip("vertex2(x,y)","cc.vertex2F(x,y)")
return cc.vertex2F(x,y)
end
2014-10-17 14:15:30 +08:00
_G.vertex2 = vertex2
2014-03-10 14:04:58 +08:00
local function vertex3(x,y,z)
deprecatedTip("vertex3(x,y,z)","cc.Vertex3F(x,y,z)")
return cc.Vertex3F(x,y,z)
end
2014-10-17 14:15:30 +08:00
_G.vertex3 = vertex3
2014-03-10 14:04:58 +08:00
local function tex2(u,v)
deprecatedTip("tex2(u,v)","cc.tex2f(u,v)")
return cc.tex2f(u,v)
end
2014-10-17 14:15:30 +08:00
_G.tex2 = tex2
2014-03-10 14:04:58 +08:00
local function ccc4BFromccc4F(color4F)
deprecatedTip("ccc4BFromccc4F(color4F)","Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0)")
2014-10-11 01:27:12 +08:00
return Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0)
2014-03-10 14:04:58 +08:00
end
2014-10-17 14:15:30 +08:00
_G.ccc4BFromccc4F = ccc4BFromccc4F
2014-03-10 14:04:58 +08:00
local function ccColor3BDeprecated()
deprecatedTip("ccColor3B","cc.c3b(0,0,0)")
return cc.c3b(0,0,0)
end
2014-10-17 14:15:30 +08:00
_G.ccColor3B = ccColor3BDeprecated
2014-03-10 14:04:58 +08:00
local function ccColor4BDeprecated()
deprecatedTip("ccColor4B","cc.c4b(0,0,0,0)")
return cc.c4b(0,0,0,0)
end
2014-10-17 14:15:30 +08:00
_G.ccColor4B = ccColor4BDeprecated
2014-03-10 14:04:58 +08:00
local function ccColor4FDeprecated()
deprecatedTip("ccColor4F","cc.c4f(0.0,0.0,0.0,0.0)")
return cc.c4f(0.0,0.0,0.0,0.0)
end
2014-10-17 14:15:30 +08:00
_G.ccColor4F = ccColor4FDeprecated
2014-03-10 14:04:58 +08:00
local function ccVertex2FDeprecated()
deprecatedTip("ccVertex2F","cc.vertex2F(0.0,0.0)")
return cc.vertex2F(0.0,0.0)
end
2014-10-17 14:15:30 +08:00
_G.ccVertex2F = ccVertex2FDeprecated
2014-03-10 14:04:58 +08:00
local function ccVertex3FDeprecated()
deprecatedTip("ccVertex3F","cc.Vertex3F(0.0, 0.0, 0.0)")
return cc.Vertex3F(0.0, 0.0, 0.0)
end
2014-10-17 14:15:30 +08:00
_G.ccVertex3F = ccVertex3FDeprecated
2014-03-10 14:04:58 +08:00
local function ccTex2FDeprecated()
deprecatedTip("ccTex2F","cc.tex2F(0.0, 0.0)")
return cc.tex2F(0.0, 0.0)
end
2014-10-17 14:15:30 +08:00
_G.ccTex2F = ccTex2FDeprecated
2014-03-10 14:04:58 +08:00
local function ccPointSpriteDeprecated()
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
2014-10-17 14:15:30 +08:00
_G.ccPointSprite = ccPointSpriteDeprecated
2014-03-10 14:04:58 +08:00
local function ccQuad2Deprecated()
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
2014-10-17 14:15:30 +08:00
_G.ccQuad2 = ccQuad2Deprecated
2014-03-10 14:04:58 +08:00
local function ccQuad3Deprecated()
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
2014-10-17 14:15:30 +08:00
_G.ccQuad3 = ccQuad3Deprecated
2014-03-10 14:04:58 +08:00
local function ccV2FC4BT2FDeprecated()
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
2014-10-17 14:15:30 +08:00
_G.ccV2F_C4B_T2F = ccV2FC4BT2FDeprecated
2014-03-10 14:04:58 +08:00
local function ccV2FC4FT2FDeprecated()
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
2014-10-17 14:15:30 +08:00
_G.ccV2F_C4F_T2F = ccV2FC4FT2FDeprecated
2014-03-10 14:04:58 +08:00
local function ccV3FC4BT2FDeprecated()
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
2014-10-17 14:15:30 +08:00
_G.ccV3F_C4B_T2F = ccV3FC4BT2FDeprecated
2014-03-10 14:04:58 +08:00
local function ccV2FC4BT2FQuadDeprecated()
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
2014-10-17 14:15:30 +08:00
_G.ccV2F_C4B_T2F_Quad = ccV2FC4BT2FQuadDeprecated
2014-03-10 14:04:58 +08:00
local function ccV3FC4BT2FQuadDeprecated()
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
2014-10-17 14:15:30 +08:00
_G.ccV3F_C4B_T2F_Quad = ccV3FC4BT2FQuadDeprecated
2014-03-10 14:04:58 +08:00
local function ccV2FC4FT2FQuadDeprecated()
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
2014-10-17 14:15:30 +08:00
_G.ccV2F_C4F_T2F_Quad = ccV2FC4FT2FQuadDeprecated
2014-03-10 14:04:58 +08:00
local function ccT2FQuadDeprecated()
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
2014-10-17 14:15:30 +08:00
_G.ccT2F_Quad = ccT2FQuadDeprecated
2014-03-10 14:04:58 +08:00
local function ccAnimationFrameDataDeprecated()
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
2014-10-17 14:15:30 +08:00
_G.ccAnimationFrameData = ccAnimationFrameDataDeprecated
2014-03-10 14:04:58 +08:00
local function tex2(u,v)
deprecatedTip("tex2(u,v)","cc.tex2f(u,v)")
return cc.tex2f(u,v)
end
2014-10-17 14:15:30 +08:00
_G.tex2 = tex2
2014-03-10 14:04:58 +08:00
--functions of CCApplication will be deprecated end
local CCApplicationDeprecated = { }
function CCApplicationDeprecated.sharedApplication()
deprecatedTip("CCApplication:sharedApplication","CCApplication:getInstance")
return CCApplication:getInstance()
end
2014-10-17 14:15:30 +08:00
CCApplication.sharedApplication = CCApplicationDeprecated.sharedApplication
2014-03-10 14:04:58 +08:00
--functions of CCApplication will be deprecated end
--functions of CCDirector will be deprecated end
local CCDirectorDeprecated = { }
function CCDirectorDeprecated.sharedDirector()
deprecatedTip("CCDirector:sharedDirector","CCDirector:getInstance")
return CCDirector:getInstance()
end
2014-10-17 14:15:30 +08:00
CCDirector.sharedDirector = CCDirectorDeprecated.sharedDirector
2014-03-10 14:04:58 +08:00
--functions of CCDirector will be deprecated end
--functions of CCUserDefault will be deprecated end
local CCUserDefaultDeprecated = { }
function CCUserDefaultDeprecated.sharedUserDefault()
deprecatedTip("CCUserDefault:sharedUserDefault","CCUserDefault:getInstance")
return CCUserDefault:getInstance()
end
2014-10-17 14:15:30 +08:00
CCUserDefault.sharedUserDefault = CCUserDefaultDeprecated.sharedUserDefault
2014-03-10 14:04:58 +08:00
function CCUserDefaultDeprecated.purgeSharedUserDefault()
deprecatedTip("CCUserDefault:purgeSharedUserDefault","CCUserDefault:destroyInstance")
return CCUserDefault:destroyInstance()
end
2014-10-17 14:15:30 +08:00
CCUserDefault.purgeSharedUserDefault = CCUserDefaultDeprecated.purgeSharedUserDefault
2014-03-10 14:04:58 +08:00
--functions of CCUserDefault will be deprecated end
--functions of CCGrid3DAction will be deprecated begin
local CCGrid3DActionDeprecated = { }
function CCGrid3DActionDeprecated.vertex(self,pt)
deprecatedTip("vertex","CCGrid3DAction:getVertex")
return self:getVertex(pt)
end
2014-10-17 14:15:30 +08:00
CCGrid3DAction.vertex = CCGrid3DActionDeprecated.vertex
2014-03-10 14:04:58 +08:00
function CCGrid3DActionDeprecated.originalVertex(self,pt)
deprecatedTip("originalVertex","CCGrid3DAction:getOriginalVertex")
return self:getOriginalVertex(pt)
end
2014-10-17 14:15:30 +08:00
CCGrid3DAction.originalVertex = CCGrid3DActionDeprecated.originalVertex
2014-03-10 14:04:58 +08:00
--functions of CCGrid3DAction will be deprecated end
--functions of CCTiledGrid3DAction will be deprecated begin
local CCTiledGrid3DActionDeprecated = { }
function CCTiledGrid3DActionDeprecated.tile(self,pt)
deprecatedTip("tile","CCTiledGrid3DAction:getTile")
return self:getTile(pt)
end
2014-10-17 14:15:30 +08:00
CCTiledGrid3DAction.tile = CCTiledGrid3DActionDeprecated.tile
2014-03-10 14:04:58 +08:00
function CCTiledGrid3DActionDeprecated.originalTile(self,pt)
deprecatedTip("originalTile","CCTiledGrid3DAction:getOriginalTile")
return self:getOriginalTile(pt)
end
2014-10-17 14:15:30 +08:00
CCTiledGrid3DAction.originalTile = CCTiledGrid3DActionDeprecated.originalTile
2014-03-10 14:04:58 +08:00
--functions of CCTiledGrid3DAction will be deprecated end
--functions of CCTexture2D will be deprecated begin
local CCTexture2DDeprecated = { }
function CCTexture2DDeprecated.stringForFormat(self)
deprecatedTip("Texture2D:stringForFormat","Texture2D:getStringForFormat")
return self:getStringForFormat()
end
2014-10-17 14:15:30 +08:00
CCTexture2D.stringForFormat = CCTexture2DDeprecated.stringForFormat
2014-03-10 14:04:58 +08:00
function CCTexture2DDeprecated.bitsPerPixelForFormat(self)
deprecatedTip("Texture2D:bitsPerPixelForFormat","Texture2D:getBitsPerPixelForFormat")
return self:getBitsPerPixelForFormat()
end
2014-10-17 14:15:30 +08:00
CCTexture2D.bitsPerPixelForFormat = CCTexture2DDeprecated.bitsPerPixelForFormat
2014-03-10 14:04:58 +08:00
function CCTexture2DDeprecated.bitsPerPixelForFormat(self,pixelFormat)
deprecatedTip("Texture2D:bitsPerPixelForFormat","Texture2D:getBitsPerPixelForFormat")
return self:getBitsPerPixelForFormat(pixelFormat)
end
2014-10-17 14:15:30 +08:00
CCTexture2D.bitsPerPixelForFormat = CCTexture2DDeprecated.bitsPerPixelForFormat
2014-03-10 14:04:58 +08:00
function CCTexture2DDeprecated.defaultAlphaPixelFormat(self)
deprecatedTip("Texture2D:defaultAlphaPixelFormat","Texture2D:getDefaultAlphaPixelFormat")
return self:getDefaultAlphaPixelFormat()
end
2014-10-17 14:15:30 +08:00
CCTexture2D.defaultAlphaPixelFormat = CCTexture2DDeprecated.defaultAlphaPixelFormat
2014-03-10 14:04:58 +08:00
--functions of CCTexture2D will be deprecated end
--functions of CCTimer will be deprecated begin
local CCTimerDeprecated = { }
function CCTimerDeprecated.timerWithScriptHandler(handler,seconds)
deprecatedTip("CCTimer:timerWithScriptHandler","CCTimer:createWithScriptHandler")
return CCTimer:createWithScriptHandler(handler,seconds)
end
2014-10-17 14:15:30 +08:00
CCTimer.timerWithScriptHandler = CCTimerDeprecated.timerWithScriptHandler
2014-03-10 14:04:58 +08:00
function CCTimerDeprecated.numberOfRunningActionsInTarget(self,target)
deprecatedTip("CCActionManager:numberOfRunningActionsInTarget","CCActionManager:getNumberOfRunningActionsInTarget")
return self:getNumberOfRunningActionsInTarget(target)
end
2014-10-17 14:15:30 +08:00
CCTimer.numberOfRunningActionsInTarget = CCTimerDeprecated.numberOfRunningActionsInTarget
2014-03-10 14:04:58 +08:00
--functions of CCTimer will be deprecated end
--functions of CCMenuItemFont will be deprecated begin
local CCMenuItemFontDeprecated = { }
function CCMenuItemFontDeprecated.fontSize()
deprecatedTip("CCMenuItemFont:fontSize","CCMenuItemFont:getFontSize")
return CCMenuItemFont:getFontSize()
end
2014-10-17 14:15:30 +08:00
CCMenuItemFont.fontSize = CCMenuItemFontDeprecated.fontSize
2014-03-10 14:04:58 +08:00
function CCMenuItemFontDeprecated.fontName()
deprecatedTip("CCMenuItemFont:fontName","CCMenuItemFont:getFontName")
return CCMenuItemFont:getFontName()
end
2014-10-17 14:15:30 +08:00
CCMenuItemFont.fontName = CCMenuItemFontDeprecated.fontName
2014-03-10 14:04:58 +08:00
function CCMenuItemFontDeprecated.fontSizeObj(self)
deprecatedTip("CCMenuItemFont:fontSizeObj","CCMenuItemFont:getFontSizeObj")
return self:getFontSizeObj()
end
2014-10-17 14:15:30 +08:00
CCMenuItemFont.fontSizeObj = CCMenuItemFontDeprecated.fontSizeObj
2014-03-10 14:04:58 +08:00
function CCMenuItemFontDeprecated.fontNameObj(self)
deprecatedTip("CCMenuItemFont:fontNameObj","CCMenuItemFont:getFontNameObj")
return self:getFontNameObj()
end
2014-10-17 14:15:30 +08:00
CCMenuItemFont.fontNameObj = CCMenuItemFontDeprecated.fontNameObj
2014-03-10 14:04:58 +08:00
--functions of CCMenuItemFont will be deprecated end
--functions of CCMenuItemToggle will be deprecated begin
local CCMenuItemToggleDeprecated = { }
function CCMenuItemToggleDeprecated.selectedItem(self)
deprecatedTip("CCMenuItemToggle:selectedItem","CCMenuItemToggle:getSelectedItem")
return self:getSelectedItem()
end
2014-10-17 14:15:30 +08:00
CCMenuItemToggle.selectedItem = CCMenuItemToggleDeprecated.selectedItem
2014-03-10 14:04:58 +08:00
--functions of CCMenuItemToggle will be deprecated end
--functions of CCTileMapAtlas will be deprecated begin
local CCTileMapAtlasDeprecated = { }
function CCTileMapAtlasDeprecated.tileAt(self,pos)
deprecatedTip("CCTileMapAtlas:tileAt","CCTileMapAtlas:getTileAt")
return self:getTileAt(pos)
end
2014-10-17 14:15:30 +08:00
CCTileMapAtlas.tileAt = CCTileMapAtlasDeprecated.tileAt
2014-03-10 14:04:58 +08:00
--functions of CCTileMapAtlas will be deprecated end
--functions of CCTMXLayer will be deprecated begin
local CCTMXLayerDeprecated = { }
function CCTMXLayerDeprecated.tileAt(self,tileCoordinate)
deprecatedTip("CCTMXLayer:tileAt","CCTMXLayer:getTileAt")
return self:getTileAt(tileCoordinate)
end
2014-10-17 14:15:30 +08:00
CCTMXLayer.tileAt = CCTMXLayerDeprecated.tileAt
2014-03-10 14:04:58 +08:00
function CCTMXLayerDeprecated.tileGIDAt(self,tileCoordinate)
deprecatedTip("CCTMXLayer:tileGIDAt","CCTMXLayer:getTileGIDAt")
return self:getTileGIDAt(tileCoordinate)
end
2014-10-17 14:15:30 +08:00
CCTMXLayer.tileGIDAt = CCTMXLayerDeprecated.tileGIDAt
2014-03-10 14:04:58 +08:00
function CCTMXLayerDeprecated.positionAt(self,tileCoordinate)
deprecatedTip("CCTMXLayer:positionAt","CCTMXLayer:getPositionAt")
return self:getPositionAt(tileCoordinate)
end
2014-10-17 14:15:30 +08:00
CCTMXLayer.positionAt = CCTMXLayerDeprecated.positionAt
2014-03-10 14:04:58 +08:00
function CCTMXLayerDeprecated.propertyNamed(self,propertyName)
deprecatedTip("CCTMXLayer:propertyNamed","CCTMXLayer:getProperty")
return self:getProperty(propertyName)
end
2014-10-17 14:15:30 +08:00
CCTMXLayer.propertyNamed = CCTMXLayerDeprecated.propertyNamed
2014-03-10 14:04:58 +08:00
--functions of CCTMXLayer will be deprecated end
--functions of CCTMXTiledMap will be deprecated begin
local CCTMXTiledMapDeprecated = { }
function CCTMXTiledMapDeprecated.layerNamed(self,layerName)
deprecatedTip("CCTMXTiledMap:layerNamed","CCTMXTiledMap:getLayer")
return self:getLayer(layerName)
end
2014-10-17 14:15:30 +08:00
CCTMXTiledMap.layerNamed = CCTMXTiledMapDeprecated.layerNamed
2014-03-10 14:04:58 +08:00
function CCTMXTiledMapDeprecated.propertyNamed(self,propertyName)
deprecatedTip("CCTMXTiledMap:propertyNamed","CCTMXTiledMap:getProperty")
return self:getProperty(propertyName)
end
2014-10-17 14:15:30 +08:00
CCTMXTiledMap.propertyNamed = CCTMXTiledMapDeprecated.propertyNamed
2014-03-10 14:04:58 +08:00
function CCTMXTiledMapDeprecated.propertiesForGID(self,GID)
deprecatedTip("CCTMXTiledMap:propertiesForGID","CCTMXTiledMap:getPropertiesForGID")
return self:getPropertiesForGID(GID)
end
2014-10-17 14:15:30 +08:00
CCTMXTiledMap.propertiesForGID = CCTMXTiledMapDeprecated.propertiesForGID
2014-03-10 14:04:58 +08:00
function CCTMXTiledMapDeprecated.objectGroupNamed(self,groupName)
deprecatedTip("CCTMXTiledMap:objectGroupNamed","CCTMXTiledMap:getObjectGroup")
return self:getObjectGroup(groupName)
end
2014-10-17 14:15:30 +08:00
CCTMXTiledMap.objectGroupNamed = CCTMXTiledMapDeprecated.objectGroupNamed
2014-03-10 14:04:58 +08:00
--functions of CCTMXTiledMap will be deprecated end
--functions of CCTMXMapInfo will be deprecated begin
local CCTMXMapInfoDeprecated = { }
function CCTMXMapInfoDeprecated.getStoringCharacters(self)
deprecatedTip("CCTMXMapInfo:getStoringCharacters","CCTMXMapInfo:isStoringCharacters")
return self:isStoringCharacters()
end
2014-10-17 14:15:30 +08:00
CCTMXMapInfo.getStoringCharacters = CCTMXMapInfoDeprecated.getStoringCharacters
2014-03-10 14:04:58 +08:00
function CCTMXMapInfoDeprecated.formatWithTMXFile(infoTable,tmxFile)
deprecatedTip("CCTMXMapInfo:formatWithTMXFile","CCTMXMapInfo:create")
return CCTMXMapInfo:create(tmxFile)
end
2014-10-17 14:15:30 +08:00
CCTMXMapInfo.formatWithTMXFile = CCTMXMapInfoDeprecated.formatWithTMXFile
2014-03-10 14:04:58 +08:00
function CCTMXMapInfoDeprecated.formatWithXML(infoTable,tmxString,resourcePath)
deprecatedTip("CCTMXMapInfo:formatWithXML","TMXMapInfo:createWithXML")
return CCTMXMapInfo:createWithXML(tmxString,resourcePath)
end
2014-10-17 14:15:30 +08:00
CCTMXMapInfo.formatWithXML = CCTMXMapInfoDeprecated.formatWithXML
2014-03-10 14:04:58 +08:00
--functions of CCTMXMapInfo will be deprecated end
--functions of CCTMXObject will be deprecated begin
local CCTMXObjectGroupDeprecated = { }
function CCTMXObjectGroupDeprecated.propertyNamed(self,propertyName)
deprecatedTip("CCTMXObjectGroup:propertyNamed","CCTMXObjectGroup:getProperty")
return self:getProperty(propertyName)
end
2014-10-17 14:15:30 +08:00
CCTMXObjectGroup.propertyNamed = CCTMXObjectGroupDeprecated.propertyNamed
2014-03-10 14:04:58 +08:00
function CCTMXObjectGroupDeprecated.objectNamed(self, objectName)
deprecatedTip("CCTMXObjectGroup:objectNamed","CCTMXObjectGroup:getObject")
return self:getObject(objectName)
end
2014-10-17 14:15:30 +08:00
CCTMXObjectGroup.objectNamed = CCTMXObjectGroupDeprecated.objectNamed
2014-03-10 14:04:58 +08:00
--functions of CCTMXObject will be deprecated end
--functions of CCRenderTexture will be deprecated begin
local CCRenderTextureDeprecated = { }
function CCRenderTextureDeprecated.newCCImage(self)
deprecatedTip("CCRenderTexture:newCCImage","CCRenderTexture:newImage")
return self:newImage()
end
2014-10-17 14:15:30 +08:00
CCRenderTexture.newCCImage = CCRenderTextureDeprecated.newCCImage
2014-03-10 14:04:58 +08:00
--functions of CCRenderTexture will be deprecated end
--functions of Sprite will be deprecated begin
local CCSpriteDeprecated = { }
function CCSpriteDeprecated.setFlipX(self,flag)
deprecatedTip("CCSpriteDeprecated:setFlipX","CCSpriteDeprecated:setFlippedX")
return self:setFlippedX(flag)
end
2014-10-17 14:15:30 +08:00
cc.Sprite.setFlipX = CCSpriteDeprecated.setFlipX
2014-03-10 14:04:58 +08:00
function CCSpriteDeprecated.setFlipY(self,flag)
deprecatedTip("CCSpriteDeprecated:setFlipY","CCSpriteDeprecated:setFlippedY")
return self:setFlippedY(flag)
end
2014-10-17 14:15:30 +08:00
cc.Sprite.setFlipY = CCSpriteDeprecated.setFlipY
2014-03-10 14:04:58 +08:00
--functions of Sprite will be deprecated end
--functions of Layer will be deprecated begin
local CCLayerDeprecated = {}
function CCLayerDeprecated.setKeypadEnabled( self, enabled)
return self:setKeyboardEnabled(enabled)
end
2014-10-17 14:15:30 +08:00
cc.Layer.setKeypadEnabled = CCLayerDeprecated.setKeypadEnabled
2014-03-10 14:04:58 +08:00
function CCLayerDeprecated.isKeypadEnabled(self)
return self:isKeyboardEnabled()
end
2014-10-17 14:15:30 +08:00
cc.Layer.isKeypadEnabled = CCLayerDeprecated.isKeypadEnabled
2014-03-10 14:04:58 +08:00
--functions of Layer will be deprecated end
--functions of cc.Node will be deprecated begin
local NodeDeprecated = { }
function NodeDeprecated.setZOrder(self,zOrder)
deprecatedTip("cc.Node:setZOrder","cc.Node:setLocalZOrder")
return self:setLocalZOrder(zOrder)
end
2014-10-17 14:15:30 +08:00
cc.Node.setZOrder = NodeDeprecated.setZOrder
2014-03-10 14:04:58 +08:00
function NodeDeprecated.getZOrder(self)
deprecatedTip("cc.Node:getZOrder","cc.Node:getLocalZOrder")
return self:getLocalZOrder()
end
2014-10-17 14:15:30 +08:00
cc.Node.getZOrder = NodeDeprecated.getZOrder
2014-03-10 14:04:58 +08:00
function NodeDeprecated.setVertexZ(self,vertexZ)
deprecatedTip("cc.Node:setVertexZ", "cc.Node:setPositionZ")
return self:setPositionZ(vertexZ)
end
2014-10-17 14:15:30 +08:00
cc.Node.setVertexZ = NodeDeprecated.setVertexZ
2014-03-10 14:04:58 +08:00
function NodeDeprecated.getVertexZ(self)
deprecatedTip("cc.Node:getVertexZ", "cc.Node:getPositionZ")
return self:getPositionZ()
end
2014-10-17 14:15:30 +08:00
cc.Node.getVertexZ = NodeDeprecated.getVertexZ
2014-03-10 14:04:58 +08:00
--functions of cc.Node will be deprecated end
--functions of cc.GLProgram will be deprecated begin
local GLProgram = { }
function GLProgram.initWithVertexShaderByteArray(self,vShaderByteArray, fShaderByteArray)
deprecatedTip("cc.GLProgram:initWithVertexShaderByteArray","cc.GLProgram:initWithByteArrays")
return self:initWithByteArrays(vShaderByteArray, fShaderByteArray)
end
2014-10-17 14:15:30 +08:00
cc.GLProgram.initWithVertexShaderByteArray = GLProgram.initWithVertexShaderByteArray
2014-03-10 14:04:58 +08:00
function GLProgram.initWithVertexShaderFilename(self,vShaderByteArray, fShaderByteArray)
deprecatedTip("cc.GLProgram:initWithVertexShaderFilename","cc.GLProgram:initWithFilenames")
return self:initWithFilenames(vShaderByteArray, fShaderByteArray)
end
2014-10-17 14:15:30 +08:00
cc.GLProgram.initWithVertexShaderFilename = GLProgram.initWithVertexShaderFilename
2014-03-10 14:04:58 +08:00
function GLProgram.addAttribute(self, attributeName, index)
deprecatedTip("cc.GLProgram:addAttribute","cc.GLProgram:bindAttribLocation")
return self:bindAttribLocation(attributeName, index)
end
2014-10-17 14:15:30 +08:00
cc.GLProgram.addAttribute = GLProgram.addAttribute
2014-03-10 14:04:58 +08:00
--functions of cc.GLProgram will be deprecated end