Quantcast
Channel: Cocos Forums - Latest topics
Viewing all 17112 articles
Browse latest View live

OpenGL error 0x0502 in CCRenderer.cpp and CCTextureAtlas.cpp

$
0
0

@SimonArchNox wrote:

Hey all
I’ve encountered the following issue when debugging my game on Android with the Emulator.
I get a black screen while the application actually running but nothing is displayed on screen. Funny thing, I do manage to see ads - interstitials.
I managed to found the following errors:

I/OpenGLRenderer: Davey! duration=1868ms; Flags=1, IntendedVsync=2695875256932, Vsync=2696125256922, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=2696141389100, AnimationStart=2696141457600, PerformTraversalsStart=2696141495900, DrawStart=2697411835000, SyncQueued=2697416715100, SyncStart=2697722473300, IssueDrawCommandsStart=2697725437800, SwapBuffers=2697929896100, FrameCompleted=2698049618100, DequeueBufferDuration=55777000, QueueBufferDuration=1216000,
D/Cocos2dxActivity: onWindowFocusChanged() hasFocus=true
I/FA-Ads: App measurement is starting up, version: 19025
To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
I/WebViewFactory: Loading com.android.chrome version 69.0.3497.100 (code 349710017)
I/m.reilak.dejav: The ClassLoaderContext is a special shared library.
I/FA-Ads: Tag Manager is not found and thus will not be used
D/cocos2d-x debug info: create rendererRecreatedListener for GLProgramState
I/chatty: uid=10086(com.reilak.myGameProject) GLThread 422 identical 1 line
D/cocos2d-x debug info: create rendererRecreatedListener for GLProgramState
D/eglCodecCommon: setVertexArrayObject: set vao to 2 (2) 0 0
setVertexArrayObject: set vao to 0 (0) 3 0
E/eglCodecCommon: removeVertexArrayObject: ERROR: cannot delete VAO 0!
D/eglCodecCommon: setVertexArrayObject: set vao to 3 (3) 0 0
setVertexArrayObject: set vao to 0 (0) 5 0
D/eglCodecCommon: setVertexArrayObject: set vao to 4 (4) 0 0
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 7 0
D/cocos2d-x debug info: OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCRenderer.cpp restoreRenderState 189
W/SoundPool: Use of stream types is deprecated for operations other than volume control
See the documentation of SoundPool() for what to use instead with android.media.AudioAttributes to qualify your playback use case
D/cocos2d-x debug info: OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
D/cocos2d-x debug info: OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCRenderer.cpp restoreRenderState 189
D/cocos2d-x debug info: OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
D/cocos2d-x debug info: OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCRenderer.cpp restoreRenderState 189
D/cocos2d-x debug info: OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
D/cocos2d-x debug info: OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCRenderer.cpp restoreRenderState 189
D/cocos2d-x debug info: OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
D/cocos2d-x debug info: OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
D/cocos2d-x debug info: OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCRenderer.cpp restoreRenderState 189
D/cocos2d-x debug info: OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCRenderer.cpp restoreRenderState 189
D/cocos2d-x debug info: OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
D/cocos2d-x debug info: OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 699
OpenGL error 0x0502 in D:\Projects\myGameProject\cocos2d\cocos\renderer\CCRenderer.cpp restoreRenderState 189

