Game Development Community

Question about using a single frame of animation

by Cody Dempsey · in Torque Game Builder · 06/04/2010 (7:48 pm) · 2 replies

I'm trying to figure out how to do this, and having some difficulty. I want to, for example, have one imagemap with 4 cells, lets call them A, B, C & D. I have a button. When I press the button each time, I want to show the next cell/frame.

I've looked through the documentation that came with TGB, but can't find anything about image maps except two places that tell me to see the section about imagemaps. I suspect they are called something else in the docs, but I don't know what it is (Tilemaps? Static Sprites?)

I looked on TDN, and there I found references to using t2dAnimatedSprite.setanimationframe(%frame), but that doesn't work for an animation that isn't playing.

I searched the forums and the best thread I could find was this one, in which Sven Bergström (a very helpful chap--he helped me and others get through an issue with TGB and Torsion) replied to this question (from a different poster) with: "You haven't read the documentation clearly ;) Its all too obvious when someone doesn't!". I tried to look in the documentation (actually, I looked there first) but can't find it.

So if someone smart could either point me to the place where I can find this information, or throw me a hint, I'd really appreciate it.

Thanks for reading!

About the author

"Come not near to me, for I be indier than thou." -- MC Frontalot

Recent Threads


#1
06/04/2010 (7:59 pm)
You just want to use a static sprite and then use "setFrame" to change the frame. You can even get the current frame using "getFrame".
#2
06/04/2010 (8:15 pm)
Thanks, I'll give it a shot.

EDIT: Holy crap. You are my new hero. I will toast you for a week, my friend.

I didn't realize that the static sprites were including all of the frames. I thought that when I dragged a frame to the window, it was only that frame.

Thank you very much.