DeprecatedCocos2dFunc.lua 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014
  1. --tip
  2. local function deprecatedTip(old_name,new_name)
  3. print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********")
  4. end
  5. --functions of CCDirector will be deprecated,begin
  6. local CCDirectorDeprecated = { }
  7. function CCDirectorDeprecated.sharedDirector()
  8. deprecatedTip("CCDirector:sharedDirector","cc.Director:getInstance")
  9. return cc.Director:getInstance()
  10. end
  11. CCDirector.sharedDirector = CCDirectorDeprecated.sharedDirector
  12. --functions of CCDirector will be deprecated,end
  13. --functions of CCTextureCache will be deprecated begin
  14. local TextureCacheDeprecated = {}
  15. function TextureCacheDeprecated.getInstance(self)
  16. deprecatedTip("cc.TextureCache:getInstance","cc.Director:getInstance():getTextureCache")
  17. return cc.Director:getInstance():getTextureCache()
  18. end
  19. cc.TextureCache.getInstance = TextureCacheDeprecated.getInstance
  20. function TextureCacheDeprecated.destroyInstance(self)
  21. deprecatedTip("cc.TextureCache:destroyInstance","cc.Director:getInstance():destroyTextureCache")
  22. return cc.Director:getInstance():destroyTextureCache()
  23. end
  24. cc.TextureCache.destroyInstance = TextureCacheDeprecated.destroyInstance
  25. function TextureCacheDeprecated.dumpCachedTextureInfo(self)
  26. deprecatedTip("self:dumpCachedTextureInfo","self:getCachedTextureInfo")
  27. return print(self:getCachedTextureInfo())
  28. end
  29. cc.TextureCache.dumpCachedTextureInfo = TextureCacheDeprecated.dumpCachedTextureInfo
  30. local CCTextureCacheDeprecated = { }
  31. function CCTextureCacheDeprecated.sharedTextureCache()
  32. deprecatedTip("CCTextureCache:sharedTextureCache","CCTextureCache:getInstance")
  33. return cc.TextureCache:getInstance()
  34. end
  35. rawset(CCTextureCache,"sharedTextureCache",CCTextureCacheDeprecated.sharedTextureCache)
  36. function CCTextureCacheDeprecated.purgeSharedTextureCache()
  37. deprecatedTip("CCTextureCache:purgeSharedTextureCache","CCTextureCache:destroyInstance")
  38. return cc.TextureCache:destroyInstance()
  39. end
  40. rawset(CCTextureCache,"purgeSharedTextureCache",CCTextureCacheDeprecated.purgeSharedTextureCache)
  41. function CCTextureCacheDeprecated.addUIImage(self, image, key)
  42. deprecatedTip("CCTextureCache:addUIImage","CCTextureCache:addImage")
  43. return self:addImage(image,key)
  44. end
  45. CCTextureCache.addUIImage = CCTextureCacheDeprecated.addUIImage
  46. --functions of CCTextureCache will be deprecated end
  47. --functions of CCAnimation will be deprecated begin
  48. local CCAnimationDeprecated = {}
  49. function CCAnimationDeprecated.addSpriteFrameWithFileName(self,...)
  50. deprecatedTip("CCAnimationDeprecated:addSpriteFrameWithFileName","cc.Animation:addSpriteFrameWithFile")
  51. return self:addSpriteFrameWithFile(...)
  52. end
  53. CCAnimation.addSpriteFrameWithFileName = CCAnimationDeprecated.addSpriteFrameWithFileName
  54. --functions of CCAnimation will be deprecated end
  55. --functions of CCAnimationCache will be deprecated begin
  56. local CCAnimationCacheDeprecated = { }
  57. function CCAnimationCacheDeprecated.sharedAnimationCache()
  58. deprecatedTip("CCAnimationCache:sharedAnimationCache","CCAnimationCache:getInstance")
  59. return CCAnimationCache:getInstance()
  60. end
  61. CCAnimationCache.sharedAnimationCache = CCAnimationCacheDeprecated.sharedAnimationCache
  62. function CCAnimationCacheDeprecated.purgeSharedAnimationCache()
  63. deprecatedTip("CCAnimationCache:purgeSharedAnimationCache","CCAnimationCache:destroyInstance")
  64. return CCAnimationCache:destroyInstance()
  65. end
  66. CCAnimationCache.purgeSharedAnimationCache = CCAnimationCacheDeprecated.purgeSharedAnimationCache
  67. function CCAnimationCacheDeprecated.addAnimationsWithFile(self,...)
  68. deprecatedTip("CCAnimationCache:addAnimationsWithFile","cc.AnimationCache:addAnimations")
  69. return self:addAnimations(...)
  70. end
  71. CCAnimationCache.addAnimationsWithFile = CCAnimationCacheDeprecated.addAnimationsWithFile
  72. function CCAnimationCacheDeprecated.animationByName(self,...)
  73. deprecatedTip("CCAnimationCache:animationByName","cc.AnimationCache:getAnimation")
  74. return self:getAnimation(...)
  75. end
  76. CCAnimationCache.animationByName = CCAnimationCacheDeprecated.animationByName
  77. function CCAnimationCacheDeprecated.removeAnimationByName(self)
  78. deprecatedTip("CCAnimationCache:removeAnimationByName","cc.AnimationCache:removeAnimation")
  79. return self:removeAnimation()
  80. end
  81. CCAnimationCache.removeAnimationByName = CCAnimationCacheDeprecated.removeAnimationByName
  82. --functions of CCAnimationCache will be deprecated end
  83. --functions of CCFileUtils will be deprecated end
  84. local CCFileUtilsDeprecated = { }
  85. function CCFileUtilsDeprecated.sharedFileUtils()
  86. deprecatedTip("CCFileUtils:sharedFileUtils","CCFileUtils:getInstance")
  87. return cc.FileUtils:getInstance()
  88. end
  89. CCFileUtils.sharedFileUtils = CCFileUtilsDeprecated.sharedFileUtils
  90. function CCFileUtilsDeprecated.purgeFileUtils()
  91. deprecatedTip("CCFileUtils:purgeFileUtils","CCFileUtils:destroyInstance")
  92. return cc.FileUtils:destroyInstance()
  93. end
  94. CCFileUtils.purgeFileUtils = CCFileUtilsDeprecated.purgeFileUtils
  95. --functions of CCFileUtils will be deprecated end
  96. --functions of CCMenu will be deprecated begin
  97. local CCMenuDeprecated = { }
  98. function CCMenuDeprecated.createWithItem(self,...)
  99. deprecatedTip("CCMenuDeprecated:createWithItem","cc.Menu:createWithItem")
  100. return self:create(...)
  101. end
  102. CCMenu.createWithItem = CCMenuDeprecated.createWithItem
  103. function CCMenuDeprecated.setHandlerPriority(self)
  104. print("\n********** \n".."setHandlerPriority was deprecated in 3.0. \n**********")
  105. end
  106. CCMenu.setHandlerPriority = CCMenuDeprecated.setHandlerPriority
  107. --functions of CCMenu will be deprecated end
  108. --functions of CCNode will be deprecated begin
  109. local CCNodeDeprecated = { }
  110. function CCNodeDeprecated.boundingBox(self)
  111. deprecatedTip("CCNode:boundingBox","cc.Node:getBoundingBox")
  112. return self:getBoundingBox()
  113. end
  114. CCNode.boundingBox = CCNodeDeprecated.boundingBox
  115. function CCNodeDeprecated.numberOfRunningActions(self)
  116. deprecatedTip("CCNode:numberOfRunningActions","cc.Node:getNumberOfRunningActions")
  117. return self:getNumberOfRunningActions()
  118. end
  119. CCNode.numberOfRunningActions = CCNodeDeprecated.numberOfRunningActions
  120. function CCNodeDeprecated.removeFromParentAndCleanup(self,...)
  121. deprecatedTip("CCNode:removeFromParentAndCleanup","cc.Node:removeFromParent")
  122. return self:removeFromParent(...)
  123. end
  124. CCNode.removeFromParentAndCleanup = CCNodeDeprecated.removeFromParentAndCleanup
  125. --functions of CCNode will be deprecated end
  126. --CCDrawPrimitives will be deprecated begin
  127. local function CCDrawPrimitivesClassDeprecated()
  128. deprecatedTip("CCDrawPrimitives","cc.DrawPrimitives")
  129. return cc.DrawPrimitives
  130. end
  131. _G.CCDrawPrimitives = CCDrawPrimitivesClassDeprecated()
  132. --functions of CCDrawPrimitives will be deprecated begin
  133. local CCDrawPrimitivesDeprecated = { }
  134. function CCDrawPrimitivesDeprecated.ccDrawPoint(pt)
  135. deprecatedTip("ccDrawPoint","cc.DrawPrimitives.drawPoint")
  136. return cc.DrawPrimitives.drawPoint(pt)
  137. end
  138. _G.ccDrawPoint = CCDrawPrimitivesDeprecated.ccDrawPoint
  139. function CCDrawPrimitivesDeprecated.ccDrawLine(origin,destination)
  140. deprecatedTip("ccDrawLine","cc.DrawPrimitives.drawLine")
  141. return cc.DrawPrimitives.drawLine(origin,destination)
  142. end
  143. _G.ccDrawLine = CCDrawPrimitivesDeprecated.ccDrawLine
  144. function CCDrawPrimitivesDeprecated.ccDrawRect(origin,destination)
  145. deprecatedTip("ccDrawRect","cc.DrawPrimitives.drawRect")
  146. return cc.DrawPrimitives.drawRect(origin,destination)
  147. end
  148. _G.ccDrawRect = CCDrawPrimitivesDeprecated.ccDrawRect
  149. function CCDrawPrimitivesDeprecated.ccDrawSolidRect(origin,destination,color)
  150. deprecatedTip("ccDrawSolidRect","cc.DrawPrimitives.drawSolidRect")
  151. return cc.DrawPrimitives.drawSolidRect(origin,destination,color)
  152. end
  153. _G.ccDrawSolidRect = CCDrawPrimitivesDeprecated.ccDrawSolidRect
  154. -- params:... may represent two param(xScale,yScale) or nil
  155. function CCDrawPrimitivesDeprecated.ccDrawCircle(center,radius,angle,segments,drawLineToCenter,...)
  156. deprecatedTip("ccDrawCircle","cc.DrawPrimitives.drawCircle")
  157. return cc.DrawPrimitives.drawCircle(center,radius,angle,segments,drawLineToCenter,...)
  158. end
  159. _G.ccDrawCircle = CCDrawPrimitivesDeprecated.ccDrawCircle
  160. -- params:... may represent two param(xScale,yScale) or nil
  161. function CCDrawPrimitivesDeprecated.ccDrawSolidCircle(center,radius,angle,segments,...)
  162. deprecatedTip("ccDrawSolidCircle","cc.DrawPrimitives.drawSolidCircle")
  163. return cc.DrawPrimitives.drawSolidCircle(center,radius,angle,segments,...)
  164. end
  165. _G.ccDrawSolidCircle = CCDrawPrimitivesDeprecated.ccDrawSolidCircle
  166. function CCDrawPrimitivesDeprecated.ccDrawQuadBezier(origin,control,destination,segments)
  167. deprecatedTip("ccDrawQuadBezier","cc.DrawPrimitives.drawQuadBezier")
  168. return cc.DrawPrimitives.drawQuadBezier(origin,control,destination,segments)
  169. end
  170. _G.ccDrawQuadBezier = CCDrawPrimitivesDeprecated.ccDrawQuadBezier
  171. function CCDrawPrimitivesDeprecated.ccDrawCubicBezier(origin,control1,control2,destination,segments)
  172. deprecatedTip("ccDrawCubicBezier","cc.DrawPrimitives.drawCubicBezier")
  173. return cc.DrawPrimitives.drawCubicBezier(origin,control1,control2,destination,segments)
  174. end
  175. _G.ccDrawCubicBezier = CCDrawPrimitivesDeprecated.ccDrawCubicBezier
  176. function CCDrawPrimitivesDeprecated.ccDrawCatmullRom(arrayOfControlPoints,segments)
  177. deprecatedTip("ccDrawCatmullRom","cc.DrawPrimitives.drawCatmullRom")
  178. return cc.DrawPrimitives.drawCatmullRom(arrayOfControlPoints,segments)
  179. end
  180. _G.ccDrawCatmullRom = CCDrawPrimitivesDeprecated.ccDrawCatmullRom
  181. function CCDrawPrimitivesDeprecated.ccDrawCardinalSpline(config,tension,segments)
  182. deprecatedTip("ccDrawCardinalSpline","cc.DrawPrimitives.drawCardinalSpline")
  183. return cc.DrawPrimitives.drawCardinalSpline(config,tension,segments)
  184. end
  185. _G.ccDrawCardinalSpline = CCDrawPrimitivesDeprecated.ccDrawCardinalSpline
  186. function CCDrawPrimitivesDeprecated.ccDrawColor4B(r,g,b,a)
  187. deprecatedTip("ccDrawColor4B","cc.DrawPrimitives.drawColor4B")
  188. return cc.DrawPrimitives.drawColor4B(r,g,b,a)
  189. end
  190. _G.ccDrawColor4B = CCDrawPrimitivesDeprecated.ccDrawColor4B
  191. function CCDrawPrimitivesDeprecated.ccDrawColor4F(r,g,b,a)
  192. deprecatedTip("ccDrawColor4F","cc.DrawPrimitives.drawColor4F")
  193. return cc.DrawPrimitives.drawColor4F(r,g,b,a)
  194. end
  195. _G.ccDrawColor4F = CCDrawPrimitivesDeprecated.ccDrawColor4F
  196. function CCDrawPrimitivesDeprecated.ccPointSize(pointSize)
  197. deprecatedTip("ccPointSize","cc.DrawPrimitives.setPointSize")
  198. return cc.DrawPrimitives.setPointSize(pointSize)
  199. end
  200. _G.ccPointSize = CCDrawPrimitivesDeprecated.ccPointSize
  201. --functions of CCDrawPrimitives will be deprecated end
  202. --CCDrawPrimitives will be deprecated end
  203. local CCProgressTimerDeprecated = {}
  204. function CCProgressTimerDeprecated.setReverseProgress(self,...)
  205. deprecatedTip("CCProgressTimer","CCProgressTimer:setReverseDirection")
  206. return self:setReverseDirection(...)
  207. end
  208. CCProgressTimer.setReverseProgress = CCProgressTimerDeprecated.setReverseProgress
  209. --functions of CCSpriteFrameCache will be deprecated begin
  210. local CCSpriteFrameCacheDeprecated = { }
  211. function CCSpriteFrameCacheDeprecated.spriteFrameByName(self,szName)
  212. deprecatedTip("CCSpriteFrameCache:spriteFrameByName","CCSpriteFrameCache:getSpriteFrameByName")
  213. return self:getSpriteFrameByName(szName)
  214. end
  215. CCSpriteFrameCache.spriteFrameByName = CCSpriteFrameCacheDeprecated.spriteFrameByName
  216. function CCSpriteFrameCacheDeprecated.sharedSpriteFrameCache()
  217. deprecatedTip("CCSpriteFrameCache:sharedSpriteFrameCache","CCSpriteFrameCache:getInstance")
  218. return CCSpriteFrameCache:getInstance()
  219. end
  220. CCSpriteFrameCache.sharedSpriteFrameCache = CCSpriteFrameCacheDeprecated.sharedSpriteFrameCache
  221. function CCSpriteFrameCacheDeprecated.purgeSharedSpriteFrameCache()
  222. deprecatedTip("CCSpriteFrameCache:purgeSharedSpriteFrameCache","CCSpriteFrameCache:destroyInstance")
  223. return CCSpriteFrameCache:destroyInstance()
  224. end
  225. CCSpriteFrameCache.purgeSharedSpriteFrameCache = CCSpriteFrameCacheDeprecated.purgeSharedSpriteFrameCache
  226. function CCSpriteFrameCacheDeprecated.addSpriteFramesWithFile(self,...)
  227. deprecatedTip("CCSpriteFrameCache:addSpriteFramesWithFile","CCSpriteFrameCache:addSpriteFrames")
  228. return self:addSpriteFrames(...)
  229. end
  230. rawset(CCSpriteFrameCache,"addSpriteFramesWithFile",CCSpriteFrameCacheDeprecated.addSpriteFramesWithFile)
  231. function CCSpriteFrameCacheDeprecated.getSpriteFrameByName(self,...)
  232. deprecatedTip("CCSpriteFrameCache:getSpriteFrameByName","CCSpriteFrameCache:getSpriteFrame")
  233. return self:getSpriteFrame(...)
  234. end
  235. CCSpriteFrameCache.getSpriteFrameByName = CCSpriteFrameCacheDeprecated.getSpriteFrameByName
  236. --functions of CCSpriteFrameCache will be deprecated end
  237. --functions of CCLabelAtlas will be deprecated begin
  238. local CCLabelAtlasDeprecated = {}
  239. function CCLabelAtlasDeprecated.create(self,...)
  240. deprecatedTip("CCLabelAtlas:create","CCLabelAtlas:_create")
  241. return self:_create(...)
  242. end
  243. CCLabelAtlas.create = CCLabelAtlasDeprecated.create
  244. --functions of CCLabelAtlas will be deprecated end
  245. ---------------------------
  246. --global functions wil be deprecated, begin
  247. local function CCRectMake(x,y,width,height)
  248. deprecatedTip("CCRectMake(x,y,width,height)","cc.rect(x,y,width,height) in lua")
  249. return cc.rect(x,y,width,height)
  250. end
  251. _G.CCRectMake = CCRectMake
  252. local function ccc3(r,g,b)
  253. deprecatedTip("ccc3(r,g,b)","cc.c3b(r,g,b)")
  254. return cc.c3b(r,g,b)
  255. end
  256. _G.ccc3 = ccc3
  257. local function ccp(x,y)
  258. deprecatedTip("ccp(x,y)","cc.p(x,y)")
  259. return cc.p(x,y)
  260. end
  261. _G.ccp = ccp
  262. local function CCSizeMake(width,height)
  263. deprecatedTip("CCSizeMake(width,height)","cc.size(width,height)")
  264. return cc.size(width,height)
  265. end
  266. _G.CCSizeMake = CCSizeMake
  267. local function ccc4(r,g,b,a)
  268. deprecatedTip("ccc4(r,g,b,a)","cc.c4b(r,g,b,a)")
  269. return cc.c4b(r,g,b,a)
  270. end
  271. _G.ccc4 = ccc4
  272. local function ccc4FFromccc3B(color3B)
  273. deprecatedTip("ccc4FFromccc3B(color3B)","cc.c4f(color3B.r / 255.0,color3B.g / 255.0,color3B.b / 255.0,1.0)")
  274. return cc.c4f(color3B.r/255.0, color3B.g/255.0, color3B.b/255.0, 1.0)
  275. end
  276. _G.ccc4FFromccc3B = ccc4FFromccc3B
  277. local function ccc4f(r,g,b,a)
  278. deprecatedTip("ccc4f(r,g,b,a)","cc.c4f(r,g,b,a)")
  279. return cc.c4f(r,g,b,a)
  280. end
  281. _G.ccc4f = ccc4f
  282. local function ccc4FFromccc4B(color4B)
  283. deprecatedTip("ccc4FFromccc4B(color4B)","cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)")
  284. return cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)
  285. end
  286. _G.ccc4FFromccc4B = ccc4FFromccc4B
  287. local function ccc4FEqual(a,b)
  288. deprecatedTip("ccc4FEqual(a,b)","a:equals(b)")
  289. return a:equals(b)
  290. end
  291. _G.ccc4FEqual = ccc4FEqual
  292. --global functions wil be deprecated, end
  293. --functions of _G will be deprecated begin
  294. local function ccpLineIntersect(a,b,c,d,s,t)
  295. deprecatedTip("ccpLineIntersect","cc.pIsLineIntersect")
  296. return cc.pIsLineIntersect(a,b,c,d,s,t)
  297. end
  298. _G.ccpLineIntersect = ccpLineIntersect
  299. local function CCPointMake(x,y)
  300. deprecatedTip("CCPointMake(x,y)","cc.p(x,y)")
  301. return cc.p(x,y)
  302. end
  303. _G.CCPointMake = CCPointMake
  304. local function ccpNeg(pt)
  305. deprecatedTip("ccpNeg","cc.pSub")
  306. return cc.pSub({x = 0,y = 0}, pt)
  307. end
  308. _G.ccpNeg = ccpNeg
  309. local function ccpAdd(pt1,pt2)
  310. deprecatedTip("ccpAdd","cc.pAdd")
  311. return cc.pAdd(pt1,pt2)
  312. end
  313. _G.ccpAdd = ccpAdd
  314. local function ccpSub(pt1,pt2)
  315. deprecatedTip("ccpSub","cc.pSub")
  316. return cc.pSub(pt1,pt2)
  317. end
  318. _G.ccpSub = ccpSub
  319. local function ccpMult(pt,factor)
  320. deprecatedTip("ccpMult","cc.pMul")
  321. return cc.pMul(pt,factor)
  322. end
  323. _G.ccpMult = ccpMult
  324. local function ccpMidpoint(pt1,pt2)
  325. deprecatedTip("ccpMidpoint","cc.pMidpoint")
  326. return cc.pMidpoint(pt1,pt2)
  327. end
  328. _G.ccpMidpoint = ccpMidpoint
  329. local function ccpDot(pt1,pt2)
  330. deprecatedTip("ccpDot","cc.pDot")
  331. return cc.pDot(pt1,pt2)
  332. end
  333. _G.ccpDot = ccpDot
  334. local function ccpCross(pt1,pt2)
  335. deprecatedTip("ccpCross","cc.pCross")
  336. return cc.pCross(pt1, pt2)
  337. end
  338. _G.ccpCross = ccpCross
  339. local function ccpPerp(pt)
  340. deprecatedTip("ccpPerp","cc.pPerp")
  341. return cc.pPerp(pt)
  342. end
  343. _G.ccpPerp = ccpPerp
  344. local function ccpRPerp(pt)
  345. deprecatedTip("ccpRPerp","cc.RPerp")
  346. return cc.RPerp(pt)
  347. end
  348. _G.ccpRPerp = ccpRPerp
  349. local function ccpProject(pt1,pt2)
  350. deprecatedTip("ccpProject","cc.pProject")
  351. return cc.pProject(pt1,pt2)
  352. end
  353. _G.ccpProject = ccpProject
  354. local function ccpRotate(pt1,pt2)
  355. deprecatedTip("ccpRotate","cc.pRotate")
  356. return cc.pRotate(pt1,pt2)
  357. end
  358. _G.ccpRotate = ccpRotate
  359. local function ccpUnrotate(pt1,pt2)
  360. deprecatedTip("ccpUnrotate","cc.pUnrotate")
  361. return cc.pUnrotate(pt1,pt2)
  362. end
  363. _G.ccpUnrotate = ccpUnrotate
  364. local function ccpLengthSQ(pt)
  365. deprecatedTip("ccpLengthSQ","cc.pLengthSQ")
  366. return cc.pLengthSQ(pt)
  367. end
  368. _G.ccpLengthSQ = ccpLengthSQ
  369. local function ccpDistanceSQ(pt1,pt2)
  370. deprecatedTip("ccpDistanceSQ","cc.pDistanceSQ")
  371. return cc.pDistanceSQ(pt1,pt2)
  372. end
  373. _G.ccpDistanceSQ = ccpDistanceSQ
  374. local function ccpLength(pt)
  375. deprecatedTip("ccpLength","cc.pGetLength")
  376. return cc.pGetLength(pt)
  377. end
  378. _G.ccpLength = ccpLength
  379. local function ccpDistance(pt1,pt2)
  380. deprecatedTip("ccpDistance","cc.pGetDistance")
  381. return cc.pGetDistance(pt1, pt2)
  382. end
  383. _G.ccpDistance = ccpDistance
  384. local function ccpNormalize(pt)
  385. deprecatedTip("ccpNormalize","cc.pNormalize")
  386. return cc.pNormalize(pt)
  387. end
  388. _G.ccpNormalize = ccpNormalize
  389. local function ccpForAngle(angle)
  390. deprecatedTip("ccpForAngle","cc.pForAngle")
  391. return cc.pForAngle(angle)
  392. end
  393. _G.ccpForAngle = ccpForAngle
  394. local function ccpToAngle(pt)
  395. deprecatedTip("ccpToAngle","cc.pToAngleSelf")
  396. return cc.pToAngleSelf(pt)
  397. end
  398. _G.ccpToAngle = ccpToAngle
  399. local function ccpClamp(pt1,pt2,pt3)
  400. deprecatedTip("ccpClamp","cc.pGetClampPoint")
  401. return cc.pGetClampPoint(pt1,pt2,pt3)
  402. end
  403. _G.ccpClamp = ccpClamp
  404. local function ccpFromSize(sz)
  405. deprecatedTip("ccpFromSize(sz)","cc.pFromSize")
  406. return cc.pFromSize(sz)
  407. end
  408. _G.ccpFromSize = ccpFromSize
  409. local function ccpLerp(pt1,pt2,alpha)
  410. deprecatedTip("ccpLerp","cc.pLerp")
  411. return cc.pLerp(pt1,pt2,alpha)
  412. end
  413. _G.ccpLerp = ccpLerp
  414. local function ccpFuzzyEqual(pt1,pt2,variance)
  415. deprecatedTip("ccpFuzzyEqual","cc.pFuzzyEqual")
  416. return cc.pFuzzyEqual(pt1,pt2,variance)
  417. end
  418. _G.ccpFuzzyEqual = ccpFuzzyEqual
  419. local function ccpCompMult(pt1,pt2)
  420. deprecatedTip("ccpCompMult","cc.p")
  421. return cc.p(pt1.x * pt2.x , pt1.y * pt2.y)
  422. end
  423. _G.ccpCompMult = ccpCompMult
  424. local function ccpAngleSigned(pt1,pt2)
  425. deprecatedTip("ccpAngleSigned","cc.pGetAngle")
  426. return cc.pGetAngle(pt1, pt2)
  427. end
  428. _G.ccpAngleSigned = ccpAngleSigned
  429. local function ccpAngle(pt1,pt2)
  430. deprecatedTip("ccpAngle","cc.pGetAngle")
  431. return cc.pGetAngle(pt1,ptw)
  432. end
  433. _G.ccpAngle = ccpAngle
  434. local function ccpRotateByAngle(pt1,pt2,angle)
  435. deprecatedTip("ccpRotateByAngle","cc.pRotateByAngle")
  436. return cc.pRotateByAngle(pt1, pt2, angle)
  437. end
  438. _G.ccpRotateByAngle = ccpRotateByAngle
  439. local function ccpSegmentIntersect(pt1,pt2,pt3,pt4)
  440. deprecatedTip("ccpSegmentIntersect","cc.pIsSegmentIntersect")
  441. return cc.pIsSegmentIntersect(pt1,pt2,pt3,pt4)
  442. end
  443. _G.ccpSegmentIntersect = ccpSegmentIntersect
  444. local function ccpIntersectPoint(pt1,pt2,pt3,pt4)
  445. deprecatedTip("ccpIntersectPoint","cc.pGetIntersectPoint")
  446. return cc.pGetIntersectPoint(pt1,pt2,pt3,pt4)
  447. end
  448. _G.ccpIntersectPoint = ccpIntersectPoint
  449. local function vertex2(x,y)
  450. deprecatedTip("vertex2(x,y)","cc.vertex2F(x,y)")
  451. return cc.vertex2F(x,y)
  452. end
  453. _G.vertex2 = vertex2
  454. local function vertex3(x,y,z)
  455. deprecatedTip("vertex3(x,y,z)","cc.Vertex3F(x,y,z)")
  456. return cc.Vertex3F(x,y,z)
  457. end
  458. _G.vertex3 = vertex3
  459. local function tex2(u,v)
  460. deprecatedTip("tex2(u,v)","cc.tex2f(u,v)")
  461. return cc.tex2f(u,v)
  462. end
  463. _G.tex2 = tex2
  464. local function ccc4BFromccc4F(color4F)
  465. deprecatedTip("ccc4BFromccc4F(color4F)","Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0)")
  466. return Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0)
  467. end
  468. _G.ccc4BFromccc4F = ccc4BFromccc4F
  469. local function ccColor3BDeprecated()
  470. deprecatedTip("ccColor3B","cc.c3b(0,0,0)")
  471. return cc.c3b(0,0,0)
  472. end
  473. _G.ccColor3B = ccColor3BDeprecated
  474. local function ccColor4BDeprecated()
  475. deprecatedTip("ccColor4B","cc.c4b(0,0,0,0)")
  476. return cc.c4b(0,0,0,0)
  477. end
  478. _G.ccColor4B = ccColor4BDeprecated
  479. local function ccColor4FDeprecated()
  480. deprecatedTip("ccColor4F","cc.c4f(0.0,0.0,0.0,0.0)")
  481. return cc.c4f(0.0,0.0,0.0,0.0)
  482. end
  483. _G.ccColor4F = ccColor4FDeprecated
  484. local function ccVertex2FDeprecated()
  485. deprecatedTip("ccVertex2F","cc.vertex2F(0.0,0.0)")
  486. return cc.vertex2F(0.0,0.0)
  487. end
  488. _G.ccVertex2F = ccVertex2FDeprecated
  489. local function ccVertex3FDeprecated()
  490. deprecatedTip("ccVertex3F","cc.Vertex3F(0.0, 0.0, 0.0)")
  491. return cc.Vertex3F(0.0, 0.0, 0.0)
  492. end
  493. _G.ccVertex3F = ccVertex3FDeprecated
  494. local function ccTex2FDeprecated()
  495. deprecatedTip("ccTex2F","cc.tex2F(0.0, 0.0)")
  496. return cc.tex2F(0.0, 0.0)
  497. end
  498. _G.ccTex2F = ccTex2FDeprecated
  499. local function ccPointSpriteDeprecated()
  500. deprecatedTip("ccPointSprite","cc.PointSprite(cc.vertex2F(0.0, 0.0),cc.c4b(0.0, 0.0, 0.0),0)")
  501. return cc.PointSprite(cc.vertex2F(0.0, 0.0),cc.c4b(0.0, 0.0, 0.0),0)
  502. end
  503. _G.ccPointSprite = ccPointSpriteDeprecated
  504. local function ccQuad2Deprecated()
  505. 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))")
  506. 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))
  507. end
  508. _G.ccQuad2 = ccQuad2Deprecated
  509. local function ccQuad3Deprecated()
  510. 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))")
  511. 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))
  512. end
  513. _G.ccQuad3 = ccQuad3Deprecated
  514. local function ccV2FC4BT2FDeprecated()
  515. 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))")
  516. return cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0))
  517. end
  518. _G.ccV2F_C4B_T2F = ccV2FC4BT2FDeprecated
  519. local function ccV2FC4FT2FDeprecated()
  520. 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))")
  521. 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))
  522. end
  523. _G.ccV2F_C4F_T2F = ccV2FC4FT2FDeprecated
  524. local function ccV3FC4BT2FDeprecated()
  525. 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))")
  526. 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))
  527. end
  528. _G.ccV3F_C4B_T2F = ccV3FC4BT2FDeprecated
  529. local function ccV2FC4BT2FQuadDeprecated()
  530. 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)))")
  531. 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)))
  532. end
  533. _G.ccV2F_C4B_T2F_Quad = ccV2FC4BT2FQuadDeprecated
  534. local function ccV3FC4BT2FQuadDeprecated()
  535. deprecatedTip("ccV3F_C4B_T2F_Quad","cc.V3F_C4B_T2F_Quad(_tl, _bl, _tr, _br)")
  536. 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)))
  537. end
  538. _G.ccV3F_C4B_T2F_Quad = ccV3FC4BT2FQuadDeprecated
  539. local function ccV2FC4FT2FQuadDeprecated()
  540. deprecatedTip("ccV2F_C4F_T2F_Quad","cc.V2F_C4F_T2F_Quad(_bl, _br, _tl, _tr)")
  541. 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)))
  542. end
  543. _G.ccV2F_C4F_T2F_Quad = ccV2FC4FT2FQuadDeprecated
  544. local function ccT2FQuadDeprecated()
  545. deprecatedTip("ccT2F_Quad","cc.T2F_Quad(_bl, _br, _tl, _tr)")
  546. 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))
  547. end
  548. _G.ccT2F_Quad = ccT2FQuadDeprecated
  549. local function ccAnimationFrameDataDeprecated()
  550. deprecatedTip("ccAnimationFrameData","cc.AnimationFrameData( _texCoords, _delay, _size)")
  551. 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))
  552. end
  553. _G.ccAnimationFrameData = ccAnimationFrameDataDeprecated
  554. local function tex2(u,v)
  555. deprecatedTip("tex2(u,v)","cc.tex2f(u,v)")
  556. return cc.tex2f(u,v)
  557. end
  558. _G.tex2 = tex2
  559. --functions of CCApplication will be deprecated end
  560. local CCApplicationDeprecated = { }
  561. function CCApplicationDeprecated.sharedApplication()
  562. deprecatedTip("CCApplication:sharedApplication","CCApplication:getInstance")
  563. return CCApplication:getInstance()
  564. end
  565. CCApplication.sharedApplication = CCApplicationDeprecated.sharedApplication
  566. --functions of CCApplication will be deprecated end
  567. --functions of CCDirector will be deprecated end
  568. local CCDirectorDeprecated = { }
  569. function CCDirectorDeprecated.sharedDirector()
  570. deprecatedTip("CCDirector:sharedDirector","CCDirector:getInstance")
  571. return CCDirector:getInstance()
  572. end
  573. CCDirector.sharedDirector = CCDirectorDeprecated.sharedDirector
  574. --functions of CCDirector will be deprecated end
  575. --functions of CCUserDefault will be deprecated end
  576. local CCUserDefaultDeprecated = { }
  577. function CCUserDefaultDeprecated.sharedUserDefault()
  578. deprecatedTip("CCUserDefault:sharedUserDefault","CCUserDefault:getInstance")
  579. return CCUserDefault:getInstance()
  580. end
  581. CCUserDefault.sharedUserDefault = CCUserDefaultDeprecated.sharedUserDefault
  582. function CCUserDefaultDeprecated.purgeSharedUserDefault()
  583. deprecatedTip("CCUserDefault:purgeSharedUserDefault","CCUserDefault:destroyInstance")
  584. return CCUserDefault:destroyInstance()
  585. end
  586. CCUserDefault.purgeSharedUserDefault = CCUserDefaultDeprecated.purgeSharedUserDefault
  587. --functions of CCUserDefault will be deprecated end
  588. --functions of CCGrid3DAction will be deprecated begin
  589. local CCGrid3DActionDeprecated = { }
  590. function CCGrid3DActionDeprecated.vertex(self,pt)
  591. deprecatedTip("vertex","CCGrid3DAction:getVertex")
  592. return self:getVertex(pt)
  593. end
  594. CCGrid3DAction.vertex = CCGrid3DActionDeprecated.vertex
  595. function CCGrid3DActionDeprecated.originalVertex(self,pt)
  596. deprecatedTip("originalVertex","CCGrid3DAction:getOriginalVertex")
  597. return self:getOriginalVertex(pt)
  598. end
  599. CCGrid3DAction.originalVertex = CCGrid3DActionDeprecated.originalVertex
  600. --functions of CCGrid3DAction will be deprecated end
  601. --functions of CCTiledGrid3DAction will be deprecated begin
  602. local CCTiledGrid3DActionDeprecated = { }
  603. function CCTiledGrid3DActionDeprecated.tile(self,pt)
  604. deprecatedTip("tile","CCTiledGrid3DAction:getTile")
  605. return self:getTile(pt)
  606. end
  607. CCTiledGrid3DAction.tile = CCTiledGrid3DActionDeprecated.tile
  608. function CCTiledGrid3DActionDeprecated.originalTile(self,pt)
  609. deprecatedTip("originalTile","CCTiledGrid3DAction:getOriginalTile")
  610. return self:getOriginalTile(pt)
  611. end
  612. CCTiledGrid3DAction.originalTile = CCTiledGrid3DActionDeprecated.originalTile
  613. --functions of CCTiledGrid3DAction will be deprecated end
  614. --functions of CCTexture2D will be deprecated begin
  615. local CCTexture2DDeprecated = { }
  616. function CCTexture2DDeprecated.stringForFormat(self)
  617. deprecatedTip("Texture2D:stringForFormat","Texture2D:getStringForFormat")
  618. return self:getStringForFormat()
  619. end
  620. CCTexture2D.stringForFormat = CCTexture2DDeprecated.stringForFormat
  621. function CCTexture2DDeprecated.bitsPerPixelForFormat(self)
  622. deprecatedTip("Texture2D:bitsPerPixelForFormat","Texture2D:getBitsPerPixelForFormat")
  623. return self:getBitsPerPixelForFormat()
  624. end
  625. CCTexture2D.bitsPerPixelForFormat = CCTexture2DDeprecated.bitsPerPixelForFormat
  626. function CCTexture2DDeprecated.bitsPerPixelForFormat(self,pixelFormat)
  627. deprecatedTip("Texture2D:bitsPerPixelForFormat","Texture2D:getBitsPerPixelForFormat")
  628. return self:getBitsPerPixelForFormat(pixelFormat)
  629. end
  630. CCTexture2D.bitsPerPixelForFormat = CCTexture2DDeprecated.bitsPerPixelForFormat
  631. function CCTexture2DDeprecated.defaultAlphaPixelFormat(self)
  632. deprecatedTip("Texture2D:defaultAlphaPixelFormat","Texture2D:getDefaultAlphaPixelFormat")
  633. return self:getDefaultAlphaPixelFormat()
  634. end
  635. CCTexture2D.defaultAlphaPixelFormat = CCTexture2DDeprecated.defaultAlphaPixelFormat
  636. --functions of CCTexture2D will be deprecated end
  637. --functions of CCTimer will be deprecated begin
  638. local CCTimerDeprecated = { }
  639. function CCTimerDeprecated.timerWithScriptHandler(handler,seconds)
  640. deprecatedTip("CCTimer:timerWithScriptHandler","CCTimer:createWithScriptHandler")
  641. return CCTimer:createWithScriptHandler(handler,seconds)
  642. end
  643. CCTimer.timerWithScriptHandler = CCTimerDeprecated.timerWithScriptHandler
  644. function CCTimerDeprecated.numberOfRunningActionsInTarget(self,target)
  645. deprecatedTip("CCActionManager:numberOfRunningActionsInTarget","CCActionManager:getNumberOfRunningActionsInTarget")
  646. return self:getNumberOfRunningActionsInTarget(target)
  647. end
  648. CCTimer.numberOfRunningActionsInTarget = CCTimerDeprecated.numberOfRunningActionsInTarget
  649. --functions of CCTimer will be deprecated end
  650. --functions of CCMenuItemFont will be deprecated begin
  651. local CCMenuItemFontDeprecated = { }
  652. function CCMenuItemFontDeprecated.fontSize()
  653. deprecatedTip("CCMenuItemFont:fontSize","CCMenuItemFont:getFontSize")
  654. return CCMenuItemFont:getFontSize()
  655. end
  656. CCMenuItemFont.fontSize = CCMenuItemFontDeprecated.fontSize
  657. function CCMenuItemFontDeprecated.fontName()
  658. deprecatedTip("CCMenuItemFont:fontName","CCMenuItemFont:getFontName")
  659. return CCMenuItemFont:getFontName()
  660. end
  661. CCMenuItemFont.fontName = CCMenuItemFontDeprecated.fontName
  662. function CCMenuItemFontDeprecated.fontSizeObj(self)
  663. deprecatedTip("CCMenuItemFont:fontSizeObj","CCMenuItemFont:getFontSizeObj")
  664. return self:getFontSizeObj()
  665. end
  666. CCMenuItemFont.fontSizeObj = CCMenuItemFontDeprecated.fontSizeObj
  667. function CCMenuItemFontDeprecated.fontNameObj(self)
  668. deprecatedTip("CCMenuItemFont:fontNameObj","CCMenuItemFont:getFontNameObj")
  669. return self:getFontNameObj()
  670. end
  671. CCMenuItemFont.fontNameObj = CCMenuItemFontDeprecated.fontNameObj
  672. --functions of CCMenuItemFont will be deprecated end
  673. --functions of CCMenuItemToggle will be deprecated begin
  674. local CCMenuItemToggleDeprecated = { }
  675. function CCMenuItemToggleDeprecated.selectedItem(self)
  676. deprecatedTip("CCMenuItemToggle:selectedItem","CCMenuItemToggle:getSelectedItem")
  677. return self:getSelectedItem()
  678. end
  679. CCMenuItemToggle.selectedItem = CCMenuItemToggleDeprecated.selectedItem
  680. --functions of CCMenuItemToggle will be deprecated end
  681. --functions of CCTileMapAtlas will be deprecated begin
  682. local CCTileMapAtlasDeprecated = { }
  683. function CCTileMapAtlasDeprecated.tileAt(self,pos)
  684. deprecatedTip("CCTileMapAtlas:tileAt","CCTileMapAtlas:getTileAt")
  685. return self:getTileAt(pos)
  686. end
  687. CCTileMapAtlas.tileAt = CCTileMapAtlasDeprecated.tileAt
  688. --functions of CCTileMapAtlas will be deprecated end
  689. --functions of CCTMXLayer will be deprecated begin
  690. local CCTMXLayerDeprecated = { }
  691. function CCTMXLayerDeprecated.tileAt(self,tileCoordinate)
  692. deprecatedTip("CCTMXLayer:tileAt","CCTMXLayer:getTileAt")
  693. return self:getTileAt(tileCoordinate)
  694. end
  695. CCTMXLayer.tileAt = CCTMXLayerDeprecated.tileAt
  696. function CCTMXLayerDeprecated.tileGIDAt(self,tileCoordinate)
  697. deprecatedTip("CCTMXLayer:tileGIDAt","CCTMXLayer:getTileGIDAt")
  698. return self:getTileGIDAt(tileCoordinate)
  699. end
  700. CCTMXLayer.tileGIDAt = CCTMXLayerDeprecated.tileGIDAt
  701. function CCTMXLayerDeprecated.positionAt(self,tileCoordinate)
  702. deprecatedTip("CCTMXLayer:positionAt","CCTMXLayer:getPositionAt")
  703. return self:getPositionAt(tileCoordinate)
  704. end
  705. CCTMXLayer.positionAt = CCTMXLayerDeprecated.positionAt
  706. function CCTMXLayerDeprecated.propertyNamed(self,propertyName)
  707. deprecatedTip("CCTMXLayer:propertyNamed","CCTMXLayer:getProperty")
  708. return self:getProperty(propertyName)
  709. end
  710. CCTMXLayer.propertyNamed = CCTMXLayerDeprecated.propertyNamed
  711. --functions of CCTMXLayer will be deprecated end
  712. --functions of CCTMXTiledMap will be deprecated begin
  713. local CCTMXTiledMapDeprecated = { }
  714. function CCTMXTiledMapDeprecated.layerNamed(self,layerName)
  715. deprecatedTip("CCTMXTiledMap:layerNamed","CCTMXTiledMap:getLayer")
  716. return self:getLayer(layerName)
  717. end
  718. CCTMXTiledMap.layerNamed = CCTMXTiledMapDeprecated.layerNamed
  719. function CCTMXTiledMapDeprecated.propertyNamed(self,propertyName)
  720. deprecatedTip("CCTMXTiledMap:propertyNamed","CCTMXTiledMap:getProperty")
  721. return self:getProperty(propertyName)
  722. end
  723. CCTMXTiledMap.propertyNamed = CCTMXTiledMapDeprecated.propertyNamed
  724. function CCTMXTiledMapDeprecated.propertiesForGID(self,GID)
  725. deprecatedTip("CCTMXTiledMap:propertiesForGID","CCTMXTiledMap:getPropertiesForGID")
  726. return self:getPropertiesForGID(GID)
  727. end
  728. CCTMXTiledMap.propertiesForGID = CCTMXTiledMapDeprecated.propertiesForGID
  729. function CCTMXTiledMapDeprecated.objectGroupNamed(self,groupName)
  730. deprecatedTip("CCTMXTiledMap:objectGroupNamed","CCTMXTiledMap:getObjectGroup")
  731. return self:getObjectGroup(groupName)
  732. end
  733. CCTMXTiledMap.objectGroupNamed = CCTMXTiledMapDeprecated.objectGroupNamed
  734. --functions of CCTMXTiledMap will be deprecated end
  735. --functions of CCTMXMapInfo will be deprecated begin
  736. local CCTMXMapInfoDeprecated = { }
  737. function CCTMXMapInfoDeprecated.getStoringCharacters(self)
  738. deprecatedTip("CCTMXMapInfo:getStoringCharacters","CCTMXMapInfo:isStoringCharacters")
  739. return self:isStoringCharacters()
  740. end
  741. CCTMXMapInfo.getStoringCharacters = CCTMXMapInfoDeprecated.getStoringCharacters
  742. function CCTMXMapInfoDeprecated.formatWithTMXFile(infoTable,tmxFile)
  743. deprecatedTip("CCTMXMapInfo:formatWithTMXFile","CCTMXMapInfo:create")
  744. return CCTMXMapInfo:create(tmxFile)
  745. end
  746. CCTMXMapInfo.formatWithTMXFile = CCTMXMapInfoDeprecated.formatWithTMXFile
  747. function CCTMXMapInfoDeprecated.formatWithXML(infoTable,tmxString,resourcePath)
  748. deprecatedTip("CCTMXMapInfo:formatWithXML","TMXMapInfo:createWithXML")
  749. return CCTMXMapInfo:createWithXML(tmxString,resourcePath)
  750. end
  751. CCTMXMapInfo.formatWithXML = CCTMXMapInfoDeprecated.formatWithXML
  752. --functions of CCTMXMapInfo will be deprecated end
  753. --functions of CCTMXObject will be deprecated begin
  754. local CCTMXObjectGroupDeprecated = { }
  755. function CCTMXObjectGroupDeprecated.propertyNamed(self,propertyName)
  756. deprecatedTip("CCTMXObjectGroup:propertyNamed","CCTMXObjectGroup:getProperty")
  757. return self:getProperty(propertyName)
  758. end
  759. CCTMXObjectGroup.propertyNamed = CCTMXObjectGroupDeprecated.propertyNamed
  760. function CCTMXObjectGroupDeprecated.objectNamed(self, objectName)
  761. deprecatedTip("CCTMXObjectGroup:objectNamed","CCTMXObjectGroup:getObject")
  762. return self:getObject(objectName)
  763. end
  764. CCTMXObjectGroup.objectNamed = CCTMXObjectGroupDeprecated.objectNamed
  765. --functions of CCTMXObject will be deprecated end
  766. --functions of CCRenderTexture will be deprecated begin
  767. local CCRenderTextureDeprecated = { }
  768. function CCRenderTextureDeprecated.newCCImage(self)
  769. deprecatedTip("CCRenderTexture:newCCImage","CCRenderTexture:newImage")
  770. return self:newImage()
  771. end
  772. CCRenderTexture.newCCImage = CCRenderTextureDeprecated.newCCImage
  773. --functions of CCRenderTexture will be deprecated end
  774. --functions of Sprite will be deprecated begin
  775. local CCSpriteDeprecated = { }
  776. function CCSpriteDeprecated.setFlipX(self,flag)
  777. deprecatedTip("CCSpriteDeprecated:setFlipX","CCSpriteDeprecated:setFlippedX")
  778. return self:setFlippedX(flag)
  779. end
  780. cc.Sprite.setFlipX = CCSpriteDeprecated.setFlipX
  781. function CCSpriteDeprecated.setFlipY(self,flag)
  782. deprecatedTip("CCSpriteDeprecated:setFlipY","CCSpriteDeprecated:setFlippedY")
  783. return self:setFlippedY(flag)
  784. end
  785. cc.Sprite.setFlipY = CCSpriteDeprecated.setFlipY
  786. --functions of Sprite will be deprecated end
  787. --functions of Layer will be deprecated begin
  788. local CCLayerDeprecated = {}
  789. function CCLayerDeprecated.setKeypadEnabled( self, enabled)
  790. return self:setKeyboardEnabled(enabled)
  791. end
  792. cc.Layer.setKeypadEnabled = CCLayerDeprecated.setKeypadEnabled
  793. function CCLayerDeprecated.isKeypadEnabled(self)
  794. return self:isKeyboardEnabled()
  795. end
  796. cc.Layer.isKeypadEnabled = CCLayerDeprecated.isKeypadEnabled
  797. --functions of Layer will be deprecated end
  798. --functions of cc.Node will be deprecated begin
  799. local NodeDeprecated = { }
  800. function NodeDeprecated.setZOrder(self,zOrder)
  801. deprecatedTip("cc.Node:setZOrder","cc.Node:setLocalZOrder")
  802. return self:setLocalZOrder(zOrder)
  803. end
  804. cc.Node.setZOrder = NodeDeprecated.setZOrder
  805. function NodeDeprecated.getZOrder(self)
  806. deprecatedTip("cc.Node:getZOrder","cc.Node:getLocalZOrder")
  807. return self:getLocalZOrder()
  808. end
  809. cc.Node.getZOrder = NodeDeprecated.getZOrder
  810. function NodeDeprecated.setVertexZ(self,vertexZ)
  811. deprecatedTip("cc.Node:setVertexZ", "cc.Node:setPositionZ")
  812. return self:setPositionZ(vertexZ)
  813. end
  814. cc.Node.setVertexZ = NodeDeprecated.setVertexZ
  815. function NodeDeprecated.getVertexZ(self)
  816. deprecatedTip("cc.Node:getVertexZ", "cc.Node:getPositionZ")
  817. return self:getPositionZ()
  818. end
  819. cc.Node.getVertexZ = NodeDeprecated.getVertexZ
  820. --functions of cc.Node will be deprecated end
  821. --functions of cc.GLProgram will be deprecated begin
  822. local GLProgram = { }
  823. function GLProgram.initWithVertexShaderByteArray(self,vShaderByteArray, fShaderByteArray)
  824. deprecatedTip("cc.GLProgram:initWithVertexShaderByteArray","cc.GLProgram:initWithByteArrays")
  825. return self:initWithByteArrays(vShaderByteArray, fShaderByteArray)
  826. end
  827. cc.GLProgram.initWithVertexShaderByteArray = GLProgram.initWithVertexShaderByteArray
  828. function GLProgram.initWithVertexShaderFilename(self,vShaderByteArray, fShaderByteArray)
  829. deprecatedTip("cc.GLProgram:initWithVertexShaderFilename","cc.GLProgram:initWithFilenames")
  830. return self:initWithFilenames(vShaderByteArray, fShaderByteArray)
  831. end
  832. cc.GLProgram.initWithVertexShaderFilename = GLProgram.initWithVertexShaderFilename
  833. function GLProgram.addAttribute(self, attributeName, index)
  834. deprecatedTip("cc.GLProgram:addAttribute","cc.GLProgram:bindAttribLocation")
  835. return self:bindAttribLocation(attributeName, index)
  836. end
  837. cc.GLProgram.addAttribute = GLProgram.addAttribute
  838. --functions of cc.GLProgram will be deprecated end