cocos2dx 3.0 b/rc Animation black border (Halo effect ) problem!

cocos2dx 3.0 b/rc Animation black border (Halo effect ) problem!
0.0 0


When loading animation exported by “Cocostudio” or simply when placing two sprites one in front the other with transparency (same size or not) it show some darker border as the attached image.

Was trying to change the “pixelFormat” but I can not find the way to do it.


Tested and not working:
Projection to 2D

error.png (18.3 KB)


it could be your sprite, did you try to reproduce it in photoshop?
can you provide your sprite file so we can test?


@Wuhao In “photoshop” there is no problem, also cocostudio (in animation and scene editors emulator) dose not have any artifact.

You can produce it (in cocos2d-x 3.0) by simply put these two sprite in the same position.
No Animation, but it cause the same problem.



I found the fix

try this line of code





@Wuhao Thanks again, but the problem persist.

And with “ALPHA_NON_PREMULTIPLIED” strange render comes.

Today I have tested the same “sprites” on cocos2d-x 2.4 and there is no problem, so I think its about the new render of 3.0x.


I just updated to 3.0 rc from the alpha version and the problem just appear also for me, while it works perfectly with the alpha version. Anyone has found a soultion?

See the attached images.


I just tested it also in the new 3.0 rc1 version, and the problem persist.

Please, can someone test it? it was working fine in the alpha version and it happens now in a new clean project simply adding an image.

I attach the image that I am using for test (and use a white background to see the problem).


@Wuhao By the way, using this is not solving the problem:

Looks like it is solved, but really it is adding a white border in the image.


It looks like is a problem loading the image, due from beta version them are loaded using the libpng library.
This not should be the solution, but I found a workaround exporting again the image and disabling the smooth from the illustrator export window (or photoshop).
If someone found another better solution please, share with us.


Yes, this is weird, that some program like photoshop, files are perfect, but illustrator, no matter what you do, the result is crap


It’s 3.3 and problem still persists. 2 images one on another made in cocos studio (v. 2.1). Images are perfectly fine. How to fix this?


I figured it out. It seems there’s a bug in cocos studio (I’m using 2.1 version) with sprite sheets. The case was I had image gap to 0px, which should work, but it didn’t. So I changed it to 1px and it’s all fine.


Can you create a bug for cocostudio
It’ll be great if you can provide some samples :slight_smile:


I cannot reproduce it on simple project. Looks like there must some solid conditions for this bug to occur.
I can only give you few screenshots:

Gap 0px:

Gap 1px:

I didn’t try this yet on windows. Cocos studio is really buggy on mac os, so it may work on windows.