Ccaudio.js
SimpleAudioEngine.js
renamed to CCAudio.js
.
AudioEngine
The following methods are removed:
preloadMusicpreloadEffectisFormatSupportedpreloadSound
cc.AudioEngine.end
Is moved to the instance, not as a static method of the class.
Cc.texturecache
Several of the following APIs have been removed:
cc.loadimgcc.loadimage.handlercc.computeimageformattype
addImageAsync
The method was merged into the addImage
middle.
Cctgalib.js
Removed cc.tgaLoad
.
Cc. Texture2d
change:
Cc. texture_2d_pixel_format_rgba8888---CC. Texture2D.PIXEL_FORMAT_RGBA8888cc.TEXTURE_2D_PIXEL_FORMAT_RGB888---CC. Texture2D.PIXEL_FORMAT_RGB888cc.TEXTURE_2D_PIXEL_FORMAT_RGB565---CC. Texture2D.PIXEL_FORMAT_RGB565cc.TEXTURE_2D_PIXEL_FORMAT_A8---CC. Texture2D.PIXEL_FORMAT_A8cc.TEXTURE_2D_PIXEL_FORMAT_I8---CC. TEXTURE2D.PIXEL_FORMAT_I8CC.TEXTURE_2D_PIXEL_FORMAT_AI88---CC. Texture2D.PIXEL_FORMAT_AI88cc.TEXTURE_2D_PIXEL_FORMAT_RGBA4444---CC. Texture2D.PIXEL_FORMAT_RGBA4444cc.TEXTURE_2D_PIXEL_FORMAT_RGB5A1---CC. Texture2D.PIXEL_FORMAT_RGB5A1cc.TEXTURE_2D_PIXEL_FORMAT_PVRTC4---CC. Texture2D.PIXEL_FORMAT_PVRTC4cc.TEXTURE_2D_PIXEL_FORMAT_PVRTC2---CC. Texture2D.PIXEL_FORMAT_PVRTC2cc.TEXTURE_2D_PIXEL_FORMAT_DEFAULT---CC. Texture2D.PIXEL_FORMAT_DEFAULTcc.Texture2D.setDefaultAlphaPixelFormat (FORMAT)--CC. Texture2d.defaultpixelformat = FORMATCC. Texture2d.getdefaultalphapixelformat () -CC. Texture2D.defaultPixelFormatcc.Texture2D.defaultAlphaPixelFormat ()---CC. Texture2d.defaultpixelformat
Cc. Scheduler
cc.PRIORITY_SYSTEM
instead cc.Scheduler.PRIORITY_SYSTEM
.
Array manipulation functions
Some of these functions change the beginning of the name to lowercase, and some discard the function directly with the array.
cc.ArrayVerifyType --> cc.arrayVerifyTypecc.ArrayRemoveObject --> cc.arrayRemoveObjectcc.ArrayRemoveArray ---> cc.arrayRemoveArraycc.ArrayAppendObjectsToIndex --> cc.arrayAppendObjectsToIndexcc.ArrayRemoveObjectAtIndex(arr, index) --> arr.splice(index, 1)cc.ArrayGetIndexOfValue(arr, value) --> arr.indexOf(value)cc.ArrayAppendObject(arr, addObj) --> arr.push(addObj)cc.ArrayAppendObjectToIndex(arr, addObj, index) --> arr.splice(index, 0, addObj)cc.ArrayGetIndexOfObject(arr, findObj) --> arr.indexOf(findObj)cc.ArrayContainsObject(arr, findObj) --> arr.indexOf(findObj) != -1remove cc.HASH_FIND_INT
A common method or object becomes a private method or object:
Cc.setup--cc._setupcc.initdebugsetting-Cc._initdebugsettingcc.canvas --Cc._canvascc.drawingutil--Cc._drawingutilcc.rendercontext-Cc._renderconte Xtcc.gamediv--Cc._gamedivcc.setcontextmenuenable-Cc._setcontextmenuenablecc.rendercontex Ttype--Cc._rendertypecc.canvas-Cc._render_type_canvascc.webgl--& Gt Cc._render_type_canvascc.mainrendercontextbackup---cc._mainrendercontextbackupcc.rectfromstring and CC. Spriteframecache._rectfromstringcc.pointfromstring-Cc.spriteframecache._pointfromstringcc.sizefromstring -Cc.spriteframecache._sizefromstring
Constant
Delete:
cc.IS_SHOW_DEBUG_ON_PAGEcc.COCOS2D_DEBUG
Other
Modify
cc.dumpConfig ---> cc.sys.dump
Delete:
cc.isAddedHiddenEventcc.originalCanvasSize
New:
cc.BuilderReader.registerController
reprinted from:http://www.cocos2dx.net/post/247
Cocos2d-js Official documents 21, V3 API changes relative to V2 version