Increase size of particles
by Abhinav Chokhavatia · in Torque Game Builder · 06/12/2008 (2:36 am) · 2 replies
Hey guys!
I was trying to create a huge explosion in my game and I was using a particel effect for this. The default size of this particle is 16x16. I was calling this particle effect to play from script and I wanted to increase its size. I tried using the setSize() function on the particle object, but the size does not increase. How do I increase the size of the particle effect?
Thanks!
I was trying to create a huge explosion in my game and I was using a particel effect for this. The default size of this particle is 16x16. I was calling this particle effect to play from script and I wanted to increase its size. I tried using the setSize() function on the particle object, but the size does not increase. How do I increase the size of the particle effect?
Thanks!
About the author
#2
One quick way of doing this is altering the size scale via the effect object:
If you've set your particles to maintain their ration, you will not need to alter the Y scale.
Hope this helps.
EDIT: But as James says, this is a pretty painful way of doing it, and should really only be used if you have a specific reason for doing so. Otherwise, you should just be able to alter the size of your explosion over time via the editor in the appropriate emitter object.
07/26/2008 (6:54 am)
Hi, if I understand you correctly, you want to alter the particle size in script, via the effect object? Keep in mind there is a difference between t2dParticleEffect objects, and t2dParticleEmitter objects. t2dParticleEffect objects can be viewed as basically container objects for emitters, and you can have many emitters within these effect objects.One quick way of doing this is altering the size scale via the effect object:
%someParticleEffect.selectGraph("sizex_scale");
%someParticleEffect.setDataKeyValue(0, %foo);If you've set your particles to maintain their ration, you will not need to alter the Y scale.
Hope this helps.
EDIT: But as James says, this is a pretty painful way of doing it, and should really only be used if you have a specific reason for doing so. Otherwise, you should just be able to alter the size of your explosion over time via the editor in the appropriate emitter object.
Associate James Ford
Sickhead Games