Particle image size?

Hi ( yes me again!)

This time I have a question about those images that came with PC. I am using them in my explosion effects. I am

Also using the scale function of PC to reduce the size of the explosion just before I start an emitter which may not the smartest thing to do because of the possible overhead on using the scale function in PC. I was wondering if reducing the images used in PC instead. The images that come with PC are 128X128 ( which I suppose because we could use them with retina screen) I reduced all those to 32X32.

Which is better for performance sake?: scale function of PC or using smaller images?

Hope someone can answer this one.

Mo [import]uid: 49236 topic_id: 19565 reply_id: 319565[/import]

Well, using smaller images is obviously gonna be better performance cause it uses less memory and it’ll be quicker to load to memory.

If you don’t want to lose image quality, you could, instead of using the scale function from PC, declare the particle type’s width and height as 32x32. As an alternative, you could also scale the emitter or the group the emitter is inserted in.

cheers,
B. [import]uid: 79152 topic_id: 19565 reply_id: 75722[/import]

If you create a particle type, you can define the imageWidth and imageHeight of your particle image. Particle Candy uses Corona’s newImageRect internally, which then loads the required image into memory exactly with the size you specified. This is the recommended way.

However, if you need to use a particle effect or image with different sizes throughout your game, it’s ok to use a bigger image and just scale the emitter to your needs.

Just keep in mind that, as bigger images are, as more processing power is required on the device. [import]uid: 10504 topic_id: 19565 reply_id: 76356[/import]

Thanks to both of you!

Is there a recommended image size? Is scaling the emitter during the game( just before the effect ) processing intensive?

Thanks again

Mo [import]uid: 49236 topic_id: 19565 reply_id: 76358[/import]

Scaling an emitter should not require any noticeable performance sind all it does is to set a scale value (this scale value is used by all particle types anyway).

A recommended size to load images are powers of 2 (4,8,16,32,64,128 etc.) Corona images are textures internally and using square sized images of these sizes, requires less preparation when loading the images into the graphics memory. [import]uid: 10504 topic_id: 19565 reply_id: 76363[/import]

Got it. Thank you very much.

Mo [import]uid: 49236 topic_id: 19565 reply_id: 76365[/import]