Game Development Community

T2dParticleEffect stretching

by Panayoti "urbansquall" Haritatos · in Torque Game Builder · 09/12/2006 (5:29 pm) · 4 replies

I remember looking at the code for the Flegg grav gun demo a while back, and they were stretching the grav gun ray (particle effect). I remember you had to stretch the bitmap of the lightning bolts seperatly. I have been trying to find this code again because I don't know how you stretch that layer of the particle effect.

Does someone know how to do this?

Thanks.

#1
09/13/2006 (11:46 am)
Uncheck "Fixed Aspect" in your particle settings? I think you could get something like that witht he right settings and that unchecked.
#2
09/17/2006 (7:35 am)
Thanks for the advice, but I currently have that setup and it does not work.

What I would really like is the code that was in the Flegg Grav Gun demo to strecth the gravity gun beam (particle effect). I remember looking at that code at some point, and it is exactly what I need right now, and I cannot seem to get my code to work at all right now.

If no one has that code, I think I have to resize the specific emitter (the particle emitter with the animation in it). However, I don't really know how to do that. Again, I believe I have to select the X base graph, but I have no clue how to do that.

Could someone please help me out?

Thanks again.
#3
09/18/2006 (12:55 pm)
Don't those scripts come with TGB? Maybe I'm wrong, I have it here locally anyways. You get the graph doing something like.
//Store a reference to the emitter you want to modify
%myParticleEffecct.myEmitterRef = %myParticleEffect.findEmitterObject("myEmitterObject");

//Set the graph field you want to modify
%myParticleEffect.myEmitterRef.selectGraph("sizex_base");

//Modify a key on that graph
%myParticleEffect.myEmitterRef.setDataKeyValue(0, %newSize);
And you would still need Fixed Aspect unchecked for it to stretch right I think.
#4
09/18/2006 (3:35 pm)
Thank you so much.
I know that the script did come with it at some point, but I can't seem to find it
in the new releases. I may just be looking in the wrong place though.