"COCOS2D-JS Official documents" 21, V3 API changes relative to the V2 version

Source: Internet
Author: User

Ccaudio.js

SimpleAudioEngine.jsrenamed to CCAudio.js .

AudioEngineThe following methods are removed:

preloadMusicpreloadEffectisFormatSupportedpreloadSound

cc.AudioEngine.endIs 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  

addImageAsyncThe 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_SYSTEMinstead 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.