Cocos Creator v2.3.1 Released!
Cocos Creator v2.3.1 is officially released. v2.3.1 is a a bug fix release that aims to fix defects and improve stability. It is recommended that all developers upgrade! Please perform the necessary technical evaluation and backups before upgrading.
Downloads
Improvements
- Adapted for WeChat PC game [#87]
- Further optimize engine package size on mini-games and web platforms
- Improve API documentation and
creator.d.ts
declaration - Added support for TiledMap Object layer Top-Down and Manual rendering order and horizontal and vertical flip (thanks @大城小胖) [#6157]
- Support using Backspace button to delete nodes in the scene
- Lock built-in resources to avoid misuse
- Disable
evalString
calls in native non-JS threads to avoid V8 crashes
Editor
- Fixed the issue that npm module cannot be used after upgrading to 2.3.0
- Fixed an issue where VS Code could not break after upgrading to 2.3.0
- After upgrading to 2.3.0, it may cause the script to depend on the cycle and an “TypeError: Object prototype may only be an Object or null” error occurs.
- Fixed the problem that plugin path may be wrong when building only scripts on Windows platform (thanks to shengyong)
- Fixed the problem of incomplete node display after importing some models (thanks C_Tsang)
- Fixed the issue that Spine binary files cannot be uploaded on WeChat mini games
- Fixed the issue that the signing certificate generated by Xiaomi to the default path will be deleted during the build
Engine
- [Core] Optimize the initialization process when dynamically creating Label nodes [#6173]
- [Core] Fixed the problem that dynamically modifying the material in Prefab will cause other same materials to be changed [#6201]
- [Core] Fix the rendering level problem that may be caused by repeatedly setting zIndex repeatedly (thanks @大城小胖) [#6227]
- [Core] Fixed the issue that the EditBox input box was misplaced after the CanWidth component was checked for fitWidth [#6233]
- [Core] Fix RichText’s modification and typographical errors when active is false [#6231]
- [Core] Fix the first Burst display of 3D particles is incorrect. [#6269]
- [Native] Fix the error caused by destroying Mask in event callback [#6186]
- [Native] Fixed the problem of invalid material switching technology (thanks inkfood.com) [#250]
- [Native] Fix incorrect width and height obtained after window size change [#249]
- [Native] Fix the problem that the widget is not updated after the window size is changed [#6224]
- [Native] Fix JS native debugging cannot use Performance and Profiler [#2186]
- [Native] Fix Editbox clicking soft keyboard to collapse triangle, did not trigger edit completion event
- [Native] Fix memory leak when restarting the game [#2215]
- [Native] Fix the problem that the Android audio module will prevent the device from entering the power saving mode after entering the background [#2137]
- [Native] Fix window adaptive problem when split screen in Android [#2142]
- [Native] Fix window size error after Windows platform restart [#2129]
- [HTML] Fixed the problem that audio cannot be played when safari returns to the game from the background [#6198]
- [Mini game] Fix the problem that Audio is not destroyed [#6221]
Known issues
- An error can occur when importing a Cocos Studio project in v2.3.1. This issue will be fixed in v2.3.2. Developers can temporarily import projects in the old version editor if needed, and then upgrade to v2.3.1 for use.
Upgrade Tips
Upgrading a project from a previous version of Cocos Creator is irreversible. Please backup the old version of the project before upgrading.
Projects under development can usually be upgraded seamlessly, but because of the uniqueness of each project, developers should conduct a technical evaluation based on their project’s own needs. If developers encounter difficulties in upgrading, please feel free to give us feedback and we will try our best to assist. In addition, due to stability considerations, it is recommended that projects that are about to be launched or already launched be upgraded with caution.
Upgrade from < v2.3.0 version
If an “Can not find module.module for path…” loading warning occurs:
After upgrading to 2.3, this warning may be due to the stricter case detection of the
import/require
paths in the script. In the old version, if the case of the path does not match the actual file, there may be some potential errors which may not be manifested. We recommend that projects experiencing this issue correct the capitalizations.
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/src
directory, and the third-party library used by itself, please put it in theapp/libs
directory.If the code and third-party libraries used by Android Instant are separate, please put them in the
game/src
,game/libs
directories.For code and third-party libraries shared by Android and Android Instant, please place them in the
src
andlibs
directories under theproj.android-studio
root directory, respectively.
proj.android-studio
under the root directoryjni/CocosAndroid.mk
,jni/CocosApplication.mk
, mainly used to configure engine-related configuration, developer configuration, it is recommended that Android be placed inapp/jni/Android.mk
andapp/jni/Application.mk
, Android Instant Please put ingame/jni/Android.mk
andgame/jni/Application.mk
.When Cocos Creator compiles Android, it will execute
assembleRelease/Debug
by default, and when compiling Android Instant, it will executeinstant: assembleRelease/Debug
.
Upgrade from version v2.0 - v2.3.0
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)
Upgrade from < v2.2.0
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 throughdestroy()
, 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.
Upgrade from <v2.0
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.