Game Development Community

Callback every frame

by Tomas Dahle · in Torque Game Builder · 04/27/2005 (4:09 am) · 6 replies

I guess this is something someone has asked before, but I could not find a specific answer when attempting to search the forums.

Is there a way to have a callback into my script for every frame that is rendered?

#1
04/27/2005 (4:36 am)
You can add the following function

function fxSceneGraph2d::onUpdateScene( %this )
{
  // call whatever you want here
}

Although as this is called so frequently, its advisable to do as little work inside here as possible.
#2
04/27/2005 (4:38 am)
Tomas: Have you tried looking through the reference documentation? You can search that as well if you don't know where to start.

- Melv.
#3
04/27/2005 (5:57 am)
Melv: Well I didn't know how T2D works well enough to expect fxSceneGraph2d to contain such a loopback.
#4
04/28/2005 (12:29 am)
@Tomas: Sorry, I wasn't trying to be critical, I didn't mean to sound that way. I just wanted to make sure that you were actively using it because it contains all the commands. You could search for "update" and you'd probably find it quickly.

There has been an update to the documentation that you'll see soon that orders the function-calls by their functionality rather than just listing everything in alphabetical order (which breaks up similar commands) so that should help.

- Melv.
#5
04/28/2005 (12:12 pm)
"There has been an update to the documentation that you'll see soon"
Agh, that "Soon" word again; when oh when whilst thou commence thy upload, oh great Melv?
#6
04/28/2005 (1:27 pm)
Thats an awesome idea Melv. Looking forward to it. And the fish demo tutorial also :)