And it keeps going like that.
I found a topic that says this error (OpenGL error 0x0502) has been solved in cocos2dx 3.17 (Android emulator black screen), but I’m using 3.17.2 with PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86 and still get this issue for some reason.
Found a doc (https://drive.google.com/file/d/1ChY7c1xSnKmu_vTuEoseshHBzvivlVqB/view) that suggests to edit CCGLProgram.cpp, I did tried that but the issue still persists.

One thing to note is that the first error on the log is actually:

E/eglCodecCommon: removeVertexArrayObject: ERROR: cannot delete VAO 0!

And then we get to see the OpenGL error 0x0502 error in CCRenderer.cpp and CCTextureAtlas.cpp
Is this a new face of an old problem?

Posts: 1

Participants: 1

Read full topic


implement admob into a project

$
0
0

@samaharoke wrote:

I searched all the internet and all the information I could get was from 5 years ago and even when I try to follow their procedures it does not work because all of the download files from so long ago.please answer me as fast as you can.help

Posts: 1

Participants: 1

Read full topic

Creator 2.3 subpackage issue wechat dev tool?

Cocos2d-x v4 Tutorial Series - Sonar Systems

CC 2.3.3 screenshot of 3d objects

$
0
0

@FocusCreative wrote:

Hi folks!
I’m trying to make a screenshot share feature for my little 3d game made with Cocos Creator 2.3.3.
I’ve already implemented the feature and it works well on 2d objects but something weird happends on 3d setup.
How it works:
I create a render texture is onLoad function (inspired from 07_capture_texture in the example cases project)

this.Render_Texture = new cc.RenderTexture();
this.Render_Texture.initWithSize(cc.visibleRect.width, cc.visibleRect.height, RB_FMT_S8);

When user hit screenshot I change camera’s targetTexture for one frame:

this.Camera.targetTexture = this.Render_Texture; // let the camera to render one frame on the texture
this.scheduleOnce(function(){ 
    this.Capture_Screen_And_Share();
    this.Camera.targetTexture = null; // remove render target
}.bind(this),0);

This is the result. Only the last objects in node tree are visible:
Crowded_Streets_202041010282

I’ve changed render texture buffer format:

this.Render_Texture.initWithSize(cc.visibleRect.width, cc.visibleRect.height, cc.gfx.RB_FMT_D16);

This is the 2nd result:


As you can see this is much better but we have jagged edges on some objects. I think there is a depth buffer resolution problem.

This is the real screenshot of the game. I’m trying to get this result:

How can I solve it?

Posts: 1

Participants: 1

Read full topic

ScreenShot for Native build in cocos creator

Cocos Creator v2.3.3 released, now bundled in Cocos Dashboard!

$
0
0

@slackmoehrle wrote:

Cocos Creator v2.3.3 released, now using Cocos Dashboard!

Cocos Creator v2.3.3 is here! This update brings more new features, optimizes performance and improves stability. Efficiency is everything!

It is recommended for all v2.3 developers to upgrade! Please perform the necessary technical evaluation and backups before upgrading.

Yes, you use Dashboard now to Download and manage Cocos Creator

Visit, the Creator website for more details.

Downloads

Download Creator from within Dashboard

Cocos 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:

What’s New

Support PCF soft shadow

Starting from v2.3.3, the Light component can set the shadow type to SOFT_PCF3X3 or SOFT_PCF5X5 to turn on soft shadows. After opening, the shadow will not have hard edges, the effect is more soft and natural. Example:

Support zooming Sprite by 9-sliced SpriteFrame in TILED mode

Starting with v2.3.3, the image will be repeated to fit the size of the Sprite when using TILED mode. If the SpriteFrame is 9-sliced, the corners will also remain unscaled while the other areas will be repeated.

Improve web page loading speed during preview

In order to further improve development efficiency, we optimized the loading speed of scripts during web page preview in both the engine and in project code. When the custom engine feature is turned on, or when using a mobile phone to preview, developers get a really smoother experience.

Release Notes

Engine

  • [Core] Fix the problem that hidden nodes will not trigger touch events when touching with single touch [#6395]

  • [Core] Fix the problem that the AudioSource component setting Play On Load is invalid when the scene starts with Async Load Assets [#6412]

  • [Core] Fixed Spine resource rendering error if defaultSkin is not set [#6432]

  • [Core] Fix the warning when Label is empty when using BITMAP mode [#6315]

  • [Core] Fixed RichText unable to input single angle bracket text [#6314]

  • [Core] Fix the problem that the current time obtained by VideoPlayer on different platforms may be inconsistent [#6360]

  • [Tween] Tween adds stopAll, stopAllByTag, stopAllByTarget and other interfaces to facilitate playback control [#6338]

  • [Tween] Added bezierTo, bezierBy, flipX, flipY, blink interfaces [#6327]

  • [Tween] Optimized the intelligent hints of the API code of Tween.to and Tween.by, which can intelligently display the target attribute

  • [3D] Added Node.forward, Node.right, Node.up APIs to get all directions of nodes in the world coordinate system [#6287]

  • [3D] Fix the problem that the Sprite node may render incorrectly when switching 3D node settings [#2335]

  • [3D] Fix the issue that ROTATION_CHANGED event is not triggered when Node.eulerAngles changes [#6325]

  • [3D] Fix the incorrect rotation of cc.Rotate3DBy [#6377]

  • [3D] Fix the calculation error of vertex tangent conversion to world coordinate system in built-in Effect [#6358]

  • [3D] Fix the problem of data failure when the number of vertices set by Mesh exceeds the original number [#6359]

Native

  • Fix the problem that the native SocketIO may make a request error when the server is closed [#2338]

  • Fix the problem that the return value of jsb.fileUtils.listFilesRecursively is incorrect [#2337]

  • Fix the calculation error of cc.sys.getSafeAreaRect on Android devices [#2145]

  • Fix the problem of incorrect line-breaking effect after using emoji on native platform Label [#6353]

  • Fix the problem that the native platform Graphic cannot be drawn if there are too many vertices [#1935]

  • Fix the problem of getting wrong devicePixelRatio in the initialization stage of Windows and Mac platforms [#2309]

  • Fixed trailing material error when 3D particles did not open TrailModule on native platform [#6413]

Mini Game

  • Adapt to the numeric keyboard keys of PC WeChat games [#98]

  • Fixed an issue where the Baidu game VideoPlayer was hidden after entering text

  • Fix OPPO fast game Label text truncated at the top [#6441]

Web

  • Fix the problem that the EditBox input box is misaligned after screen resize [#6347]

  • Fix the problem that the mobile terminal keyboard does not respond to touch events when pulling up the status button [# 6337]

  • Fix the problem of incorrect interface adaptation after EditBox editing on UC browser of iOS [# 6471]

Editor

  • Support displaying the attributes information of the grid in the Properties Panel

  • Added case verification of require path in project script

  • Fixed the issue of block blocking when previewing particles in the editor

  • Fixed the issue that the component @menu decorator is invalid

  • Fixed an issue where the editor could not be opened after setting the language on Cocos Dashboard

  • Fixed an issue where a progress bar sometimes appears in the editor

  • Fixed an issue where clicking the 3D toggle button is invalid when selecting multiple nodes in the property panel

  • Fix the problem of error report when importing ccs project

  • Fixed an error when deleting 3D particle materials in the editor

  • Fixed an issue where rename animation clips and nodes is invalid when adding a recording animation editor

  • Fixed an issue where the animation editor reported an error when animating the camera backgroundColor

  • Fixed an issue where deleting a script after the script reported an error still failed to clear the console error

  • Fix the problem that the custom component menu is not sorted alphabetically

  • Fix the problem that the paste menu is invalid when no node is selected

  • Fixed the issue of material error after deleting texture attribute

  • Fixed an issue where the EditBox node reported an error after selecting the Reset All menu item in the properties panel

  • Fixed an issue where importing materials with the same name in the model would cause the import to fail

  • Fixed an issue where Prefab cannot automatically synchronize to the original Prefab when deleting child nodes after setting automatic synchronization

  • Fixed an issue where using the wrong custom engine would cause the editor to not start

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 < 2.3.3 version

  • The CCTexture2D and CCTexture2DRGB methods in the Effect have been abandoned.

  • Vec3.FRONT has been abandoned, please use Vec3.FORWARD instead.

Upgrade from < v2.3.0 version

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.

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 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.

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.

Posts: 2

Participants: 1

Read full topic

How to make playable ad??

$
0
0

@scarletor wrote:

Hello everyone!

I normally make facebook instant game, but today my boss ask me to make playable ad.

I’ve played some playable ad on android but i dont understand how to build it? And how to make redirect link to google play? I haven’t seen any tutorial about making playable ad by cocos creator or API or anything!!

If someone know about this please tell me, thank you!

Posts: 1

Participants: 1

Read full topic


ts-util-is not found. v2.3.3

Cocos Creator v2.3.3 released, now bundled in Cocos Dashboard!

$
0
0

@slackmoehrle wrote:

Cocos Creator v2.3.3 released, now using Cocos Dashboard!

Cocos Creator v2.3.3 is here! This update brings more new features, optimizes performance and improves stability. Efficiency is everything!

It is recommended for all v2.3 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

Note: Starting with Cocos Creator v2.4 using Dashboard will be required! There will no longer be a separate Cocos Creator installer provided. Please download and get acclimated with Dashboard soon.

Downloads

Dashboard for MacOS

Dashboard for Windows

Download Creator from Dashboard

Cocos 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:

What’s New

Support PCF soft shadow

Starting from v2.3.3, the Light component can set the shadow type to SOFT_PCF3X3 or SOFT_PCF5X5 to turn on soft shadows. After opening, the shadow will not have hard edges, the effect is more soft and natural. Example:

Support zooming Sprite by 9-sliced SpriteFrame in TILED mode

Starting with v2.3.3, the image will be repeated to fit the size of the Sprite when using TILED mode. If the SpriteFrame is 9-sliced, the corners will also remain unscaled while the other areas will be repeated.

Improve web page loading speed during preview

In order to further improve development efficiency, we optimized the loading speed of scripts during web page preview in both the engine and in project code. When the custom engine feature is turned on, or when using a mobile phone to preview, developers get a really smoother experience.

Release Notes

Engine

  • [Core] Fix the problem that hidden nodes will not trigger touch events when touching with single touch [#6395]

  • [Core] Fix the problem that the AudioSource component setting Play On Load is invalid when the scene starts with Async Load Assets [#6412]

  • [Core] Fixed Spine resource rendering error if defaultSkin is not set [#6432]

  • [Core] Fix the warning when Label is empty when using BITMAP mode [#6315]

  • [Core] Fixed RichText unable to input single angle bracket text [#6314]

  • [Core] Fix the problem that the current time obtained by VideoPlayer on different platforms may be inconsistent [#6360]

  • [Tween] Tween adds stopAll, stopAllByTag, stopAllByTarget and other interfaces to facilitate playback control [#6338]

  • [Tween] Added bezierTo, bezierBy, flipX, flipY, blink interfaces [#6327]

  • [Tween] Optimized the intelligent hints of the API code of Tween.to and Tween.by, which can intelligently display the target attribute

  • [3D] Added Node.forward, Node.right, Node.up APIs to get all directions of nodes in the world coordinate system [#6287]

  • [3D] Fix the problem that the Sprite node may render incorrectly when switching 3D node settings [#2335]

  • [3D] Fix the issue that ROTATION_CHANGED event is not triggered when Node.eulerAngles changes [#6325]

  • [3D] Fix the incorrect rotation of cc.Rotate3DBy [#6377]

  • [3D] Fix the calculation error of vertex tangent conversion to world coordinate system in built-in Effect [#6358]

  • [3D] Fix the problem of data failure when the number of vertices set by Mesh exceeds the original number [#6359]

Native

  • Fix the problem that the native SocketIO may make a request error when the server is closed [#2338]

  • Fix the problem that the return value of jsb.fileUtils.listFilesRecursively is incorrect [#2337]

  • Fix the calculation error of cc.sys.getSafeAreaRect on Android devices [#2145]

  • Fix the problem of incorrect line-breaking effect after using emoji on native platform Label [#6353]

  • Fix the problem that the native platform Graphic cannot be drawn if there are too many vertices [#1935]

  • Fix the problem of getting wrong devicePixelRatio in the initialization stage of Windows and Mac platforms [#2309]

  • Fixed trailing material error when 3D particles did not open TrailModule on native platform [#6413]

Mini Game

  • Adapt to the numeric keyboard keys of PC WeChat games [#98]

  • Fixed an issue where the Baidu game VideoPlayer was hidden after entering text

  • Fix OPPO fast game Label text truncated at the top [#6441]

Web

  • Fix the problem that the EditBox input box is misaligned after screen resize [#6347]

  • Fix the problem that the mobile terminal keyboard does not respond to touch events when pulling up the status button [# 6337]

  • Fix the problem of incorrect interface adaptation after EditBox editing on UC browser of iOS [# 6471]

Editor

  • Support displaying the attributes information of the grid in the Properties Panel

  • Added case verification of require path in project script

  • Fixed the issue of block blocking when previewing particles in the editor

  • Fixed the issue that the component @menu decorator is invalid

  • Fixed an issue where the editor could not be opened after setting the language on Cocos Dashboard

  • Fixed an issue where a progress bar sometimes appears in the editor

  • Fixed an issue where clicking the 3D toggle button is invalid when selecting multiple nodes in the property panel

  • Fix the problem of error report when importing ccs project

  • Fixed an error when deleting 3D particle materials in the editor

  • Fixed an issue where rename animation clips and nodes is invalid when adding a recording animation editor

  • Fixed an issue where the animation editor reported an error when animating the camera backgroundColor

  • Fixed an issue where deleting a script after the script reported an error still failed to clear the console error

  • Fix the problem that the custom component menu is not sorted alphabetically

  • Fix the problem that the paste menu is invalid when no node is selected

  • Fixed the issue of material error after deleting texture attribute

  • Fixed an issue where the EditBox node reported an error after selecting the Reset All menu item in the properties panel

  • Fixed an issue where importing materials with the same name in the model would cause the import to fail

  • Fixed an issue where Prefab cannot automatically synchronize to the original Prefab when deleting child nodes after setting automatic synchronization

  • Fixed an issue where using the wrong custom engine would cause the editor to not start

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 < 2.3.3 version

  • The CCTexture2D and CCTexture2DRGB methods in the Effect have been abandoned.

  • Vec3.FRONT has been abandoned, please use Vec3.FORWARD instead.

Upgrade from < v2.3.0 version

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.

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 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.

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.

Just in case

Note: If you prefer not to use Dashboard now, you may still download Cocos Creator v2.3.3 for MacOS and Windows. However, starting with Cocos Creator v2.4 using Dashboard will be required! There will no longer be a separate Cocos Creator installer provided. Please download and get acclimated with Dashboard soon.

Posts: 2

Participants: 1

Read full topic

Running Cocos games in native Java Android App

$
0
0

@CodeCrust wrote:

Hello,
So we have a Android social chat app sort of . And we are looking to add some js games like from cocos creator to the app to be played.

We want to add several games.
So should we like use Webview to open those js games?
is there some faster and more performant way for it.

Posts: 1

Participants: 1

Read full topic

How to use old JS project in Creator?

$
0
0

@jeevs wrote:

I have an old project in JS, it’s a card game. I used to code with Cocos Code back then. How can I use it with new Creator now?

Posts: 1

Participants: 1

Read full topic

Help, IAP (how use sdkbox)

$
0
0

@C_Stefano wrote:

@yinjimmy (hi)

Hi, we missing only a step to complete our project… the IAP.
So we could use sdkbox to integrate it, but we don’t know how sdkbox works on cococreator.

  1. where is the sdkbox_config.json file?
  2. we have wrote this file to use sdkbox, maybe rights?

cc.IAP = {

products: []

};

cc.Class({
extends: cc.Component,

properties: {

    onCallbackSuccessful: {

        default: [],
        type: [cc.Component.EventHandler],
        tooltip: 'Quando l\'acquisto va a buon fine'
    },

    onCallbackFailed: {

        default: [],
        type: [cc.Component.EventHandler],
        tooltip: 'Quando l\'acquisto fallisce'
    },
    
    onCallbackCancel: {

        default: [],
        type: [cc.Component.EventHandler],
        tooltip: 'Quando l\'acquisto viene cancellata la procedura'
    },

    onCallbackRestored: {

        default: [],
        type: [cc.Component.EventHandler],
        tooltip: 'Quando l\'acquisto viene ripristinato (quelli non consumabili)'
    },

    labelInfo: {
        default: null,
        type: cc.Label
    }

},

// LIFE-CYCLE CALLBACKS:

printProduct(p) {
    
    var id = p.name;

    this.log("======The product info======");
    this.log("GUMBALL name :=", p.name);
    this.log("GUMBALL title :=", p.title);
    this.log("GUMBALL description :=", p.description);
    this.log("GUMBALL price :=", p.price);
    this.log("GUMBALL priceValue :=", p.priceValue);
    this.log("GUMBALL currencyCode :=", p.currencyCode);
    this.log("GUMBALL receipt :=", p.receipt);
    this.log("GUMBALL receiptCipheredPayload :=", p.receiptCipheredPayload);
    this.log("GUMBALL transactionID :=", p.transactionID);
    this.log("");
},

onLoad () 
{
    this.bufferInfo = [];

    if(cc.Smallthing === undefined) {

        cc.Smallthing = {}; // ponte fra iOS-Android e Javascript
    }

    if(cc.Smallthing.IAP !== undefined) {
        this.node.destroy();
        return;
    }

    cc.Smallthing.IAP = this;

    cc.IAP.product = [];

    // inizializza iap
    if(typeof sdkbox === 'undefined') {

        this.log("GUMBALL FATAL ERROR, missing SDKBOX");
        return;
    }

    sdkbox.IAP.init();

    sdkbox.IAP.setDebug(cc.gameData.isIAPDEBUG);

    sdkbox.IAP.setListener({

        onSuccess : function (product) {

            //Purchase success
            cc.Smallthing.IAP.log("Purchase successful: " + product.name);

            // callback
            sdkbox.IAP.onSuccessful(product.name);

            sdkbox.IAP.printProduct(product);
        },

        onFailure : function (product, msg) {

            //Purchase failed
            //msg is the error message
            cc.Smallthing.IAP.log("Purchase failed: " + product.name + " error: " + msg);

            sdkbox.IAP.onCallbackFailed(product.name, msg);
        },

        onCanceled : function (product) {

            //Purchase was canceled by user
            cc.Smallthing.IAP.log("Purchase canceled: " + product.name);

            sdkbox.IAP.onCallbackCancel(product.name);
        },

        onRestored : function (product) {

            //Purchase restored
            cc.Smallthing.IAP.log("Restored: " + product.name);

            sdkbox.IAP.printProduct(product);

            sdkbox.IAP.onCallbackRestored(product.name);
        },

        // CALLBACK per la richiesta di prodotti
        onProductRequestSuccess : function (products) {

            //Returns you the data for all the iap products
            //You can get each item using following method
            cc.Smallthing.IAP.log("===========================");
            cc.Smallthing.IAP.log("========== IAP ============");
            cc.Smallthing.IAP.log("===========================");

            cc.IAP.products = [];

            for (var i = 0; i < products.length; i++) {

                cc.Smallthing.IAP.log("===========================");
                cc.Smallthing.IAP.log("name: " + products[i].name);
                cc.Smallthing.IAP.log("price: " + products[i].price);
                cc.Smallthing.IAP.log("priceValue: " + products[i].priceValue);
                cc.Smallthing.IAP.log("===========================");

                (function() {

                    cc.IAP.products.push(products[i]);
                }());
            }
        },

        onProductRequestFailure : function (msg) {

            //When product refresh request fails.
            cc.Smallthing.IAP.log("Failed to get products");
        },

        onShouldAddStorePayment: function(productId) {

            cc.Smallthing.IAP.log("onShouldAddStorePayment:" + productId);
            return true;
        },

        onFetchStorePromotionOrder : function (productIds, error) {

            cc.Smallthing.IAP.log("onFetchStorePromotionOrder:" + " " + " e:" + error);
        },

        onFetchStorePromotionVisibility : function (productId, visibility, error) {

            cc.Smallthing.IAP.log("onFetchStorePromotionVisibility:" + productId + " v:" + visibility + " e:" + error);
        },

        onUpdateStorePromotionOrder : function (error) {

            cc.Smallthing.IAP.log("onUpdateStorePromotionOrder:" + error);
        },

        onUpdateStorePromotionVisibility : function (error) {

            cc.Smallthing.IAP.log("onUpdateStorePromotionVisibility:" + error);
        },
    });
    
},

log(msg) {

    cc.log('GUNBALL ' + msg);

    if(cc.isValid(this.labelInfo)) {

        this.bufferInfo.splice(0, 0, msg);
    }
},

refresh() {

    if(typeof sdkbox === 'undefined' || sdkbox === null) 
    {
        this.log('SDKBOX MISSING');
        return;
    }

    sdkbox.IAP.refresh();
},

restore() {

    if(typeof sdkbox === 'undefined' || sdkbox === null) {
        this.log('SDKBOX MISSING');
        return;
    }

    sdkbox.IAP.restore();
},

purchaseBag1() {

    this.purchase('coin_bag_1');
},

purchaseBag2() {

    this.purchase('coin_bag_2');
},

purchaseBag3() {

    this.purchase('coin_bag_3');
},

purchaseBag4() {

    this.purchase('coin_bag_4');
},

purchaseBag5() {

    this.purchase('coin_bag_5');
},

purchase(id) {
    
    if(typeof sdkbox !== 'undefined') 
        sdkbox.IAP.purchase(id);
},

getProductInfo(id) {

    for(var i = 0; i < cc.IAP.products.length; i++) {
        var p = cc.IAP.products[i];
        if(p.name === id)
            return p;
    }

    return null;
 },

onSuccessful(id) {

    if(typeof sdkbox === 'undefined' || sdkbox === null) return;

    for(var i = 0; i < this.onCallbackSuccessful.length; i++) {

        this.onCallbackSuccessful[i].emit([id]);
    }

    if(cc.IAPCALLBACK !== null) {

        for(var i = 0; i < cc.IAPCALLBACK.onCallbackSuccessful.length; i++) {

            cc.IAPCALLBACK.onCallbackSuccessful[i].emit([id]);
        }
    }

    if(id === 'coin_bag_1') {
        this.log('IAP onSuccessful coin_bag_1');
    }
    else if(id === 'coin_bag_2') {
        this.log('IAP onSuccessful coin_bag_2');
    }
    else if(id === 'coin_bag_3') {
        this.log('IAP onSuccessful coin_bag_3');
    }
    else if(id === 'coin_bag_4') {
        this.log('IAP onSuccessful coin_bag_4');
    }
    else if(id === 'coin_bag_5') {
        this.log('IAP onSuccessful coin_bag_5');
    }                                
},

onFailed(id, msg) {

    for(var i = 0; i < this.onCallbackFailed.length; i++) {

        this.onCallbackFailed[i].emit([id, msg]);
    }

    if(cc.IAPCALLBACK !== null) {

        for(var i = 0; i < cc.IAPCALLBACK.onCallbackFailed.length; i++) {

            cc.IAPCALLBACK.onCallbackFailed[i].emit([id]);
        }
    }
},

onCancel(id) {

    for(var i = 0; i < this.onCallbackCancel.length; i++) {

        this.onCallbackCancel[i].emit([id]);
    }

    if(cc.IAPCALLBACK !== null) {

        for(var i = 0; i < cc.IAPCALLBACK.onCallbackCancel.length; i++) {

            cc.IAPCALLBACK.onCallbackCancel[i].emit([id]);
        }
    }         
},    

onRestored(id) {

    for(var i = 0; i < this.onCallbackRestored.length; i++) {

        this.onCallbackRestored[i].emit([id]);
    }

    if(cc.IAPCALLBACK !== null) {

        for(var i = 0; i < cc.IAPCALLBACK.onCallbackRestored.length; i++) {

            cc.IAPCALLBACK.onCallbackRestored[i].emit([id]);
        }
    }          
},    

update(dt) {

    if(cc.isValid(this.labelInfo)) {
        var s = '';
        var count = this.bufferInfo.length;
        if(count > 16)
            count = 16;
        for(var i = 0; i < count; i++) {
            s += this.bufferInfo[i] + '\n';
        }
        this.labelInfo.string = s;
    }
}

});

missing something? many thanks for help!

Stefano

Posts: 1

Participants: 1

Read full topic

Bug - Particle System

$
0
0

@hanthuyen8 wrote:

I find the Cocos creator particle system difficult to use. The following 3 things make me feel very annoying and I think these are bugs:

  1. The particle speed is not stable, sometimes very slow and sometimes very fast even though I have set the speed to 0.

  2. The particle’s color is not accurate, although I set it all to white (alpha: 255 for both start and end). But in the game the color is completely random.

  3. The color blend is hard to use, the effect displayed on the Editor is completely different on the web browser. Moreover, none of the settings render what I want. I just wanted it to display correctly, but completely failed.

  • If DST_ALPHA, the color is almost white.
  • If ONE_MINUS_SRC_ALPHA, I have attached the following picture.
  • For the remaining settings it draws tranparency to black or a random color. I do not understand their purpose to do?

This is the original image and I want it to display exactly like this:
particle 1

Here is the actual image:
Annotation 2020-04-11 193007 Annotation 2020-04-11 194213

Here is my setting:

Posts: 1

Participants: 1

Read full topic

Setting up an efficient scripting/debugging workflow using WebStorm

$
0
0

@cpp1073 wrote:

I can’t seem to get debugging working quite right, no matter what I try. Half the time I’m going off outdated articles translated from Chinese, as there’s so little official documentation available on IDE setup (at least that I can see). Getting a little frustrated and would really appreciate some help.

I’m frequently getting this page when I try to resume the script:

Sometimes WebStorm hangs for several minutes before launching the browser, and then usually gets stuck on the loading bar.

I’m also not able to step-into cocos library functions, although I had this working temporarily and must have broken it while trying to fix another issues.

I’d be very grateful for any up-to-date steps on settings things up correctly, thanks!

Posts: 1

Participants: 1

Read full topic


Effect/Material problems 2.3.3

$
0
0

@Zakhar wrote:

Hello everybody!

After migration to 2.3.3 i got problem with my shader effect.

In editor v2.2.2 my shader looks like this:

In web shader looks like this:

In editor v2.3.3 shader looks as in editor v2.2.2
But in web i got just black screen

My shader code:

void main () {
vec3 col = smoothstep(0.7, 0.1, distance(vec2(0.5), v_uv0)) * vec3(0.0, 0.3, 0.45);
gl_FragColor = vec4(col, 0.25);
}

Posts: 1

Participants: 1

Read full topic

Share app created

$
0
0

@pacear10 wrote:

Hello everyone after several months of working for the first time with Cocos Creator and several queries to the forum :slight_smile: I managed to finish the first app, is there a section where I can share it?

Posts: 3

Participants: 2

Read full topic

[Android] App to demonstrate mental agility

SdkBox IAP Processing a previous payment. ISSUE

$
0
0

@vkreal2 wrote:

Hi @yinjimmy can you please help us resolve the issue below Processing a previous payment.

We are using…

Latest Sdkbox IAP
Cocos2d-x 3.17.2

Thank you!

2020-04-12 18:49:36.619 9274-9332/? D/cocos2d-x debug info: ############ BEGIN IAP init ############
2020-04-12 18:49:36.621 9274-9332/? D/IAP: creating Products list:
2020-04-12 18:49:36.627 9274-9332/? I/IAP: AndroidManifest has no store metadata. Defaulting to ‘googleplay’
2020-04-12 18:49:36.627 9274-9332/? E/IAP: Can’t create IAP java object of type: ‘’.
2020-04-12 18:49:36.629 9274-9332/? D/cocos2d-x debug info: ############ END IAP ############
2020-04-12 18:49:36.629 9274-9332/? D/IAP: Refreshing products: ‘android.test.purchased,com.game.foobar.unlockall’
2020-04-12 19:06:19.444 11683-11740/? D/cocos2d-x debug info: ############ BEGIN IAP init ############
2020-04-12 19:06:19.446 11683-11740/? D/IAP: creating Products list:
2020-04-12 19:06:19.454 11683-11740/? I/IAP: AndroidManifest has no store metadata. Defaulting to ‘googleplay’
2020-04-12 19:06:19.454 11683-11740/? E/IAP: Can’t create IAP java object of type: ‘’.
2020-04-12 19:06:19.457 11683-11740/? D/cocos2d-x debug info: ############ END IAP ############
2020-04-12 19:06:19.457 11683-11740/? D/IAP: Refreshing products: ‘android.test.purchased,com.game.foobar.unlockall’
2020-04-12 19:06:24.852 11683-11740/? E/IAP: Processing a previous payment.
2020-04-12 19:06:25.395 11683-11740/? E/IAP: Processing a previous payment.
2020-04-12 19:06:25.591 11683-11740/? E/IAP: Processing a previous payment.
2020-04-12 19:19:24.881 11683-11740/? E/IAP: Processing a previous payment.

Posts: 1

Participants: 1

Read full topic

Hot Update problem on creator newer version

$
0
0

@SanichiTrix wrote:

Hi, I’m using cocos creator for developing android app, My app is about to finished but I’m stuck at the hot update thing, I read the documentation(a bit, and still didn’t understand how it works) and I downloaded the sample provided, the sample’s project is older than my current cocos creator version, 2.1.4.

I tried to run the sample’s project anyway and tried to use the Update button, but none of them are working because it local manifest doesn’t found(but there’s “project” manifest on asset folder and in the canvas, there’s Hot update script where the ManifestUrl is already assigned to project manifest)

can someone please help ? I’m confused how hot-update in this project works since there are md5 thing, and i’ve seen inside the project.manifest, what is packageUrl, is this the package we’re gonna download ? also what is Manifest for? I thought update is like just download a specific file then replacing the specific file at specific location/path.

Posts: 1

Participants: 1

Read full topic

Viewing all 17112 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>