CCSprite showing weird debug? - cocos2d-iphone

Has anyone seen this before?
Sprite is an animation created in SpriteBuilder (1.4.9) which is loaded onto the screen and positioned in code.
myFoodAnim = (CCSprite*)[CCBReader load:#"foodAnim64"];
Occasionally I get text overlayed as in the pictures below. This only seems to be happening on older 32bit iphone 5, ipad2 and ipad mini. Not on iphone 5s,6,6+
Image1
Image2

Related

A strange frame rate with actions on retina iPad only

Using actions with cocos2d v2.0 it works perfect on all iPhones and regular iPad. but when testing the same code only on iPad retina simulator ,when the button is a x2 bigger, so all actions (scale,move etc) are seems like they missing some pixels in their movement( for example a moving sprite is go 1 -3 -5 instead of 1-2-3-4-5 , seems like low frame rate or jump pixels)
There is no memory issue, its just a simple page with simple action :
id action=[CCScaleTo actionWithDuration:0.5 scaleX:0.95 scaleY:1.1];
id action1=[CCScaleTo actionWithDuration:0.5 scaleX:1 scaleY:1 ];
id seqb=[CCSequence actions:action,action1, nil];
id forever=[CCRepeatForever actionWithAction:seqb];
[play runAction:forever];
Why is it happens only in the retina display? does actions are not have the resolution for iPad retina -so they jumping on pixels ?
Do i have to enable the retina somewhere ? (it does get the -ipadhd image as retina and resize it)
EDIT EDIT
I have read that :
Slows down the iPad retina simulator 6.0
and could see that maybe the mac processor is not handle that .
Well thats strange , i have the new macbook retina ,it has a strong processor, and i am sure more than an iPad, so how is that true that iPad can handle it but not the mac ?
ignore the simulator, test on an actual device.
Note that the ipad retina simulator is really slow which is likely causing this issue.

Cocos2d-x high DesignResolution and iOS simulator display bug

I'm currently building a game with cocos2dx 3.0 alpha0 in c++. At the moment I'm building for iOS.
I tried to set the "DesignResolution" at 1280 by 1920 (Which is double the iPhone 4 resolution) so I can have the graphics look good on iPad retina. Everything works fine on the devices but when I try to run it on the iPhone and iPad simulator I get three quarters of the screen rendered black. This happens whether it's iPhone, iPad or iPad retina simulator. When I tried to reduce the DesignResolution to 640 by 960 it shows fine on the simulator.
Does anyone have any information on this issue? How can I fix this rendering issue on the simulator?

TexturePacker and Cocos2d iPhone - blurry sprites

I'm using TexturePacker to generate sprite sheets. I have images sized perfectly for retina iPhone, I'm using AutoSD feature in TexturePacker to pack them to sprite.png and sprite-hd.png. Both png files look sharp. When I test my game in retina emulator it looks crisp, everything's fine. However when I run 480x320 iPhone in emulator and my regular sprite.png loads - sprites look blurry.
When I manually resized all my individual sprite files and created a sprite sheet from them using TexturePacker it looked fine too.
I was hoping TexturePacker would save me some time doing things manually, and I can't understand why my sprites look blurry. Please help.

Issue with size of CCsprites

im testing my game on iphone5 simulator
i have background sprite with 1136*640 pixels size image
if i set my background with,
background1.anchorPoint=CGPointZero;
background1.position=ccp(0,0);
cocos2d magnifies that image.
if i set my background with,
background1.anchorPoint=CGPointZero;
background1.position=ccp(0,0);
background1.scale=0.5;
image fits screen, which is perfect. but if i do so then i get wrong background.contentSize , is that magnification of sprite stoppable?
i'v also set [director enableRetinaDisplay:NO];
It's probably because you haven't named the sprite with the -widehd extension. Like: background-widehd.png OR -iphone5hd depending on your version of cocos2d. If you targeting retina displays you should:
[director enableRetinaDisplay:YES]

How to load the loading scene background in cocos2d without blanking out?

I have a cocos2d game that has a loading scene where we load a bunch of assets. The game starts with the splash screen, and then launches the loading scene. The loading scene starts by loading the background, so the user sees the loading scene background while the assets are being loaded.
I load the loading scene background by calling CCSprite::spriteWithFile: and passing the filepath: loadingbackground.pvr.ccz
It seems to work differently on different devices:
On iphone (3gs) simulator, I see the loading scene as expected.
On iphone retina simulator, I don't see the loading scene (there aren't many assets yet, so may be happening quickly) and it goes directly to the main menu scene.
On the ipad 3 device, the splash screen comes up, and then there is a half second of black screen, and then the main menu scene shows up.
I want to see what I can do to avoid that black screen showing up on iPad 3. I suspect this is because of the time taken to load the loading background.
I have tried the following optimizations (mostly based on #Steffen's blog post on memory optimization):
Moved the loading background (originally 2.3 MB RGB8 png file) into a pvr.ccz spritesheet by itself, which reduced its size to 1.8 MB.
Removed the image from the texture soon after use.
I still see a black screen on iPad 3. Any suggestions?
Update: Found the issue - I had some code where I was overriding OnEnter and calling [[CCDirector sharedDirector]replaceScene] in it, and also calling the same from the background thread. Removed the OnEnter overload and it worked without flicker.
Thanks
Ignore whatever happens in Simulator. That's not relevant, focus on the device.
When the loading scene initializes and you add the loading scene's background, make sure you schedule update and load your assets in the update method. Otherwise if you load the assets in init, the background won't be drawn because you're loading all the assets before cocos2d gets to redraw the screen.
If this still fails, simply send the visit message to the background sprite followed by [[CCDirector sharedDirector] drawScene]. This forces a redraw of the scene.
Is this cocos2d-iphone or cocos2d-x ? make sure the tags are correct :)
I think you're referring to the startup flicker, there are a few ways to avoid that.
first thing you need to make sure you're handling the rootViewController correctly for iOS 6 and iOS 5 and below, there are a little changes for each.
You can find a little reference here:
http://www.cocos2d-iphone.org/forum/topic/34471
Second thing you need to know that simulator's behaviour is not stable, you should always rely on real devices for testing, but it's very likely you'll still have the flicker issues.
Sorry I didn't provide example code, but you haven't supported enough information to know what's the real issue here.