Sprite zoom/scale functionality?
by Jason McIntosh · in Torque Game Builder · 03/11/2005 (10:34 am) · 5 replies
Will there eventually be a function to smoothly scale a sprite from one size to another? I know that you can set the size, but that doesn't exactly scale smoothly between one size and another. :) I seem to recall that you can use particles for this or somesuch? But I'd like to have a pulsing image without using a particle for it.
Edit: I'd also love to see this for color blending so we can fade in/out individual sprites smoothly.
Edit: I'd also love to see this for color blending so we can fade in/out individual sprites smoothly.
About the author
#2
03/11/2005 (11:29 am)
Cool. Thanks for the reply.
#3
03/12/2005 (12:17 pm)
Pretty easy to do all kinds od stuff if every sprite could have a callback called once every fraction of a second or so.
#4
Another (untested) idea would be to stick all the objects you want to participate in the callback in a SimSet and have something that calls a callback method for each object in that set every x milliseconds. This would make it pretty easy to "register" a callback; all you'd have to do is add it to the set.
03/12/2005 (6:37 pm)
You can set up a callback like pattern in a number of fairly streightforward ways. One is to have a method or function that scheduals a call to itself:function fxSceneObject2D::callback(%obj) {
// do something interesting here...
%obj.schedule (125, callback) ;
}Another (untested) idea would be to stick all the objects you want to participate in the callback in a SimSet and have something that calls a callback method for each object in that set every x milliseconds. This would make it pretty easy to "register" a callback; all you'd have to do is add it to the set.
#5
- Melv.
03/13/2005 (2:02 am)
Greg is correct. There's also the update-scene callback although you can hurt performance if you do too much there.- Melv.
Associate Melv May
- Melv.