Cocos Creator v2.4.8 focused on fixing some 2.x related problems recently discovered, focusing on improving the editor’s experience and the stability of the engine. It is recommended that all 2.x users upgrade. This version has not broken the compatibility of projects and plugins, please refer to the upgrade instructions of 2.4.7 to update.
We will continue to deliver critical bug fixes in 2022, as planned at the time of the 3.0 general release. These fixes will only be optimized around stability and usability, so it is no longer recommended for new users or new projects to choose 2.4, please use the 3.x version for development.
- Adapt to Xcode 13 [#72]
Fixed an issue where the cursor would not be automatically restored after clicking the middle mouse button in the scene panel on Windows.
Fixed a calculation error when the parent node’s Scale is 0 when moving the node hierarchy in the editor.
Fixed the problem that when naming nodes in the hierarchy manager, the behavior of selecting text with the mouse would change to dragging nodes.
Fixed an issue where the number of resources doubled when searching for resources when the resource manager panel was popped up and then embedded in the main window.
Fixed the error caused by exiting after setting the Active of the node where the Sprite or RichText is located to False when editing animations.
Fixed the problem that the preview script may fail to compile when the number of project scripts is very large (does not affect the build result).
Fix compilation failure caused by setting Android API to 31 [#4147].
Allow receiving touch events on the PC web platform for listening to Touch events on some touch-enabled PCs [#9898].
Fix the problem that there is only one hidden child node under ScrollView, which may cause stack overflow [#9914].
Fix the problem that the scene does not refresh when editing LabelShadow color [#9909].
Twenn.stopAllByTagonly stop the animation of the first matching tag [#9902].
Fix the problem that WebSocket messages are truncated [#3789].
Fix the problem that the Android JNI call may cause the game to crash [#4147].
Fix the issue that calling
Skeleton.setSkeletonDatacauses Node’s click event not to trigger [#366].
As Cocos Creator 3.0 version has been officially released, v2.4.x will be used as the LTS (long-term support) version, providing continuous updates for the next two years! In 2021, 2.4 will continue to be updated to provide bug fixes and new mini-game platform support to ensure the successful launch of your project; in 2022, we will continue to provide developers with the key to 2.4 Bug fixes to ensure the smooth operation of online games! therefore:
Existing 2.x projects can continue to develop without compulsory upgrade to 3.0.
For new projects, it is recommended to use version 3.0 for development. We will continue to optimize the development experience and operating efficiency of 3.0 to support the smooth launch of heavy games of different categories such as 2D and 3D.
Upgrading a project from a previous version of Cocos Creator is irreversible. Please backup the old version of the project before upgrading.
Most projects can usually be upgraded automatically, but because the project is inevitably unique, developers should try and evaluate the new version of the engine in advance according to the needs of the project. In addition, due to stability considerations, it is recommended that projects that are about to go online or already online should be carefully upgraded. The following is the upgrade instructions. If developers encounter difficulties during the upgrade, please give us feedback and we will try our best to assist.
cc.loaderis no longer recommended, please use the latest
cc.assetManagerinstead, please refer to the Resource Management Module Upgrade Guide
The sub-package function has been upgraded to Asset Bundle, please refer to the Resource Subcontract Upgrade Guide
Adjusted the directory structure after the project is built and adjusted the API of
BuildResults. If you use the editor plug-in to get the editor’s build results, please refer to Customized Project Build Process Upgrade Guide
cc.RawAssetthat was deprecated since 1.10 has been officially removed, please use
cc.Assetinstead. Since 2.4 is no longer compatible with the legacy usage of the RawAsset type in the original 1.x project, it is recommended that all projects to be upgraded to 2.4, especially those upgraded from version 1.9, be edited in any 1.10 ~ 2.3 version. All warnings or errors output when the compiler compiles the code are processed correctly, and then upgraded to 2.4.
cc.Color.fromHexis deprecated, please use
CCTexture2DRGBmethods in the Effect have been abandoned.
Vec3.FRONThas been abandoned, please use
Since v2.3.0, Android and Android Instant use the same build template, please note:
If the code is used solely by the Android platform, please put it in the
app/srcdirectory, and the third-party library used by itself, please put it in the
If the code and third-party libraries used by Android Instant are separate, please put them in the
For code and third-party libraries shared by Android and Android Instant, please place them in the
libsdirectories under the
proj.android-studioroot directory, respectively.
proj.android-studiounder the root directory
jni/CocosApplication.mk, mainly used to configure engine-related configuration, developer configuration, it is recommended that Android be placed in
app/jni/Application.mk, Android Instant, please put in
When Cocos Creator compiles for Android, it will execute
assembleRelease/Debugby default, and when compiling for Android Instant, it will execute
In addition, when Cocos Creator compiles for Android, it will execute
assembleRelease/Debug by default, and when compiling Android Instant, it will execute in
If you have customized the pause logic when switching between audio background and background, please remove it after upgrading to 2.3.0 Currently Cocos Creator games automatically pause and resume audio internally when switching between front and back on all platforms. If the developer has customized this block before, and listens for and performs audio operations like
resume(), it may conflict with the engine’s default behavior. If you encounter related audio issues, simply remove the corresponding custom code.
Starting from 2.3.0, the Canvas component is no longer responsible for setting the Canvas node size to the screen size. This behavior will be implemented in conjunction with the Widget component. To ensure compatibility, after the 2.0 project is upgraded, the node where Canvas is located will automatically add Widget components. (No problem upgrading from a 1.0 project)
Starting from 2.2.0, we have strengthened the memory management mechanism, and now require users to dynamically create
cc.Node which is independent of the scene node tree through code must be released through
destroy(), otherwise the engine cannot know when to recycle this type The memory of the node will cause a memory leak.
- In addition, the nodes that are manually removed from the scene need to be unified when they are not needed.
// Assuming testNode is a node in the scene, if it was manually // removed from the scene before, such as testNode.parent = null; // or testNode.removeFromParent(true); // or parentNode.removeChild(testNode); // If testNode will be used again in the future, there is no need to // manually destroy the node otherwise it should be called manually testNode.destroy();
- If a node is managed via
cc.NodePool, it is not affected.
If you open the 1.x project, all resources such as scenes will be upgraded automatically. If there are warnings or errors in the code, you can refer to v1.10.0 Resource Upgrade Guide and the v2.0.0 Upgrade Documentation.
The Cocos Dashboard serves as a unified downloader and launch portal for Cocos Creator. Everyone can upgrade and manage multiple versions of Cocos Creator. In addition, unified project management and a creation panel is integrated, which is convenient for everyone to develop projects with different versions of engines at the same time.
Manage projects developed under different versions:
You can choose to use a different version of Cocos Creator when creating a new project: