CCSprite has weird white pixels around the border - ios

I'm facing a weird problem in cocos2d for my iPhone game. I have created a PNG file as below
In cocos2d, I use CCSpriteSheet to get each ball all of the with PNG file. It works well until then.
However, the weird thing is that on the iPhone's screen, the ball has weird white pixels around the border, as shown in the below screenshot
I have done so many researches on the web. But every suggestion like using TexturePacker or reset the glBlendFunc didn't work :(
Do you have any idea?
Update: I try to used normal CCSprite with separate PNG file of only one ball, the problem is still! I guess that I have to configure the cocos2d sourcecode some how to get it worked.

I have figured out the issue. Not because of the graphic itself. It's because of the box2d create an outline for the b2Fixture on the back of the CCSprite. Here I posted a question for that specific question!
http://www.cocos2d-iphone.org/forum/topic/25368?replies=1#post-132008

Related

SKSpriteNode Texture Black Box

For some reason when I use certain SKSpriteNode textures, they appear as black boxes in the app. For example in my game scene in Xcode I see:
But in the actual app I see:
Does anyone know why this happens, or how to fix it? Any help is greatly appreciated. Thanks!
I found the issue. Even though the picture size after manually changing the size was fine, the original picture size was too big. I fixed the issue by simply resizing the original image.

Sprite edge cut off on right side

I'm making a game using Cocos2D and my sprites are kept in a TexturePacker sprite sheet. A couple of days ago I realized that nearly all of my sprites are missing a column of one to two pixels off their right side. The sprite png files and the texturepacker file display the sprites correctly, but ingame they look sliced. It looks like the sprite image itself is offcenter of its textureRect. This doesn't seem to happen with all the sprites, but I'm noticing it with enough of them that it may be.
So far I've tried messing around with TexturePacker settings but nothing is fixing it. Any ideas?

Xcode SpriteKit Designer Clear Background Red X

I'm not sure what the issue is, but I'm trying to design a level in Apple's Sprite Kit editor, and I'm running into a problem with SKSpriteNodes that have a transparent background. Sometimes the background doesn't appear as clear. Instead, SpriteKit seems to load a Red X as a background image.
Naturally, I can't have this. Also, it's a problem because I really should be doing all of the level design in the editor instead of manually adding sprites in my Scene code.
Has anyone come across this problem? Could it be a bug in SpriteKit Designer? (There are a number of issues I've had with it since starting to use the tool).
Here is a photo of what it looks like:
I found a kinda hacky way to solve it. Basically, as uchuugaka said, the Red X appears when Sprite Kit fails to load a texture. If you want a clear background, you have to load a clear png file as the background of the sprite. There is no "No Texture" option currently available in the Sprite Kit designer.
Take these steps.
1.) Open any .png file with some transparency in it.
2.) Copy an arbitrary rectangular section of pixels.
3.) Create a new file with said arbitrary pixels.
4.) Save this file as your "clear.png" and import it into your project.
5.) Click on the sprite node with the Big Red X so you can see its setting. Take a screenshot of its position, size, etc. using preview. These settings will get erased when you swap the texture over to clear.png
6.) Swap the texture to clear.png
7.) Re-enter the sprite settings from your screenshot.
8.) Because SpriteKit Editor is currently horribly terribly flawed (see post above), you will need to reset your sprite's physics properites. Set the physics body to none. Then set it to bounding box or circle or alpha mask or whatever you had earlier.
9.) I hope you remembered your collision mask, category mask, and other physics body properties because they just got reset to the default. Re-enter what you had earlier or you will get a very unexpected result.

openGLES 2.0 - Cocos2d, showing white where alpha is reduced

Ok, hey guys. This is the first time I've had to ask a question myself, since I can't seem to find what I'm looking for anywhere.
I'm using Cocos2D and CCDrawingPrimitives to draw points with a fade.
It was working perfectly. Now, instead of going transparent, the points just get more and more white. I didn't change anything in the code either so it's annoying. Anyway I'm seeing the same issue within other areas of my app as well. When I want transparency I get a blend of the original colour over pure white.
I've tried alot of different blend combinations etc.
I have kind of fixed the problem by fading the brightness of the colour as I lower the alpha. but it was much better before since on anything other than white the reducing brightness is a bit noticeable...
Any help is appreciated. Thank you.

UIBezierPath from image

I have several png files that look similar to this this:
Everything is transparent but the black path. What I am trying to do is create a UIBezierPath from the non transparent part.
Edit:
So I was thinking what about creating a mask with the png then from the mask go to a UIBezierPath. Would that work?
Edit Again:
I found the solution, look at my answer.
I went a different direction. Instead of using PNGs I went with SVG and used PocketSVG to parse the file. It works great.
The process you're looking for is known as skeletonization, there's a good summary of techniques in this post:
Determine the midline of a bent, elongated region

Resources