Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-10-2009, 02:58 AM   #2 (permalink)
smasher
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
Default

Quote:
Originally Posted by AmitSrivastava View Post
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.
__________________

Free Games!
smasher is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,866
Threads: 89,223
Posts: 380,688
Top Poster: BrianSlick (7,129)
Welcome to our newest member, sethaver
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:58 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.