spriteWithFile or spriteWithTexture?

spriteWithFile or spriteWithTexture?
0.0 0


If I want to create several sprites all using the same image, what are the advantages or disadvantages of using these two commands?

If I use spriteWithFile I will be calling it several times with the same filename, if I use spriteWithTexture I would first create the texture for the file one time then make several sprites with the same texture2d. Does this save memory?

Thanks for the info.


CCTextureCache will cache the texture. So you can use spriteWithFile, because it only loads image one time.