How do you get the total frames in a t2dStaticSprite
by Leroy Frederick · in Torque Game Builder · 08/20/2006 (4:22 pm) · 5 replies
Hi all :),
I wasn't able to find a way to set a specific frame or end on a specific frame for t2dAnimatedSprites, so i've decided to use t2dStaticSprites instead and use the setFrame fuction (basically, ive created a playAnimation() function that works just as well as the animated counterpart, but has more flexibilty)
Only problem is current i have to wait for the setFrame function not to work (cannot set frame) to know when to stop/reCycle the animation which doesn't cause any major problems, but isn't ideal either!
So, how do you get the total frames in a t2dStaticSprite?
Alternatively, if there is a way or easy resource that gives animated Sprites the abilty to end on a specific frame or set the frame of animation without it first being played, please share! www.garagegames.com/mg/forums/result.thread.php?qt=49454#374568 :)
Thanks in advance!
I wasn't able to find a way to set a specific frame or end on a specific frame for t2dAnimatedSprites, so i've decided to use t2dStaticSprites instead and use the setFrame fuction (basically, ive created a playAnimation() function that works just as well as the animated counterpart, but has more flexibilty)
Only problem is current i have to wait for the setFrame function not to work (cannot set frame) to know when to stop/reCycle the animation which doesn't cause any major problems, but isn't ideal either!
So, how do you get the total frames in a t2dStaticSprite?
Alternatively, if there is a way or easy resource that gives animated Sprites the abilty to end on a specific frame or set the frame of animation without it first being played, please share! www.garagegames.com/mg/forums/result.thread.php?qt=49454#374568 :)
Thanks in advance!
#2
08/21/2006 (5:07 am)
Thanks for your response, Dynamic field? I've already created a field to add the intended frames (e.g. Player[1].Head.Frames=12;) but in the level editor for instance, it has the amount of frames in a static sprite below the sprite image preview, how/what command retrieves this information?
#3
08/21/2006 (9:37 am)
Run a dump on your image map datablock object. You'll see a method named getFrameCount. Try that.
#4
08/21/2006 (10:27 am)
Oh man :S, i already ran a .dump(), looked through the whole list, and must of missed that, thanks Ben!
#5
08/21/2006 (6:04 pm)
Glad you got what you need! I missed it the first time too...
Torque Owner Ben R Vesco