Cocos Creator v1.4.0 beta releases(02.07 updated rc.2)

I can confirm this as a bug of loader, the url stored in cache have been modified, it will be fixed in the next release. Thanks ~

Great, thanks :slight_smile:

If it is possible I would like at least a comment on my other post on whether the things are going to be fixed or not, so that I can know if I have to wait for a next release, or try to find a workaround myself.

For that problem, please give a sample to @owen, he is the owner of UI module, and he did asked for a test sample :wink:

Sorry, since his reply was to the post with messed up textures (which was fixed in beta.5) I thought that nobody had replied to the other post. I’ll try to make a minimal project to showcase the issues and upload it :slight_smile:

Here is a minimal project illustrating the issues outlined here

GuiIssues.zip (177.7 KB)

thanks, I will take a look at all the issues you list above later.

Hi, Sliced sprite can not fullfil your requirement, given that the border will keep the exact size. Scale is needed here.

Yes, but in my opinion there are several cases of a sliced sprite - you can have 9, 6, 4, 3 or 2 zones (1 zone is plain scaling). When you have 9 zones, you have all the components to fill out a node, without the need to scale a texture, but what if there are 3 zones?

In my example for the progress bar there are 3 zones and there are 2 options - use slicing, or use scaling. If I use scaling, if the progress bar node has a different width/height ratio than the texture, the image will be very distorted, but if slicing is done correctly here is what it could do:

If the 3 zones are along horizontal and the height of the node is different from the height of the texture - downsample or upsample the texture along with the slice coordinates to match the height of the node. Then apply the left border on the left, the right border on the right and fill out the middle with the middle zone. This way everything will get scaled proportionately and even if the node has a different width/height ratio, it will not look distorted as the borders are scaled proportionately and the middle is filled with the middle zone which is meant for that. The same logic applies to 3 vertical zones and texture width.

scrollbar and mask issue will be fixed in the next release. The sliced sprite issue you could discuss with @dabingnn, he is the owner. :smile:

To modify the slicing coordinates in runtime is not possible at the moment, or requires totally rework of the scale9sprite class.

I guess you could implement a solution yourself if necessary, here’s the outline.

  • Create a component that extends cc.Sprite
  • During initialization, get the spriteFrame and it’s trimmed texture size (origW, origH)
  • when size changed, check if the size (newW, newH) is below the trimmed texture size in any dimension, if so invent a result size and calculate it like following:
//assume newH < origH 
resultW = origH/newH * newW;
resultH = origH;
resultScale = origH/newH;
this.node.width = resultW;
this.node.height = resultH;
this.node.scale = resultScale;

This workaround has limitation, for example the node size will no longer represents the real size of the node anymore and may affect layout and widget. But we will see if it works with your project. You can also implement your own cc.Sprite class and totally changed the behavior of size and scale if needed.

Thank you all for the support you offer.

@owen Great, will be looking forward to the next release

@nantas2 Thank you for the explanation and sample code, it seems like the issue is indeed deeply rooted in the code and can’t be fixed easily. If I come up with a code solution I will definitely share it, so that others can use it as well, otherwise it seems that the next best thing might be for me to have separate textures for each possible size depending on the design resolution of the scene and hope that the problem doesn’t occur when the scaling is between the design resolution and real resolution and not the texture and design resolution.

Hello again

It seems like either my code is faulty, or I have an affinity for finding bugs :smiley:

I’ve made a screen for inviting facebook friends. In order to show the user profile images, I use the cc.loader.load method on demand when scrolling through the list, so that network traffic is used only when needed. However if I scroll too quickly through the list, sometimes the app crashes and this is a part of the last lines in the logcat:

