SKSpriteNode Texture Black Box - ios

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.

Related

Camera Overlay Image Is squished on iPad

So it seems that because of the menu bar on the right hand side of the gui, the overlay I'm adding is being squished. The image I'm getting from the artist is a square, but once the overlay is applied inside the camera it is no longer square. What do I have to do to get the image to be applied for the whole screen, or what must I do to get the square to appear as a square in my app? Any ideas about how to get over this problem would be appreciated. Thanks.
Sincerely,
Sean
I thought this was an Xcode issue, but it turns out I was subtracting 100 from the width because of a problem I was previously solving. Sorry for wasting your time on this one- the problem was in my code.

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.

How to select a triangle in XNA?

I have a triangle with a transparent background (png image) I want its color to change when selecting it.
The point is that the color should change only when touching the non-transparent part of the image.
This should be working when the image is scaled..
Any ideas please?
Thanks...
Since you do not know the exact size/shape of the triangle, you'll need to use Per-Pixel collision detection. The App Hub has a tutorial for that. It even works with scaled/rotated objects.
Hope it helps!

Prob when rotating an uiimageview

When I am working with uiimageview, I want to rotate it with a small angle, and I did. But, in the border of uiimageview after rotating appears spikes, like a saw. I do not know why and try to fix it but I cant. Please help me.
Couple of options..
1) If you are using Core Graphics functions to rotate you can enable anti alias options
CGContextSetAllowsAntialiasing(context, true);
CGContextSetShouldAntialias(context, true);
2) Add a 1 pixel transparent border to the your image on all 4 sides.
One more thing, there is a technical term to the spikes you saw and it is aliasing. And the techniques to prevent aliasing are called anti aliasing techniques. Hope this helps.
Thanks all you guys :) My friend showed me another way to fix it. I think this way is better than using transparent border trick. He changed an attribute in info plist file, that is "Renders with edge antialisasing", to YES. And everything becomes okay :). I hope it will help someone get a same prob with me :)
Take a UIView as subView and Place UIImageView on subView.
Keep the size of subView and UIImageView Same.
Now, Use "UIViewAnimationTransitionFlipFromRight" or "UIViewAnimationTransitionFlipFromLeft" with Timer.
What you can do easily is to add a 1px transparent border around your image. So if your image is, let's say, 50x50 pixels you need to make it 52x52 such that the outer pixels are transparent. When you will rotate it should look fine now.

CCSprite has weird white pixels around the border

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

Resources