Images getting resized and replaced randomly

Images getting resized and replaced randomly
0.0 0


Hi, I have a weird thing going on where it will randomly resize my image assets to half scale. It will also not consider the transparent area and set the image as if the image was the size of the non-transparent area. I’m fairly new at this but I have no idea what’s going, especially since this is working perfect in Android and Windows. Have anyone had anything like this happen before?

I forgot to mention that in playing with this I tried using only scale2 for all my assets, and that didn’t seem to do anything either. Also, I haven’t tried this on a device, only on the emulator.

I looks like I’ve found the problem, but I’m not quite sure what the solution should be. I’m using CCFileUtils::sharedFileUtils()->setResourceDirectory(). I have 3 different sizes with files all the same names inside of each folder. I’m adding them to my XCode project by right-clicking on “Resources” and adding them to my project. It seems that the images are being pulled from a random folder from my assets which is why they seem to be scaled down. I found this by only using 1 resource directory, and it worked. Now my question is, am I just putting the resources in my project incorrectly, or is there a better way to do this to have assets for 3 different sizes?


You need to make sure you add your image folder as a reference, not just a folder.
I had this same issue.

The folder in xCode would be blue if you added it correctly.


That was it! Thanks! Everything’s working now.