01-05 11:59:18.425 29189-30175/org.cocos2d.GameTemplate W/art: Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[196,tid=30175,Native,Thread*=0xb979e858,peer=0x12d5f9a0,"Thread-60754"]
01-05 11:59:18.425 29189-30175/org.cocos2d.GameTemplate D/JniHelper: JniHelper::getJavaVM(), pthread_self() = -1180386000
01-05 11:59:18.440 29189-30182/org.cocos2d.GameTemplate W/art: Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[200,tid=30182,Native,Thread*=0xb99f4ec0,peer=0x12e800a0,"Thread-60759"]
01-05 11:59:18.440 29189-30182/org.cocos2d.GameTemplate D/JniHelper: JniHelper::getJavaVM(), pthread_self() = -1183773744
01-05 11:59:18.443 29189-30179/org.cocos2d.GameTemplate W/art: Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[197,tid=30179,Native,Thread*=0xb9719eb0,peer=0x12e730a0,"Thread-60757"]
01-05 11:59:18.443 29189-30179/org.cocos2d.GameTemplate D/JniHelper: JniHelper::getJavaVM(), pthread_self() = -1186646928
01-05 11:59:18.444 29189-30184/org.cocos2d.GameTemplate W/art: Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[202,tid=30184,Native,Thread*=0xb99b0cd0,peer=0x12e8d100,"Thread-60760"]
01-05 11:59:18.444 29189-30184/org.cocos2d.GameTemplate D/JniHelper: JniHelper::getJavaVM(), pthread_self() = -1183900376
01-05 11:59:18.444 29189-30183/org.cocos2d.GameTemplate W/art: Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[201,tid=30183,Native,Thread*=0xb9a54220,peer=0x12e910a0,"Thread-60761"]
01-05 11:59:18.444 29189-30183/org.cocos2d.GameTemplate D/JniHelper: JniHelper::getJavaVM(), pthread_self() = -1183793408
01-05 11:59:18.454 29189-30186/org.cocos2d.GameTemplate W/art: Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[194,tid=30186,Native,Thread*=0xb979e858,peer=0x12e2c6a0,"Thread-60763"]
01-05 11:59:18.454 29189-30186/org.cocos2d.GameTemplate D/JniHelper: JniHelper::getJavaVM(), pthread_self() = -1180905168
01-05 11:59:18.454 29189-30185/org.cocos2d.GameTemplate W/art: Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[203,tid=30185,Native,Thread*=0xb99cd868,peer=0x12d5fee0,"Thread-60762"]
01-05 11:59:18.454 29189-30185/org.cocos2d.GameTemplate D/JniHelper: JniHelper::getJavaVM(), pthread_self() = -1180128256
01-05 11:59:20.160 21094-21141/? I/Finsky: [60197] com.google.android.finsky.d.g.run(1151): Replicating app states via AMAS.
01-05 11:59:20.376 21094-21141/? I/Finsky: [60197] com.google.android.finsky.d.e.a(313): Completed 0 account content syncs with 0 successful.
01-05 11:59:20.377 21094-21094/? I/Finsky: [1] com.google.android.finsky.services.j.a(148): Installation state replication succeeded.
01-05 11:59:20.531 29189-29199/org.cocos2d.GameTemplate W/art: Suspending all threads took: 7.782ms
01-05 11:59:20.534 29189-29189/org.cocos2d.GameTemplate D/Cocos2dxDownloader: onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@3e651668
01-05 11:59:20.534 29189-29189/org.cocos2d.GameTemplate D/Cocos2dxDownloader: onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@1a4e6a81
01-05 11:59:20.534 29189-29189/org.cocos2d.GameTemplate D/Cocos2dxDownloader: onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@389cd726
01-05 11:59:20.535 29189-29189/org.cocos2d.GameTemplate D/Cocos2dxDownloader: onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@31b95f67
01-05 11:59:20.535 29189-29189/org.cocos2d.GameTemplate D/Cocos2dxDownloader: onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@17a93114
01-05 11:59:20.535 29189-29189/org.cocos2d.GameTemplate D/Cocos2dxDownloader: onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@29762dbd
01-05 11:59:20.535 29189-29189/org.cocos2d.GameTemplate D/Cocos2dxDownloader: onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@66f3fb2
01-05 11:59:20.682 561-644/? D/WifiService: Client connection lost with reason: 4
01-05 11:59:20.682 561-4504/? I/WindowState: WIN DEATH: Window{16c441c7 u0 org.cocos2d.GameTemplate/org.cocos2dx.javascript.AppActivity}
01-05 11:59:20.682 561-683/? D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=1108, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ], android.os.BinderProxy@27259c41)
01-05 11:59:20.682 561-4504/? W/WindowManager: Force-removing child win Window{3c82ad8c u0 SurfaceView} from container Window{16c441c7 u0 org.cocos2d.GameTemplate/org.cocos2dx.javascript.AppActivity}
01-05 11:59:20.683 561-683/? D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=1113, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ], android.os.BinderProxy@3be585e6)
01-05 11:59:20.683 561-925/? D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=1109, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ], android.os.BinderProxy@256a4727)
01-05 11:59:20.683 561-645/? D/ConnectivityService: releasing NetworkRequest NetworkRequest [ id=1108, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.683 561-683/? D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=1114, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ], android.os.BinderProxy@3f185dd4)
01-05 11:59:20.683 561-925/? D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=1115, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ], android.os.BinderProxy@2feebb7d)
01-05 11:59:20.683 561-683/? D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=1110, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ], android.os.BinderProxy@25741a72)
01-05 11:59:20.683 561-683/? D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=1111, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ], android.os.BinderProxy@38aa2ec3)
01-05 11:59:20.683 561-925/? D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=1112, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ], android.os.BinderProxy@28878340)
01-05 11:59:20.684 561-645/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=1108, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.684 561-645/? D/ConnectivityService: releasing NetworkRequest NetworkRequest [ id=1113, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.685 561-645/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=1113, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.685 561-645/? D/ConnectivityService: releasing NetworkRequest NetworkRequest [ id=1109, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.685 561-645/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=1109, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.686 561-645/? D/ConnectivityService: releasing NetworkRequest NetworkRequest [ id=1114, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.686 561-645/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=1114, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.686 561-645/? D/ConnectivityService: releasing NetworkRequest NetworkRequest [ id=1115, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.687 561-645/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=1115, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.687 561-645/? D/ConnectivityService: releasing NetworkRequest NetworkRequest [ id=1110, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.688 561-645/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=1110, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.688 561-645/? D/ConnectivityService: releasing NetworkRequest NetworkRequest [ id=1111, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.689 561-645/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=1111, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.689 561-645/? D/ConnectivityService: releasing NetworkRequest NetworkRequest [ id=1112, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.689 561-645/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=1112, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
01-05 11:59:20.692 561-576/? W/WindowManager: Failed looking up window
                                              java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@2381a2bf does not exist
                                                  at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8539)
                                                  at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8530)
                                                  at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1142)
                                                  at android.os.BinderProxy.sendDeathNotice(Binder.java:551)
01-05 11:59:20.692 561-576/? I/WindowState: WIN DEATH: null
01-05 11:59:20.772 204-204/? I/Zygote: Process 29189 exited due to signal (11)

Could it be that there is some sort of pooling or error on your side of the code when requests are rapidly sent, so that this crash occurs and if so, can you look into the issue? I think I read in some changelog that some pooling has been done or a limit has been set on the requests, but I guess this would mean that the images will be loaded slower as they are loaded in smaller batches. Otherwise I am open to suggestions on limiting or enqueueing the requests on my side if you think that this can’t be fixed in your code.

Just to clarify again, the app doesn’t always crash, so this is most likely something that is related to more network requests being sent as the user scrolls faster.

beta.9 updated on 01.11.17

I get a white page with the following:

{“status”:406,“msg”:"\u4f1a\u8bdd\u4e0d\u5b58\u5728\u6216\u5df2\u8fc7\u671f",“data”:""}

Best regards,
Zsolt

is there any english Documentation for Cocos Creator v1.4.0-beta.9?

I found a bug in Cocos Creator. It does exist in 1.3.3 and 1.4.0 beta releases as well. Using the built-in Simulator the following code does not call EVENT_HIDE, it always calls the EVENT_SHOW:

    cc.game.on(cc.game.EVENT_HIDE, function () {
        cc.log("Hide");
    });    
    
    cc.game.on(cc.game.EVENT_SHOW, function () {
        cc.log("Show");
    }); 

Please fix it.

Best regards,
Zsolt

Have you tested it on iOS or Android?

Hi @owen,

I tested it on Android and it works fine. It also works on Chrome broswer.

Best regards,
Zsolt

Hi team,

when I close Cocos Creator and have forgotten to save, I get the “Save Scene Confirm” window.

Now when I just close the window or press Cancel, I would expect to continue in the Cocos Creator editor. But the editor closes and my changes are lost. :frowning:

Can someone take a look please.

Thanks

Michael

Hi Team,
I have got memory leaks issue when using cocos creator 1.4 beta 9.

I created 2 scene called Scene1, Scene2, Scene3 and some individual prefabs in prefabs folder. I drag and drop those prefabs into Scene2, add some node into Scene3 directly using Create => Create xxx on “Node tree”. Then I do 2 case step by step and monitor cc_Node object count:

Case 1:

  1. Run Scene1 first
  2. From Scene1 goto Scene2
  3. From Scene2 go back to Scene1

Case 2:

  1. Run Scene1 first
  2. From Scene1 goto Scene3
  3. From Scene3 go back to Scene1

Result:

  • Case 1 => all cc_Node created in Scene2 NOT release when go back to to Scene 1
  • Case 2 => all cc._Node in Scene 3 was released

But when I try to do 2 way below, When do Case 1 all cc_Node will be released:

  1. Remove cc_PrefabInfo (json object refer to asset in prefabs folder) in xxx.fire file and reload Cocos Creator
  2. After drag and drop all prefabs into Scene2, I remove all prefabs in prefabs folder.

I can’t do those way because many prefabs I reuse on some Scene.
Please fix this issue?

Thanks,

(I’m using Chrome browser & Chrome developer profile to monitor cc_Node object in memory)