Game Development Community

Profilling

by Bruno · in Torque Game Builder · 09/10/2008 (3:21 pm) · 1 replies

Hi,

Is there a way to profile in TGB, on how many animated objects are currently created ?
The idea is, i'm creating at runtime a animation :

%zap = new t2dAnimatedSprite() { scenegraph = MySceneGraph; };
  %zap.setSize(120,120);
  %zap.setPosition(%x*$tile_size-$locX, (%y)*$tile_size-$locY);
  %zap.playAnimation(FXBlue1Animation);

What i wanted to know, is how many animated objects are currently created, so that i could abort
another object creation, if for example i knew it already existed 20 objects in the render queue.

thanks,
Bruno

#1
09/10/2008 (3:31 pm)
You could use a global variable counter, which you increment whenever you allocate one. Or if these can also be deleted somewhere, you could decrement it there, OR, create a simSet that you always add them to on creation (onAdd?).