Hi all. I am trying to render UI objects on the top of my 3d game. I thought I can use 2 cameras (one for UI and one for 3d world), but I don’t know why, 3d objects are above my UI objects:
1 post - 1 participant
Hi all. I am trying to render UI objects on the top of my 3d game. I thought I can use 2 cameras (one for UI and one for 3d world), but I don’t know why, 3d objects are above my UI objects:
1 post - 1 participant
when I migrated my project from 2.3.3 to 2.3.4 I started getting the following error endlessly:
TypeError: Cannot read property ‘effect’ of null
at addMeshToNode (/Applications/CocosCreator/Creator/2.3.4/CocosCreator.app/Contents/Resources/app.asar/editor/page/gizmos/utils/engine/2d.js:1:1591)
at Object.f.arrow (/Applications/CocosCreator/Creator/2.3.4/CocosCreator.app/Contents/Resources/app.asar/editor/page/gizmos/3d/elements/utils/controller-utils.js:1:573)
at module.exports.createAxis (/Applications/CocosCreator/Creator/2.3.4/CocosCreator.app/Contents/Resources/app.asar/editor/page/gizmos/3d/elements/controller/position-controller.js:1:657)
at module.exports.initShape (/Applications/CocosCreator/Creator/2.3.4/CocosCreator.app/Contents/Resources/app.asar/editor/page/gizmos/3d/elements/controller/position-controller.js:1:1268)
at new module.exports (/Applications/CocosCreator/Creator/2.3.4/CocosCreator.app/Contents/Resources/app.asar/editor/page/gizmos/3d/elements/controller/position-controller.js:1:619)
at module.exports.createController (/Applications/CocosCreator/Creator/2.3.4/CocosCreator.app/Contents/Resources/app.asar/editor/page/gizmos/3d/elements/transform/position-gizmo.js:1:552)
at module.exports.init (/Applications/CocosCreator/Creator/2.3.4/CocosCreator.app/Contents/Resources/app.asar/editor/page/gizmos/3d/elements/transform/position-gizmo.js:1:470)
at module.exports.init (/Applications/CocosCreator/Creator/2.3.4/CocosCreator.app/Contents/Resources/app.asar/editor/page/gizmos/2d/elements/transform/position-gizmo.js:1:372)
at module.exports.show (/Applications/CocosCreator/Creator/2.3.4/CocosCreator.app/Contents/Resources/app.asar/editor/page/gizmos/2d/elements/gizmo.js:1:4650)
at module.exports.update (/Applications/CocosCreator/Creator/2.3.4/CocosCreator.app/Contents/Resources/app.asar/editor/page/gizmos/2d/elements/gizmo.js:1:4263)
this error appears when I click on any ui element in the node tree. can someone please help?
thanks!
P.S. Does the above error have anything to do with the upgrade instructions:
Upgrade from < 2.3.3 version
- The
CCTexture2D
andCCTexture2DRGB
methods in the Effect have been abandoned.
I am using cc.Texture2D in my project.
1 post - 1 participant
Cocos Creator v2.4.0 is here! This update brings more new features, optimizes performance and improves stability. Efficiency is everything! This version contains many new features and updates, such as resource management system refactoring, asset bundles, optimized the performance of graphic rendering.
It is recommended for all v2.3.x developers to upgrade! Please perform the necessary technical evaluation and backups before upgrading.
Note: Yes, you use Dashboard now to Download and manage Cocos Creator
Download Creator from Dashboard
The Cocos Dashboard serves as a unified downloader and launch portal for Cocos Creator and Cocos Creator 3D engines. 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:
If the worker wants to do his best, he must first sharpen his weapon! After two months of testing, version 2.4.0 is finally here! Thanks to all the friends who gave us valuable comments and suggestions!
Asset Bundle can divide the resources in a project into modules according to the wishes of the developer, and divide the resources with different needs in different scenarios into multiple packages. This reduces the time required to download and load a game for the first time, and can also be copied across projects.
Asset Bundle also provides priority, compression type and other related settings to optimize the package and loading of the Asset Bundle.
For additional details, please refer to the Asset Bundle documentation and the Load Asset Bundle documentation.
cc.AssetManager
module for resource managementAsset Manager is newly introduced in Cocos Creator v2.4. It has the function to load resources, find resources, destroy resources, cache resources, asset bundles and so on. Asset Manager has better performance, easier-to-use APIs, and stronger scalability. It mainly provides the following new features:
Supports loading and pre-loading of all resources, pre-loading can run silently in a lighter way, without affecting operation efficiency.
Supports Asset Bundles.
Supports a more secure automatic release mechanism, no need to consider its reference when releasing resources, to avoid mistaken release of resources.
Support download failure retry, download priority, download concurrent number and other settings, which can be adjusted according to various situations.
Support more convenient custom loading process to achieve special effects.
For details, please refer to the Asset Manager documentation and the Dynamic Loading documentation.
Supports setting Label’s belnding options, and different settings in different usage scenarios can be used to maximize text rendering performance. For details, please refer to the Blending Mode of System Fonts documentation.
Increased Label initialization speed, Android increased by about 5 times, iOS increased by 3 times
Support bold, outline, shadow and other effects when using TTF
font and Char
mode
Using SDF technology to optimize Graphic’s aliasing problem:
The editor further supports the compression texture limitation of more mini game platforms. Just add the compressed texture format in the Mini Game item to set the compression of multiple platforms including WeChat mini games, OPPO mini games, Vivo mini games, etc.
Cocos Creator v2.4 further improves the native hot update capability and optimize the following:
Add interface to get update package size
Add MD5 parameter to the link, more friendly to CDN
Solve the problem of resource loss and confusion caused by interruption of the update process
Please see this GitHub issue.
For details, please refer to the Hot Update Sample Tutorial.
This component will adapt the layout of the node where it is located to the safe area of the mobile phone with a special screen. It can be adapted to Android and iOS devices. For details, refer to the SafeArea Component documentation.
Add compressed texture cache function, cache the compressed texture after construction, and reuse the cache content as much as possible to speed up the construction speed
Use ImageBitmap
to load images on the Web platform, improve the preview and Web platform image resolution speed, and reduce the stutter during loading
Editor property panel supports drag and drop array assignment
Upgrade TypeScript version to 3.9.2
Upgrade the V8 version of the native platform to 8.0.426.16
Support importing GLTF resources
Support the first scene subcontracting function on all small game platforms
Support module culling during preview, improve preview speed, and expose module culling settings earlier
Optimize the performance of free and relative modes of 2D particle system [#6236]
Optimize the efficiency of ToggleContainer
to get toggleItems
[#6569]
Increase the bandwidth of the native platform WebSocket [#2353]
SpriteFrame
resource adds a None
trim type, which can be quickly set to no crop.
Improve the code hints of jsb
Support setting preview port
The window size can be set when the native desktop platform is built
[CORE] Fixed the issue that the return value of cc.easeBackOut
is incorrect when time is 0, [#6728], (thank you chen-gaoyuan)
[CORE] Fixed the issue of Node.walk
traversal error [#6710]
[CORE] Fixed the error of calling cc.dynamicAtlasManager.showDebug
[#6697]
[CORE] Fixed the issue of setting node size
in onLoad is invalid [#6688]
[CORE] Fixed the issue of resetting the background material back to the default material when the button is disabled [#6562]
[CORE] Fixed error when BMFont configuration data does not exist [#6472]
[CORE] Fixed the issue of invalid transparency after pre-multiplication is enabled [#6451]
[CORE] Fixed the issue of Camera.render()
rendering twice, [#6355], (thank you Dacheng Xiaofa)
[CORE] Fixed the issue of picture flip after calling Texture2D.setPremultiplyAlpha
[#6602]
[PARTICLE] Fixed the 2d particle system relative mode, the particle follows the problem when the node rotates [#6236]
[3D] Fixed the problem that 3D Label is not displayed in char mode [#6882]
[3D] Fixed the problem of rendering error caused by checking the option Enable Auto Batch
and switching Mesh resources [#6901]
[3D] Fixed the problem of rendering the shadow of a single camera misaligned [#6477]
[3D] Fixed the issue of cc_matProj
error in effect [#6653]
[EDITBOX] Fixed the issue that the EditBox.maxLength attribute does not take effect in number mode [#6725]
[EDITBOX] Fixed the issue that the EditBox could not update the position when scrolling in ScrollView [#6634]
[TILEDMAP] Fixed the possible rendering order of Tiled Map may be wrong [#6284]
[TILEDMAP] Fixed the problem that the hidden image of Tiled Map will still be rendered [#6309]
[SPINE] Fixed Spine texture rendering error after using compressed texture [#6483]
[SPINE] Fixed the issue that Spine texture may render incorrectly [#6584]
[SPINE] Fixed the issue that DragonBone and Spine render incorrectly after the texture is set to pre-multiplied [#6696], (thanks Dacheng Xiaofa).
[DRAGONBONE] Fixed the issue that DragonBone keeps reporting errors when destroying scenes [#6553]
Fixed the problem of incorrect node scaling after screen flip [#6689]
Fix Android native JniHelper
is not thread safe [#2457]
Fix the issue that unzip
is not thread safe [#2131], (thanks benloong)
Fix the problem that the Edit button of Android EditBox is blocked by the virtual navigation bar [#2426]
Fix the problem that Spine node can not get the node size on iOS [#273]
Fix the issue of cc_time
error in native Effect [#6586]
Fix the possible crash of iOS audio playback [#2358]
Fix the problem of node rotation calculation error [#2361]
Fixed the crash caused by encoding error when setting Label.string
[#2395]
Fixed an error when the game exited [#2406]
Fix the problem that the input box will push up the view after the screen is rotated [#2415]
Fix the problem that the path animation in the JSON file exported by Spine 3.6.53 failed to parse [#2413], (thanks to laomoi)
Fix the problem of gravity sensor error on Android [#2231]
Fix Tiled Map will not be rendered when the node moves to a location without plot information [#2283]
Fix the problem that the original WebSocket interface is inconsistent with the Web [#2297]
Fixed an issue where calling Camera’s render method would cause Spine to speed up playback [#258]
Fixed an issue where the AudioSource module was removed due to the removal of the AudioSource module on the Android platform
Fix Android 9, Android 10 version number detection failure [#6466]
Fix the issue that audio cannot be played after removing the headset from iOS Web-Mobile [#6730]
Fix WebView
transparency error on iOS [#6717]
Fix the problem that English can no longer be input after entering Chinese on iOS browser [#6631]
Fixed the issue that the WeChat mini game WebSocket sends an error report of Uint8Array
[#115]
Fixed the issue that playback cannot be resumed automatically when audio is interrupted unexpectedly [#118]
Fix the problem that PC WeChat data open domain cannot run
Fix the problem of incorrect save and restore status of Sprite Editor
Fixed an issue where animation clips that are not being edited cannot be renamed in animation editing state
Fixed an issue where the editor could not recognize after adding Spine resources
Fixed the issue that the editor may not open after the user plug-in restarts
Fixed an issue where the return value of getNativeAssetPaths
was called multiple times incorrectly
Fix the problem that the script fails to load after the script is renamed
Fixed an issue where width and height will be reported incorrectly when clicking on the gallery
Fixed the issue that the picture may be distorted when using Auto Atlas
Fixed an issue where importing some pictures caused the resource panel error
Fixed the problem that the node cannot be deleted by delete key in Prefab edit mode
Fixed an issue where Filter Unused Resources was not valid when the atlas was not exported
Fix the problem that the value range of the macro defined in the effect is invalid [#6616]
Fixed an issue where the animation editor setting CircleCollider.offset
attribute is abnormal [#6600]
Fix the problem that the last save is invalid
Fixed the issue of invalid setting preview browser
Fix the problem of error report when importing Cocos Studio project without font resources
Fixed an issue where multiple openings may cause editor errors
cc.assetManager.postLoadNative
to load and play.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.
cc.loader
is no longer recommended, please use the latest cc.assetManager
instead, 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
The cc.RawAsset
that was deprecated since 1.10 has been officially removed, please use cc.Asset
instead. 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.fromHex
is deprecated, please use cc.Color.fromHEX
interface
The CCTexture2D
and CCTexture2DRGB
methods in the Effect have been abandoned.
Vec3.FRONT
has been abandoned, please use Vec3.FORWARD
instead.
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
and libs
directories under the proj.android-studio
root directory, respectively.
proj.android-studio
under the root directory jni/CocosAndroid.mk
, jni/CocosApplication.mk
, mainly used to configure engine-related configuration, developer configuration, it is recommended that Android be placed in app/jni/Android.mk
and app/jni/Application.mk
, Android Instant, please put in game/jni/Android.mk
and game/jni/Application.mk
.
When Cocos Creator compiles for Android, it will execute assembleRelease/Debug
by default, and when compiling for Android Instant, it will execute instant: assembleRelease/Debug
.
In addition, when Cocos Creator compiles for Android, it will execute assembleRelease/Debug
by default, and when compiling Android Instant, it will execute in``stant:assembleRelease/Debug
.
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 cc.audioEngine.pause()
and 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.
// 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();
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.
1 post - 1 participant
Hi .
I’m Using Cocos Creator, But When I Want To Make A New Project This Error Will Appear :
“Invalid Project Path, Can Only Contains Alphanumeric Characters, - And _”
I First Used My Location For The Projects , Than Tried With The Default Location But Noting Happened .
Please Help Me .
What Should I Do ?!
2 posts - 2 participants
Keeping your gamers on your game is a big discussion as GaaS (Games as a service) begins to grow. But how do I do that? Ted Verani of wappier shares some ideas in our blog on how to improve retention as well as what their company can do to help you with your game.
1 post - 1 participant
So I have recently been learning cc.tween in Cocos Creator, and they have been easy to use, and work great overall. One issue I’ve ran into is I can’t seem to find a way to adjust them on the fly in the editor. For example, say I have a tween where one line of code is, .to(5, {rotation: 1080}, {easing: ‘quadOut’}), and it works as expected. The object rotates three times over five seconds. What I can’t do is something like this, .to(timer, {spins * 360}, {easing: ‘quadOut’}), where you can control the time and the amount of spins in the editor as much as you need, instead of going in and changing the code each time.
I am going through some documentation, and it’s possible I’ve missed it, so any help would be greatly appreciated.
3 posts - 2 participants
Steps to reproduce:
1.) Sign out of your apple ID on a simulator
2.) Sign in on an apple ID
3.) Do not set up game center yet.
4.) Open a game that uses game center through SDKBOXPlay
5.) Tap ‘Sign Out’ on the game center popup.
6.) Confirm.
7.) App Crashes
As described above: There is a specific popup of the game center popup which allows the user to select ‘continue’ or ‘sign out’. This only happens once on a device if they launch a game before game center is set up. If they sign out in this pop up, SDKBOXPlay crashes.
The line of code:
#17 0x00000001079eb306 in __31-[SdkboxPlayGCDelegate signin:]_block_invoke at /Volumes/extend/jenkins/sdkbox/release/plugins/sdkboxplay/proj.ios/PluginSdkboxPlay/SdkboxPlayGCDelegate.mm:182
Version of sdkboxPlay: v2.6.0.1 (Also happened on older version)
1 post - 1 participant
Hi fellows Cocos developer,
Do you guys encounter this? What’s the counter for? Do you know how to stop it or disable it?
1 post - 1 participant
[I just solved this, but leaving it here in case it’ll help anyone else] I realized that I didn’t actually call FileUtils::getInstance()->setWritablePath(my_path), I was just using my path. Now everything is working great!
I just realized that I’m having a serious problem with this function. I have an in-game editor that worked great last year, but this year I’ve changed my writablePath to use a folder under the Documents folder. This makes it so much easier for the users than using appdata/local.
However, now the RenderTexture::saveToDisk is still writing to the appdata/local subfolder, which means it’s broken for me. I’ll see if there’s a way to copy the image to the actual working folder after I create it (tricky, since it’s asynchronous).
Surely there’s a better solution? I don’t understand why I can’t give an absolute path to saveToDisk, nor why it’s ignoring my actual working directory.
thanks,
Dogwalker
1 post - 1 participant
Hi,
I have integrated AbMob using SDKBox extension in Cocos Creator v2.3.4. While running the iOS build i am getting the following error.
Assertion failed: (isObject()), function toObject, file /Volumes/MyFiles/Cocos-Projects/RummyPlugins/build/jsb-default/frameworks/cocos2d-x/cocos/scripting/js-bindings/jswrapper/Value.cpp, line 539.
Also, I have integrated the same in Cocos Creator v2.0.9 and it’s working fine.
Kindly help me out in fixing the problem.
Thanks.
2 posts - 2 participants
Hi,
I’m trying to port my old GL shader program to V.4. The doc says:
Create a backend::ProgramState object with
ProgramState(const std::string& vertexShader, const std::string& fragmentShader)
Well, I’m stuck here. I don’t seem to have this constructor. I tried to have a look around cocos to spy how it’s done, but I’ve had no luck in finding examples of loading shaders from files.
What do I do? I must be missing something obvious!
Edit: Should I subclass Program?
Also:
Metal uses MSL as the shader development language. To support the OpenGL ES shader running on the Metal framework, V4 uses glsl-optimizer to convert the OpenGL ES shader to a Metal MSL shader.
Does this mean that my GL shaders will automatically be adapted to Metal without me having to rewrite them?
3 posts - 2 participants
Hi,
In the example cases of physics in cocos creator , on the varying restitution scene i have changed the gravity scale from 1 to 9 of center body with restitution of 0.5.
This results in it falling first obviously but upon landing it starts to wobble with the floor.
The video of this can be found at :
https://drive.google.com/file/d/1Gg2CCzmgffAa0n8I-S8tdTQEaSMlTpcH/view?usp=sharing
Can you help me out to resolve this effect , as i need increased gravity on a body with high restitution but it should eventually stop not keep on wobbling like this.
2 posts - 2 participants
I would like to know whether there is a way to make an .aar file in android studio and then call its code from cocos creator . I looked into reflections but that is not my requirement. also, I need to call non-static native android and native iOS methods and don’t know how to do that.
Also, how can I pass the context of the cocos activity to the custom plugin(if one can be made)?
does someone have a solution?
1 post - 1 participant
Hello everyone! I already posted about Munchie Match before and that it was made in cocos2dx and works on multiple platforms: Munchie Match (New Unique Match 3 Puzzle Game) [iOS/Android/Windows/MacOS/Apple Watch/Apple Tv]
But just wanted to provide you with this information about it:
MUNCHIE MATCH 1.2 BIG UPDATE FOR JUNE 23 2020
-The game is now more aesthetically pleasing.
-Added classic arcade mode. Destroy a set amount of monsters per level with old school restrictions, emulating the retro feel of tile matching games and making you think differently.
-Added Local Multiplayer. You can now play with a friend on the same keyboard, with two controllers or online with Steam’s Remote Play Together feature. Choose between 3 difference modes: arcade, classic arcade or the campaign for Co-Op play.
-You can now start from any arcade level that you want.
-Added Linux support.
-Upgraded cocos2dx v3.15.x to v4 for Metal support on Mac.
-Bug fixing.
All available here : https://store.steampowered.com/app/1046210/Munchie_Match/
Thank you all!
1 post - 1 participant
where can i learn about cocos2d js using chipmunk, i saw the links of galantegames but they are all down
1 post - 1 participant
i want to run a git project i download.
i tried cocos compile but i am etting
Can’t find config file .cocos-project.json
3 posts - 2 participants
In case anyone needs to debug graphic issues:
https://github.com/baldurk/renderdoc
Excerpt from the info page:
RenderDoc is a frame-capture based graphics debugger, currently available for Vulkan, D3D11, D3D12, OpenGL, and OpenGL ES development on Windows 7 - 10, Linux, Android, Stadia, and Nintendo Switch™. It is completely open-source under the MIT license.
Similar to nVidia Nsight Graphics, but RenderDoc is probably more useful given you can use any GPU, and it works on more platforms (like Android and Nintendo Switch).
1 post - 1 participant
i ran this game before but suddenly i am getting this error
2 posts - 2 participants