Quote:
Originally Posted by AmitSrivastava
hi everyone,
am facing a problem, in my game i am using 80-90 png images of different size. The problem is that game is slow and unplayable, is there any difference if I crush png images and then use with "imageNamed:" ...... before I used "imageWithContentsofFile" .... but it had taken lots of time to load...
Is there any way to solve this prob
Thanx in advance ..
|
Were you calling "imageWithContentsofFile" every frame? You probably need to load your images into an array at startup, and then reference them each frame without recreating them.
"imageNamed" is faster when you recreate the same image over and over, but you should not need to recreate them over and over; also imageNamed uses more memory (to cache the images.)
Also, how big are the images? If they are full-screen you'll probably only get about 20 images loaded at once before you run out of memory.