Sizing particle effects
by Drew -Gaiiden- Sikora · in Torque Game Builder · 01/26/2006 (2:21 am) · 6 replies
K I've tried everything I can think of at 5 in the morning and I can't get it. I'm using one the stock particles, shockwave_burst.eff, in my game and when I load the particle with this
%explosion = new t2dParticleEffect() { scenegraph = gcSceneGraph; };
%explosion.loadEffect("~/client/effects/shockwave_burst.eff");
%explosion.setEffectLifeMode(kill, 0.1);
%explosion.setPosition("0 0");
%explosion.playEffect();All I see is this little pinprick of an explosion in the center of the screen. I have my camera set to a resolution of 1024x768. I've tried setting the size in code and in the particle editor, but it doesn't seem to make any difference for some reason. Any ideas?
#2
So wait then what does the object size field at the top of the editor do? How come changing that had no effect and instead I had to scale the effect?
01/26/2006 (10:23 am)
Nice that worked, thanks Philip. What units is this scale in? I size it at 50 and the explosion was pretty large! Way larger than I thought it would be.So wait then what does the object size field at the top of the editor do? How come changing that had no effect and instead I had to scale the effect?
#3
The object-size is the bounding-box, the one you change by using "setSize()". In the case of a particle-effect, the size (area) is only used if you set the emitter mode to either LineX, lineY or area. Essentially, the area used to spawn particles. The default of point just emits particles at the current effects position.
All units in T2D are in world-units. If you want this to mean a real unit then that would depend on how you set-up your camera(s).
Hope this helps,
- Melv.
01/26/2006 (11:14 am)
Drew,The object-size is the bounding-box, the one you change by using "setSize()". In the case of a particle-effect, the size (area) is only used if you set the emitter mode to either LineX, lineY or area. Essentially, the area used to spawn particles. The default of point just emits particles at the current effects position.
All units in T2D are in world-units. If you want this to mean a real unit then that would depend on how you set-up your camera(s).
Hope this helps,
- Melv.
#4
01/26/2006 (11:55 am)
Thanks Melv! I gots explosions - wheeee :)
#6
01/26/2006 (1:02 pm)
Particles are extremely fun ... lol, you'll see how much fun I have with them in the checker's game :)
Torque Owner Philip Mansfield
Default Studio Name
%explosion.selectGraph("sizex_scale"); %explosion.setDataKeyValue(0, XSizeHere); %explosion.selectGraph("sizey_scale"); %explosion.setDataKeyValue(0, YSizeHere);Obviously, replace XSizeHere and YSizeHere with the numbers you want to use.