Reputation: 517
I have a simple application using Cocos2d, and all the images show up fine when running on the simulator. However, when i run it on an iphone, all the images are scaled up and incredible amount, making the game unplayable.
Has anyone got any ideas as to why this is happening, and how to fix it?
Upvotes: 0
Views: 149
Reputation: 517
I found out that the problem was that when i initialised the sprite, using spriteWithFile
, it set it to a certain size. When i changed the sprites texture later on, it kept the size of the last image, but had a different texture.
Upvotes: 0
Reputation: 2171
You need to consider the possibility that your simulator is running retina. Probably you are trying to display an image that is at the higher resolution on an older, non-retina device.
You can also just add the suffix "-hd" to any image, and then cocos2d will recognize it as being at the higher resolution automatically. But when you actually finish your app you will want to have 2 copies of each image, one at each resolution.
Upvotes: 1